file_ms_alloc:
  539|      2|{
  540|      2|	struct magic_set *ms;
  541|      2|	size_t i, len;
  542|       |
  543|      2|	if ((ms = CAST(struct magic_set *, calloc(CAST(size_t, 1u),
  ------------------
  |  |  452|      2|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (543:6): [True: 0, False: 2]
  ------------------
  544|      2|	    sizeof(*ms)))) == NULL)
  545|      0|		return NULL;
  546|       |
  547|      2|	if (magic_setflags(ms, flags) == -1) {
  ------------------
  |  Branch (547:6): [True: 0, False: 2]
  ------------------
  548|      0|		errno = EINVAL;
  549|      0|		goto free;
  550|      0|	}
  551|       |
  552|      2|	ms->o.buf = ms->o.pbuf = NULL;
  553|      2|	ms->o.blen = 0;
  554|      2|	len = (ms->c.len = 10) * sizeof(*ms->c.li);
  555|       |
  556|      2|	if ((ms->c.li = CAST(struct level_info *, malloc(len))) == NULL)
  ------------------
  |  |  452|      2|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (556:6): [True: 0, False: 2]
  ------------------
  557|      0|		goto free;
  558|       |
  559|      2|	ms->event_flags = 0;
  560|      2|	ms->error = -1;
  561|      6|	for (i = 0; i < MAGIC_SETS; i++)
  ------------------
  |  |  471|      6|#define MAGIC_SETS	2
  ------------------
  |  Branch (561:14): [True: 4, False: 2]
  ------------------
  562|      4|		ms->mlist[i] = NULL;
  563|      2|	ms->fnamebuf = NULL;
  564|      2|	ms->file = "unknown";
  565|      2|	ms->line = 0;
  566|      2|	ms->magwarn = 0;
  567|      2|	ms->indir_max = FILE_INDIR_MAX;
  ------------------
  |  |  522|      2|#define	FILE_INDIR_MAX			50
  ------------------
  568|      2|	ms->name_max = FILE_NAME_MAX;
  ------------------
  |  |  523|      2|#define	FILE_NAME_MAX			150
  ------------------
  569|      2|	ms->elf_shnum_max = FILE_ELF_SHNUM_MAX;
  ------------------
  |  |  520|      2|#define	FILE_ELF_SHNUM_MAX		32768
  ------------------
  570|      2|	ms->elf_shsize_max = FILE_ELF_SHSIZE_MAX;
  ------------------
  |  |  521|      2|#define	FILE_ELF_SHSIZE_MAX		(128 * 1024 * 1024)
  ------------------
  571|      2|	ms->elf_phnum_max = FILE_ELF_PHNUM_MAX;
  ------------------
  |  |  519|      2|#define	FILE_ELF_PHNUM_MAX		2048
  ------------------
  572|      2|	ms->elf_notes_max = FILE_ELF_NOTES_MAX;
  ------------------
  |  |  518|      2|#define	FILE_ELF_NOTES_MAX		256
  ------------------
  573|      2|	ms->regex_max = FILE_REGEX_MAX;
  ------------------
  |  |  524|      2|#define	FILE_REGEX_MAX			8192
  ------------------
  574|      2|	ms->bytes_max = FILE_BYTES_MAX;
  ------------------
  |  |  516|      2|# define FILE_BYTES_MAX (7 * 1024 * 1024)/* how much of the file to look at */
  ------------------
  575|      2|	ms->encoding_max = FILE_ENCODING_MAX;
  ------------------
  |  |  525|      2|#define	FILE_ENCODING_MAX		(64 * 1024)
  ------------------
  576|      2|	ms->magwarn_max = FILE_MAGWARN_MAX;
  ------------------
  |  |  526|      2|#define	FILE_MAGWARN_MAX		64
  ------------------
  577|      2|#ifdef USE_C_LOCALE
  578|      2|	ms->c_lc_ctype = newlocale(LC_CTYPE_MASK, "C", 0);
  579|      2|	assert(ms->c_lc_ctype != NULL);
  ------------------
  |  Branch (579:2): [True: 0, False: 2]
  |  Branch (579:2): [True: 2, False: 0]
  ------------------
  580|      2|#endif
  581|      2|	return ms;
  582|      0|free:
  583|      0|	free(ms);
  584|       |	return NULL;
  585|      2|}
file_apprentice:
  726|      2|{
  727|      2|	char *p;
  728|      2|	int fileerr, errs = -1;
  729|      2|	size_t i, j;
  730|       |
  731|      2|	(void)file_reset(ms, 0);
  732|       |
  733|      2|	if ((fn = magic_getpath(fn, action)) == NULL)
  ------------------
  |  Branch (733:6): [True: 0, False: 2]
  ------------------
  734|      0|		return -1;
  735|       |
  736|      2|	init_file_tables();
  737|       |
  738|      2|	free(ms->fnamebuf);
  739|      2|	ms->file = NULL;
  740|      2|	if ((ms->fnamebuf = strdup(fn)) == NULL) {
  ------------------
  |  Branch (740:6): [True: 0, False: 2]
  ------------------
  741|      0|		file_oomem(ms, strlen(fn));
  742|      0|		return -1;
  743|      0|	}
  744|       |
  745|      6|	for (i = 0; i < MAGIC_SETS; i++) {
  ------------------
  |  |  471|      6|#define MAGIC_SETS	2
  ------------------
  |  Branch (745:14): [True: 4, False: 2]
  ------------------
  746|      4|		mlist_free(ms->mlist[i]);
  747|      4|		if ((ms->mlist[i] = mlist_alloc()) == NULL) {
  ------------------
  |  Branch (747:7): [True: 0, False: 4]
  ------------------
  748|      0|			file_oomem(ms, sizeof(*ms->mlist[0]));
  749|      0|			for (j = 0; j < i; j++) {
  ------------------
  |  Branch (749:16): [True: 0, False: 0]
  ------------------
  750|      0|				mlist_free(ms->mlist[j]);
  751|      0|				ms->mlist[j] = NULL;
  752|      0|			}
  753|      0|			return -1;
  754|      0|		}
  755|      4|	}
  756|      2|	fn = ms->fnamebuf;
  757|       |
  758|      4|	while (fn) {
  ------------------
  |  Branch (758:9): [True: 2, False: 2]
  ------------------
  759|      2|		p = CCAST(char *, strchr(fn, PATHSEP));
  ------------------
  |  |  454|      2|#define CCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
  760|      2|		if (p)
  ------------------
  |  Branch (760:7): [True: 0, False: 2]
  ------------------
  761|      0|			*p++ = '\0';
  762|      2|		if (*fn == '\0')
  ------------------
  |  Branch (762:7): [True: 0, False: 2]
  ------------------
  763|      0|			break;
  764|      2|		fileerr = apprentice_1(ms, fn, action);
  765|      2|		errs = MAX(errs, fileerr);
  ------------------
  |  Branch (765:10): [True: 0, False: 2]
  ------------------
  766|      2|		fn = p;
  767|      2|	}
  768|       |
  769|      2|	if (errs == -1) {
  ------------------
  |  Branch (769:6): [True: 0, False: 2]
  ------------------
  770|      0|		for (i = 0; i < MAGIC_SETS; i++) {
  ------------------
  |  |  471|      0|#define MAGIC_SETS	2
  ------------------
  |  Branch (770:15): [True: 0, False: 0]
  ------------------
  771|      0|			mlist_free(ms->mlist[i]);
  772|      0|			ms->mlist[i] = NULL;
  773|      0|		}
  774|      0|		file_error(ms, 0, "could not find any valid magic files!");
  775|      0|		return -1;
  776|      0|	}
  777|       |
  778|       |#if 0
  779|       |	/*
  780|       |	 * Always leave the database loaded
  781|       |	 */
  782|       |	if (action == FILE_LOAD)
  783|       |		return 0;
  784|       |
  785|       |	for (i = 0; i < MAGIC_SETS; i++) {
  786|       |		mlist_free(ms->mlist[i]);
  787|       |		ms->mlist[i] = NULL;
  788|       |	}
  789|       |#endif
  790|       |
  791|      2|	switch (action) {
  792|      2|	case FILE_LOAD:
  ------------------
  |  |  187|      2|#define	FILE_LOAD	0
  ------------------
  |  Branch (792:2): [True: 2, False: 0]
  ------------------
  793|      2|	case FILE_COMPILE:
  ------------------
  |  |  189|      2|#define FILE_COMPILE	2
  ------------------
  |  Branch (793:2): [True: 0, False: 2]
  ------------------
  794|      2|	case FILE_CHECK:
  ------------------
  |  |  188|      2|#define FILE_CHECK	1
  ------------------
  |  Branch (794:2): [True: 0, False: 2]
  ------------------
  795|      2|	case FILE_LIST:
  ------------------
  |  |  190|      2|#define FILE_LIST	3
  ------------------
  |  Branch (795:2): [True: 0, False: 2]
  ------------------
  796|      2|		return 0;
  797|      0|	default:
  ------------------
  |  Branch (797:2): [True: 0, False: 2]
  ------------------
  798|      0|		file_error(ms, 0, "Invalid action %d", action);
  799|      0|		return -1;
  800|      2|	}
  801|      2|}
file_signextend:
 1653|   127M|{
 1654|   127M|	if (!(m->flag & UNSIGNED)) {
  ------------------
  |  |  229|   127M|#define UNSIGNED	0x08	/* comparison is unsigned */
  ------------------
  |  Branch (1654:6): [True: 119M, False: 7.68M]
  ------------------
 1655|   119M|		switch(m->type) {
 1656|       |		/*
 1657|       |		 * Do not remove the casts below.  They are
 1658|       |		 * vital.  When later compared with the data,
 1659|       |		 * the sign extension must have happened.
 1660|       |		 */
 1661|  1.20M|		case FILE_BYTE:
  ------------------
  |  |  246|  1.20M|#define 			FILE_BYTE		1
  ------------------
  |  Branch (1661:3): [True: 1.20M, False: 118M]
  ------------------
 1662|  1.20M|			v = CAST(signed char,  v);
  ------------------
  |  |  452|  1.20M|#define CAST(T, b)	((T)(b))
  ------------------
 1663|  1.20M|			break;
 1664|  2.28M|		case FILE_SHORT:
  ------------------
  |  |  247|  2.28M|#define				FILE_SHORT		2
  ------------------
  |  Branch (1664:3): [True: 2.28M, False: 117M]
  ------------------
 1665|  7.14M|		case FILE_BESHORT:
  ------------------
  |  |  252|  7.14M|#define				FILE_BESHORT		7
  ------------------
  |  Branch (1665:3): [True: 4.86M, False: 114M]
  ------------------
 1666|  11.2M|		case FILE_LESHORT:
  ------------------
  |  |  255|  11.2M|#define				FILE_LESHORT		10
  ------------------
  |  Branch (1666:3): [True: 4.09M, False: 115M]
  ------------------
 1667|  11.2M|			v = CAST(short, v);
  ------------------
  |  |  452|  11.2M|#define CAST(T, b)	((T)(b))
  ------------------
 1668|  11.2M|			break;
 1669|      0|		case FILE_DATE:
  ------------------
  |  |  251|      0|#define				FILE_DATE		6
  ------------------
  |  Branch (1669:3): [True: 0, False: 119M]
  ------------------
 1670|    429|		case FILE_BEDATE:
  ------------------
  |  |  254|    429|#define				FILE_BEDATE		9
  ------------------
  |  Branch (1670:3): [True: 429, False: 119M]
  ------------------
 1671|    583|		case FILE_LEDATE:
  ------------------
  |  |  257|    583|#define				FILE_LEDATE		12
  ------------------
  |  Branch (1671:3): [True: 154, False: 119M]
  ------------------
 1672|    757|		case FILE_MEDATE:
  ------------------
  |  |  266|    757|#define				FILE_MEDATE		21
  ------------------
  |  Branch (1672:3): [True: 174, False: 119M]
  ------------------
 1673|    757|		case FILE_LDATE:
  ------------------
  |  |  259|    757|#define				FILE_LDATE		14
  ------------------
  |  Branch (1673:3): [True: 0, False: 119M]
  ------------------
 1674|  1.18k|		case FILE_BELDATE:
  ------------------
  |  |  260|  1.18k|#define				FILE_BELDATE		15
  ------------------
  |  Branch (1674:3): [True: 430, False: 119M]
  ------------------
 1675|  1.27k|		case FILE_LELDATE:
  ------------------
  |  |  261|  1.27k|#define				FILE_LELDATE		16
  ------------------
  |  Branch (1675:3): [True: 92, False: 119M]
  ------------------
 1676|  1.27k|		case FILE_MELDATE:
  ------------------
  |  |  267|  1.27k|#define				FILE_MELDATE		22
  ------------------
  |  Branch (1676:3): [True: 0, False: 119M]
  ------------------
 1677|  1.94M|		case FILE_LONG:
  ------------------
  |  |  249|  1.94M|#define				FILE_LONG		4
  ------------------
  |  Branch (1677:3): [True: 1.93M, False: 117M]
  ------------------
 1678|  17.1M|		case FILE_BELONG:
  ------------------
  |  |  253|  17.1M|#define				FILE_BELONG		8
  ------------------
  |  Branch (1678:3): [True: 15.1M, False: 104M]
  ------------------
 1679|  23.1M|		case FILE_LELONG:
  ------------------
  |  |  256|  23.1M|#define				FILE_LELONG		11
  ------------------
  |  Branch (1679:3): [True: 6.02M, False: 113M]
  ------------------
 1680|  23.1M|		case FILE_MELONG:
  ------------------
  |  |  268|  23.1M|#define				FILE_MELONG		23
  ------------------
  |  Branch (1680:3): [True: 76, False: 119M]
  ------------------
 1681|  23.1M|		case FILE_FLOAT:
  ------------------
  |  |  278|  23.1M|#define				FILE_FLOAT		33
  ------------------
  |  Branch (1681:3): [True: 0, False: 119M]
  ------------------
 1682|  23.1M|		case FILE_BEFLOAT:
  ------------------
  |  |  279|  23.1M|#define				FILE_BEFLOAT		34
  ------------------
  |  Branch (1682:3): [True: 0, False: 119M]
  ------------------
 1683|  23.1M|		case FILE_LEFLOAT:
  ------------------
  |  |  280|  23.1M|#define				FILE_LEFLOAT		35
  ------------------
  |  Branch (1683:3): [True: 0, False: 119M]
  ------------------
 1684|  23.1M|		case FILE_MSDOSDATE:
  ------------------
  |  |  300|  23.1M|#define				FILE_MSDOSDATE		55
  ------------------
  |  Branch (1684:3): [True: 0, False: 119M]
  ------------------
 1685|  23.1M|		case FILE_BEMSDOSDATE:
  ------------------
  |  |  302|  23.1M|#define				FILE_BEMSDOSDATE	57
  ------------------
  |  Branch (1685:3): [True: 0, False: 119M]
  ------------------
 1686|  23.1M|		case FILE_LEMSDOSDATE:
  ------------------
  |  |  301|  23.1M|#define				FILE_LEMSDOSDATE	56
  ------------------
  |  Branch (1686:3): [True: 292, False: 119M]
  ------------------
 1687|  23.1M|		case FILE_MSDOSTIME:
  ------------------
  |  |  303|  23.1M|#define				FILE_MSDOSTIME		58
  ------------------
  |  Branch (1687:3): [True: 0, False: 119M]
  ------------------
 1688|  23.1M|		case FILE_BEMSDOSTIME:
  ------------------
  |  |  305|  23.1M|#define				FILE_BEMSDOSTIME	60
  ------------------
  |  Branch (1688:3): [True: 0, False: 119M]
  ------------------
 1689|  23.1M|		case FILE_LEMSDOSTIME:
  ------------------
  |  |  304|  23.1M|#define				FILE_LEMSDOSTIME	59
  ------------------
  |  Branch (1689:3): [True: 292, False: 119M]
  ------------------
 1690|  23.1M|			v = CAST(int32_t, v);
  ------------------
  |  |  452|  23.1M|#define CAST(T, b)	((T)(b))
  ------------------
 1691|  23.1M|			break;
 1692|  85.1k|		case FILE_QUAD:
  ------------------
  |  |  269|  85.1k|#define				FILE_QUAD		24
  ------------------
  |  Branch (1692:3): [True: 85.1k, False: 119M]
  ------------------
 1693|  1.04M|		case FILE_BEQUAD:
  ------------------
  |  |  271|  1.04M|#define				FILE_BEQUAD		26
  ------------------
  |  Branch (1693:3): [True: 959k, False: 118M]
  ------------------
 1694|  1.54M|		case FILE_LEQUAD:
  ------------------
  |  |  270|  1.54M|#define				FILE_LEQUAD		25
  ------------------
  |  Branch (1694:3): [True: 500k, False: 119M]
  ------------------
 1695|  1.54M|		case FILE_QDATE:
  ------------------
  |  |  272|  1.54M|#define				FILE_QDATE		27
  ------------------
  |  Branch (1695:3): [True: 0, False: 119M]
  ------------------
 1696|  1.54M|		case FILE_QLDATE:
  ------------------
  |  |  275|  1.54M|#define				FILE_QLDATE		30
  ------------------
  |  Branch (1696:3): [True: 0, False: 119M]
  ------------------
 1697|  1.54M|		case FILE_QWDATE:
  ------------------
  |  |  287|  1.54M|#define				FILE_QWDATE		42
  ------------------
  |  Branch (1697:3): [True: 206, False: 119M]
  ------------------
 1698|  1.54M|		case FILE_BEQDATE:
  ------------------
  |  |  274|  1.54M|#define				FILE_BEQDATE		29
  ------------------
  |  Branch (1698:3): [True: 1.00k, False: 119M]
  ------------------
 1699|  1.54M|		case FILE_BEQLDATE:
  ------------------
  |  |  277|  1.54M|#define				FILE_BEQLDATE		32
  ------------------
  |  Branch (1699:3): [True: 187, False: 119M]
  ------------------
 1700|  1.54M|		case FILE_BEQWDATE:
  ------------------
  |  |  289|  1.54M|#define				FILE_BEQWDATE		44
  ------------------
  |  Branch (1700:3): [True: 0, False: 119M]
  ------------------
 1701|  1.54M|		case FILE_LEQDATE:
  ------------------
  |  |  273|  1.54M|#define				FILE_LEQDATE		28
  ------------------
  |  Branch (1701:3): [True: 37, False: 119M]
  ------------------
 1702|  1.54M|		case FILE_LEQLDATE:
  ------------------
  |  |  276|  1.54M|#define				FILE_LEQLDATE		31
  ------------------
  |  Branch (1702:3): [True: 458, False: 119M]
  ------------------
 1703|  1.54M|		case FILE_LEQWDATE:
  ------------------
  |  |  288|  1.54M|#define				FILE_LEQWDATE		43
  ------------------
  |  Branch (1703:3): [True: 1.86k, False: 119M]
  ------------------
 1704|  1.54M|		case FILE_DOUBLE:
  ------------------
  |  |  281|  1.54M|#define				FILE_DOUBLE		36
  ------------------
  |  Branch (1704:3): [True: 0, False: 119M]
  ------------------
 1705|  1.54M|		case FILE_BEDOUBLE:
  ------------------
  |  |  282|  1.54M|#define				FILE_BEDOUBLE		37
  ------------------
  |  Branch (1705:3): [True: 0, False: 119M]
  ------------------
 1706|  1.54M|		case FILE_LEDOUBLE:
  ------------------
  |  |  283|  1.54M|#define				FILE_LEDOUBLE		38
  ------------------
  |  Branch (1706:3): [True: 0, False: 119M]
  ------------------
 1707|  1.55M|		case FILE_OFFSET:
  ------------------
  |  |  297|  1.55M|#define				FILE_OFFSET		52
  ------------------
  |  Branch (1707:3): [True: 4.72k, False: 119M]
  ------------------
 1708|  1.55M|		case FILE_BEVARINT:
  ------------------
  |  |  298|  1.55M|#define				FILE_BEVARINT		53
  ------------------
  |  Branch (1708:3): [True: 0, False: 119M]
  ------------------
 1709|  1.55M|		case FILE_LEVARINT:
  ------------------
  |  |  299|  1.55M|#define				FILE_LEVARINT		54
  ------------------
  |  Branch (1709:3): [True: 0, False: 119M]
  ------------------
 1710|  1.55M|			v = CAST(int64_t, v);
  ------------------
  |  |  452|  1.55M|#define CAST(T, b)	((T)(b))
  ------------------
 1711|  1.55M|			break;
 1712|  80.9M|		case FILE_STRING:
  ------------------
  |  |  250|  80.9M|#define				FILE_STRING		5
  ------------------
  |  Branch (1712:3): [True: 80.9M, False: 38.7M]
  ------------------
 1713|  81.0M|		case FILE_PSTRING:
  ------------------
  |  |  258|  81.0M|#define				FILE_PSTRING		13
  ------------------
  |  Branch (1713:3): [True: 36.4k, False: 119M]
  ------------------
 1714|  81.0M|		case FILE_BESTRING16:
  ------------------
  |  |  263|  81.0M|#define				FILE_BESTRING16		18
  ------------------
  |  Branch (1714:3): [True: 119, False: 119M]
  ------------------
 1715|  81.1M|		case FILE_LESTRING16:
  ------------------
  |  |  264|  81.1M|#define				FILE_LESTRING16		19
  ------------------
  |  Branch (1715:3): [True: 84.0k, False: 119M]
  ------------------
 1716|  81.4M|		case FILE_REGEX:
  ------------------
  |  |  262|  81.4M|#define				FILE_REGEX		17
  ------------------
  |  Branch (1716:3): [True: 322k, False: 119M]
  ------------------
 1717|  82.2M|		case FILE_SEARCH:
  ------------------
  |  |  265|  82.2M|#define				FILE_SEARCH		20
  ------------------
  |  Branch (1717:3): [True: 846k, False: 118M]
  ------------------
 1718|  82.2M|		case FILE_DEFAULT:
  ------------------
  |  |  248|  82.2M|#define				FILE_DEFAULT		3
  ------------------
  |  Branch (1718:3): [True: 8.45k, False: 119M]
  ------------------
 1719|  82.2M|		case FILE_INDIRECT:
  ------------------
  |  |  286|  82.2M|#define				FILE_INDIRECT		41
  ------------------
  |  Branch (1719:3): [True: 0, False: 119M]
  ------------------
 1720|  82.2M|		case FILE_NAME:
  ------------------
  |  |  290|  82.2M|#define				FILE_NAME		45
  ------------------
  |  Branch (1720:3): [True: 0, False: 119M]
  ------------------
 1721|  82.2M|		case FILE_USE:
  ------------------
  |  |  291|  82.2M|#define				FILE_USE		46
  ------------------
  |  Branch (1721:3): [True: 0, False: 119M]
  ------------------
 1722|  82.2M|		case FILE_CLEAR:
  ------------------
  |  |  292|  82.2M|#define				FILE_CLEAR		47
  ------------------
  |  Branch (1722:3): [True: 1.49k, False: 119M]
  ------------------
 1723|  82.2M|		case FILE_DER:
  ------------------
  |  |  293|  82.2M|#define				FILE_DER		48
  ------------------
  |  Branch (1723:3): [True: 0, False: 119M]
  ------------------
 1724|  82.5M|		case FILE_GUID:
  ------------------
  |  |  294|  82.5M|#define				FILE_GUID		49
  ------------------
  |  Branch (1724:3): [True: 305k, False: 119M]
  ------------------
 1725|  82.5M|		case FILE_LEGUID:
  ------------------
  |  |  295|  82.5M|#define				FILE_LEGUID		50
  ------------------
  |  Branch (1725:3): [True: 0, False: 119M]
  ------------------
 1726|  82.5M|		case FILE_BEGUID:
  ------------------
  |  |  296|  82.5M|#define				FILE_BEGUID		51
  ------------------
  |  Branch (1726:3): [True: 62, False: 119M]
  ------------------
 1727|  82.5M|		case FILE_OCTAL:
  ------------------
  |  |  306|  82.5M|#define				FILE_OCTAL		61
  ------------------
  |  Branch (1727:3): [True: 0, False: 119M]
  ------------------
 1728|  82.5M|			break;
 1729|      0|		default:
  ------------------
  |  Branch (1729:3): [True: 0, False: 119M]
  ------------------
 1730|      0|			if (ms->flags & MAGIC_CHECK)
  ------------------
  |  |   39|      0|#define	MAGIC_CHECK		0x0000040 /* Print warnings to stderr */
  ------------------
  |  Branch (1730:8): [True: 0, False: 0]
  ------------------
 1731|      0|			    file_magwarn(ms, "cannot happen: m->type=%d\n",
 1732|      0|				    m->type);
 1733|      0|			return FILE_BADSIZE;
  ------------------
  |  |  175|      0|#define FILE_BADSIZE CAST(size_t, ~0ul)
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1734|   119M|		}
 1735|   119M|	}
 1736|   127M|	return v;
 1737|   127M|}
file_pstring_length_size:
 3630|  45.1k|{
 3631|  45.1k|	switch (m->str_flags & PSTRING_LEN) {
  ------------------
  |  |  382|  45.1k|#define str_flags _u._s._flags
  ------------------
              	switch (m->str_flags & PSTRING_LEN) {
  ------------------
  |  |  411|  45.1k|    (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
  |  |  ------------------
  |  |  |  |  403|  45.1k|#define PSTRING_1_BE				BIT(7)
  |  |  |  |  ------------------
  |  |  |  |  |  |  395|  45.1k|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
  |  |  ------------------
  |  |  |  |  406|  45.1k|#define PSTRING_2_LE				BIT(9)
  |  |  |  |  ------------------
  |  |  |  |  |  |  395|  45.1k|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
  |  |  ------------------
  |  |  |  |  405|  45.1k|#define PSTRING_2_BE				BIT(8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  395|  45.1k|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
  |  |  ------------------
  |  |  |  |  408|  45.1k|#define PSTRING_4_LE				BIT(11)
  |  |  |  |  ------------------
  |  |  |  |  |  |  395|  45.1k|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
  |  |  ------------------
  |  |  |  |  407|  45.1k|#define PSTRING_4_BE				BIT(10)
  |  |  |  |  ------------------
  |  |  |  |  |  |  395|  45.1k|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3632|  34.5k|	case PSTRING_1_LE:
  ------------------
  |  |  404|  34.5k|#define PSTRING_1_LE				BIT(7)
  |  |  ------------------
  |  |  |  |  395|  34.5k|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (3632:2): [True: 34.5k, False: 10.6k]
  ------------------
 3633|  34.5k|		return 1;
 3634|    408|	case PSTRING_2_LE:
  ------------------
  |  |  406|    408|#define PSTRING_2_LE				BIT(9)
  |  |  ------------------
  |  |  |  |  395|    408|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (3634:2): [True: 408, False: 44.7k]
  ------------------
 3635|  9.53k|	case PSTRING_2_BE:
  ------------------
  |  |  405|  9.53k|#define PSTRING_2_BE				BIT(8)
  |  |  ------------------
  |  |  |  |  395|  9.53k|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (3635:2): [True: 9.12k, False: 36.0k]
  ------------------
 3636|  9.53k|		return 2;
 3637|    801|	case PSTRING_4_LE:
  ------------------
  |  |  408|    801|#define PSTRING_4_LE				BIT(11)
  |  |  ------------------
  |  |  |  |  395|    801|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (3637:2): [True: 801, False: 44.3k]
  ------------------
 3638|  1.07k|	case PSTRING_4_BE:
  ------------------
  |  |  407|  1.07k|#define PSTRING_4_BE				BIT(10)
  |  |  ------------------
  |  |  |  |  395|  1.07k|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (3638:2): [True: 270, False: 44.8k]
  ------------------
 3639|  1.07k|		return 4;
 3640|      0|	default:
  ------------------
  |  Branch (3640:2): [True: 0, False: 45.1k]
  ------------------
 3641|      0|		file_error(ms, 0, "corrupt magic file "
 3642|      0|		    "(bad pascal string length %d)",
 3643|      0|		    m->str_flags & PSTRING_LEN);
  ------------------
  |  |  382|      0|#define str_flags _u._s._flags
  ------------------
              		    m->str_flags & PSTRING_LEN);
  ------------------
  |  |  411|      0|    (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
  |  |  ------------------
  |  |  |  |  403|      0|#define PSTRING_1_BE				BIT(7)
  |  |  |  |  ------------------
  |  |  |  |  |  |  395|      0|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
  |  |  ------------------
  |  |  |  |  406|      0|#define PSTRING_2_LE				BIT(9)
  |  |  |  |  ------------------
  |  |  |  |  |  |  395|      0|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
  |  |  ------------------
  |  |  |  |  405|      0|#define PSTRING_2_BE				BIT(8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  395|      0|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
  |  |  ------------------
  |  |  |  |  408|      0|#define PSTRING_4_LE				BIT(11)
  |  |  |  |  ------------------
  |  |  |  |  |  |  395|      0|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
  |  |  ------------------
  |  |  |  |  407|      0|#define PSTRING_4_BE				BIT(10)
  |  |  |  |  ------------------
  |  |  |  |  |  |  395|      0|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3644|      0|		return FILE_BADSIZE;
  ------------------
  |  |  175|      0|#define FILE_BADSIZE CAST(size_t, ~0ul)
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 3645|  45.1k|	}
 3646|  45.1k|}
file_pstring_get_length:
 3651|  36.5k|{
 3652|  36.5k|	size_t len = 0;
 3653|  36.5k|	const unsigned char *s = RCAST(const unsigned char *, ss);
  ------------------
  |  |  453|  36.5k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 3654|  36.5k|	unsigned int s3, s2, s1, s0;
 3655|       |
 3656|  36.5k|	switch (m->str_flags & PSTRING_LEN) {
  ------------------
  |  |  382|  36.5k|#define str_flags _u._s._flags
  ------------------
              	switch (m->str_flags & PSTRING_LEN) {
  ------------------
  |  |  411|  36.5k|    (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
  |  |  ------------------
  |  |  |  |  403|  36.5k|#define PSTRING_1_BE				BIT(7)
  |  |  |  |  ------------------
  |  |  |  |  |  |  395|  36.5k|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
  |  |  ------------------
  |  |  |  |  406|  36.5k|#define PSTRING_2_LE				BIT(9)
  |  |  |  |  ------------------
  |  |  |  |  |  |  395|  36.5k|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
  |  |  ------------------
  |  |  |  |  405|  36.5k|#define PSTRING_2_BE				BIT(8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  395|  36.5k|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
  |  |  ------------------
  |  |  |  |  408|  36.5k|#define PSTRING_4_LE				BIT(11)
  |  |  |  |  ------------------
  |  |  |  |  |  |  395|  36.5k|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
  |  |  ------------------
  |  |  |  |  407|  36.5k|#define PSTRING_4_BE				BIT(10)
  |  |  |  |  ------------------
  |  |  |  |  |  |  395|  36.5k|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3657|  33.6k|	case PSTRING_1_LE:
  ------------------
  |  |  404|  33.6k|#define PSTRING_1_LE				BIT(7)
  |  |  ------------------
  |  |  |  |  395|  33.6k|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (3657:2): [True: 33.6k, False: 2.83k]
  ------------------
 3658|  33.6k|		len = *s;
 3659|  33.6k|		break;
 3660|    136|	case PSTRING_2_LE:
  ------------------
  |  |  406|    136|#define PSTRING_2_LE				BIT(9)
  |  |  ------------------
  |  |  |  |  395|    136|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (3660:2): [True: 136, False: 36.3k]
  ------------------
 3661|    136|		s0 = s[0];
 3662|    136|		s1 = s[1];
 3663|    136|		len = (s1 << 8) | s0;
 3664|    136|		break;
 3665|  2.33k|	case PSTRING_2_BE:
  ------------------
  |  |  405|  2.33k|#define PSTRING_2_BE				BIT(8)
  |  |  ------------------
  |  |  |  |  395|  2.33k|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (3665:2): [True: 2.33k, False: 34.1k]
  ------------------
 3666|  2.33k|		s0 = s[0];
 3667|  2.33k|		s1 = s[1];
 3668|  2.33k|		len = (s0 << 8) | s1;
 3669|  2.33k|		break;
 3670|    269|	case PSTRING_4_LE:
  ------------------
  |  |  408|    269|#define PSTRING_4_LE				BIT(11)
  |  |  ------------------
  |  |  |  |  395|    269|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (3670:2): [True: 269, False: 36.2k]
  ------------------
 3671|    269|		s0 = s[0];
 3672|    269|		s1 = s[1];
 3673|    269|		s2 = s[2];
 3674|    269|		s3 = s[3];
 3675|    269|		len = (s3 << 24) | (s2 << 16) | (s1 << 8) | s0;
 3676|    269|		break;
 3677|     90|	case PSTRING_4_BE:
  ------------------
  |  |  407|     90|#define PSTRING_4_BE				BIT(10)
  |  |  ------------------
  |  |  |  |  395|     90|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (3677:2): [True: 90, False: 36.4k]
  ------------------
 3678|     90|		s0 = s[0];
 3679|     90|		s1 = s[1];
 3680|     90|		s2 = s[2];
 3681|     90|		s3 = s[3];
 3682|     90|		len = (s0 << 24) | (s1 << 16) | (s2 << 8) | s3;
 3683|     90|		break;
 3684|      0|	default:
  ------------------
  |  Branch (3684:2): [True: 0, False: 36.5k]
  ------------------
 3685|      0|		file_error(ms, 0, "corrupt magic file "
 3686|      0|		    "(bad pascal string length %d)",
 3687|      0|		    m->str_flags & PSTRING_LEN);
  ------------------
  |  |  382|      0|#define str_flags _u._s._flags
  ------------------
              		    m->str_flags & PSTRING_LEN);
  ------------------
  |  |  411|      0|    (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
  |  |  ------------------
  |  |  |  |  403|      0|#define PSTRING_1_BE				BIT(7)
  |  |  |  |  ------------------
  |  |  |  |  |  |  395|      0|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
  |  |  ------------------
  |  |  |  |  406|      0|#define PSTRING_2_LE				BIT(9)
  |  |  |  |  ------------------
  |  |  |  |  |  |  395|      0|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
  |  |  ------------------
  |  |  |  |  405|      0|#define PSTRING_2_BE				BIT(8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  395|      0|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
  |  |  ------------------
  |  |  |  |  408|      0|#define PSTRING_4_LE				BIT(11)
  |  |  |  |  ------------------
  |  |  |  |  |  |  395|      0|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
  |  |  ------------------
  |  |  |  |  407|      0|#define PSTRING_4_BE				BIT(10)
  |  |  |  |  ------------------
  |  |  |  |  |  |  395|      0|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3688|      0|		return FILE_BADSIZE;
  ------------------
  |  |  175|      0|#define FILE_BADSIZE CAST(size_t, ~0ul)
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 3689|  36.5k|	}
 3690|       |
 3691|  36.5k|	if (m->str_flags & PSTRING_LENGTH_INCLUDES_ITSELF) {
  ------------------
  |  |  382|  36.5k|#define str_flags _u._s._flags
  ------------------
              	if (m->str_flags & PSTRING_LENGTH_INCLUDES_ITSELF) {
  ------------------
  |  |  412|  36.5k|#define PSTRING_LENGTH_INCLUDES_ITSELF		BIT(12)
  |  |  ------------------
  |  |  |  |  395|  36.5k|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (3691:6): [True: 2.31k, False: 34.2k]
  ------------------
 3692|  2.31k|		size_t l = file_pstring_length_size(ms, m);
 3693|  2.31k|		if (l == FILE_BADSIZE)
  ------------------
  |  |  175|  2.31k|#define FILE_BADSIZE CAST(size_t, ~0ul)
  |  |  ------------------
  |  |  |  |  452|  2.31k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (3693:7): [True: 0, False: 2.31k]
  ------------------
 3694|      0|			return l;
 3695|  2.31k|		len -= l;
 3696|  2.31k|	}
 3697|       |
 3698|  36.5k|	return len;
 3699|  36.5k|}
file_magicfind:
 3703|  52.4k|{
 3704|  52.4k|	uint32_t i, j;
 3705|  52.4k|	struct mlist *mlist, *ml;
 3706|       |
 3707|  52.4k|	mlist = ms->mlist[1];
 3708|       |
 3709|  52.4k|	for (ml = mlist->next; ml != mlist; ml = ml->next) {
  ------------------
  |  Branch (3709:25): [True: 52.4k, False: 0]
  ------------------
 3710|  52.4k|		struct magic *ma = ml->magic;
 3711|   148M|		for (i = 0; i < ml->nmagic; i++) {
  ------------------
  |  Branch (3711:15): [True: 148M, False: 0]
  ------------------
 3712|   148M|			if (ma[i].type != FILE_NAME)
  ------------------
  |  |  290|   148M|#define				FILE_NAME		45
  ------------------
  |  Branch (3712:8): [True: 141M, False: 7.22M]
  ------------------
 3713|   141M|				continue;
 3714|  7.22M|			if (strcmp(ma[i].value.s, name) == 0) {
  ------------------
  |  Branch (3714:8): [True: 52.4k, False: 7.16M]
  ------------------
 3715|  52.4k|				v->magic = &ma[i];
 3716|  52.4k|				v->magic_rxcomp = &(ml->magic_rxcomp[i]);
 3717|  1.13M|				for (j = i + 1; j < ml->nmagic; j++)
  ------------------
  |  Branch (3717:21): [True: 1.13M, False: 85]
  ------------------
 3718|  1.13M|				    if (ma[j].cont_level == 0)
  ------------------
  |  Branch (3718:13): [True: 52.3k, False: 1.08M]
  ------------------
 3719|  52.3k|					    break;
 3720|  52.4k|				v->nmagic = j - i;
 3721|  52.4k|				return 0;
 3722|  52.4k|			}
 3723|  7.22M|		}
 3724|  52.4k|	}
 3725|      0|	return -1;
 3726|  52.4k|}
apprentice.c:mlist_free:
  665|      4|{
  666|      4|	struct mlist *ml, *next;
  667|       |
  668|      4|	if (mlist == NULL)
  ------------------
  |  Branch (668:6): [True: 4, False: 0]
  ------------------
  669|      4|		return;
  670|       |
  671|      0|	for (ml = mlist->next; ml != mlist;) {
  ------------------
  |  Branch (671:25): [True: 0, False: 0]
  ------------------
  672|      0|		next = ml->next;
  673|      0|		mlist_free_one(ml);
  674|      0|		ml = next;
  675|      0|	}
  676|      0|	mlist_free_one(mlist);
  677|      0|}
apprentice.c:init_file_tables:
  413|      2|{
  414|      2|	static int done = 0;
  415|      2|	const struct type_tbl_s *p;
  416|       |
  417|      2|	if (done)
  ------------------
  |  Branch (417:6): [True: 0, False: 2]
  ------------------
  418|      0|		return;
  419|      2|	done++;
  420|       |
  421|    126|	for (p = type_tbl; p->len; p++) {
  ------------------
  |  Branch (421:21): [True: 124, False: 2]
  ------------------
  422|    124|		assert(p->type < FILE_NAMES_SIZE);
  ------------------
  |  Branch (422:3): [True: 0, False: 124]
  |  Branch (422:3): [True: 124, False: 0]
  ------------------
  423|    124|		file_names[p->type] = p->name;
  424|    124|		file_formats[p->type] = p->format;
  425|    124|	}
  426|      2|	assert(p - type_tbl == FILE_NAMES_SIZE);
  ------------------
  |  Branch (426:2): [True: 0, False: 2]
  |  Branch (426:2): [True: 2, False: 0]
  ------------------
  427|      2|}
apprentice.c:mlist_alloc:
  623|      4|{
  624|      4|	struct mlist *mlist;
  625|      4|	if ((mlist = CAST(struct mlist *, calloc(1, sizeof(*mlist)))) == NULL) {
  ------------------
  |  |  452|      4|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (625:6): [True: 0, False: 4]
  ------------------
  626|      0|		return NULL;
  627|      0|	}
  628|      4|	mlist->next = mlist->prev = mlist;
  629|      4|	return mlist;
  630|      4|}
apprentice.c:add_mlist:
  431|      4|{
  432|      4|	struct mlist *ml;
  433|       |
  434|      4|	mlp->map = NULL;
  435|      4|	if ((ml = CAST(struct mlist *, malloc(sizeof(*ml)))) == NULL)
  ------------------
  |  |  452|      4|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (435:6): [True: 0, False: 4]
  ------------------
  436|      0|		return -1;
  437|       |
  438|      4|	ml->map = idx == 0 ? map : NULL;
  ------------------
  |  Branch (438:12): [True: 2, False: 2]
  ------------------
  439|      4|	ml->magic = map->magic[idx];
  440|      4|	ml->nmagic = map->nmagic[idx];
  441|      4|	if (ml->nmagic) {
  ------------------
  |  Branch (441:6): [True: 4, False: 0]
  ------------------
  442|      4|		ml->magic_rxcomp = CAST(file_regex_t **,
  ------------------
  |  |  452|      4|#define CAST(T, b)	((T)(b))
  ------------------
  443|      4|		    calloc(ml->nmagic, sizeof(*ml->magic_rxcomp)));
  444|      4|		if (ml->magic_rxcomp == NULL) {
  ------------------
  |  Branch (444:7): [True: 0, False: 4]
  ------------------
  445|      0|			free(ml);
  446|      0|			return -1;
  447|      0|		}
  448|      4|	} else
  449|      0|		ml->magic_rxcomp = NULL;
  450|      4|	mlp->prev->next = ml;
  451|      4|	ml->prev = mlp->prev;
  452|      4|	ml->next = mlp;
  453|      4|	mlp->prev = ml;
  454|      4|	return 0;
  455|      4|}
apprentice.c:apprentice_1:
  462|      2|{
  463|      2|	struct magic_map *map;
  464|      2|#ifndef COMPILE_ONLY
  465|      2|	size_t i;
  466|      2|#endif
  467|       |
  468|      2|	if (magicsize != FILE_MAGICSIZE) {
  ------------------
  |  |  183|      2|#define FILE_MAGICSIZE	432
  ------------------
  |  Branch (468:6): [True: 0, False: 2]
  ------------------
  469|      0|		file_error(ms, 0, "magic element size %lu != %lu",
  470|      0|		    CAST(unsigned long, sizeof(*map->magic[0])),
  ------------------
  |  |  452|      0|#define CAST(T, b)	((T)(b))
  ------------------
  471|      0|		    CAST(unsigned long, FILE_MAGICSIZE));
  ------------------
  |  |  452|      0|#define CAST(T, b)	((T)(b))
  ------------------
  472|      0|		return -1;
  473|      0|	}
  474|       |
  475|      2|	if (action == FILE_COMPILE) {
  ------------------
  |  |  189|      2|#define FILE_COMPILE	2
  ------------------
  |  Branch (475:6): [True: 0, False: 2]
  ------------------
  476|      0|		map = apprentice_load(ms, fn, action);
  477|      0|		if (map == NULL)
  ------------------
  |  Branch (477:7): [True: 0, False: 0]
  ------------------
  478|      0|			return -1;
  479|      0|		return apprentice_compile(ms, map, fn);
  480|      0|	}
  481|       |
  482|      2|#ifndef COMPILE_ONLY
  483|      2|	map = apprentice_map(ms, fn);
  484|      2|	if (map == NULL) {
  ------------------
  |  Branch (484:6): [True: 0, False: 2]
  ------------------
  485|      0|		if (ms->flags & MAGIC_CHECK)
  ------------------
  |  |   39|      0|#define	MAGIC_CHECK		0x0000040 /* Print warnings to stderr */
  ------------------
  |  Branch (485:7): [True: 0, False: 0]
  ------------------
  486|      0|			file_magwarn(ms, "using regular magic file `%s'", fn);
  487|      0|		map = apprentice_load(ms, fn, action);
  488|      0|		if (map == NULL)
  ------------------
  |  Branch (488:7): [True: 0, False: 0]
  ------------------
  489|      0|			return -1;
  490|      0|	}
  491|       |
  492|      6|	for (i = 0; i < MAGIC_SETS; i++) {
  ------------------
  |  |  471|      6|#define MAGIC_SETS	2
  ------------------
  |  Branch (492:14): [True: 4, False: 2]
  ------------------
  493|      4|		if (add_mlist(ms->mlist[i], map, i) == -1) {
  ------------------
  |  Branch (493:7): [True: 0, False: 4]
  ------------------
  494|       |			/* failed to add to any list, free explicitly */
  495|      0|			if (i == 0)
  ------------------
  |  Branch (495:8): [True: 0, False: 0]
  ------------------
  496|      0|				apprentice_unmap(map);
  497|      0|			else
  498|      0|				mlist_free_all(ms);
  499|      0|			file_oomem(ms, sizeof(*ms->mlist[0]));
  500|      0|			return -1;
  501|      0|		}
  502|      4|	}
  503|       |
  504|      2|	if (action == FILE_LIST) {
  ------------------
  |  |  190|      2|#define FILE_LIST	3
  ------------------
  |  Branch (504:6): [True: 0, False: 2]
  ------------------
  505|      0|		for (i = 0; i < MAGIC_SETS; i++) {
  ------------------
  |  |  471|      0|#define MAGIC_SETS	2
  ------------------
  |  Branch (505:15): [True: 0, False: 0]
  ------------------
  506|      0|			printf("Set %" SIZE_T_FORMAT "u:\nBinary patterns:\n",
  507|      0|			    i);
  508|      0|			apprentice_list(ms->mlist[i], BINTEST);
  ------------------
  |  |  231|      0|#define BINTEST		0x20	/* test is for a binary type (set only
  ------------------
  509|      0|			printf("Text patterns:\n");
  510|      0|			apprentice_list(ms->mlist[i], TEXTTEST);
  ------------------
  |  |  233|      0|#define TEXTTEST	0x40	/* for passing to file_softmagic */
  ------------------
  511|      0|		}
  512|      0|	}
  513|      2|	return 0;
  514|       |#else
  515|       |	return 0;
  516|       |#endif /* COMPILE_ONLY */
  517|      2|}
apprentice.c:mkdbname:
 3526|      2|{
 3527|      2|	const char *p, *q;
 3528|      2|	char *buf;
 3529|       |
 3530|      2|	if (strip) {
  ------------------
  |  Branch (3530:6): [True: 0, False: 2]
  ------------------
 3531|      0|		if ((p = strrchr(fn, '/')) != NULL)
  ------------------
  |  Branch (3531:7): [True: 0, False: 0]
  ------------------
 3532|      0|			fn = ++p;
 3533|      0|	}
 3534|       |
 3535|     94|	for (q = fn; *q; q++)
  ------------------
  |  Branch (3535:15): [True: 92, False: 2]
  ------------------
 3536|     92|		continue;
 3537|       |	/* Look for .mgc */
 3538|      6|	for (p = ext + sizeof(ext) - 1; p >= ext && q >= fn; p--, q--)
  ------------------
  |  Branch (3538:34): [True: 6, False: 0]
  |  Branch (3538:46): [True: 6, False: 0]
  ------------------
 3539|      6|		if (*p != *q)
  ------------------
  |  Branch (3539:7): [True: 2, False: 4]
  ------------------
 3540|      2|			break;
 3541|       |
 3542|       |	/* Did not find .mgc, restore q */
 3543|      2|	if (p >= ext)
  ------------------
  |  Branch (3543:6): [True: 2, False: 0]
  ------------------
 3544|     94|		for (q = fn; *q; q++)
  ------------------
  |  Branch (3544:16): [True: 92, False: 2]
  ------------------
 3545|     92|			continue;
 3546|       |
 3547|      2|	q++;
 3548|       |	/* Compatibility with old code that looked in .mime */
 3549|      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 (3549:6): [True: 0, False: 2]
  ------------------
 3550|      0|		if (asprintf(&buf, "%.*s.mime%s", CAST(int, q - fn), fn, ext)
  ------------------
  |  |  452|      0|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (3550:7): [True: 0, False: 0]
  ------------------
 3551|      0|		    < 0)
 3552|      0|			return NULL;
 3553|      0|		if (access(buf, R_OK) != -1) {
  ------------------
  |  Branch (3553:7): [True: 0, False: 0]
  ------------------
 3554|      0|			ms->flags &= MAGIC_MIME_TYPE;
  ------------------
  |  |   37|      0|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  ------------------
 3555|      0|			return buf;
 3556|      0|		}
 3557|      0|		free(buf);
 3558|      0|	}
 3559|      2|	if (asprintf(&buf, "%.*s%s", CAST(int, q - fn), fn, ext) < 0)
  ------------------
  |  |  452|      2|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (3559:6): [True: 0, False: 2]
  ------------------
 3560|      0|		return NULL;
 3561|       |
 3562|       |	/* Compatibility with old code that looked in .mime */
 3563|      2|	if (strstr(fn, ".mime") != NULL)
  ------------------
  |  Branch (3563:6): [True: 0, False: 2]
  ------------------
 3564|      0|		ms->flags &= MAGIC_MIME_TYPE;
  ------------------
  |  |   37|      0|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  ------------------
 3565|      2|	return buf;
 3566|      2|}
apprentice.c:apprentice_map:
 3323|      2|{
 3324|      2|	int fd;
 3325|      2|	struct stat st;
 3326|      2|	char *dbname = NULL;
 3327|      2|	struct magic_map *map;
 3328|      2|	struct magic_map *rv = NULL;
 3329|       |
 3330|      2|	fd = -1;
 3331|      2|	if ((map = CAST(struct magic_map *, calloc(1, sizeof(*map)))) == NULL) {
  ------------------
  |  |  452|      2|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (3331:6): [True: 0, False: 2]
  ------------------
 3332|      0|		file_oomem(ms, sizeof(*map));
 3333|      0|		goto error;
 3334|      0|	}
 3335|      2|	map->type = MAP_TYPE_USER;	/* unspecified */
  ------------------
  |  |   81|      2|#define MAP_TYPE_USER	0
  ------------------
 3336|       |
 3337|      2|	dbname = mkdbname(ms, fn, 0);
 3338|      2|	if (dbname == NULL)
  ------------------
  |  Branch (3338:6): [True: 0, False: 2]
  ------------------
 3339|      0|		goto error;
 3340|       |
 3341|      2|	if ((fd = open(dbname, O_RDONLY|O_BINARY)) == -1)
  ------------------
  |  |  728|      2|#define O_BINARY	0
  ------------------
  |  Branch (3341:6): [True: 0, False: 2]
  ------------------
 3342|      0|		goto error;
 3343|       |
 3344|      2|	if (fstat(fd, &st) == -1) {
  ------------------
  |  Branch (3344:6): [True: 0, False: 2]
  ------------------
 3345|      0|		file_error(ms, errno, "cannot stat `%s'", dbname);
 3346|      0|		goto error;
 3347|      0|	}
 3348|      2|	if (st.st_size < 8 || st.st_size > maxoff_t()) {
  ------------------
  |  Branch (3348:6): [True: 0, False: 2]
  |  Branch (3348:24): [True: 0, False: 2]
  ------------------
 3349|      0|		file_error(ms, 0, "file `%s' is too %s", dbname,
 3350|      0|		    st.st_size < 8 ? "small" : "large");
  ------------------
  |  Branch (3350:7): [True: 0, False: 0]
  ------------------
 3351|      0|		goto error;
 3352|      0|	}
 3353|       |
 3354|      2|	map->len = CAST(size_t, st.st_size);
  ------------------
  |  |  452|      2|#define CAST(T, b)	((T)(b))
  ------------------
 3355|      2|#ifdef QUICK
 3356|      2|	map->type = MAP_TYPE_MMAP;
  ------------------
  |  |   83|      2|#define MAP_TYPE_MMAP	2
  ------------------
 3357|      2|	if ((map->p = mmap(0, CAST(size_t, st.st_size), PROT_READ|PROT_WRITE,
  ------------------
  |  |  452|      2|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (3357:6): [True: 0, False: 2]
  ------------------
 3358|      2|	    MAP_PRIVATE|MAP_FILE, fd, CAST(off_t, 0))) == MAP_FAILED) {
  ------------------
  |  |  452|      2|#define CAST(T, b)	((T)(b))
  ------------------
 3359|      0|		file_error(ms, errno, "cannot map `%s'", dbname);
 3360|      0|		goto error;
 3361|      0|	}
 3362|       |#else
 3363|       |	map->type = MAP_TYPE_MALLOC;
 3364|       |	if ((map->p = CAST(void *, malloc(map->len))) == NULL) {
 3365|       |		file_oomem(ms, map->len);
 3366|       |		goto error;
 3367|       |	}
 3368|       |	if (read(fd, map->p, map->len) != (ssize_t)map->len) {
 3369|       |		file_badread(ms);
 3370|       |		goto error;
 3371|       |	}
 3372|       |#endif
 3373|      2|	(void)close(fd);
 3374|      2|	fd = -1;
 3375|       |
 3376|      2|	if (check_buffer(ms, map, dbname) != 0) {
  ------------------
  |  Branch (3376:6): [True: 0, False: 2]
  ------------------
 3377|      0|		goto error;
 3378|      0|	}
 3379|      2|#ifdef QUICK
 3380|      2|	if (mprotect(map->p, CAST(size_t, st.st_size), PROT_READ) == -1) {
  ------------------
  |  |  452|      2|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (3380:6): [True: 0, False: 2]
  ------------------
 3381|      0|		file_error(ms, errno, "cannot mprotect `%s'", dbname);
 3382|      0|		goto error;
 3383|      0|	}
 3384|      2|#endif
 3385|       |
 3386|      2|	free(dbname);
 3387|      2|	return map;
 3388|       |
 3389|      0|error:
 3390|      0|	if (fd != -1)
  ------------------
  |  Branch (3390:6): [True: 0, False: 0]
  ------------------
 3391|      0|		(void)close(fd);
 3392|      0|	apprentice_unmap(map);
 3393|      0|	free(dbname);
 3394|      0|	return rv;
 3395|      2|}
apprentice.c:maxoff_t:
  314|      2|maxoff_t(void) {
  315|      2|	if (/*CONSTCOND*/sizeof(off_t) == sizeof(int))
  ------------------
  |  Branch (315:19): [Folded, False: 2]
  ------------------
  316|      0|		return CAST(off_t, INT_MAX);
  ------------------
  |  |  452|      0|#define CAST(T, b)	((T)(b))
  ------------------
  317|      2|	if (/*CONSTCOND*/sizeof(off_t) == sizeof(long))
  ------------------
  |  Branch (317:19): [True: 2, Folded]
  ------------------
  318|      2|		return CAST(off_t, LONG_MAX);
  ------------------
  |  |  452|      2|#define CAST(T, b)	((T)(b))
  ------------------
  319|      0|	return 0x7fffffff;
  320|      2|}
apprentice.c:check_buffer:
 3399|      2|{
 3400|      2|	uint32_t *ptr;
 3401|      2|	uint32_t entries, nentries;
 3402|      2|	uint32_t version;
 3403|      2|	int i, needsbyteswap;
 3404|       |
 3405|      2|	entries = CAST(uint32_t, map->len / sizeof(struct magic));
  ------------------
  |  |  452|      2|#define CAST(T, b)	((T)(b))
  ------------------
 3406|      2|	if (entries < MAGIC_SETS) {
  ------------------
  |  |  471|      2|#define MAGIC_SETS	2
  ------------------
  |  Branch (3406:6): [True: 0, False: 2]
  ------------------
 3407|      0|		file_error(ms, 0, "Too few magic entries %u in `%s'",
 3408|      0|		    entries, dbname);
 3409|      0|		return -1;
 3410|      0|	}
 3411|      2|	if ((entries * sizeof(struct magic)) != map->len) {
  ------------------
  |  Branch (3411:6): [True: 0, False: 2]
  ------------------
 3412|      0|		file_error(ms, 0, "Size of `%s' %" SIZE_T_FORMAT "u is not "
 3413|      0|		    "a multiple of %" SIZE_T_FORMAT "u",
 3414|      0|		    dbname, map->len, sizeof(struct magic));
 3415|      0|		return -1;
 3416|      0|	}
 3417|       |
 3418|      2|	ptr = CAST(uint32_t *, map->p);
  ------------------
  |  |  452|      2|#define CAST(T, b)	((T)(b))
  ------------------
 3419|      2|	if (*ptr != MAGICNO) {
  ------------------
  |  |  181|      2|#define MAGICNO		0xF11E041C
  ------------------
  |  Branch (3419:6): [True: 0, False: 2]
  ------------------
 3420|      0|		if (file_swap4(*ptr) != MAGICNO) {
  ------------------
  |  |   38|      0|#define file_swap4(x)	bswap_32(x)
  ------------------
              		if (file_swap4(*ptr) != MAGICNO) {
  ------------------
  |  |  181|      0|#define MAGICNO		0xF11E041C
  ------------------
  |  Branch (3420:7): [True: 0, False: 0]
  ------------------
 3421|      0|			file_error(ms, 0, "bad magic in `%s'", dbname);
 3422|      0|			return -1;
 3423|      0|		}
 3424|      0|		needsbyteswap = 1;
 3425|      0|	} else
 3426|      2|		needsbyteswap = 0;
 3427|      2|	if (needsbyteswap)
  ------------------
  |  Branch (3427:6): [True: 0, False: 2]
  ------------------
 3428|      0|		version = file_swap4(ptr[1]);
  ------------------
  |  |   38|      0|#define file_swap4(x)	bswap_32(x)
  ------------------
 3429|      2|	else
 3430|      2|		version = ptr[1];
 3431|      2|	if (version != VERSIONNO) {
  ------------------
  |  |  182|      2|#define VERSIONNO	21
  ------------------
  |  Branch (3431:6): [True: 0, False: 2]
  ------------------
 3432|      0|		file_error(ms, 0, "File %s supports only version %d magic "
 3433|      0|		    "files. `%s' is version %d", VERSION,
  ------------------
  |  |  386|      0|#define VERSION "5.48"
  ------------------
 3434|      0|		    VERSIONNO, dbname, version);
  ------------------
  |  |  182|      0|#define VERSIONNO	21
  ------------------
 3435|      0|		return -1;
 3436|      0|	}
 3437|      2|	map->magic[0] = CAST(struct magic *, map->p) + 1;
  ------------------
  |  |  452|      2|#define CAST(T, b)	((T)(b))
  ------------------
 3438|      2|	nentries = 0;
 3439|      6|	for (i = 0; i < MAGIC_SETS; i++) {
  ------------------
  |  |  471|      6|#define MAGIC_SETS	2
  ------------------
  |  Branch (3439:14): [True: 4, False: 2]
  ------------------
 3440|      4|		if (needsbyteswap)
  ------------------
  |  Branch (3440:7): [True: 0, False: 4]
  ------------------
 3441|      0|			map->nmagic[i] = file_swap4(ptr[i + 2]);
  ------------------
  |  |   38|      0|#define file_swap4(x)	bswap_32(x)
  ------------------
 3442|      4|		else
 3443|      4|			map->nmagic[i] = ptr[i + 2];
 3444|      4|		if (map->nmagic[i] > entries) {
  ------------------
  |  Branch (3444:7): [True: 0, False: 4]
  ------------------
 3445|      0|			file_error(ms, 0, "nmagic[%u] too large in `%s'", i,
 3446|      0|			    dbname);
 3447|      0|			return -1;
 3448|      0|		}
 3449|      4|		if (i != MAGIC_SETS - 1)
  ------------------
  |  |  471|      4|#define MAGIC_SETS	2
  ------------------
  |  Branch (3449:7): [True: 2, False: 2]
  ------------------
 3450|      2|			map->magic[i + 1] = map->magic[i] + map->nmagic[i];
 3451|      4|		nentries += map->nmagic[i];
 3452|      4|	}
 3453|      2|	if (entries != nentries + 1) {
  ------------------
  |  Branch (3453:6): [True: 0, False: 2]
  ------------------
 3454|      0|		file_error(ms, 0, "Inconsistent entries in `%s' %u != %u",
 3455|      0|		    dbname, entries, nentries + 1);
 3456|      0|		return -1;
 3457|      0|	}
 3458|      2|	if (needsbyteswap)
  ------------------
  |  Branch (3458:6): [True: 0, False: 2]
  ------------------
 3459|      0|		for (i = 0; i < MAGIC_SETS; i++)
  ------------------
  |  |  471|      0|#define MAGIC_SETS	2
  ------------------
  |  Branch (3459:15): [True: 0, False: 0]
  ------------------
 3460|      0|			byteswap(map->magic[i], map->nmagic[i]);
 3461|      2|	return 0;
 3462|      2|}

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

buffer_init:
   42|   142M|{
   43|   142M|	b->fd = fd;
   44|   142M|	if (st)
  ------------------
  |  Branch (44:6): [True: 2.21k, False: 142M]
  ------------------
   45|  2.21k|		memcpy(&b->st, st, sizeof(b->st));
   46|   142M|	else if (b->fd == -1 || fstat(b->fd, &b->st) == -1)
  ------------------
  |  Branch (46:11): [True: 142M, False: 0]
  |  Branch (46:26): [True: 0, False: 0]
  ------------------
   47|   142M|		memset(&b->st, 0, sizeof(b->st));
   48|   142M|	b->fbuf = data;
   49|   142M|	b->flen = len;
   50|   142M|	b->eoff = 0;
   51|       |	b->ebuf = NULL;
   52|   142M|	b->elen = 0;
   53|   142M|}
buffer_fini:
   57|  47.5k|{
   58|  47.5k|	free(b->ebuf);
   59|       |	b->ebuf = NULL;
   60|  47.5k|	b->elen = 0;
   61|  47.5k|}
buffer_fill:
   65|   418k|{
   66|   418k|	struct buffer *b = CCAST(struct buffer *, bb);
  ------------------
  |  |  454|   418k|#define CCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
   67|       |
   68|   418k|	if (b->elen != 0)
  ------------------
  |  Branch (68:6): [True: 0, False: 418k]
  ------------------
   69|      0|		return b->elen == FILE_BADSIZE ? -1 : 0;
  ------------------
  |  |  175|      0|#define FILE_BADSIZE CAST(size_t, ~0ul)
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (69:10): [True: 0, False: 0]
  ------------------
   70|       |
   71|       |	// Nothing to refill, everything is in memory
   72|   418k|	if (b->fd == -1)
  ------------------
  |  Branch (72:6): [True: 418k, False: 0]
  ------------------
   73|   418k|		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 ?
  ------------------
  |  |  452|      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;
  ------------------
  |  |  452|      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;
  ------------------
  |  |  175|      0|#define FILE_BADSIZE CAST(size_t, ~0ul)
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
   98|      0|	return -1;
   99|      0|}

cdf_swap_header:
  229|  3.58k|{
  230|  3.58k|	size_t i;
  231|       |
  232|  3.58k|	h->h_magic = CDF_TOLE8(h->h_magic);
  ------------------
  |  |   81|  3.58k|    (CAST(uint64_t, NEED_SWAP ? _cdf_tole8(x) : CAST(uint64_t, x)))
  |  |  ------------------
  |  |  |  |  452|  7.16k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 3.58k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  233|  3.58k|	h->h_uuid[0] = CDF_TOLE8(h->h_uuid[0]);
  ------------------
  |  |   81|  3.58k|    (CAST(uint64_t, NEED_SWAP ? _cdf_tole8(x) : CAST(uint64_t, x)))
  |  |  ------------------
  |  |  |  |  452|  7.16k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 3.58k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  234|  3.58k|	h->h_uuid[1] = CDF_TOLE8(h->h_uuid[1]);
  ------------------
  |  |   81|  3.58k|    (CAST(uint64_t, NEED_SWAP ? _cdf_tole8(x) : CAST(uint64_t, x)))
  |  |  ------------------
  |  |  |  |  452|  7.16k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 3.58k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  235|  3.58k|	h->h_revision = CDF_TOLE2(h->h_revision);
  ------------------
  |  |   85|  3.58k|    (CAST(uint16_t, NEED_SWAP ? _cdf_tole2(x) : CAST(uint16_t, x)))
  |  |  ------------------
  |  |  |  |  452|  7.16k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 3.58k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  236|  3.58k|	h->h_version = CDF_TOLE2(h->h_version);
  ------------------
  |  |   85|  3.58k|    (CAST(uint16_t, NEED_SWAP ? _cdf_tole2(x) : CAST(uint16_t, x)))
  |  |  ------------------
  |  |  |  |  452|  7.16k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 3.58k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  237|  3.58k|	h->h_byte_order = CDF_TOLE2(h->h_byte_order);
  ------------------
  |  |   85|  3.58k|    (CAST(uint16_t, NEED_SWAP ? _cdf_tole2(x) : CAST(uint16_t, x)))
  |  |  ------------------
  |  |  |  |  452|  7.16k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 3.58k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  238|  3.58k|	h->h_sec_size_p2 = CDF_TOLE2(h->h_sec_size_p2);
  ------------------
  |  |   85|  3.58k|    (CAST(uint16_t, NEED_SWAP ? _cdf_tole2(x) : CAST(uint16_t, x)))
  |  |  ------------------
  |  |  |  |  452|  7.16k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 3.58k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  239|  3.58k|	h->h_short_sec_size_p2 = CDF_TOLE2(h->h_short_sec_size_p2);
  ------------------
  |  |   85|  3.58k|    (CAST(uint16_t, NEED_SWAP ? _cdf_tole2(x) : CAST(uint16_t, x)))
  |  |  ------------------
  |  |  |  |  452|  7.16k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 3.58k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  240|  3.58k|	h->h_num_sectors_in_sat = CDF_TOLE4(h->h_num_sectors_in_sat);
  ------------------
  |  |   83|  3.58k|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  452|  7.16k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 3.58k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  241|  3.58k|	h->h_secid_first_directory = CDF_TOLE4(h->h_secid_first_directory);
  ------------------
  |  |   83|  3.58k|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  452|  7.16k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 3.58k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  242|  3.58k|	h->h_min_size_standard_stream =
  243|  3.58k|	    CDF_TOLE4(h->h_min_size_standard_stream);
  ------------------
  |  |   83|  3.58k|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  452|  7.16k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 3.58k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  244|  3.58k|	h->h_secid_first_sector_in_short_sat =
  245|  3.58k|	    CDF_TOLE4(CAST(uint32_t, h->h_secid_first_sector_in_short_sat));
  ------------------
  |  |   83|  3.58k|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  452|  7.16k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 3.58k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  246|  3.58k|	h->h_num_sectors_in_short_sat =
  247|  3.58k|	    CDF_TOLE4(h->h_num_sectors_in_short_sat);
  ------------------
  |  |   83|  3.58k|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  452|  7.16k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 3.58k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  248|  3.58k|	h->h_secid_first_sector_in_master_sat =
  249|  3.58k|	    CDF_TOLE4(CAST(uint32_t, h->h_secid_first_sector_in_master_sat));
  ------------------
  |  |   83|  3.58k|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  452|  7.16k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 3.58k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  250|  3.58k|	h->h_num_sectors_in_master_sat =
  251|  3.58k|	    CDF_TOLE4(h->h_num_sectors_in_master_sat);
  ------------------
  |  |   83|  3.58k|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  452|  7.16k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 3.58k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  252|   394k|	for (i = 0; i < __arraycount(h->h_master_sat); i++) {
  ------------------
  |  |  130|   394k|#define __arraycount(a) (sizeof(a) / sizeof(a[0]))
  ------------------
  |  Branch (252:14): [True: 390k, False: 3.58k]
  ------------------
  253|   390k|		h->h_master_sat[i] =
  254|   390k|		    CDF_TOLE4(CAST(uint32_t, h->h_master_sat[i]));
  ------------------
  |  |   83|   390k|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  452|   781k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 390k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  255|   390k|	}
  256|  3.58k|}
cdf_unpack_header:
  260|  3.58k|{
  261|  3.58k|	size_t i;
  262|  3.58k|	size_t len = 0;
  263|       |
  264|  3.58k|	CDF_UNPACK(h->h_magic);
  ------------------
  |  |  205|  3.58k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  265|  3.58k|	CDF_UNPACKA(h->h_uuid);
  ------------------
  |  |  207|  3.58k|    (void)memcpy((a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  266|  3.58k|	CDF_UNPACK(h->h_revision);
  ------------------
  |  |  205|  3.58k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  267|  3.58k|	CDF_UNPACK(h->h_version);
  ------------------
  |  |  205|  3.58k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  268|  3.58k|	CDF_UNPACK(h->h_byte_order);
  ------------------
  |  |  205|  3.58k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  269|  3.58k|	CDF_UNPACK(h->h_sec_size_p2);
  ------------------
  |  |  205|  3.58k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  270|  3.58k|	CDF_UNPACK(h->h_short_sec_size_p2);
  ------------------
  |  |  205|  3.58k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  271|  3.58k|	CDF_UNPACKA(h->h_unused0);
  ------------------
  |  |  207|  3.58k|    (void)memcpy((a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  272|  3.58k|	CDF_UNPACK(h->h_num_sectors_in_sat);
  ------------------
  |  |  205|  3.58k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  273|  3.58k|	CDF_UNPACK(h->h_secid_first_directory);
  ------------------
  |  |  205|  3.58k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  274|  3.58k|	CDF_UNPACKA(h->h_unused1);
  ------------------
  |  |  207|  3.58k|    (void)memcpy((a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  275|  3.58k|	CDF_UNPACK(h->h_min_size_standard_stream);
  ------------------
  |  |  205|  3.58k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  276|  3.58k|	CDF_UNPACK(h->h_secid_first_sector_in_short_sat);
  ------------------
  |  |  205|  3.58k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  277|  3.58k|	CDF_UNPACK(h->h_num_sectors_in_short_sat);
  ------------------
  |  |  205|  3.58k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  278|  3.58k|	CDF_UNPACK(h->h_secid_first_sector_in_master_sat);
  ------------------
  |  |  205|  3.58k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  279|  3.58k|	CDF_UNPACK(h->h_num_sectors_in_master_sat);
  ------------------
  |  |  205|  3.58k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  280|   394k|	for (i = 0; i < __arraycount(h->h_master_sat); i++)
  ------------------
  |  |  130|   394k|#define __arraycount(a) (sizeof(a) / sizeof(a[0]))
  ------------------
  |  Branch (280:14): [True: 390k, False: 3.58k]
  ------------------
  281|   390k|		CDF_UNPACK(h->h_master_sat[i]);
  ------------------
  |  |  205|   390k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  282|  3.58k|}
cdf_swap_class:
  303|    898|{
  304|    898|	d->cl_dword = CDF_TOLE4(d->cl_dword);
  ------------------
  |  |   83|    898|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  452|  1.79k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 898]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  305|    898|	d->cl_word[0] = CDF_TOLE2(d->cl_word[0]);
  ------------------
  |  |   85|    898|    (CAST(uint16_t, NEED_SWAP ? _cdf_tole2(x) : CAST(uint16_t, x)))
  |  |  ------------------
  |  |  |  |  452|  1.79k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 898]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  306|    898|	d->cl_word[1] = CDF_TOLE2(d->cl_word[1]);
  ------------------
  |  |   85|    898|    (CAST(uint16_t, NEED_SWAP ? _cdf_tole2(x) : CAST(uint16_t, x)))
  |  |  ------------------
  |  |  |  |  452|  1.79k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 898]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  307|    898|}
cdf_unpack_dir:
  311|  15.6k|{
  312|  15.6k|	size_t len = 0;
  313|       |
  314|  15.6k|	CDF_UNPACKA(d->d_name);
  ------------------
  |  |  207|  15.6k|    (void)memcpy((a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  315|  15.6k|	CDF_UNPACK(d->d_namelen);
  ------------------
  |  |  205|  15.6k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  316|  15.6k|	CDF_UNPACK(d->d_type);
  ------------------
  |  |  205|  15.6k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  317|  15.6k|	CDF_UNPACK(d->d_color);
  ------------------
  |  |  205|  15.6k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  318|  15.6k|	CDF_UNPACK(d->d_left_child);
  ------------------
  |  |  205|  15.6k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  319|  15.6k|	CDF_UNPACK(d->d_right_child);
  ------------------
  |  |  205|  15.6k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  320|  15.6k|	CDF_UNPACK(d->d_storage);
  ------------------
  |  |  205|  15.6k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  321|  15.6k|	CDF_UNPACKA(d->d_storage_uuid);
  ------------------
  |  |  207|  15.6k|    (void)memcpy((a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  322|  15.6k|	CDF_UNPACK(d->d_flags);
  ------------------
  |  |  205|  15.6k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  323|  15.6k|	CDF_UNPACK(d->d_created);
  ------------------
  |  |  205|  15.6k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  324|  15.6k|	CDF_UNPACK(d->d_modified);
  ------------------
  |  |  205|  15.6k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  325|  15.6k|	CDF_UNPACK(d->d_stream_first_sector);
  ------------------
  |  |  205|  15.6k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  326|  15.6k|	CDF_UNPACK(d->d_size);
  ------------------
  |  |  205|  15.6k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  327|  15.6k|	CDF_UNPACK(d->d_unused0);
  ------------------
  |  |  205|  15.6k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  328|  15.6k|}
cdf_zero_stream:
  332|  4.32k|{
  333|  4.32k|	scn->sst_len = 0;
  334|  4.32k|	scn->sst_dirlen = 0;
  335|  4.32k|	scn->sst_ss = 0;
  336|  4.32k|	free(scn->sst_tab);
  337|       |	scn->sst_tab = NULL;
  338|  4.32k|	return -1;
  339|  4.32k|}
cdf_read_header:
  395|  11.1k|{
  396|  11.1k|	char buf[512];
  397|       |
  398|  11.1k|	(void)memcpy(cdf_bo.s, "\01\02\03\04", 4);
  399|  11.1k|	if (cdf_read(info, CAST(off_t, 0), buf, sizeof(buf)) == -1)
  ------------------
  |  |  452|  11.1k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (399:6): [True: 7.56k, False: 3.58k]
  ------------------
  400|  7.56k|		return -1;
  401|  3.58k|	cdf_unpack_header(h, buf);
  402|  3.58k|	cdf_swap_header(h);
  403|  3.58k|	if (h->h_magic != CDF_MAGIC) {
  ------------------
  |  |   61|  3.58k|#define CDF_MAGIC	0xE11AB1A1E011CFD0LL
  ------------------
  |  Branch (403:6): [True: 1.86k, False: 1.71k]
  ------------------
  404|  1.86k|		DPRINTF(("Bad magic %#" INT64_T_FORMAT "x != %#"
  405|  1.86k|		    INT64_T_FORMAT "x\n",
  406|  1.86k|		    (unsigned long long)h->h_magic,
  407|  1.86k|		    (unsigned long long)CDF_MAGIC));
  408|  1.86k|		goto out;
  409|  1.86k|	}
  410|  1.71k|	if (h->h_sec_size_p2 > 20) {
  ------------------
  |  Branch (410:6): [True: 19, False: 1.69k]
  ------------------
  411|     19|		DPRINTF(("Bad sector size %hu\n", h->h_sec_size_p2));
  412|     19|		goto out;
  413|     19|	}
  414|  1.69k|	if (h->h_short_sec_size_p2 > 20) {
  ------------------
  |  Branch (414:6): [True: 4, False: 1.69k]
  ------------------
  415|      4|		DPRINTF(("Bad short sector size %hu\n",
  416|      4|		    h->h_short_sec_size_p2));
  417|      4|		goto out;
  418|      4|	}
  419|  1.69k|	return 0;
  420|  1.89k|out:
  421|  1.89k|	errno = EFTYPE;
  ------------------
  |  |   58|  1.89k|#define EFTYPE EINVAL
  ------------------
  422|  1.89k|	return -1;
  423|  1.69k|}
cdf_read_sector:
  429|   287k|{
  430|   287k|	size_t ss = CDF_SEC_SIZE(h);
  ------------------
  |  |   80|   287k|#define CDF_SEC_SIZE(h) CAST(size_t, 1 << (h)->h_sec_size_p2)
  |  |  ------------------
  |  |  |  |  452|   287k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  431|   287k|	size_t pos;
  432|       |
  433|   287k|	if (SIZE_T_MAX / ss < CAST(size_t, id))
  ------------------
  |  |   62|   287k|#define SIZE_T_MAX CAST(size_t, ~0ULL)
  |  |  ------------------
  |  |  |  |  452|   287k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
              	if (SIZE_T_MAX / ss < CAST(size_t, id))
  ------------------
  |  |  452|   287k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (433:6): [True: 0, False: 287k]
  ------------------
  434|      0|		return -1;
  435|       |
  436|   287k|	pos = CDF_SEC_POS(h, id);
  ------------------
  |  |   81|   287k|#define CDF_SEC_POS(h, secid) (CDF_SEC_SIZE(h) + (secid) * CDF_SEC_SIZE(h))
  |  |  ------------------
  |  |  |  |   80|   287k|#define CDF_SEC_SIZE(h) CAST(size_t, 1 << (h)->h_sec_size_p2)
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|   287k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define CDF_SEC_POS(h, secid) (CDF_SEC_SIZE(h) + (secid) * CDF_SEC_SIZE(h))
  |  |  ------------------
  |  |  |  |   80|   287k|#define CDF_SEC_SIZE(h) CAST(size_t, 1 << (h)->h_sec_size_p2)
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|   287k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  437|   287k|	assert(ss == len);
  ------------------
  |  Branch (437:2): [True: 0, False: 287k]
  |  Branch (437:2): [True: 287k, False: 0]
  ------------------
  438|   287k|	return cdf_read(info, CAST(off_t, pos), RCAST(char *, buf) + offs, len);
  ------------------
  |  |  452|   287k|#define CAST(T, b)	((T)(b))
  ------------------
              	return cdf_read(info, CAST(off_t, pos), RCAST(char *, buf) + offs, len);
  ------------------
  |  |  453|   287k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
  439|   287k|}
cdf_read_short_sector:
  444|    315|{
  445|    315|	size_t ss = CDF_SHORT_SEC_SIZE(h);
  ------------------
  |  |   82|    315|#define CDF_SHORT_SEC_SIZE(h)	CAST(size_t, 1 << (h)->h_short_sec_size_p2)
  |  |  ------------------
  |  |  |  |  452|    315|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  446|    315|	size_t pos;
  447|       |
  448|    315|	if (SIZE_T_MAX / ss < CAST(size_t, id))
  ------------------
  |  |   62|    315|#define SIZE_T_MAX CAST(size_t, ~0ULL)
  |  |  ------------------
  |  |  |  |  452|    315|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
              	if (SIZE_T_MAX / ss < CAST(size_t, id))
  ------------------
  |  |  452|    315|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (448:6): [True: 0, False: 315]
  ------------------
  449|      0|		return -1;
  450|       |
  451|    315|	pos = CDF_SHORT_SEC_POS(h, id);
  ------------------
  |  |   83|    315|#define CDF_SHORT_SEC_POS(h, secid) ((secid) * CDF_SHORT_SEC_SIZE(h))
  |  |  ------------------
  |  |  |  |   82|    315|#define CDF_SHORT_SEC_SIZE(h)	CAST(size_t, 1 << (h)->h_short_sec_size_p2)
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|    315|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  452|    315|	assert(ss == len);
  ------------------
  |  Branch (452:2): [True: 0, False: 315]
  |  Branch (452:2): [True: 315, False: 0]
  ------------------
  453|    315|	if (pos + len > CDF_SEC_SIZE(h) * sst->sst_len) {
  ------------------
  |  |   80|    315|#define CDF_SEC_SIZE(h) CAST(size_t, 1 << (h)->h_sec_size_p2)
  |  |  ------------------
  |  |  |  |  452|    315|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (453:6): [True: 16, False: 299]
  ------------------
  454|     16|		DPRINTF(("Out of bounds read %" SIZE_T_FORMAT "u > %"
  455|     16|		    SIZE_T_FORMAT "u\n",
  456|     16|		    pos + len, CDF_SEC_SIZE(h) * sst->sst_len));
  457|     16|		goto out;
  458|     16|	}
  459|    299|	(void)memcpy(RCAST(char *, buf) + offs,
  ------------------
  |  |  453|    299|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
  460|    299|	    RCAST(const char *, sst->sst_tab) + pos, len);
  ------------------
  |  |  453|    299|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
  461|    299|	return len;
  462|     16|out:
  463|     16|	errno = EFTYPE;
  ------------------
  |  |   58|     16|#define EFTYPE EINVAL
  ------------------
  464|     16|	return -1;
  465|    315|}
cdf_read_sat:
  472|  1.69k|{
  473|  1.69k|	size_t i, j, k;
  474|  1.69k|	size_t ss = CDF_SEC_SIZE(h);
  ------------------
  |  |   80|  1.69k|#define CDF_SEC_SIZE(h) CAST(size_t, 1 << (h)->h_sec_size_p2)
  |  |  ------------------
  |  |  |  |  452|  1.69k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  475|  1.69k|	cdf_secid_t *msa, mid, sec;
  476|  1.69k|	size_t nsatpersec = (ss / sizeof(mid)) - 1;
  477|       |
  478|   111k|	for (i = 0; i < __arraycount(h->h_master_sat); i++)
  ------------------
  |  |  130|   111k|#define __arraycount(a) (sizeof(a) / sizeof(a[0]))
  ------------------
  |  Branch (478:14): [True: 110k, False: 806]
  ------------------
  479|   110k|		if (h->h_master_sat[i] == CDF_SECID_FREE)
  ------------------
  |  |   54|   110k|#define CDF_SECID_FREE					-1
  ------------------
  |  Branch (479:7): [True: 886, False: 109k]
  ------------------
  480|    886|			break;
  481|       |
  482|  1.69k|#define CDF_SEC_LIMIT (UINT32_MAX / (64 * ss))
  483|  1.69k|	if ((nsatpersec > 0 &&
  ------------------
  |  Branch (483:7): [True: 1.56k, False: 125]
  ------------------
  484|  1.56k|	    h->h_num_sectors_in_master_sat > CDF_SEC_LIMIT / nsatpersec) ||
  ------------------
  |  |  482|  1.56k|#define CDF_SEC_LIMIT (UINT32_MAX / (64 * ss))
  ------------------
  |  Branch (484:6): [True: 17, False: 1.55k]
  ------------------
  485|  1.67k|	    i > CDF_SEC_LIMIT) {
  ------------------
  |  |  482|  1.67k|#define CDF_SEC_LIMIT (UINT32_MAX / (64 * ss))
  ------------------
  |  Branch (485:6): [True: 1, False: 1.67k]
  ------------------
  486|     18|		DPRINTF(("Number of sectors in master SAT too big %u %"
  487|     18|		    SIZE_T_FORMAT "u\n", h->h_num_sectors_in_master_sat, i));
  488|     18|		errno = EFTYPE;
  ------------------
  |  |   58|     18|#define EFTYPE EINVAL
  ------------------
  489|     18|		return -1;
  490|     18|	}
  491|       |
  492|  1.67k|	sat->sat_len = h->h_num_sectors_in_master_sat * nsatpersec + i;
  493|  1.67k|#define CDF_SAT_LIMIT	(16 * 1024 * 1024)
  494|  1.67k|	if (ss != 0 && sat->sat_len > CDF_SAT_LIMIT / ss) {
  ------------------
  |  |  493|  1.67k|#define CDF_SAT_LIMIT	(16 * 1024 * 1024)
  ------------------
  |  Branch (494:6): [True: 1.67k, False: 0]
  |  Branch (494:17): [True: 24, False: 1.65k]
  ------------------
  495|     24|		errno = EFTYPE;
  ------------------
  |  |   58|     24|#define EFTYPE EINVAL
  ------------------
  496|     24|		return -1;
  497|     24|	}
  498|  1.65k|	DPRINTF(("sat_len = %" SIZE_T_FORMAT "u ss = %" SIZE_T_FORMAT "u\n",
  499|  1.65k|	    sat->sat_len, ss));
  500|  1.65k|	if ((sat->sat_tab = CAST(cdf_secid_t *, CDF_CALLOC(sat->sat_len, ss)))
  ------------------
  |  |  452|  1.65k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (500:6): [True: 0, False: 1.65k]
  ------------------
  501|  1.65k|	    == NULL)
  502|      0|		return -1;
  503|       |
  504|  23.4k|	for (i = 0; i < __arraycount(h->h_master_sat); i++) {
  ------------------
  |  |  130|  23.4k|#define __arraycount(a) (sizeof(a) / sizeof(a[0]))
  ------------------
  |  Branch (504:14): [True: 23.2k, False: 162]
  ------------------
  505|  23.2k|		if (h->h_master_sat[i] < 0)
  ------------------
  |  Branch (505:7): [True: 1.47k, False: 21.8k]
  ------------------
  506|  1.47k|			break;
  507|  21.8k|		if (cdf_read_sector(info, sat->sat_tab, ss * i, ss, h,
  ------------------
  |  Branch (507:7): [True: 13, False: 21.8k]
  ------------------
  508|  21.8k|		    h->h_master_sat[i]) != CAST(ssize_t, ss)) {
  ------------------
  |  |  452|  21.8k|#define CAST(T, b)	((T)(b))
  ------------------
  509|     13|			DPRINTF(("Reading sector %d", h->h_master_sat[i]));
  510|     13|			goto out1;
  511|     13|		}
  512|  21.8k|	}
  513|       |
  514|  1.63k|	if ((msa = CAST(cdf_secid_t *, CDF_CALLOC(1, ss))) == NULL)
  ------------------
  |  |  452|  1.63k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (514:6): [True: 0, False: 1.63k]
  ------------------
  515|      0|		goto out1;
  516|       |
  517|  1.63k|	mid = h->h_secid_first_sector_in_master_sat;
  518|  77.7k|	for (j = 0; j < h->h_num_sectors_in_master_sat; j++) {
  ------------------
  |  Branch (518:14): [True: 76.6k, False: 1.09k]
  ------------------
  519|  76.6k|		if (mid < 0)
  ------------------
  |  Branch (519:7): [True: 350, False: 76.2k]
  ------------------
  520|    350|			goto out;
  521|  76.2k|		if (j >= CDF_LOOP_LIMIT) {
  ------------------
  |  |   50|  76.2k|#define CDF_LOOP_LIMIT					10000
  ------------------
  |  Branch (521:7): [True: 7, False: 76.2k]
  ------------------
  522|      7|			DPRINTF(("Reading master sector loop limit"));
  523|      7|			goto out3;
  524|      7|		}
  525|  76.2k|		if (cdf_read_sector(info, msa, 0, ss, h, mid) !=
  ------------------
  |  Branch (525:7): [True: 64, False: 76.1k]
  ------------------
  526|  76.2k|		    CAST(ssize_t, ss)) {
  ------------------
  |  |  452|  76.2k|#define CAST(T, b)	((T)(b))
  ------------------
  527|     64|			DPRINTF(("Reading master sector %d", mid));
  528|     64|			goto out2;
  529|     64|		}
  530|   253k|		for (k = 0; k < nsatpersec; k++, i++) {
  ------------------
  |  Branch (530:15): [True: 177k, False: 76.0k]
  ------------------
  531|   177k|			sec = CDF_TOLE4(CAST(uint32_t, msa[k]));
  ------------------
  |  |   83|   177k|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  452|   355k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 177k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  532|   177k|			if (sec < 0)
  ------------------
  |  Branch (532:8): [True: 89, False: 177k]
  ------------------
  533|     89|				goto out;
  534|   177k|			if (i >= sat->sat_len) {
  ------------------
  |  Branch (534:8): [True: 0, False: 177k]
  ------------------
  535|      0|			    DPRINTF(("Out of bounds reading MSA %"
  536|      0|				SIZE_T_FORMAT "u >= %" SIZE_T_FORMAT "u",
  537|      0|				i, sat->sat_len));
  538|      0|			    goto out3;
  539|      0|			}
  540|   177k|			if (cdf_read_sector(info, sat->sat_tab, ss * i, ss, h,
  ------------------
  |  Branch (540:8): [True: 33, False: 177k]
  ------------------
  541|   177k|			    sec) != CAST(ssize_t, ss)) {
  ------------------
  |  |  452|   177k|#define CAST(T, b)	((T)(b))
  ------------------
  542|     33|				DPRINTF(("Reading sector %d",
  543|     33|				    CDF_TOLE4(msa[k])));
  544|     33|				goto out2;
  545|     33|			}
  546|   177k|		}
  547|  76.0k|		mid = CDF_TOLE4(CAST(uint32_t, msa[nsatpersec]));
  ------------------
  |  |   83|  76.0k|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  452|   152k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 76.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  548|  76.0k|	}
  549|  1.53k|out:
  550|  1.53k|	sat->sat_len = i;
  551|  1.53k|	free(msa);
  552|  1.53k|	return 0;
  553|      7|out3:
  554|      7|	errno = EFTYPE;
  ------------------
  |  |   58|      7|#define EFTYPE EINVAL
  ------------------
  555|    104|out2:
  556|    104|	free(msa);
  557|    117|out1:
  558|    117|	free(sat->sat_tab);
  559|    117|	return -1;
  560|    104|}
cdf_count_chain:
  564|  4.36k|{
  565|  4.36k|	size_t i, j;
  566|  4.36k|	cdf_secid_t maxsector = CAST(cdf_secid_t, (sat->sat_len * size)
  ------------------
  |  |  452|  4.36k|#define CAST(T, b)	((T)(b))
  ------------------
  567|  4.36k|	    / sizeof(maxsector));
  568|       |
  569|  4.36k|	DPRINTF(("Chain:"));
  570|  4.36k|	if (sid == CDF_SECID_END_OF_CHAIN) {
  ------------------
  |  |   55|  4.36k|#define CDF_SECID_END_OF_CHAIN				-2
  ------------------
  |  Branch (570:6): [True: 65, False: 4.30k]
  ------------------
  571|       |		/* 0-length chain. */
  572|     65|		DPRINTF((" empty\n"));
  573|     65|		return 0;
  574|     65|	}
  575|       |
  576|   357k|	for (j = i = 0; sid >= 0; i++, j++) {
  ------------------
  |  Branch (576:18): [True: 353k, False: 3.98k]
  ------------------
  577|   353k|		DPRINTF((" %d", sid));
  578|   353k|		if (j >= CDF_LOOP_LIMIT) {
  ------------------
  |  |   50|   353k|#define CDF_LOOP_LIMIT					10000
  ------------------
  |  Branch (578:7): [True: 34, False: 353k]
  ------------------
  579|     34|			DPRINTF(("Counting chain loop limit"));
  580|     34|			goto out;
  581|     34|		}
  582|   353k|		if (sid >= maxsector) {
  ------------------
  |  Branch (582:7): [True: 283, False: 352k]
  ------------------
  583|    283|			DPRINTF(("Sector %d >= %d\n", sid, maxsector));
  584|    283|			goto out;
  585|    283|		}
  586|   352k|		sid = CDF_TOLE4(CAST(uint32_t, sat->sat_tab[sid]));
  ------------------
  |  |   83|   352k|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  452|   705k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 352k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  587|   352k|	}
  588|  3.98k|	if (i == 0) {
  ------------------
  |  Branch (588:6): [True: 207, False: 3.78k]
  ------------------
  589|    207|		DPRINTF((" none, sid: %d\n", sid));
  590|    207|		goto out;
  591|       |
  592|    207|	}
  593|  3.78k|	DPRINTF(("\n"));
  594|  3.78k|	return i;
  595|    524|out:
  596|    524|	errno = EFTYPE;
  ------------------
  |  |   58|    524|#define EFTYPE EINVAL
  ------------------
  597|    524|	return CAST(size_t, -1);
  ------------------
  |  |  452|    524|#define CAST(T, b)	((T)(b))
  ------------------
  598|  3.98k|}
cdf_read_long_sector_chain:
  603|  1.28k|{
  604|  1.28k|	size_t ss = CDF_SEC_SIZE(h), i, j;
  ------------------
  |  |   80|  1.28k|#define CDF_SEC_SIZE(h) CAST(size_t, 1 << (h)->h_sec_size_p2)
  |  |  ------------------
  |  |  |  |  452|  1.28k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  605|  1.28k|	ssize_t nr;
  606|  1.28k|	scn->sst_tab = NULL;
  607|  1.28k|	scn->sst_len = cdf_count_chain(sat, sid, ss);
  608|  1.28k|	scn->sst_dirlen = MAX(h->h_min_size_standard_stream, len);
  ------------------
  |  Branch (608:20): [True: 318, False: 969]
  ------------------
  609|  1.28k|	scn->sst_ss = ss;
  610|       |
  611|  1.28k|	if (sid == CDF_SECID_END_OF_CHAIN || len == 0)
  ------------------
  |  |   55|  2.57k|#define CDF_SECID_END_OF_CHAIN				-2
  ------------------
  |  Branch (611:6): [True: 4, False: 1.28k]
  |  Branch (611:39): [True: 44, False: 1.23k]
  ------------------
  612|     48|		return cdf_zero_stream(scn);
  613|       |
  614|  1.23k|	if (scn->sst_len == CAST(size_t, -1))
  ------------------
  |  |  452|  1.23k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (614:6): [True: 98, False: 1.14k]
  ------------------
  615|     98|		goto out;
  616|       |
  617|  1.14k|	scn->sst_tab = CDF_CALLOC(scn->sst_len, ss);
  ------------------
  |  |   95|  1.14k|#define CDF_CALLOC(n, u) cdf_calloc(__FILE__, __LINE__, (n), (u))
  ------------------
  618|  1.14k|	if (scn->sst_tab == NULL)
  ------------------
  |  Branch (618:6): [True: 0, False: 1.14k]
  ------------------
  619|      0|		return cdf_zero_stream(scn);
  620|       |
  621|  4.90k|	for (j = i = 0; sid >= 0; i++, j++) {
  ------------------
  |  Branch (621:18): [True: 3.79k, False: 1.11k]
  ------------------
  622|  3.79k|		if (j >= CDF_LOOP_LIMIT) {
  ------------------
  |  |   50|  3.79k|#define CDF_LOOP_LIMIT					10000
  ------------------
  |  Branch (622:7): [True: 0, False: 3.79k]
  ------------------
  623|      0|			DPRINTF(("Read long sector chain loop limit"));
  624|      0|			goto out;
  625|      0|		}
  626|  3.79k|		if (i >= scn->sst_len) {
  ------------------
  |  Branch (626:7): [True: 0, False: 3.79k]
  ------------------
  627|      0|			DPRINTF(("Out of bounds reading long sector chain "
  628|      0|			    "%" SIZE_T_FORMAT "u > %" SIZE_T_FORMAT "u\n", i,
  629|      0|			    scn->sst_len));
  630|      0|			goto out;
  631|      0|		}
  632|  3.79k|		if ((nr = cdf_read_sector(info, scn->sst_tab, i * ss, ss, h,
  ------------------
  |  Branch (632:7): [True: 29, False: 3.76k]
  ------------------
  633|  3.79k|		    sid)) != CAST(ssize_t, ss)) {
  ------------------
  |  |  452|  3.79k|#define CAST(T, b)	((T)(b))
  ------------------
  634|     29|			if (i == scn->sst_len - 1 && nr > 0) {
  ------------------
  |  Branch (634:8): [True: 17, False: 12]
  |  Branch (634:33): [True: 0, False: 17]
  ------------------
  635|       |				/* Last sector might be truncated */
  636|      0|				return 0;
  637|      0|			}
  638|     29|			DPRINTF(("Reading long sector chain %d", sid));
  639|     29|			goto out;
  640|     29|		}
  641|  3.76k|		sid = CDF_TOLE4(CAST(uint32_t, sat->sat_tab[sid]));
  ------------------
  |  |   83|  3.76k|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  452|  7.53k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 3.76k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  642|  3.76k|	}
  643|  1.11k|	return 0;
  644|    127|out:
  645|    127|	errno = EFTYPE;
  ------------------
  |  |   58|    127|#define EFTYPE EINVAL
  ------------------
  646|    127|	return cdf_zero_stream(scn);
  647|  1.14k|}
cdf_read_short_sector_chain:
  653|    206|{
  654|    206|	size_t ss = CDF_SHORT_SEC_SIZE(h), i, j;
  ------------------
  |  |   82|    206|#define CDF_SHORT_SEC_SIZE(h)	CAST(size_t, 1 << (h)->h_short_sec_size_p2)
  |  |  ------------------
  |  |  |  |  452|    206|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  655|    206|	scn->sst_tab = NULL;
  656|    206|	scn->sst_len = cdf_count_chain(ssat, sid, CDF_SEC_SIZE(h));
  ------------------
  |  |   80|    206|#define CDF_SEC_SIZE(h) CAST(size_t, 1 << (h)->h_sec_size_p2)
  |  |  ------------------
  |  |  |  |  452|    206|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  657|    206|	scn->sst_dirlen = len;
  658|    206|	scn->sst_ss = ss;
  659|       |
  660|    206|	if (scn->sst_len == CAST(size_t, -1))
  ------------------
  |  |  452|    206|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (660:6): [True: 108, False: 98]
  ------------------
  661|    108|		goto out;
  662|       |
  663|     98|	scn->sst_tab = CDF_CALLOC(scn->sst_len, ss);
  ------------------
  |  |   95|     98|#define CDF_CALLOC(n, u) cdf_calloc(__FILE__, __LINE__, (n), (u))
  ------------------
  664|     98|	if (scn->sst_tab == NULL)
  ------------------
  |  Branch (664:6): [True: 0, False: 98]
  ------------------
  665|      0|		return cdf_zero_stream(scn);
  666|       |
  667|    397|	for (j = i = 0; sid >= 0; i++, j++) {
  ------------------
  |  Branch (667:18): [True: 315, False: 82]
  ------------------
  668|    315|		if (j >= CDF_LOOP_LIMIT) {
  ------------------
  |  |   50|    315|#define CDF_LOOP_LIMIT					10000
  ------------------
  |  Branch (668:7): [True: 0, False: 315]
  ------------------
  669|      0|			DPRINTF(("Read short sector chain loop limit"));
  670|      0|			goto out;
  671|      0|		}
  672|    315|		if (i >= scn->sst_len) {
  ------------------
  |  Branch (672:7): [True: 0, False: 315]
  ------------------
  673|      0|			DPRINTF(("Out of bounds reading short sector chain "
  674|      0|			    "%" SIZE_T_FORMAT "u > %" SIZE_T_FORMAT "u\n",
  675|      0|			    i, scn->sst_len));
  676|      0|			goto out;
  677|      0|		}
  678|    315|		if (cdf_read_short_sector(sst, scn->sst_tab, i * ss, ss, h,
  ------------------
  |  Branch (678:7): [True: 16, False: 299]
  ------------------
  679|    315|		    sid) != CAST(ssize_t, ss)) {
  ------------------
  |  |  452|    315|#define CAST(T, b)	((T)(b))
  ------------------
  680|     16|			DPRINTF(("Reading short sector chain %d", sid));
  681|     16|			goto out;
  682|     16|		}
  683|    299|		sid = CDF_TOLE4(CAST(uint32_t, ssat->sat_tab[sid]));
  ------------------
  |  |   83|    299|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  452|    598|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 299]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  684|    299|	}
  685|     82|	return 0;
  686|    124|out:
  687|    124|	errno = EFTYPE;
  ------------------
  |  |   58|    124|#define EFTYPE EINVAL
  ------------------
  688|    124|	return cdf_zero_stream(scn);
  689|     98|}
cdf_read_sector_chain:
  695|  1.17k|{
  696|       |
  697|  1.17k|	if (len < h->h_min_size_standard_stream && sst->sst_tab != NULL)
  ------------------
  |  Branch (697:6): [True: 361, False: 812]
  |  Branch (697:45): [True: 206, False: 155]
  ------------------
  698|    206|		return cdf_read_short_sector_chain(h, ssat, sst, sid, len,
  699|    206|		    scn);
  700|    967|	else
  701|    967|		return cdf_read_long_sector_chain(info, h, sat, sid, len, scn);
  702|  1.17k|}
cdf_read_dir:
  707|  1.34k|{
  708|  1.34k|	size_t i, j;
  709|  1.34k|	size_t ss = CDF_SEC_SIZE(h), ns, nd;
  ------------------
  |  |   80|  1.34k|#define CDF_SEC_SIZE(h) CAST(size_t, 1 << (h)->h_sec_size_p2)
  |  |  ------------------
  |  |  |  |  452|  1.34k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  710|  1.34k|	char *buf;
  711|  1.34k|	cdf_secid_t sid = h->h_secid_first_directory;
  712|       |
  713|  1.34k|	ns = cdf_count_chain(sat, sid, ss);
  714|  1.34k|	if (ns == CAST(size_t, -1))
  ------------------
  |  |  452|  1.34k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (714:6): [True: 99, False: 1.24k]
  ------------------
  715|     99|		return -1;
  716|       |
  717|  1.24k|	nd = ss / CDF_DIRECTORY_SIZE;
  ------------------
  |  |  117|  1.24k|#define CDF_DIRECTORY_SIZE	128
  ------------------
  718|       |
  719|  1.24k|	dir->dir_len = ns * nd;
  720|  1.24k|	dir->dir_tab = CAST(cdf_directory_t *,
  ------------------
  |  |  452|  1.24k|#define CAST(T, b)	((T)(b))
  ------------------
  721|  1.24k|	    CDF_CALLOC(dir->dir_len, sizeof(dir->dir_tab[0])));
  722|  1.24k|	if (dir->dir_tab == NULL)
  ------------------
  |  Branch (722:6): [True: 0, False: 1.24k]
  ------------------
  723|      0|		return -1;
  724|       |
  725|  1.24k|	if ((buf = CAST(char *, CDF_MALLOC(ss))) == NULL) {
  ------------------
  |  |  452|  1.24k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (725:6): [True: 0, False: 1.24k]
  ------------------
  726|      0|		free(dir->dir_tab);
  727|      0|		return -1;
  728|      0|	}
  729|       |
  730|  5.82k|	for (j = i = 0; i < ns; i++, j++) {
  ------------------
  |  Branch (730:18): [True: 4.59k, False: 1.23k]
  ------------------
  731|  4.59k|		if (j >= CDF_LOOP_LIMIT) {
  ------------------
  |  |   50|  4.59k|#define CDF_LOOP_LIMIT					10000
  ------------------
  |  Branch (731:7): [True: 0, False: 4.59k]
  ------------------
  732|      0|			DPRINTF(("Read dir loop limit"));
  733|      0|			goto out;
  734|      0|		}
  735|  4.59k|		if (cdf_read_sector(info, buf, 0, ss, h, sid) !=
  ------------------
  |  Branch (735:7): [True: 11, False: 4.58k]
  ------------------
  736|  4.59k|		    CAST(ssize_t, ss)) {
  ------------------
  |  |  452|  4.59k|#define CAST(T, b)	((T)(b))
  ------------------
  737|     11|			DPRINTF(("Reading directory sector %d", sid));
  738|     11|			goto out;
  739|     11|		}
  740|  20.2k|		for (j = 0; j < nd; j++) {
  ------------------
  |  Branch (740:15): [True: 15.6k, False: 4.58k]
  ------------------
  741|  15.6k|			cdf_unpack_dir(&dir->dir_tab[i * nd + j],
  742|  15.6k|			    &buf[j * CDF_DIRECTORY_SIZE]);
  ------------------
  |  |  117|  15.6k|#define CDF_DIRECTORY_SIZE	128
  ------------------
  743|  15.6k|		}
  744|  4.58k|		sid = CDF_TOLE4(CAST(uint32_t, sat->sat_tab[sid]));
  ------------------
  |  |   83|  4.58k|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  452|  9.16k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 4.58k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  745|  4.58k|	}
  746|  1.23k|	if (NEED_SWAP)
  ------------------
  |  |   78|  1.23k|#define NEED_SWAP	(cdf_bo.u == CAST(uint32_t, 0x01020304))
  |  |  ------------------
  |  |  |  |  452|  1.23k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  |  Branch (78:19): [True: 0, False: 1.23k]
  |  |  ------------------
  ------------------
  747|      0|		for (i = 0; i < dir->dir_len; i++)
  ------------------
  |  Branch (747:15): [True: 0, False: 0]
  ------------------
  748|      0|			cdf_swap_dir(&dir->dir_tab[i]);
  749|  1.23k|	free(buf);
  750|  1.23k|	return 0;
  751|     11|out:
  752|     11|	free(dir->dir_tab);
  753|     11|	free(buf);
  754|     11|	errno = EFTYPE;
  ------------------
  |  |   58|     11|#define EFTYPE EINVAL
  ------------------
  755|     11|	return -1;
  756|  1.24k|}
cdf_read_ssat:
  762|  1.53k|{
  763|  1.53k|	size_t i, j;
  764|  1.53k|	size_t ss = CDF_SEC_SIZE(h);
  ------------------
  |  |   80|  1.53k|#define CDF_SEC_SIZE(h) CAST(size_t, 1 << (h)->h_sec_size_p2)
  |  |  ------------------
  |  |  |  |  452|  1.53k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  765|  1.53k|	cdf_secid_t sid = h->h_secid_first_sector_in_short_sat;
  766|       |
  767|  1.53k|	ssat->sat_tab = NULL;
  768|  1.53k|	ssat->sat_len = cdf_count_chain(sat, sid, ss);
  769|  1.53k|	if (ssat->sat_len == CAST(size_t, -1))
  ------------------
  |  |  452|  1.53k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (769:6): [True: 186, False: 1.34k]
  ------------------
  770|    186|		goto out;
  771|       |
  772|  1.34k|	ssat->sat_tab = CAST(cdf_secid_t *, CDF_CALLOC(ssat->sat_len, ss));
  ------------------
  |  |  452|  1.34k|#define CAST(T, b)	((T)(b))
  ------------------
  773|  1.34k|	if (ssat->sat_tab == NULL)
  ------------------
  |  Branch (773:6): [True: 0, False: 1.34k]
  ------------------
  774|      0|		goto out1;
  775|       |
  776|  5.24k|	for (j = i = 0; sid >= 0; i++, j++) {
  ------------------
  |  Branch (776:18): [True: 3.89k, False: 1.34k]
  ------------------
  777|  3.89k|		if (j >= CDF_LOOP_LIMIT) {
  ------------------
  |  |   50|  3.89k|#define CDF_LOOP_LIMIT					10000
  ------------------
  |  Branch (777:7): [True: 0, False: 3.89k]
  ------------------
  778|      0|			DPRINTF(("Read short sat sector loop limit"));
  779|      0|			goto out;
  780|      0|		}
  781|  3.89k|		if (i >= ssat->sat_len) {
  ------------------
  |  Branch (781:7): [True: 0, False: 3.89k]
  ------------------
  782|      0|			DPRINTF(("Out of bounds reading short sector chain "
  783|      0|			    "%" SIZE_T_FORMAT "u > %" SIZE_T_FORMAT "u\n", i,
  784|      0|			    ssat->sat_len));
  785|      0|			goto out;
  786|      0|		}
  787|  3.89k|		if (cdf_read_sector(info, ssat->sat_tab, i * ss, ss, h, sid) !=
  ------------------
  |  Branch (787:7): [True: 4, False: 3.89k]
  ------------------
  788|  3.89k|		    CAST(ssize_t, ss)) {
  ------------------
  |  |  452|  3.89k|#define CAST(T, b)	((T)(b))
  ------------------
  789|      4|			DPRINTF(("Reading short sat sector %d", sid));
  790|      4|			goto out1;
  791|      4|		}
  792|  3.89k|		sid = CDF_TOLE4(CAST(uint32_t, sat->sat_tab[sid]));
  ------------------
  |  |   83|  3.89k|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  452|  7.78k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 3.89k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  793|  3.89k|	}
  794|  1.34k|	return 0;
  795|    186|out:
  796|    186|	errno = EFTYPE;
  ------------------
  |  |   58|    186|#define EFTYPE EINVAL
  ------------------
  797|    190|out1:
  798|    190|	free(ssat->sat_tab);
  799|    190|	return -1;
  800|    186|}
cdf_read_short_stream:
  806|  1.23k|{
  807|  1.23k|	size_t i;
  808|  1.23k|	const cdf_directory_t *d;
  809|       |
  810|  1.23k|	*root = NULL;
  811|  10.1k|	for (i = 0; i < dir->dir_len; i++)
  ------------------
  |  Branch (811:14): [True: 9.44k, False: 725]
  ------------------
  812|  9.44k|		if (dir->dir_tab[i].d_type == CDF_DIR_TYPE_ROOT_STORAGE)
  ------------------
  |  |  101|  9.44k|#define CDF_DIR_TYPE_ROOT_STORAGE	5
  ------------------
  |  Branch (812:7): [True: 508, False: 8.93k]
  ------------------
  813|    508|			break;
  814|       |
  815|       |	/* If the it is not there, just fake it; some docs don't have it */
  816|  1.23k|	if (i == dir->dir_len) {
  ------------------
  |  Branch (816:6): [True: 725, False: 508]
  ------------------
  817|    725|		DPRINTF(("Cannot find root storage dir\n"));
  818|    725|		goto out;
  819|    725|	}
  820|    508|	d = &dir->dir_tab[i];
  821|    508|	*root = d;
  822|       |
  823|       |	/* If the it is not there, just fake it; some docs don't have it */
  824|    508|	if (d->d_stream_first_sector < 0) {
  ------------------
  |  Branch (824:6): [True: 188, False: 320]
  ------------------
  825|    188|		DPRINTF(("No first secror in dir\n"));
  826|    188|		goto out;
  827|    188|	}
  828|       |
  829|    320|	return cdf_read_long_sector_chain(info, h, sat,
  830|    320|	    d->d_stream_first_sector, d->d_size, scn);
  831|    913|out:
  832|       |	scn->sst_tab = NULL;
  833|    913|	(void)cdf_zero_stream(scn);
  834|    913|	return 0;
  835|    508|}
cdf_namecmp:
  839|  14.2k|{
  840|  39.9k|	for (; l--; d++, s++)
  ------------------
  |  Branch (840:9): [True: 38.7k, False: 1.18k]
  ------------------
  841|  38.7k|		if (*d != CDF_TOLE2(*s))
  ------------------
  |  |   85|  38.7k|    (CAST(uint16_t, NEED_SWAP ? _cdf_tole2(x) : CAST(uint16_t, x)))
  |  |  ------------------
  |  |  |  |  452|  77.5k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 38.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (841:7): [True: 13.0k, False: 25.7k]
  ------------------
  842|  13.0k|			return CAST(unsigned char, *d) - CDF_TOLE2(*s);
  ------------------
  |  |  452|  13.0k|#define CAST(T, b)	((T)(b))
  ------------------
              			return CAST(unsigned char, *d) - CDF_TOLE2(*s);
  ------------------
  |  |   85|  13.0k|    (CAST(uint16_t, NEED_SWAP ? _cdf_tole2(x) : CAST(uint16_t, x)))
  |  |  ------------------
  |  |  |  |  452|  26.0k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 13.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  843|  1.18k|	return 0;
  844|  14.2k|}
cdf_read_doc_summary_info:
  850|    978|{
  851|    978|	return cdf_read_user_stream(info, h, sat, ssat, sst, dir,
  852|    978|	    "\05DocumentSummaryInformation", scn);
  853|    978|}
cdf_read_summary_info:
  859|  1.15k|{
  860|  1.15k|	return cdf_read_user_stream(info, h, sat, ssat, sst, dir,
  861|  1.15k|	    "\05SummaryInformation", scn);
  862|  1.15k|}
cdf_read_user_stream:
  868|  3.28k|{
  869|  3.28k|	const cdf_directory_t *d;
  870|  3.28k|	int i = cdf_find_stream(dir, name, CDF_DIR_TYPE_USER_STREAM);
  ------------------
  |  |   98|  3.28k|#define CDF_DIR_TYPE_USER_STREAM	2
  ------------------
  871|       |
  872|  3.28k|	if (i <= 0) {
  ------------------
  |  Branch (872:6): [True: 2.11k, False: 1.17k]
  ------------------
  873|  2.11k|		memset(scn, 0, sizeof(*scn));
  874|  2.11k|		return -1;
  875|  2.11k|	}
  876|       |
  877|  1.17k|	d = &dir->dir_tab[i - 1];
  878|  1.17k|	return cdf_read_sector_chain(info, h, sat, ssat, sst,
  879|  1.17k|	    d->d_stream_first_sector, d->d_size, scn);
  880|  3.28k|}
cdf_find_stream:
  884|  3.28k|{
  885|  3.28k|	size_t i, name_len = strlen(name) + 1;
  886|       |
  887|  27.5k|	for (i = 1; i <= dir->dir_len; i++)
  ------------------
  |  Branch (887:14): [True: 25.4k, False: 2.11k]
  ------------------
  888|  25.4k|		if (dir->dir_tab[i-1].d_type == type &&
  ------------------
  |  Branch (888:7): [True: 3.92k, False: 21.5k]
  ------------------
  889|  3.92k|		    cdf_namecmp(name, dir->dir_tab[i-1].d_name, name_len)
  ------------------
  |  Branch (889:7): [True: 1.17k, False: 2.75k]
  ------------------
  890|  3.92k|		    == 0)
  891|  1.17k|			break;
  892|  3.28k|	if (i <= dir->dir_len)
  ------------------
  |  Branch (892:6): [True: 1.17k, False: 2.11k]
  ------------------
  893|  1.17k|		return CAST(int, i);
  ------------------
  |  |  452|  1.17k|#define CAST(T, b)	((T)(b))
  ------------------
  894|       |
  895|  2.11k|	DPRINTF(("Cannot find type %d `%s'\n", type, name));
  896|  2.11k|	errno = ESRCH;
  897|  2.11k|	return 0;
  898|  3.28k|}
cdf_read_property_info:
  997|    898|{
  998|    898|	const cdf_section_header_t *shp;
  999|    898|	cdf_section_header_t sh;
 1000|    898|	const uint8_t *p, *q, *e;
 1001|    898|	size_t i, o4, nelements, j, slen, left;
 1002|    898|	cdf_property_info_t *inp;
 1003|       |
 1004|    898|	if (offs > UINT32_MAX / 4) {
  ------------------
  |  Branch (1004:6): [True: 15, False: 883]
  ------------------
 1005|     15|		errno = EFTYPE;
  ------------------
  |  |   58|     15|#define EFTYPE EINVAL
  ------------------
 1006|     15|		goto out;
 1007|     15|	}
 1008|    883|	shp = CAST(const cdf_section_header_t *,
  ------------------
  |  |  452|    883|#define CAST(T, b)	((T)(b))
  ------------------
 1009|    883|	    cdf_offset(sst->sst_tab, offs));
 1010|    883|	if (cdf_check_stream_offset(sst, h, shp, sizeof(*shp), __LINE__) == -1)
  ------------------
  |  Branch (1010:6): [True: 61, False: 822]
  ------------------
 1011|     61|		goto out;
 1012|    822|	sh.sh_len = CDF_TOLE4(shp->sh_len);
  ------------------
  |  |   83|    822|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  452|  1.64k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 822]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1013|    822|	if (sh.sh_len > CDF_SHLEN_LIMIT) {
  ------------------
  |  |  900|    822|#define CDF_SHLEN_LIMIT (UINT32_MAX / 64)
  ------------------
  |  Branch (1013:6): [True: 11, False: 811]
  ------------------
 1014|     11|		errno = EFTYPE;
  ------------------
  |  |   58|     11|#define EFTYPE EINVAL
  ------------------
 1015|     11|		goto out;
 1016|     11|	}
 1017|       |
 1018|    811|	if (cdf_check_stream_offset(sst, h, shp, sh.sh_len, __LINE__) == -1)
  ------------------
  |  Branch (1018:6): [True: 44, False: 767]
  ------------------
 1019|     44|		goto out;
 1020|       |
 1021|    767|	sh.sh_properties = CDF_TOLE4(shp->sh_properties);
  ------------------
  |  |   83|    767|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  452|  1.53k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 767]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1022|    767|	DPRINTF(("section len: %u properties %u\n", sh.sh_len,
 1023|    767|	    sh.sh_properties));
 1024|    767|	if (sh.sh_properties > CDF_PROP_LIMIT)
  ------------------
  |  |  901|    767|#define CDF_PROP_LIMIT (UINT32_MAX / (64 * sizeof(cdf_property_info_t)))
  ------------------
  |  Branch (1024:6): [True: 18, False: 749]
  ------------------
 1025|     18|		goto out;
 1026|    749|	inp = cdf_grow_info(info, maxcount, sh.sh_properties);
 1027|    749|	if (inp == NULL)
  ------------------
  |  Branch (1027:6): [True: 0, False: 749]
  ------------------
 1028|      0|		goto out;
 1029|    749|	inp += *count;
 1030|    749|	*count += sh.sh_properties;
 1031|    749|	p = CAST(const uint8_t *, cdf_offset(sst->sst_tab, offs + sizeof(sh)));
  ------------------
  |  |  452|    749|#define CAST(T, b)	((T)(b))
  ------------------
 1032|    749|	e = CAST(const uint8_t *, cdf_offset(shp, sh.sh_len));
  ------------------
  |  |  452|    749|#define CAST(T, b)	((T)(b))
  ------------------
 1033|    749|	if (p >= e || cdf_check_stream_offset(sst, h, e, 0, __LINE__) == -1)
  ------------------
  |  Branch (1033:6): [True: 9, False: 740]
  |  Branch (1033:16): [True: 0, False: 740]
  ------------------
 1034|      9|		goto out;
 1035|       |
 1036|  7.14k|	for (i = 0; i < sh.sh_properties; i++) {
  ------------------
  |  Branch (1036:14): [True: 6.76k, False: 384]
  ------------------
 1037|  6.76k|		if ((q = cdf_get_property_info_pos(sst, h, p, e, i)) == NULL)
  ------------------
  |  Branch (1037:7): [True: 247, False: 6.51k]
  ------------------
 1038|    247|			goto out;
 1039|  6.51k|		inp[i].pi_id = CDF_GETUINT32(p, i << 1);
  ------------------
  |  |   91|  6.51k|#define CDF_GETUINT32(x, y)	cdf_getuint32(x, y)
  ------------------
 1040|  6.51k|		left = CAST(size_t, e - q);
  ------------------
  |  |  452|  6.51k|#define CAST(T, b)	((T)(b))
  ------------------
 1041|  6.51k|		if (left < sizeof(uint32_t)) {
  ------------------
  |  Branch (1041:7): [True: 7, False: 6.51k]
  ------------------
 1042|      7|			DPRINTF(("short info (no type)_\n"));
 1043|      7|			goto out;
 1044|      7|		}
 1045|  6.51k|		inp[i].pi_type = CDF_GETUINT32(q, 0);
  ------------------
  |  |   91|  6.51k|#define CDF_GETUINT32(x, y)	cdf_getuint32(x, y)
  ------------------
 1046|  6.51k|		DPRINTF(("%" SIZE_T_FORMAT "u) id=%#x type=%#x offs=%#tx,%#x\n",
 1047|  6.51k|		    i, inp[i].pi_id, inp[i].pi_type, q - p, offs));
 1048|  6.51k|		if (inp[i].pi_type & CDF_VECTOR) {
  ------------------
  |  |  237|  6.51k|#define CDF_VECTOR		0x00001000
  ------------------
  |  Branch (1048:7): [True: 1.48k, False: 5.02k]
  ------------------
 1049|  1.48k|			if (left < sizeof(uint32_t) * 2) {
  ------------------
  |  Branch (1049:8): [True: 6, False: 1.48k]
  ------------------
 1050|      6|				DPRINTF(("missing CDF_VECTOR length\n"));
 1051|      6|				goto out;
 1052|      6|			}
 1053|  1.48k|			nelements = CDF_GETUINT32(q, 1);
  ------------------
  |  |   91|  1.48k|#define CDF_GETUINT32(x, y)	cdf_getuint32(x, y)
  ------------------
 1054|  1.48k|			if (nelements > CDF_ELEMENT_LIMIT || nelements == 0) {
  ------------------
  |  |   51|  2.96k|#define CDF_ELEMENT_LIMIT				100000
  ------------------
  |  Branch (1054:8): [True: 33, False: 1.44k]
  |  Branch (1054:41): [True: 4, False: 1.44k]
  ------------------
 1055|     37|				DPRINTF(("CDF_VECTOR with nelements == %"
 1056|     37|				    SIZE_T_FORMAT "u\n", nelements));
 1057|     37|				goto out;
 1058|     37|			}
 1059|  1.44k|			slen = 2;
 1060|  5.02k|		} else {
 1061|  5.02k|			nelements = 1;
 1062|  5.02k|			slen = 1;
 1063|  5.02k|		}
 1064|  6.46k|		o4 = slen * sizeof(uint32_t);
 1065|  6.46k|		if (inp[i].pi_type & (CDF_ARRAY|CDF_BYREF|CDF_RESERVED))
  ------------------
  |  |  238|  6.46k|#define CDF_ARRAY		0x00002000
  ------------------
              		if (inp[i].pi_type & (CDF_ARRAY|CDF_BYREF|CDF_RESERVED))
  ------------------
  |  |  239|  6.46k|#define CDF_BYREF		0x00004000
  ------------------
              		if (inp[i].pi_type & (CDF_ARRAY|CDF_BYREF|CDF_RESERVED))
  ------------------
  |  |  240|  6.46k|#define CDF_RESERVED		0x00008000
  ------------------
  |  Branch (1065:7): [True: 1.84k, False: 4.62k]
  ------------------
 1066|  1.84k|			goto unknown;
 1067|  4.62k|		switch (inp[i].pi_type & CDF_TYPEMASK) {
  ------------------
  |  |  243|  4.62k|#define CDF_TYPEMASK		0x00000fff
  ------------------
 1068|    300|		case CDF_NULL:
  ------------------
  |  |  198|    300|#define CDF_NULL		0x00000001
  ------------------
  |  Branch (1068:3): [True: 300, False: 4.32k]
  ------------------
 1069|  1.04k|		case CDF_EMPTY:
  ------------------
  |  |  197|  1.04k|#define CDF_EMPTY		0x00000000
  ------------------
  |  Branch (1069:3): [True: 740, False: 3.88k]
  ------------------
 1070|  1.04k|			break;
 1071|    353|		case CDF_SIGNED16:
  ------------------
  |  |  199|    353|#define CDF_SIGNED16		0x00000002
  ------------------
  |  Branch (1071:3): [True: 353, False: 4.27k]
  ------------------
 1072|    353|			if (!cdf_copy_info(&inp[i], &q[o4], e, sizeof(int16_t)))
  ------------------
  |  Branch (1072:8): [True: 114, False: 239]
  ------------------
 1073|    114|				goto unknown;
 1074|    239|			break;
 1075|    430|		case CDF_SIGNED32:
  ------------------
  |  |  200|    430|#define CDF_SIGNED32		0x00000003
  ------------------
  |  Branch (1075:3): [True: 430, False: 4.19k]
  ------------------
 1076|    527|		case CDF_BOOL:
  ------------------
  |  |  208|    527|#define CDF_BOOL		0x0000000b
  ------------------
  |  Branch (1076:3): [True: 97, False: 4.52k]
  ------------------
 1077|    672|		case CDF_UNSIGNED32:
  ------------------
  |  |  215|    672|#define CDF_UNSIGNED32		0x00000013
  ------------------
  |  Branch (1077:3): [True: 145, False: 4.47k]
  ------------------
 1078|  1.09k|		case CDF_FLOAT:
  ------------------
  |  |  201|  1.09k|#define CDF_FLOAT		0x00000004
  ------------------
  |  Branch (1078:3): [True: 419, False: 4.20k]
  ------------------
 1079|  1.09k|			if (!cdf_copy_info(&inp[i], &q[o4], e, sizeof(int32_t)))
  ------------------
  |  Branch (1079:8): [True: 183, False: 908]
  ------------------
 1080|    183|				goto unknown;
 1081|    908|			break;
 1082|    908|		case CDF_SIGNED64:
  ------------------
  |  |  216|     81|#define CDF_SIGNED64		0x00000014
  ------------------
  |  Branch (1082:3): [True: 81, False: 4.54k]
  ------------------
 1083|    182|		case CDF_UNSIGNED64:
  ------------------
  |  |  217|    182|#define CDF_UNSIGNED64		0x00000015
  ------------------
  |  Branch (1083:3): [True: 101, False: 4.52k]
  ------------------
 1084|    332|		case CDF_DOUBLE:
  ------------------
  |  |  202|    332|#define CDF_DOUBLE		0x00000005
  ------------------
  |  Branch (1084:3): [True: 150, False: 4.47k]
  ------------------
 1085|    914|		case CDF_FILETIME:
  ------------------
  |  |  228|    914|#define CDF_FILETIME		0x00000040
  ------------------
  |  Branch (1085:3): [True: 582, False: 4.04k]
  ------------------
 1086|    914|			if (!cdf_copy_info(&inp[i], &q[o4], e, sizeof(int64_t)))
  ------------------
  |  Branch (1086:8): [True: 206, False: 708]
  ------------------
 1087|    206|				goto unknown;
 1088|    708|			break;
 1089|    708|		case CDF_LENGTH32_STRING:
  ------------------
  |  |  226|    322|#define CDF_LENGTH32_STRING	0x0000001e
  ------------------
  |  Branch (1089:3): [True: 322, False: 4.30k]
  ------------------
 1090|    481|		case CDF_LENGTH32_WSTRING:
  ------------------
  |  |  227|    481|#define CDF_LENGTH32_WSTRING	0x0000001f
  ------------------
  |  Branch (1090:3): [True: 159, False: 4.46k]
  ------------------
 1091|    481|			if (nelements > 1) {
  ------------------
  |  Branch (1091:8): [True: 77, False: 404]
  ------------------
 1092|     77|				size_t nelem = inp - *info;
 1093|     77|				inp = cdf_grow_info(info, maxcount, nelements);
 1094|     77|				if (inp == NULL)
  ------------------
  |  Branch (1094:9): [True: 5, False: 72]
  ------------------
 1095|      5|					goto out;
 1096|     72|				inp += nelem;
 1097|     72|			}
 1098|   192k|			for (j = 0; j < nelements && i < sh.sh_properties;
  ------------------
  |  Branch (1098:16): [True: 192k, False: 411]
  |  Branch (1098:33): [True: 191k, False: 11]
  ------------------
 1099|   191k|			    j++, i++)
 1100|   191k|			{
 1101|   191k|				uint32_t l;
 1102|       |
 1103|   191k|				if (o4 + sizeof(uint32_t) > left)
  ------------------
  |  Branch (1103:9): [True: 6, False: 191k]
  ------------------
 1104|      6|					goto out;
 1105|       |
 1106|   191k|				l = CDF_GETUINT32(q, slen);
  ------------------
  |  |   91|   191k|#define CDF_GETUINT32(x, y)	cdf_getuint32(x, y)
  ------------------
 1107|   191k|				o4 += sizeof(uint32_t);
 1108|   191k|				if (o4 + l > left)
  ------------------
  |  Branch (1108:9): [True: 48, False: 191k]
  ------------------
 1109|     48|					goto out;
 1110|       |
 1111|   191k|				inp[i].pi_str.s_len = l;
  ------------------
  |  |  191|   191k|#define pi_str	pi_val._pi_str
  ------------------
 1112|   191k|				inp[i].pi_str.s_buf = CAST(const char *,
  ------------------
  |  |  191|   191k|#define pi_str	pi_val._pi_str
  ------------------
              				inp[i].pi_str.s_buf = CAST(const char *,
  ------------------
  |  |  452|   191k|#define CAST(T, b)	((T)(b))
  ------------------
 1113|   191k|				    CAST(const void *, &q[o4]));
 1114|       |
 1115|   191k|				DPRINTF(("o=%" SIZE_T_FORMAT "u l=%d(%"
 1116|   191k|				    SIZE_T_FORMAT "u), t=%" SIZE_T_FORMAT
 1117|   191k|				    "u s=%.*s\n", o4, l,
 1118|   191k|				    CDF_ROUND(l, sizeof(l)),
 1119|   191k|				    left, (int)l, inp[i].pi_str.s_buf));
 1120|       |
 1121|   191k|				if (l & 1)
  ------------------
  |  Branch (1121:9): [True: 196, False: 191k]
  ------------------
 1122|    196|					l++;
 1123|       |
 1124|   191k|				slen += l >> 1;
 1125|   191k|				o4 = slen * sizeof(uint32_t);
 1126|   191k|			}
 1127|    422|			i--;
 1128|    422|			break;
 1129|    185|		case CDF_CLIPBOARD:
  ------------------
  |  |  235|    185|#define CDF_CLIPBOARD		0x00000047
  ------------------
  |  Branch (1129:3): [True: 185, False: 4.43k]
  ------------------
 1130|    185|			if (inp[i].pi_type & CDF_VECTOR)
  ------------------
  |  |  237|    185|#define CDF_VECTOR		0x00001000
  ------------------
  |  Branch (1130:8): [True: 69, False: 116]
  ------------------
 1131|     69|				goto unknown;
 1132|    116|			break;
 1133|    559|		default:
  ------------------
  |  Branch (1133:3): [True: 559, False: 4.06k]
  ------------------
 1134|  2.97k|		unknown:
 1135|  2.97k|			memset(&inp[i].pi_val, 0, sizeof(inp[i].pi_val));
 1136|  2.97k|			DPRINTF(("Don't know how to deal with %#x\n",
 1137|  2.97k|			    inp[i].pi_type));
 1138|  2.97k|			break;
 1139|  4.62k|		}
 1140|  4.62k|	}
 1141|    384|	return 0;
 1142|    514|out:
 1143|    514|	free(*info);
 1144|    514|	*info = NULL;
 1145|    514|	*count = 0;
 1146|    514|	*maxcount = 0;
 1147|    514|	errno = EFTYPE;
  ------------------
  |  |   58|    514|#define EFTYPE EINVAL
  ------------------
 1148|    514|	return -1;
 1149|    740|}
cdf_unpack_summary_info:
 1154|    915|{
 1155|    915|	size_t maxcount;
 1156|    915|	const cdf_summary_info_header_t *si =
 1157|    915|	    CAST(const cdf_summary_info_header_t *, sst->sst_tab);
  ------------------
  |  |  452|    915|#define CAST(T, b)	((T)(b))
  ------------------
 1158|    915|	const cdf_section_declaration_t *sd =
 1159|    915|	    CAST(const cdf_section_declaration_t *, RCAST(const void *,
  ------------------
  |  |  452|    915|#define CAST(T, b)	((T)(b))
  ------------------
 1160|    915|	    RCAST(const char *, sst->sst_tab)
 1161|    915|	    + CDF_SECTION_DECLARATION_OFFSET));
 1162|       |
 1163|    915|	if (cdf_check_stream_offset(sst, h, si, sizeof(*si), __LINE__) == -1 ||
  ------------------
  |  Branch (1163:6): [True: 12, False: 903]
  ------------------
 1164|    903|	    cdf_check_stream_offset(sst, h, sd, sizeof(*sd), __LINE__) == -1)
  ------------------
  |  Branch (1164:6): [True: 5, False: 898]
  ------------------
 1165|     17|		return -1;
 1166|    898|	ssi->si_byte_order = CDF_TOLE2(si->si_byte_order);
  ------------------
  |  |   85|    898|    (CAST(uint16_t, NEED_SWAP ? _cdf_tole2(x) : CAST(uint16_t, x)))
  |  |  ------------------
  |  |  |  |  452|  1.79k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 898]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1167|    898|	ssi->si_os_version = CDF_TOLE2(si->si_os_version);
  ------------------
  |  |   85|    898|    (CAST(uint16_t, NEED_SWAP ? _cdf_tole2(x) : CAST(uint16_t, x)))
  |  |  ------------------
  |  |  |  |  452|  1.79k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 898]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1168|    898|	ssi->si_os = CDF_TOLE2(si->si_os);
  ------------------
  |  |   85|    898|    (CAST(uint16_t, NEED_SWAP ? _cdf_tole2(x) : CAST(uint16_t, x)))
  |  |  ------------------
  |  |  |  |  452|  1.79k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 898]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1169|    898|	ssi->si_class = si->si_class;
 1170|    898|	cdf_swap_class(&ssi->si_class);
 1171|    898|	ssi->si_count = CDF_TOLE4(si->si_count);
  ------------------
  |  |   83|    898|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  452|  1.79k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 898]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1172|    898|	*count = 0;
 1173|    898|	maxcount = 0;
 1174|    898|	*info = NULL;
 1175|    898|	if (cdf_read_property_info(sst, h, CDF_TOLE4(sd->sd_offset), info,
  ------------------
  |  |   83|    898|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  452|  1.79k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 898]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1175:6): [True: 514, False: 384]
  ------------------
 1176|    898|	    count, &maxcount) == -1)
 1177|    514|		return -1;
 1178|    384|	return 0;
 1179|    898|}
cdf_print_property_name:
 1298|  1.28k|{
 1299|  1.28k|	size_t i;
 1300|       |
 1301|  23.2k|	for (i = 0; i < __arraycount(vn); i++)
  ------------------
  |  |  130|  23.2k|#define __arraycount(a) (sizeof(a) / sizeof(a[0]))
  ------------------
  |  Branch (1301:14): [True: 22.2k, False: 986]
  ------------------
 1302|  22.2k|		if (vn[i].v == p)
  ------------------
  |  Branch (1302:7): [True: 294, False: 21.9k]
  ------------------
 1303|    294|			return snprintf(buf, bufsiz, "%s", vn[i].n);
 1304|    986|	return snprintf(buf, bufsiz, "%#x", p);
 1305|  1.28k|}
cdf_print_elapsed_time:
 1309|    256|{
 1310|    256|	int len = 0;
 1311|    256|	int days, hours, mins, secs;
 1312|       |
 1313|    256|	ts /= CDF_TIME_PREC;
  ------------------
  |  |   90|    256|#define CDF_TIME_PREC	10000000
  ------------------
 1314|    256|	secs = CAST(int, ts % 60);
  ------------------
  |  |  452|    256|#define CAST(T, b)	((T)(b))
  ------------------
 1315|    256|	ts /= 60;
 1316|    256|	mins = CAST(int, ts % 60);
  ------------------
  |  |  452|    256|#define CAST(T, b)	((T)(b))
  ------------------
 1317|    256|	ts /= 60;
 1318|    256|	hours = CAST(int, ts % 24);
  ------------------
  |  |  452|    256|#define CAST(T, b)	((T)(b))
  ------------------
 1319|    256|	ts /= 24;
 1320|    256|	days = CAST(int, ts);
  ------------------
  |  |  452|    256|#define CAST(T, b)	((T)(b))
  ------------------
 1321|       |
 1322|    256|	if (days) {
  ------------------
  |  Branch (1322:6): [True: 131, False: 125]
  ------------------
 1323|    131|		len += snprintf(buf + len, bufsiz - len, "%dd+", days);
 1324|    131|		if (CAST(size_t, len) >= bufsiz)
  ------------------
  |  |  452|    131|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (1324:7): [True: 0, False: 131]
  ------------------
 1325|      0|			return len;
 1326|    131|	}
 1327|       |
 1328|    256|	if (days || hours) {
  ------------------
  |  Branch (1328:6): [True: 131, False: 125]
  |  Branch (1328:14): [True: 58, False: 67]
  ------------------
 1329|    189|		len += snprintf(buf + len, bufsiz - len, "%.2d:", hours);
 1330|    189|		if (CAST(size_t, len) >= bufsiz)
  ------------------
  |  |  452|    189|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (1330:7): [True: 0, False: 189]
  ------------------
 1331|      0|			return len;
 1332|    189|	}
 1333|       |
 1334|    256|	len += snprintf(buf + len, bufsiz - len, "%.2d:", mins);
 1335|    256|	if (CAST(size_t, len) >= bufsiz)
  ------------------
  |  |  452|    256|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (1335:6): [True: 0, False: 256]
  ------------------
 1336|      0|		return len;
 1337|       |
 1338|    256|	len += snprintf(buf + len, bufsiz - len, "%.2d", secs);
 1339|    256|	return len;
 1340|    256|}
cdf.c:cdf_read:
  370|   299k|{
  371|   299k|	size_t siz = CAST(size_t, off + len);
  ------------------
  |  |  452|   299k|#define CAST(T, b)	((T)(b))
  ------------------
  372|       |
  373|   299k|	if (CAST(off_t, off + len) != CAST(off_t, siz))
  ------------------
  |  |  452|   299k|#define CAST(T, b)	((T)(b))
  ------------------
              	if (CAST(off_t, off + len) != CAST(off_t, siz))
  ------------------
  |  |  452|   299k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (373:6): [True: 0, False: 299k]
  ------------------
  374|      0|		goto out;
  375|       |
  376|   299k|	if (info->i_buf != NULL && info->i_len >= siz) {
  ------------------
  |  Branch (376:6): [True: 299k, False: 0]
  |  Branch (376:29): [True: 291k, False: 7.72k]
  ------------------
  377|   291k|		(void)memcpy(buf, &info->i_buf[off], len);
  378|   291k|		return CAST(ssize_t, len);
  ------------------
  |  |  452|   291k|#define CAST(T, b)	((T)(b))
  ------------------
  379|   291k|	}
  380|       |
  381|  7.72k|	if (info->i_fd == -1)
  ------------------
  |  Branch (381:6): [True: 7.72k, False: 0]
  ------------------
  382|  7.72k|		goto out;
  383|       |
  384|      0|	if (pread(info->i_fd, buf, len, off) != CAST(ssize_t, len))
  ------------------
  |  |  452|      0|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (384:6): [True: 0, False: 0]
  ------------------
  385|      0|		return -1;
  386|       |
  387|      0|	return CAST(ssize_t, len);
  ------------------
  |  |  452|      0|#define CAST(T, b)	((T)(b))
  ------------------
  388|  7.72k|out:
  389|  7.72k|	errno = EINVAL;
  390|  7.72k|	return -1;
  391|      0|}
cdf.c:cdf_calloc:
  124|  7.11k|{
  125|  7.11k|	DPRINTF(("%s,%" SIZE_T_FORMAT "u: %s %" SIZE_T_FORMAT "u %"
  126|  7.11k|	    SIZE_T_FORMAT "u\n", file, line, __func__, n, u));
  127|  7.11k|	if (n == 0)
  ------------------
  |  Branch (127:6): [True: 104, False: 7.01k]
  ------------------
  128|    104|	    n++;
  129|  7.11k|	return calloc(n, u);
  130|  7.11k|}
cdf.c:cdf_malloc:
  102|  1.24k|{
  103|  1.24k|	DPRINTF(("%s,%" SIZE_T_FORMAT "u: %s %" SIZE_T_FORMAT "u\n",
  104|  1.24k|	    file, line, __func__, n));
  105|  1.24k|	if (n == 0)
  ------------------
  |  Branch (105:6): [True: 0, False: 1.24k]
  ------------------
  106|      0|	    n++;
  107|  1.24k|	return malloc(n);
  108|  1.24k|}
cdf.c:cdf_offset:
  905|  8.89k|{
  906|  8.89k|	return CAST(const void *, CAST(const uint8_t *, p) + l);
  ------------------
  |  |  452|  8.89k|#define CAST(T, b)	((T)(b))
  ------------------
  907|  8.89k|}
cdf.c:cdf_check_stream_offset:
  353|  11.0k|{
  354|  11.0k|	const char *b = RCAST(const char *, sst->sst_tab);
  ------------------
  |  |  453|  11.0k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
  355|  11.0k|	const char *e = RCAST(const char *, p) + tail;
  ------------------
  |  |  453|  11.0k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
  356|  11.0k|	size_t ss = cdf_check_stream(sst, h);
  357|  11.0k|	/*LINTED*/(void)&line;
  358|  11.0k|	if (e >= b && CAST(size_t, e - b) <= ss * sst->sst_len)
  ------------------
  |  |  452|  11.0k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (358:6): [True: 11.0k, False: 0]
  |  Branch (358:16): [True: 10.8k, False: 130]
  ------------------
  359|  10.8k|		return 0;
  360|    130|	DPRINTF(("%d: offset begin %p < end %p || %" SIZE_T_FORMAT "u"
  361|    130|	    " > %" SIZE_T_FORMAT "u [%" SIZE_T_FORMAT "u %"
  362|    130|	    SIZE_T_FORMAT "u]\n", line, b, e, (size_t)(e - b),
  363|    130|	    ss * sst->sst_len, ss, sst->sst_len));
  364|    130|	errno = EFTYPE;
  ------------------
  |  |   58|    130|#define EFTYPE EINVAL
  ------------------
  365|    130|	return -1;
  366|  11.0k|}
cdf.c:cdf_grow_info:
  942|    826|{
  943|    826|	cdf_property_info_t *inp;
  944|    826|	size_t newcount = *maxcount + incr;
  945|       |
  946|    826|	if (newcount > CDF_PROP_LIMIT) {
  ------------------
  |  |  901|    826|#define CDF_PROP_LIMIT (UINT32_MAX / (64 * sizeof(cdf_property_info_t)))
  ------------------
  |  Branch (946:6): [True: 5, False: 821]
  ------------------
  947|      5|		DPRINTF(("exceeded property limit %" SIZE_T_FORMAT "u > %"
  948|      5|		    SIZE_T_FORMAT "u\n", newcount, CDF_PROP_LIMIT));
  949|      5|		goto out;
  950|      5|	}
  951|    821|	inp = CAST(cdf_property_info_t *,
  ------------------
  |  |  452|    821|#define CAST(T, b)	((T)(b))
  ------------------
  952|    821|	    CDF_REALLOC(*info, newcount * sizeof(*inp)));
  953|    821|	if (inp == NULL)
  ------------------
  |  Branch (953:6): [True: 0, False: 821]
  ------------------
  954|      0|		goto out;
  955|       |
  956|    821|	*info = inp;
  957|    821|	*maxcount = newcount;
  958|    821|	return inp;
  959|      5|out:
  960|      5|	free(*info);
  961|      5|	*maxcount = 0;
  962|      5|	*info = NULL;
  963|       |	return NULL;
  964|    821|}
cdf.c:cdf_realloc:
  114|    821|{
  115|    821|	DPRINTF(("%s,%" SIZE_T_FORMAT "u: %s %" SIZE_T_FORMAT "u\n",
  116|    821|	    file, line, __func__, n));
  117|    821|	return realloc(p, n);
  118|    821|}
cdf.c:cdf_get_property_info_pos:
  912|  6.76k|{
  913|  6.76k|	size_t tail = (i << 1) + 1;
  914|  6.76k|	size_t ofs;
  915|       |
  916|  6.76k|	if (p >= e) {
  ------------------
  |  Branch (916:6): [True: 0, False: 6.76k]
  ------------------
  917|      0|		DPRINTF(("Past end %p < %p\n", e, p));
  918|      0|		return NULL;
  919|      0|	}
  920|       |
  921|  6.76k|	if (cdf_check_stream_offset(sst, h, p, (tail + 1) * sizeof(uint32_t),
  ------------------
  |  Branch (921:6): [True: 8, False: 6.75k]
  ------------------
  922|  6.76k|	    __LINE__) == -1)
  923|      8|		return NULL;
  924|       |
  925|  6.75k|	ofs = CDF_GETUINT32(p, tail);
  ------------------
  |  |   91|  6.75k|#define CDF_GETUINT32(x, y)	cdf_getuint32(x, y)
  ------------------
  926|  6.75k|	if (ofs < 2 * sizeof(uint32_t)) {
  ------------------
  |  Branch (926:6): [True: 20, False: 6.73k]
  ------------------
  927|     20|		DPRINTF(("Offset too small %zu\n", ofs));
  928|     20|		return NULL;
  929|     20|	}
  930|       |
  931|  6.73k|	ofs -= 2 * sizeof(uint32_t);
  932|  6.73k|	if (ofs > CAST(size_t, e - p)) {
  ------------------
  |  |  452|  6.73k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (932:6): [True: 219, False: 6.51k]
  ------------------
  933|    219|		DPRINTF(("Offset too big %zu %td\n", ofs, e - p));
  934|    219|		return NULL;
  935|    219|	}
  936|       |
  937|  6.51k|	return CAST(const uint8_t *, cdf_offset(CAST(const void *, p), ofs));
  ------------------
  |  |  452|  6.51k|#define CAST(T, b)	((T)(b))
  ------------------
  938|  6.73k|}
cdf.c:cdf_getuint32:
  198|   213k|{
  199|   213k|	uint32_t rv;
  200|   213k|	(void)memcpy(&rv, p + offs * sizeof(uint32_t), sizeof(rv));
  201|   213k|	return CDF_TOLE4(rv);
  ------------------
  |  |   83|   213k|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  452|   426k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 213k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  202|   213k|}
cdf.c:cdf_copy_info:
  969|  2.35k|{
  970|  2.35k|	if (inp->pi_type & CDF_VECTOR)
  ------------------
  |  |  237|  2.35k|#define CDF_VECTOR		0x00001000
  ------------------
  |  Branch (970:6): [True: 350, False: 2.00k]
  ------------------
  971|    350|		return 0;
  972|       |
  973|  2.00k|	if (CAST(size_t, CAST(const char *, e) - CAST(const char *, p)) < len)
  ------------------
  |  |  452|  2.00k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (973:6): [True: 153, False: 1.85k]
  ------------------
  974|    153|		return 0;
  975|       |
  976|  1.85k|	(void)memcpy(&inp->pi_val, p, len);
  977|       |
  978|  1.85k|	switch (len) {
  979|    239|	case 2:
  ------------------
  |  Branch (979:2): [True: 239, False: 1.61k]
  ------------------
  980|    239|		inp->pi_u16 = CDF_TOLE2(inp->pi_u16);
  ------------------
  |  |  186|    239|#define pi_u16	pi_val._pi_u16
  ------------------
              		inp->pi_u16 = CDF_TOLE2(inp->pi_u16);
  ------------------
  |  |   85|    239|    (CAST(uint16_t, NEED_SWAP ? _cdf_tole2(x) : CAST(uint16_t, x)))
  |  |  ------------------
  |  |  |  |  452|    478|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 239]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  981|    239|		break;
  982|    908|	case 4:
  ------------------
  |  Branch (982:2): [True: 908, False: 947]
  ------------------
  983|    908|		inp->pi_u32 = CDF_TOLE4(inp->pi_u32);
  ------------------
  |  |  184|    908|#define pi_u32	pi_val._pi_u32
  ------------------
              		inp->pi_u32 = CDF_TOLE4(inp->pi_u32);
  ------------------
  |  |   83|    908|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  452|  1.81k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 908]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  984|    908|		break;
  985|    708|	case 8:
  ------------------
  |  Branch (985:2): [True: 708, False: 1.14k]
  ------------------
  986|    708|		inp->pi_u64 = CDF_TOLE8(inp->pi_u64);
  ------------------
  |  |  182|    708|#define pi_u64	pi_val._pi_u64
  ------------------
              		inp->pi_u64 = CDF_TOLE8(inp->pi_u64);
  ------------------
  |  |   81|    708|    (CAST(uint64_t, NEED_SWAP ? _cdf_tole8(x) : CAST(uint64_t, x)))
  |  |  ------------------
  |  |  |  |  452|  1.41k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 708]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  987|    708|		break;
  988|      0|	default:
  ------------------
  |  Branch (988:2): [True: 0, False: 1.85k]
  ------------------
  989|      0|		abort();
  990|  1.85k|	}
  991|  1.85k|	return 1;
  992|  1.85k|}
cdf.c:cdf_check_stream:
  343|  11.0k|{
  344|  11.0k|	size_t ss = sst->sst_dirlen < h->h_min_size_standard_stream ?
  ------------------
  |  Branch (344:14): [True: 338, False: 10.6k]
  ------------------
  345|  11.0k|	    CDF_SHORT_SEC_SIZE(h) : CDF_SEC_SIZE(h);
  ------------------
  |  |   82|    338|#define CDF_SHORT_SEC_SIZE(h)	CAST(size_t, 1 << (h)->h_short_sec_size_p2)
  |  |  ------------------
  |  |  |  |  452|    338|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
              	    CDF_SHORT_SEC_SIZE(h) : CDF_SEC_SIZE(h);
  ------------------
  |  |   80|  10.6k|#define CDF_SEC_SIZE(h) CAST(size_t, 1 << (h)->h_sec_size_p2)
  |  |  ------------------
  |  |  |  |  452|  10.6k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  346|  11.0k|	assert(ss == sst->sst_ss);
  ------------------
  |  Branch (346:2): [True: 0, False: 11.0k]
  |  Branch (346:2): [True: 11.0k, False: 0]
  ------------------
  347|  11.0k|	return sst->sst_ss;
  348|  11.0k|}

cdf_timestamp_to_timespec:
  100|  1.83k|{
  101|  1.83k|	struct tm tm;
  102|  1.83k|#ifdef HAVE_STRUCT_TM_TM_ZONE
  103|  1.83k|	file_private char UTC[] = "UTC";
  ------------------
  |  |  108|  1.83k|#define file_private static
  ------------------
  104|  1.83k|#endif
  105|  1.83k|	int rdays;
  106|       |
  107|       |	/* Unit is 100's of nanoseconds */
  108|  1.83k|	ts->tv_nsec = (t % CDF_TIME_PREC) * 100;
  ------------------
  |  |   90|  1.83k|#define CDF_TIME_PREC	10000000
  ------------------
  109|       |
  110|  1.83k|	t /= CDF_TIME_PREC;
  ------------------
  |  |   90|  1.83k|#define CDF_TIME_PREC	10000000
  ------------------
  111|  1.83k|	tm.tm_sec = CAST(int, t % 60);
  ------------------
  |  |  452|  1.83k|#define CAST(T, b)	((T)(b))
  ------------------
  112|  1.83k|	t /= 60;
  113|       |
  114|  1.83k|	tm.tm_min = CAST(int, t % 60);
  ------------------
  |  |  452|  1.83k|#define CAST(T, b)	((T)(b))
  ------------------
  115|  1.83k|	t /= 60;
  116|       |
  117|  1.83k|	tm.tm_hour = CAST(int, t % 24);
  ------------------
  |  |  452|  1.83k|#define CAST(T, b)	((T)(b))
  ------------------
  118|  1.83k|	t /= 24;
  119|       |
  120|       |	/* XXX: Approx */
  121|  1.83k|	tm.tm_year = CAST(int, CDF_BASE_YEAR + (t / 365));
  ------------------
  |  |  452|  1.83k|#define CAST(T, b)	((T)(b))
  ------------------
  122|       |
  123|  1.83k|	if (tm.tm_year > 9999)
  ------------------
  |  Branch (123:6): [True: 312, False: 1.52k]
  ------------------
  124|    312|		goto out;
  125|       |
  126|  1.52k|	rdays = cdf_getdays(tm.tm_year);
  127|  1.52k|	t -= rdays - 1;
  128|  1.52k|	tm.tm_mday = cdf_getday(tm.tm_year, CAST(int, t));
  ------------------
  |  |  452|  1.52k|#define CAST(T, b)	((T)(b))
  ------------------
  129|  1.52k|	tm.tm_mon = cdf_getmonth(tm.tm_year, CAST(int, t));
  ------------------
  |  |  452|  1.52k|#define CAST(T, b)	((T)(b))
  ------------------
  130|  1.52k|	tm.tm_wday = 0;
  131|  1.52k|	tm.tm_yday = 0;
  132|  1.52k|	tm.tm_isdst = 0;
  133|  1.52k|#ifdef HAVE_STRUCT_TM_TM_GMTOFF
  134|  1.52k|	tm.tm_gmtoff = 0;
  135|  1.52k|#endif
  136|  1.52k|#ifdef HAVE_STRUCT_TM_TM_ZONE
  137|  1.52k|	tm.tm_zone = UTC;
  138|  1.52k|#endif
  139|  1.52k|	tm.tm_year -= 1900;
  140|  1.52k|	ts->tv_sec = mktime(&tm);
  141|  1.52k|	if (ts->tv_sec == -1)
  ------------------
  |  Branch (141:6): [True: 34, False: 1.49k]
  ------------------
  142|     34|		goto out;
  143|  1.49k|	return 0;
  144|    346|out:
  145|    346|	errno = EINVAL;
  146|    346|	return -1;
  147|  1.52k|}
cdf_ctime:
  174|    161|{
  175|    161|	char *ptr = *sec > MAX_CTIME ? NULL : ctime_r(sec, buf);
  ------------------
  |  |  173|    161|    CAST(time_t, sizeof(time_t) > 4 ? 0x3afff487cfULL : 0x7fffffffULL)
  |  |  ------------------
  |  |  |  |  452|    322|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 161, Folded]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (175:14): [True: 30, False: 131]
  ------------------
  176|    161|	if (ptr != NULL)
  ------------------
  |  Branch (176:6): [True: 131, False: 30]
  ------------------
  177|    131|		return buf;
  178|       |#ifdef WIN32
  179|       |	(void)snprintf(buf, 26, "*Bad* 0x%16.16I64x\n",
  180|       |	    CAST(long long, *sec));
  181|       |#else
  182|     30|	(void)snprintf(buf, 26, "*Bad* %#16.16" INT64_T_FORMAT "x\n",
  183|     30|	    CAST(long long, *sec));
  ------------------
  |  |  452|     30|#define CAST(T, b)	((T)(b))
  ------------------
  184|     30|#endif
  185|     30|	return buf;
  186|    161|}
cdf_time.c:cdf_getdays:
   53|  1.52k|{
   54|  1.52k|	int days = 0;
   55|  1.52k|	int y;
   56|       |
   57|  1.08M|	for (y = CDF_BASE_YEAR; y < year; y++)
  ------------------
  |  |   89|  1.52k|#define CDF_BASE_YEAR	1601
  ------------------
  |  Branch (57:26): [True: 1.08M, False: 1.52k]
  ------------------
   58|  1.08M|		days += isleap(y) + 365;
  ------------------
  |  |   41|  1.08M|#define isleap(y) ((((y) % 4) == 0) && \
  |  |  ------------------
  |  |  |  Branch (41:20): [True: 269k, False: 810k]
  |  |  ------------------
  |  |   42|  1.08M|    ((((y) % 100) != 0) || (((y) % 400) == 0)))
  |  |  ------------------
  |  |  |  Branch (42:6): [True: 259k, False: 10.3k]
  |  |  |  Branch (42:28): [True: 2.31k, False: 8.07k]
  |  |  ------------------
  ------------------
   59|       |
   60|  1.52k|	return days;
   61|  1.52k|}
cdf_time.c:cdf_getday:
   68|  1.52k|{
   69|  1.52k|	size_t m;
   70|       |
   71|  6.18k|	for (m = 0; m < __arraycount(mdays); m++) {
  ------------------
  |  |  130|  6.18k|#define __arraycount(a) (sizeof(a) / sizeof(a[0]))
  ------------------
  |  Branch (71:14): [True: 6.07k, False: 115]
  ------------------
   72|  6.07k|		int sub = mdays[m] + (m == 1 && isleap(year));
  ------------------
  |  |   41|    742|#define isleap(y) ((((y) % 4) == 0) && \
  |  |  ------------------
  |  |  |  Branch (41:20): [True: 242, False: 500]
  |  |  ------------------
  |  |   42|    742|    ((((y) % 100) != 0) || (((y) % 400) == 0)))
  |  |  ------------------
  |  |  |  Branch (42:6): [True: 134, False: 108]
  |  |  |  Branch (42:28): [True: 66, False: 42]
  |  |  ------------------
  ------------------
  |  Branch (72:25): [True: 742, False: 5.32k]
  ------------------
   73|  6.07k|		if (days < sub)
  ------------------
  |  Branch (73:7): [True: 1.41k, False: 4.66k]
  ------------------
   74|  1.41k|			return days;
   75|  4.66k|		days -= sub;
   76|  4.66k|	}
   77|    115|	return days;
   78|  1.52k|}
cdf_time.c:cdf_getmonth:
   85|  1.52k|{
   86|  1.52k|	size_t m;
   87|       |
   88|  6.04k|	for (m = 0; m < __arraycount(mdays); m++) {
  ------------------
  |  |  130|  6.04k|#define __arraycount(a) (sizeof(a) / sizeof(a[0]))
  ------------------
  |  Branch (88:14): [True: 6.04k, False: 0]
  ------------------
   89|  6.04k|		days -= mdays[m];
   90|  6.04k|		if (m == 1 && isleap(year))
  ------------------
  |  |   41|    742|#define isleap(y) ((((y) % 4) == 0) && \
  |  |  ------------------
  |  |  |  Branch (41:20): [True: 242, False: 500]
  |  |  ------------------
  |  |   42|    742|    ((((y) % 100) != 0) || (((y) % 400) == 0)))
  |  |  ------------------
  |  |  |  Branch (42:6): [True: 134, False: 108]
  |  |  |  Branch (42:28): [True: 66, False: 42]
  |  |  ------------------
  ------------------
  |  Branch (90:7): [True: 742, False: 5.30k]
  ------------------
   91|    200|			days--;
   92|  6.04k|		if (days <= 0)
  ------------------
  |  Branch (92:7): [True: 1.52k, False: 4.51k]
  ------------------
   93|  1.52k|			return CAST(int, m);
  ------------------
  |  |  452|  1.52k|#define CAST(T, b)	((T)(b))
  ------------------
   94|  6.04k|	}
   95|      0|	return CAST(int, m);
  ------------------
  |  |  452|      0|#define CAST(T, b)	((T)(b))
  ------------------
   96|  1.52k|}

file_zmagic:
  294|  14.4k|{
  295|  14.4k|	unsigned char *newbuf = NULL;
  296|  14.4k|	size_t i, nsz;
  297|  14.4k|	char *rbuf;
  298|  14.4k|	file_pushbuf_t *pb;
  299|  14.4k|	int urv, prv, rv = 0;
  300|  14.4k|	int mime = ms->flags & MAGIC_MIME;
  ------------------
  |  |   44|  14.4k|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   37|  14.4k|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  ------------------
  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   43|  14.4k|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  ------------------
  ------------------
  301|  14.4k|	int fd = b->fd;
  302|  14.4k|	const unsigned char *buf = CAST(const unsigned char *, b->fbuf);
  ------------------
  |  |  452|  14.4k|#define CAST(T, b)	((T)(b))
  ------------------
  303|  14.4k|	size_t nbytes = b->flen;
  304|  14.4k|	int sa_saved = 0;
  305|  14.4k|	struct sigaction sig_act;
  306|       |
  307|  14.4k|	if ((ms->flags & MAGIC_COMPRESS) == 0)
  ------------------
  |  |   35|  14.4k|#define	MAGIC_COMPRESS		0x0000004 /* Check inside compressed files */
  ------------------
  |  Branch (307:6): [True: 6.82k, False: 7.61k]
  ------------------
  308|  6.82k|		return 0;
  309|       |
  310|   121k|	for (i = 0; i < ncompr; i++) {
  ------------------
  |  Branch (310:14): [True: 114k, False: 7.61k]
  ------------------
  311|   114k|		int zm;
  312|   114k|		if (nbytes < CAST(size_t, abs(compr[i].maglen)))
  ------------------
  |  |  452|   114k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (312:7): [True: 7.20k, False: 107k]
  ------------------
  313|  7.20k|			continue;
  314|   107k|		if (compr[i].maglen < 0) {
  ------------------
  |  Branch (314:7): [True: 12.2k, False: 94.7k]
  ------------------
  315|  12.2k|			zm = (*compr[i].u.func)(buf);
  316|  94.7k|		} else {
  317|  94.7k|			zm = memcmp(buf, compr[i].u.magic,
  318|  94.7k|			    CAST(size_t, compr[i].maglen)) == 0;
  ------------------
  |  |  452|  94.7k|#define CAST(T, b)	((T)(b))
  ------------------
  319|  94.7k|		}
  320|       |
  321|   107k|		if (!zm)
  ------------------
  |  Branch (321:7): [True: 103k, False: 3.90k]
  ------------------
  322|   103k|			continue;
  323|       |
  324|       |		/* Prevent SIGPIPE death if child dies unexpectedly */
  325|  3.90k|		if (!sa_saved) {
  ------------------
  |  Branch (325:7): [True: 3.28k, False: 624]
  ------------------
  326|       |			//We can use sig_act for both new and old, but
  327|  3.28k|			struct sigaction new_act;
  328|  3.28k|			memset(&new_act, 0, sizeof(new_act));
  329|  3.28k|			new_act.sa_handler = SIG_IGN;
  330|  3.28k|			sa_saved = sigaction(SIGPIPE, &new_act, &sig_act) != -1;
  331|  3.28k|		}
  332|       |
  333|  3.90k|		nsz = nbytes;
  334|  3.90k|		free(newbuf);
  335|  3.90k|		urv = uncompressbuf(fd, ms->bytes_max, i, 
  336|  3.90k|		    (ms->flags & MAGIC_NO_COMPRESS_FORK), buf, &newbuf, &nsz);
  ------------------
  |  |   50|  3.90k|#define MAGIC_NO_COMPRESS_FORK	0x4000000 /* Don't allow decompression that
  ------------------
  337|  3.90k|		DPRINTF("uncompressbuf = %d, %s, %" SIZE_T_FORMAT "u\n", urv,
  338|  3.90k|		    (char *)newbuf, nsz);
  339|  3.90k|		switch (urv) {
  340|  3.18k|		case OKDATA:
  ------------------
  |  |  230|  3.18k|#define OKDATA 	0
  ------------------
  |  Branch (340:3): [True: 3.18k, False: 728]
  ------------------
  341|  3.90k|		case ERRDATA:
  ------------------
  |  |  232|  3.90k|#define ERRDATA	2
  ------------------
  |  Branch (341:3): [True: 728, False: 3.18k]
  ------------------
  342|  3.90k|			ms->flags &= ~MAGIC_COMPRESS;
  ------------------
  |  |   35|  3.90k|#define	MAGIC_COMPRESS		0x0000004 /* Check inside compressed files */
  ------------------
  343|  3.90k|			if (urv == ERRDATA)
  ------------------
  |  |  232|  3.90k|#define ERRDATA	2
  ------------------
  |  Branch (343:8): [True: 728, False: 3.18k]
  ------------------
  344|    728|				prv = format_decompression_error(ms, i, newbuf);
  345|  3.18k|			else
  346|  3.18k|				prv = file_buffer(ms, -1, NULL, name, newbuf,
  347|  3.18k|				    nsz);
  348|  3.90k|			if (prv == -1)
  ------------------
  |  Branch (348:8): [True: 0, False: 3.90k]
  ------------------
  349|      0|				goto error;
  350|  3.90k|			rv = 1;
  351|  3.90k|			if ((ms->flags & MAGIC_COMPRESS_TRANSP) != 0)
  ------------------
  |  |   48|  3.90k|#define MAGIC_COMPRESS_TRANSP	0x2000000 /* Check inside compressed files
  ------------------
  |  Branch (351:8): [True: 0, False: 3.90k]
  ------------------
  352|      0|				goto out;
  353|  3.90k|			if (mime != MAGIC_MIME && mime != 0)
  ------------------
  |  |   44|  7.81k|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   37|  3.90k|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  ------------------
  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   43|  3.90k|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  ------------------
  ------------------
  |  Branch (353:8): [True: 3.90k, False: 0]
  |  Branch (353:30): [True: 0, False: 3.90k]
  ------------------
  354|      0|				goto out;
  355|  3.90k|			if ((file_printf(ms,
  ------------------
  |  Branch (355:8): [True: 0, False: 3.90k]
  ------------------
  356|  3.90k|			    mime ? " compressed-encoding=" : " (")) == -1)
  ------------------
  |  Branch (356:8): [True: 0, False: 3.90k]
  ------------------
  357|      0|				goto error;
  358|  3.90k|			if ((pb = file_push_buffer(ms)) == NULL)
  ------------------
  |  Branch (358:8): [True: 243, False: 3.66k]
  ------------------
  359|    243|				goto error;
  360|       |			/*
  361|       |			 * XXX: If file_buffer fails here, we overwrite
  362|       |			 * the compressed text. FIXME.
  363|       |			 */
  364|  3.66k|			if (file_buffer(ms, -1, NULL, NULL, buf, nbytes) == -1)
  ------------------
  |  Branch (364:8): [True: 0, False: 3.66k]
  ------------------
  365|      0|			{
  366|      0|				if (file_pop_buffer(ms, pb) != NULL)
  ------------------
  |  Branch (366:9): [True: 0, False: 0]
  ------------------
  367|      0|					abort();
  368|      0|				goto error;
  369|      0|			}
  370|  3.66k|			if ((rbuf = file_pop_buffer(ms, pb)) != NULL) {
  ------------------
  |  Branch (370:8): [True: 3.63k, False: 27]
  ------------------
  371|  3.63k|				if (file_printf(ms, "%s", rbuf) == -1) {
  ------------------
  |  Branch (371:9): [True: 6, False: 3.63k]
  ------------------
  372|      6|					free(rbuf);
  373|      6|					goto error;
  374|      6|				}
  375|  3.63k|				free(rbuf);
  376|  3.63k|			}
  377|  3.66k|			if (!mime && file_printf(ms, ")") == -1)
  ------------------
  |  Branch (377:8): [True: 3.66k, False: 0]
  |  Branch (377:17): [True: 0, False: 3.66k]
  ------------------
  378|      0|				goto error;
  379|       |			/*FALLTHROUGH*/
  380|  3.66k|		case NODATA:
  ------------------
  |  |  231|  3.66k|#define NODATA	1
  ------------------
  |  Branch (380:3): [True: 0, False: 3.90k]
  ------------------
  381|  3.66k|			break;
  382|      0|		default:
  ------------------
  |  Branch (382:3): [True: 0, False: 3.90k]
  ------------------
  383|      0|			abort();
  384|       |			/*NOTREACHED*/
  385|    249|		error:
  386|    249|			rv = -1;
  387|    249|			break;
  388|  3.90k|		}
  389|  3.90k|	}
  390|  7.61k|out:
  391|  7.61k|	DPRINTF("rv = %d\n", rv);
  392|       |
  393|  7.61k|	if (sa_saved && sig_act.sa_handler != SIG_IGN)
  ------------------
  |  Branch (393:6): [True: 3.28k, False: 4.33k]
  |  Branch (393:18): [True: 3.28k, False: 0]
  ------------------
  394|  3.28k|		(void)sigaction(SIGPIPE, &sig_act, NULL);
  395|       |
  396|  7.61k|	free(newbuf);
  397|  7.61k|	ms->flags |= MAGIC_COMPRESS;
  ------------------
  |  |   35|  7.61k|#define	MAGIC_COMPRESS		0x0000004 /* Check inside compressed files */
  ------------------
  398|  7.61k|	DPRINTF("Zmagic returns %d\n", rv);
  399|  7.61k|	return rv;
  400|  7.61k|}
sread:
  432|  7.51k|{
  433|  7.51k|	ssize_t rv;
  434|  7.51k|#if defined(FIONREAD) && !defined(__MINGW32__)
  435|  7.51k|	int t = 0;
  436|  7.51k|#endif
  437|  7.51k|	size_t rn = n;
  438|       |
  439|  7.51k|	if (fd == STDIN_FILENO)
  ------------------
  |  Branch (439:6): [True: 0, False: 7.51k]
  ------------------
  440|      0|		goto nocheck;
  441|       |
  442|  7.51k|#if defined(FIONREAD) && !defined(__MINGW32__)
  443|  7.51k|	if (canbepipe && (ioctl(fd, FIONREAD, &t) == -1 || t == 0)) {
  ------------------
  |  Branch (443:6): [True: 0, False: 7.51k]
  |  Branch (443:20): [True: 0, False: 0]
  |  Branch (443:53): [True: 0, False: 0]
  ------------------
  444|      0|#ifdef FD_ZERO
  445|      0|		ssize_t cnt;
  446|      0|		for (cnt = 0;; cnt++) {
  447|      0|			fd_set check;
  448|      0|			struct timeval tout = {0, 100 * 1000};
  449|      0|			int selrv;
  450|       |
  451|      0|			FD_ZERO(&check);
  ------------------
  |  Branch (451:4): [Folded, False: 0]
  ------------------
  452|      0|			FD_SET(fd, &check);
  453|       |
  454|       |			/*
  455|       |			 * Avoid soft deadlock: do not read if there
  456|       |			 * is nothing to read from sockets and pipes.
  457|       |			 */
  458|      0|			selrv = select(fd + 1, &check, NULL, NULL, &tout);
  459|      0|			if (selrv == -1) {
  ------------------
  |  Branch (459:8): [True: 0, False: 0]
  ------------------
  460|      0|				if (errno == EINTR || errno == EAGAIN)
  ------------------
  |  Branch (460:9): [True: 0, False: 0]
  |  Branch (460:27): [True: 0, False: 0]
  ------------------
  461|      0|					continue;
  462|      0|			} else if (selrv == 0 && cnt >= 5) {
  ------------------
  |  Branch (462:15): [True: 0, False: 0]
  |  Branch (462:29): [True: 0, False: 0]
  ------------------
  463|      0|				return 0;
  464|      0|			} else
  465|      0|				break;
  466|      0|		}
  467|      0|#endif
  468|      0|		(void)ioctl(fd, FIONREAD, &t);
  469|      0|	}
  470|       |
  471|  7.51k|	if (t > 0 && CAST(size_t, t) < n) {
  ------------------
  |  |  452|      0|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (471:6): [True: 0, False: 7.51k]
  |  Branch (471:15): [True: 0, False: 0]
  ------------------
  472|      0|		n = t;
  473|      0|		rn = n;
  474|      0|	}
  475|  7.51k|#endif
  476|       |
  477|  7.51k|nocheck:
  478|  7.51k|	do
  479|   365k|		switch ((rv = read(fd, buf, n))) {
  480|      2|		case -1:
  ------------------
  |  Branch (480:3): [True: 2, False: 365k]
  ------------------
  481|      2|			if (errno == EINTR)
  ------------------
  |  Branch (481:8): [True: 2, False: 0]
  ------------------
  482|      2|				continue;
  483|      0|			return -1;
  484|  7.34k|		case 0:
  ------------------
  |  Branch (484:3): [True: 7.34k, False: 358k]
  ------------------
  485|  7.34k|			return rn - n;
  486|   358k|		default:
  ------------------
  |  Branch (486:3): [True: 358k, False: 7.34k]
  ------------------
  487|   358k|			n -= rv;
  488|   358k|			buf = CAST(char *, CCAST(void *, buf)) + rv;
  ------------------
  |  |  452|   358k|#define CAST(T, b)	((T)(b))
  ------------------
  489|   358k|			break;
  490|   365k|		}
  491|   358k|	while (n > 0);
  ------------------
  |  Branch (491:9): [True: 358k, False: 172]
  ------------------
  492|    172|	return rn;
  493|  7.51k|}
compress.c:lzmacmp:
  150|  4.64k|{
  151|  4.64k|	if (buf[0] != 0x5d || buf[1] || buf[2])
  ------------------
  |  Branch (151:6): [True: 4.63k, False: 18]
  |  Branch (151:24): [True: 2, False: 16]
  |  Branch (151:34): [True: 8, False: 8]
  ------------------
  152|  4.64k|		return 0;
  153|      8|	if (buf[12] && buf[12] != 0xff)
  ------------------
  |  Branch (153:6): [True: 5, False: 3]
  |  Branch (153:17): [True: 4, False: 1]
  ------------------
  154|      4|		return 0;
  155|      4|	return 1;
  156|      8|}
compress.c:zlibcmp:
  133|  7.61k|{
  134|  7.61k|	unsigned short x;
  135|       |
  136|  7.61k|	if ((buf[0] & 0xf) != 8 || (buf[0] & 0x80) != 0)
  ------------------
  |  Branch (136:6): [True: 7.52k, False: 88]
  |  Branch (136:29): [True: 29, False: 59]
  ------------------
  137|  7.55k|		return 0;
  138|     59|	if (file_bigendian())	/* endianness test */
  ------------------
  |  Branch (138:6): [True: 0, False: 59]
  ------------------
  139|      0|		x = buf[0] | (buf[1] << 8);
  140|     59|	else
  141|     59|		x = buf[1] | (buf[0] << 8);
  142|     59|	if (x % 31)
  ------------------
  |  Branch (142:6): [True: 37, False: 22]
  ------------------
  143|     37|		return 0;
  144|     22|	return 1;
  145|     59|}
compress.c:format_decompression_error:
  277|    728|{
  278|    728|	unsigned char *p;
  279|    728|	int mime = ms->flags & MAGIC_MIME;
  ------------------
  |  |   44|    728|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   37|    728|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  ------------------
  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   43|    728|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  ------------------
  ------------------
  280|       |
  281|    728|	if (!mime)
  ------------------
  |  Branch (281:6): [True: 728, False: 0]
  ------------------
  282|    728|		return file_printf(ms, "ERROR:[%s: %s]", methodname(i), buf);
  283|       |
  284|      0|	for (p = buf; *p; p++)
  ------------------
  |  Branch (284:16): [True: 0, False: 0]
  ------------------
  285|      0|		if (!isalnum(*p))
  ------------------
  |  Branch (285:7): [True: 0, False: 0]
  ------------------
  286|      0|			*p = '-';
  287|       |
  288|      0|	return file_printf(ms, "application/x-decompression-error-%s-%s",
  289|      0|	    methodname(i), buf);
  290|    728|}
compress.c:methodname:
 1097|    728|{
 1098|    728|	switch (method) {
 1099|      0|#ifdef BUILTIN_DECOMPRESS
 1100|     14|	case METH_FROZEN:
  ------------------
  |  |  198|     14|#define METH_FROZEN	2
  ------------------
  |  Branch (1100:2): [True: 14, False: 714]
  ------------------
 1101|     36|	case METH_ZLIB:
  ------------------
  |  |  206|     36|#define METH_ZLIB	14
  ------------------
  |  Branch (1101:2): [True: 22, False: 706]
  ------------------
 1102|     36|		return "zlib";
 1103|      0|#endif
 1104|      0|#ifdef BUILTIN_BZLIB
 1105|      7|	case METH_BZIP:
  ------------------
  |  |  199|      7|#define METH_BZIP	7
  ------------------
  |  Branch (1105:2): [True: 7, False: 721]
  ------------------
 1106|      7|		return "bzlib";
 1107|      0|#endif
 1108|      0|#ifdef BUILTIN_XZLIB
 1109|      3|	case METH_XZ:
  ------------------
  |  |  200|      3|#define METH_XZ		9
  ------------------
  |  Branch (1109:2): [True: 3, False: 725]
  ------------------
 1110|      7|	case METH_LZMA:
  ------------------
  |  |  205|      7|#define METH_LZMA	13
  ------------------
  |  Branch (1110:2): [True: 4, False: 724]
  ------------------
 1111|      7|		return "xzlib";
 1112|      0|#endif
 1113|      0|#ifdef BUILTIN_ZSTDLIB
 1114|      3|	case METH_ZSTD:
  ------------------
  |  |  204|      3|#define METH_ZSTD	12
  ------------------
  |  Branch (1114:2): [True: 3, False: 725]
  ------------------
 1115|      3|		return "zstd";
 1116|      0|#endif
 1117|       |#ifdef BUILTIN_LZLIB
 1118|       |	case METH_LZIP:
 1119|       |		return "lzlib";
 1120|       |#endif
 1121|       |#ifdef BUILTIN_LRZIP
 1122|       |	case METH_LRZIP:
 1123|       |		return "lrzip";
 1124|       |#endif
 1125|    675|	default:
  ------------------
  |  Branch (1125:2): [True: 675, False: 53]
  ------------------
 1126|    675|		return compr[method].argv[0];
 1127|    728|	}
 1128|    728|}
compress.c:uncompressbuf:
 1174|  3.90k|{
 1175|  3.90k|	int fdp[3][2];
 1176|  3.90k|	int status, rv, w;
 1177|  3.90k|	pid_t pid;
 1178|  3.90k|	pid_t writepid = -1;
 1179|  3.90k|	size_t i;
 1180|  3.90k|	ssize_t r, re;
 1181|  3.90k|	char *const *args;
 1182|  3.90k|#ifdef HAVE_POSIX_SPAWNP
 1183|  3.90k|	posix_spawn_file_actions_t fa;
 1184|  3.90k|#endif
 1185|  3.90k|	int (*decompress)(const unsigned char *, unsigned char **,
 1186|  3.90k|	    size_t, size_t *, int) = getdecompressor(method);
 1187|       |
 1188|  3.90k|	*newch = CAST(unsigned char *, malloc(bytes_max + 1));
  ------------------
  |  |  452|  3.90k|#define CAST(T, b)	((T)(b))
  ------------------
 1189|  3.90k|	if (*newch == NULL)
  ------------------
  |  Branch (1189:6): [True: 0, False: 3.90k]
  ------------------
 1190|      0|		return makeerror(newch, n, "No buffer, %s", strerror(errno));
 1191|       |
 1192|  3.90k|	if (decompress) {
  ------------------
  |  Branch (1192:6): [True: 55, False: 3.85k]
  ------------------
 1193|     55|		if (nofork) {
  ------------------
  |  Branch (1193:7): [True: 55, False: 0]
  ------------------
 1194|     55|			return makeerror(newch, n,
 1195|     55|			    "Fork is required to uncompress, but disabled");
 1196|     55|		}
 1197|      0|		return (*decompress)(old, newch, bytes_max, n, 1);
 1198|     55|	}
 1199|       |
 1200|  3.85k|	(void)fflush(stdout);
 1201|  3.85k|	(void)fflush(stderr);
 1202|       |
 1203|  15.4k|	for (i = 0; i < __arraycount(fdp); i++)
  ------------------
  |  |  130|  15.4k|#define __arraycount(a) (sizeof(a) / sizeof(a[0]))
  ------------------
  |  Branch (1203:14): [True: 11.5k, False: 3.85k]
  ------------------
 1204|  11.5k|		fdp[i][0] = fdp[i][1] = -1;
 1205|       |
 1206|       |	/*
 1207|       |	 * There are multithreaded users who run magic_file()
 1208|       |	 * from dozens of threads. If two parallel magic_file() calls
 1209|       |	 * analyze two large compressed files, both will spawn
 1210|       |	 * an uncompressing child here, which writes out uncompressed data.
 1211|       |	 * We read some portion, then close the pipe, then waitpid() the child.
 1212|       |	 * If uncompressed data is larger, child should get EPIPE and exit.
 1213|       |	 * However, with *parallel* calls OTHER child may unintentionally
 1214|       |	 * inherit pipe fds, thus keeping pipe open and making writes in
 1215|       |	 * our child block instead of failing with EPIPE!
 1216|       |	 * (For the bug to occur, two threads must mutually inherit their pipes,
 1217|       |	 * and both must have large outputs. Thus it happens not that often).
 1218|       |	 * To avoid this, be sure to create pipes with O_CLOEXEC.
 1219|       |	 */
 1220|  3.85k|	if ((fd == -1 && file_pipe_closexec(fdp[STDIN_FILENO]) == -1) ||
  ------------------
  |  Branch (1220:7): [True: 3.85k, False: 0]
  |  Branch (1220:19): [True: 0, False: 3.85k]
  ------------------
 1221|  3.85k|	    file_pipe_closexec(fdp[STDOUT_FILENO]) == -1 ||
  ------------------
  |  Branch (1221:6): [True: 0, False: 3.85k]
  ------------------
 1222|  3.85k|	    file_pipe_closexec(fdp[STDERR_FILENO]) == -1) {
  ------------------
  |  Branch (1222:6): [True: 0, False: 3.85k]
  ------------------
 1223|      0|		closep(fdp[STDIN_FILENO]);
 1224|      0|		closep(fdp[STDOUT_FILENO]);
 1225|      0|		return makeerror(newch, n, "Cannot create pipe, %s",
 1226|      0|		    strerror(errno));
 1227|      0|	}
 1228|       |
 1229|  3.85k|	args = RCAST(char *const *, RCAST(intptr_t, compr[method].argv));
  ------------------
  |  |  453|  3.85k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 1230|  3.85k|#ifdef HAVE_POSIX_SPAWNP
 1231|  3.85k|	posix_spawn_file_actions_init(&fa);
 1232|       |
 1233|  3.85k|	handledesc(&fa, fd, fdp);
 1234|       |
 1235|  3.85k|	DPRINTF("Executing %s\n", compr[method].argv[0]);
 1236|  3.85k|	status = posix_spawnp(&pid, compr[method].argv[0], &fa, NULL,
 1237|  3.85k|	    args, NULL);
 1238|       |
 1239|  3.85k|	posix_spawn_file_actions_destroy(&fa);
 1240|       |
 1241|  3.85k|	if (status != 0) {
  ------------------
  |  Branch (1241:6): [True: 12, False: 3.84k]
  ------------------
 1242|     12|		return makeerror(newch, n, "Cannot posix_spawn `%s', %s",
 1243|     12|		    compr[method].argv[0], strerror(status));
 1244|     12|	}
 1245|       |#else
 1246|       |	/* For processes with large mapped virtual sizes, vfork
 1247|       |	 * may be _much_ faster (10-100 times) than fork.
 1248|       |	 */
 1249|       |	pid = vfork();
 1250|       |	if (pid == -1) {
 1251|       |		return makeerror(newch, n, "Cannot vfork, %s",
 1252|       |		    strerror(errno));
 1253|       |	}
 1254|       |	if (pid == 0) {
 1255|       |		/* child */
 1256|       |		/* Note: we are after vfork, do not modify memory
 1257|       |		 * in a way which confuses parent. In particular,
 1258|       |		 * do not modify fdp[i][j].
 1259|       |		 */
 1260|       |		handledesc(NULL, fd, fdp);
 1261|       |		DPRINTF("Executing %s\n", compr[method].argv[0]);
 1262|       |
 1263|       |		(void)execvp(compr[method].argv[0], args);
 1264|       |		dprintf(STDERR_FILENO, "exec `%s' failed, %s",
 1265|       |		    compr[method].argv[0], strerror(errno));
 1266|       |		_exit(EXIT_FAILURE); /* _exit(), not exit(), because of vfork */
 1267|       |	}
 1268|       |#endif
 1269|       |	/* parent */
 1270|       |	/* Close write sides of child stdout/err pipes */
 1271|  11.5k|	for (i = 1; i < __arraycount(fdp); i++)
  ------------------
  |  |  130|  11.5k|#define __arraycount(a) (sizeof(a) / sizeof(a[0]))
  ------------------
  |  Branch (1271:14): [True: 7.68k, False: 3.84k]
  ------------------
 1272|  7.68k|		closefd(fdp[i], 1);
 1273|       |	/* Write the buffer data to child stdin, if we don't have fd */
 1274|  3.84k|	if (fd == -1) {
  ------------------
  |  Branch (1274:6): [True: 3.84k, False: 0]
  ------------------
 1275|  3.84k|		closefd(fdp[STDIN_FILENO], 0);
 1276|  3.84k|		writepid = writechild(fdp[STDIN_FILENO][1], old, *n);
 1277|  3.84k|		if (writepid == (pid_t)-1) {
  ------------------
  |  Branch (1277:7): [True: 0, False: 3.84k]
  ------------------
 1278|      0|			rv = makeerror(newch, n, "Write to child failed, %s",
 1279|      0|			    strerror(errno));
 1280|      0|			DPRINTF("Write to child failed\n");
 1281|      0|			goto err;
 1282|      0|		}
 1283|  3.84k|		closefd(fdp[STDIN_FILENO], 1);
 1284|  3.84k|	}
 1285|       |
 1286|  3.84k|	rv = OKDATA;
  ------------------
  |  |  230|  3.84k|#define OKDATA 	0
  ------------------
 1287|  3.84k|	r = sread(fdp[STDOUT_FILENO][0], *newch, bytes_max, 0);
 1288|  3.84k|	DPRINTF("read got %zd\n", r);
 1289|  3.84k|	if (r < 0) {
  ------------------
  |  Branch (1289:6): [True: 0, False: 3.84k]
  ------------------
 1290|      0|		rv = ERRDATA;
  ------------------
  |  |  232|      0|#define ERRDATA	2
  ------------------
 1291|      0|		DPRINTF("Read stdout failed %d (%s)\n", fdp[STDOUT_FILENO][0],
 1292|      0|		        strerror(errno));
 1293|      0|		goto err;
 1294|      0|	} 
 1295|  3.84k|	if (CAST(size_t, r) == bytes_max) {
  ------------------
  |  |  452|  3.84k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (1295:6): [True: 172, False: 3.67k]
  ------------------
 1296|       |		/*
 1297|       |		 * close fd so that the child exits with sigpipe and ignore
 1298|       |		 * errors, otherwise we risk the child blocking and never
 1299|       |		 * exiting.
 1300|       |		 */
 1301|    172|		DPRINTF("Closing stdout for bytes_max\n");
 1302|    172|		closefd(fdp[STDOUT_FILENO], 0);
 1303|    172|		goto ok;
 1304|    172|	}
 1305|  3.67k|	if ((re = sread(fdp[STDERR_FILENO][0], *newch, bytes_max, 0)) > 0) {
  ------------------
  |  Branch (1305:6): [True: 661, False: 3.00k]
  ------------------
 1306|    661|		DPRINTF("Got stuff from stderr %s\n", *newch);
 1307|    661|		rv = ERRDATA;
  ------------------
  |  |  232|    661|#define ERRDATA	2
  ------------------
 1308|    661|		r = filter_error(*newch, r);
 1309|    661|		goto ok;
 1310|    661|	}
 1311|  3.00k|	if  (re == 0)
  ------------------
  |  Branch (1311:7): [True: 3.00k, False: 0]
  ------------------
 1312|  3.00k|		goto ok;
 1313|      0|	rv = makeerror(newch, n, "Read stderr failed, %s",
 1314|      0|	    strerror(errno));
 1315|      0|	goto err;
 1316|  3.84k|ok:
 1317|  3.84k|	*n = r;
 1318|       |	/* NUL terminate, as every buffer is handled here. */
 1319|  3.84k|	(*newch)[*n] = '\0';
 1320|  3.84k|err:
 1321|  3.84k|	closefd(fdp[STDIN_FILENO], 1);
 1322|  3.84k|	closefd(fdp[STDOUT_FILENO], 0);
 1323|  3.84k|	closefd(fdp[STDERR_FILENO], 0);
 1324|       |
 1325|  3.84k|	w = waitpid(pid, &status, 0);
 1326|  7.68k|wait_err:
 1327|  7.68k|	if (w == -1) {
  ------------------
  |  Branch (1327:6): [True: 0, False: 7.68k]
  ------------------
 1328|      0|		rv = makeerror(newch, n, "Wait failed, %s", strerror(errno));
 1329|      0|		DPRINTF("Child wait return %#x\n", status);
 1330|  7.68k|	} else if (!WIFEXITED(status)) {
  ------------------
  |  Branch (1330:13): [True: 0, False: 7.68k]
  ------------------
 1331|      0|		DPRINTF("Child not exited (%#x)\n", status);
 1332|  7.68k|	} else if (WEXITSTATUS(status) != 0) {
  ------------------
  |  Branch (1332:13): [True: 4.67k, False: 3.00k]
  ------------------
 1333|  4.67k|		DPRINTF("Child exited (%#x)\n", WEXITSTATUS(status));
 1334|  4.67k|	}
 1335|  7.68k|	if (writepid > 0) {
  ------------------
  |  Branch (1335:6): [True: 3.84k, False: 3.84k]
  ------------------
 1336|       |		/* _After_ we know decompressor has exited, our input writer
 1337|       |		 * definitely will exit now (at worst, writing fails in it,
 1338|       |		 * since output fd is closed now on the reading size).
 1339|       |		 */
 1340|  3.84k|		w = waitpid(writepid, &status, 0);
 1341|  3.84k|		writepid = -1;
 1342|  3.84k|		goto wait_err;
 1343|  3.84k|	}
 1344|       |
 1345|  3.84k|	closefd(fdp[STDIN_FILENO], 0); //why? it is already closed here!
 1346|  3.84k|	DPRINTF("Returning %p n=%" SIZE_T_FORMAT "u rv=%d\n", *newch, *n, rv);
 1347|       |
 1348|  3.84k|	return rv;
 1349|  7.68k|}
compress.c:getdecompressor:
 1133|  3.90k|{
 1134|  3.90k|	switch (method) {
 1135|      0|#ifdef BUILTIN_DECOMPRESS
 1136|     14|	case METH_FROZEN:
  ------------------
  |  |  198|     14|#define METH_FROZEN	2
  ------------------
  |  Branch (1136:2): [True: 14, False: 3.89k]
  ------------------
 1137|     14|		return uncompressgzipped;
 1138|     22|	case METH_ZLIB:
  ------------------
  |  |  206|     22|#define METH_ZLIB	14
  ------------------
  |  Branch (1138:2): [True: 22, False: 3.88k]
  ------------------
 1139|     22|		return uncompresszlib;
 1140|      0|#endif
 1141|      0|#ifdef BUILTIN_BZLIB
 1142|      7|	case METH_BZIP:
  ------------------
  |  |  199|      7|#define METH_BZIP	7
  ------------------
  |  Branch (1142:2): [True: 7, False: 3.90k]
  ------------------
 1143|      7|		return uncompressbzlib;
 1144|      0|#endif
 1145|      0|#ifdef BUILTIN_XZLIB
 1146|      3|	case METH_XZ:
  ------------------
  |  |  200|      3|#define METH_XZ		9
  ------------------
  |  Branch (1146:2): [True: 3, False: 3.90k]
  ------------------
 1147|      7|	case METH_LZMA:
  ------------------
  |  |  205|      7|#define METH_LZMA	13
  ------------------
  |  Branch (1147:2): [True: 4, False: 3.90k]
  ------------------
 1148|      7|		return uncompressxzlib;
 1149|      0|#endif
 1150|      0|#ifdef BUILTIN_ZSTDLIB
 1151|      3|	case METH_ZSTD:
  ------------------
  |  |  204|      3|#define METH_ZSTD	12
  ------------------
  |  Branch (1151:2): [True: 3, False: 3.90k]
  ------------------
 1152|      3|		return uncompresszstd;
 1153|      0|#endif
 1154|       |#ifdef BUILTIN_LZLIB
 1155|       |	case METH_LZIP:
 1156|       |		return uncompresslzlib;
 1157|       |#endif
 1158|       |#ifdef BUILTIN_LRZIP
 1159|       |	case METH_LRZIP:
 1160|       |		return uncompresslrzip;
 1161|       |#endif
 1162|      0|#ifdef BUILTIN_LZ4LIB
 1163|      2|	case METH_LZ4:
  ------------------
  |  |  203|      2|#define	METH_LZ4	11
  ------------------
  |  Branch (1163:2): [True: 2, False: 3.90k]
  ------------------
 1164|      2|		return uncompresslz4;
 1165|      0|#endif
 1166|  3.85k|	default:
  ------------------
  |  Branch (1166:2): [True: 3.85k, False: 55]
  ------------------
 1167|       |		return NULL;
 1168|  3.90k|	}
 1169|  3.90k|}
compress.c:makeerror:
  946|     67|{
  947|     67|	char *msg;
  948|     67|	va_list ap;
  949|     67|	int rv;
  950|       |
  951|     67|	DPRINTF("Makeerror %s\n", fmt);
  952|     67|	free(*buf);
  953|     67|	va_start(ap, fmt);
  954|     67|	rv = vasprintf(&msg, fmt, ap);
  955|     67|	va_end(ap);
  956|     67|	if (rv < 0) {
  ------------------
  |  Branch (956:6): [True: 0, False: 67]
  ------------------
  957|      0|		DPRINTF("Makeerror failed");
  958|      0|		*buf = NULL;
  959|      0|		*len = 0;
  960|      0|		return NODATA;
  ------------------
  |  |  231|      0|#define NODATA	1
  ------------------
  961|      0|	}
  962|     67|	*buf = RCAST(unsigned char *, msg);
  ------------------
  |  |  453|     67|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
  963|     67|	*len = strlen(msg);
  964|     67|	return ERRDATA;
  ------------------
  |  |  232|     67|#define ERRDATA	2
  ------------------
  965|     67|}
compress.c:handledesc:
 1015|  3.85k|{
 1016|  3.85k|	if (fd != -1) {
  ------------------
  |  Branch (1016:6): [True: 0, False: 3.85k]
  ------------------
 1017|      0|		(void) lseek(fd, CAST(off_t, 0), SEEK_SET);
  ------------------
  |  |  452|      0|#define CAST(T, b)	((T)(b))
  ------------------
 1018|      0|		movedesc(v, STDIN_FILENO, fd);
 1019|  3.85k|	} else {
 1020|  3.85k|		movedesc(v, STDIN_FILENO, fdp[STDIN_FILENO][0]);
 1021|  3.85k|		if (fdp[STDIN_FILENO][1] > 2)
  ------------------
  |  Branch (1021:7): [True: 3.85k, False: 0]
  ------------------
 1022|  3.85k|		    closedesc(v, fdp[STDIN_FILENO][1]);
 1023|  3.85k|	}
 1024|       |
 1025|  3.85k|	file_clear_closexec(STDIN_FILENO);
 1026|       |
 1027|       |///FIXME: if one of the fdp[i][j] is 0 or 1, this can bomb spectacularly
 1028|  3.85k|	movedesc(v, STDOUT_FILENO, fdp[STDOUT_FILENO][1]);
 1029|  3.85k|	if (fdp[STDOUT_FILENO][0] > 2)
  ------------------
  |  Branch (1029:6): [True: 3.85k, False: 0]
  ------------------
 1030|  3.85k|		closedesc(v, fdp[STDOUT_FILENO][0]);
 1031|       |
 1032|  3.85k|	file_clear_closexec(STDOUT_FILENO);
 1033|       |
 1034|  3.85k|	movedesc(v, STDERR_FILENO, fdp[STDERR_FILENO][1]);
 1035|  3.85k|	if (fdp[STDERR_FILENO][0] > 2)
  ------------------
  |  Branch (1035:6): [True: 3.85k, False: 0]
  ------------------
 1036|  3.85k|		closedesc(v, fdp[STDERR_FILENO][0]);
 1037|       |
 1038|       |	file_clear_closexec(STDERR_FILENO);
 1039|  3.85k|}
compress.c:movedesc:
  986|  11.5k|{
  987|  11.5k|	if (fd == i)
  ------------------
  |  Branch (987:6): [True: 0, False: 11.5k]
  ------------------
  988|      0|		return; /* "no dup was necessary" */
  989|  11.5k|#ifdef HAVE_POSIX_SPAWNP
  990|  11.5k|	posix_spawn_file_actions_t *fa = RCAST(posix_spawn_file_actions_t *, v);
  ------------------
  |  |  453|  11.5k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
  991|  11.5k|	posix_spawn_file_actions_adddup2(fa, fd, i);
  992|  11.5k|	posix_spawn_file_actions_addclose(fa, fd);
  993|       |#else
  994|       |	if (dup2(fd, i) == -1) {
  995|       |		DPRINTF("dup(%d, %d) failed (%s)\n", fd, i, strerror(errno));
  996|       |		exit(EXIT_FAILURE);
  997|       |	}
  998|       |	close(v ? fd : fd);
  999|       |#endif
 1000|  11.5k|}
compress.c:closedesc:
 1004|  11.5k|{
 1005|  11.5k|#ifdef HAVE_POSIX_SPAWNP
 1006|  11.5k|	posix_spawn_file_actions_t *fa = RCAST(posix_spawn_file_actions_t *, v);
  ------------------
  |  |  453|  11.5k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 1007|  11.5k|	posix_spawn_file_actions_addclose(fa, fd);
 1008|       |#else
 1009|       |	close(v ? fd : fd);
 1010|       |#endif
 1011|  11.5k|}
compress.c:closefd:
  969|  30.9k|{
  970|  30.9k|	if (fd[i] == -1)
  ------------------
  |  Branch (970:6): [True: 7.85k, False: 23.0k]
  ------------------
  971|  7.85k|		return;
  972|  23.0k|	(void) close(fd[i]);
  973|  23.0k|	fd[i] = -1;
  974|  23.0k|}
compress.c:writechild:
 1043|  3.84k|{
 1044|  3.84k|	pid_t pid;
 1045|       |
 1046|       |	/*
 1047|       |	 * fork again, to avoid blocking because both
 1048|       |	 * pipes filled
 1049|       |	 */
 1050|  3.84k|	pid = fork();
 1051|  3.84k|	if (pid == -1) {
  ------------------
  |  Branch (1051:6): [True: 0, False: 3.84k]
  ------------------
 1052|      0|		DPRINTF("Fork failed (%s)\n", strerror(errno));
 1053|      0|		return -1;
 1054|      0|	}
 1055|  3.84k|	if (pid == 0) {
  ------------------
  |  Branch (1055:6): [True: 0, False: 3.84k]
  ------------------
 1056|       |		/* child */
 1057|      0|		if (swrite(fd, old, n) != CAST(ssize_t, n)) {
  ------------------
  |  |  452|      0|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (1057:7): [True: 0, False: 0]
  ------------------
 1058|      0|			DPRINTF("Write failed (%s)\n", strerror(errno));
 1059|      0|			exit(EXIT_FAILURE);
 1060|      0|		}
 1061|      0|		exit(EXIT_SUCCESS);
 1062|      0|	}
 1063|       |	/* parent */
 1064|  3.84k|	return pid;
 1065|  3.84k|}
compress.c:filter_error:
 1069|    661|{
 1070|    661|	char *p;
 1071|    661|	char *buf;
 1072|       |
 1073|    661|	ubuf[n] = '\0';
 1074|    661|	buf = RCAST(char *, ubuf);
  ------------------
  |  |  453|    661|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 1075|    661|	while (isspace(CAST(unsigned char, *buf)))
  ------------------
  |  Branch (1075:9): [True: 213, False: 661]
  ------------------
 1076|    213|		buf++;
 1077|    661|	DPRINTF("Filter error[[[%s]]]\n", buf);
 1078|    661|	if ((p = strchr(CAST(char *, buf), '\n')) != NULL)
  ------------------
  |  |  452|    661|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (1078:6): [True: 34, False: 627]
  ------------------
 1079|     34|		*p = '\0';
 1080|    661|	if ((p = strchr(CAST(char *, buf), ';')) != NULL)
  ------------------
  |  |  452|    661|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (1080:6): [True: 0, False: 661]
  ------------------
 1081|      0|		*p = '\0';
 1082|    661|	if ((p = strrchr(CAST(char *, buf), ':')) != NULL) {
  ------------------
  |  |  452|    661|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (1082:6): [True: 57, False: 604]
  ------------------
 1083|     57|		++p;
 1084|     57|		while (isspace(CAST(unsigned char, *p)))
  ------------------
  |  Branch (1084:10): [True: 45, False: 57]
  ------------------
 1085|     45|			p++;
 1086|     57|		n = strlen(p);
 1087|     57|		memmove(ubuf, p, CAST(size_t, n + 1));
  ------------------
  |  |  452|     57|#define CAST(T, b)	((T)(b))
  ------------------
 1088|     57|	}
 1089|    661|	DPRINTF("Filter error after[[[%s]]]\n", (char *)ubuf);
 1090|    661|	if (islower(*ubuf))
  ------------------
  |  Branch (1090:6): [True: 32, False: 629]
  ------------------
 1091|     32|		*ubuf = toupper(*ubuf);
  ------------------
  |  Branch (1091:11): [True: 0, False: 0]
  |  Branch (1091:11): [True: 0, False: 0]
  |  Branch (1091:11): [Folded, False: 32]
  ------------------
 1092|    661|	return n;
 1093|    661|}

der_offs:
  265|  32.6k|{
  266|  32.6k|	const uint8_t *b = RCAST(const uint8_t *, ms->search.s);
  ------------------
  |  |  453|  32.6k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
  267|  32.6k|	size_t offs = 0, len = ms->search.s_len ? ms->search.s_len : nbytes;
  ------------------
  |  Branch (267:25): [True: 32.6k, False: 0]
  ------------------
  268|       |
  269|  32.6k|	if (gettag(b, &offs, len) == DER_BAD) {
  ------------------
  |  |   62|  32.6k|#define DER_BAD	CAST(uint32_t, -1)
  |  |  ------------------
  |  |  |  |  452|  32.6k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (269:6): [True: 0, False: 32.6k]
  ------------------
  270|      0|		DPRINTF(("%s: bad tag 1\n", __func__));
  271|      0|		return -1;
  272|      0|	}
  273|  32.6k|	DPRINTF(("%s1: %u %" SIZE_T_FORMAT "u %d\n", __func__, ms->offset,
  274|  32.6k|	    offs, m->offset));
  275|       |
  276|  32.6k|	uint32_t tlen = getlength(b, &offs, len);
  277|  32.6k|	if (tlen == DER_BAD) {
  ------------------
  |  |   62|  32.6k|#define DER_BAD	CAST(uint32_t, -1)
  |  |  ------------------
  |  |  |  |  452|  32.6k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (277:6): [True: 0, False: 32.6k]
  ------------------
  278|      0|		DPRINTF(("%s: bad tag 2\n", __func__));
  279|      0|		return -1;
  280|      0|	}
  281|  32.6k|	DPRINTF(("%s2: %u %" SIZE_T_FORMAT "u %u\n", __func__, ms->offset,
  282|  32.6k|	    offs, tlen));
  283|       |
  284|  32.6k|	offs += ms->offset + m->offset;
  285|  32.6k|	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|  32.6k|	if (m->cont_level != 0) {
  ------------------
  |  Branch (292:6): [True: 4.58k, False: 28.1k]
  ------------------
  293|  4.58k|		if (offs + tlen > nbytes)
  ------------------
  |  Branch (293:7): [True: 0, False: 4.58k]
  ------------------
  294|      0|			return -1;
  295|  4.58k|		ms->c.li[m->cont_level - 1].off = CAST(int, offs + tlen);
  ------------------
  |  |  452|  4.58k|#define CAST(T, b)	((T)(b))
  ------------------
  296|  4.58k|		DPRINTF(("cont_level[%u] = %d\n", m->cont_level - 1,
  297|  4.58k|		    ms->c.li[m->cont_level - 1].off));
  298|  4.58k|	}
  299|  32.6k|	return CAST(int32_t, offs);
  ------------------
  |  |  452|  32.6k|#define CAST(T, b)	((T)(b))
  ------------------
  300|  32.6k|}
der_cmp:
  304|   523k|{
  305|   523k|	const uint8_t *b = RCAST(const uint8_t *, ms->search.s);
  ------------------
  |  |  453|   523k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
  306|   523k|	const char *s = m->value.s;
  307|   523k|	size_t offs = 0, len = ms->search.s_len;
  308|   523k|	uint32_t tag, tlen;
  309|   523k|	char buf[128];
  310|       |
  311|   523k|	DPRINTF(("%s: compare %zu bytes\n", __func__, len));
  312|       |
  313|   523k|	tag = gettag(b, &offs, len);
  314|   523k|	if (tag == DER_BAD) {
  ------------------
  |  |   62|   523k|#define DER_BAD	CAST(uint32_t, -1)
  |  |  ------------------
  |  |  |  |  452|   523k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (314:6): [True: 4.54k, False: 519k]
  ------------------
  315|  4.54k|		DPRINTF(("%s: bad tag 1\n", __func__));
  316|  4.54k|		return -1;
  317|  4.54k|	}
  318|       |
  319|   519k|	DPRINTF(("%s1: %d %" SIZE_T_FORMAT "u %d\n", __func__, ms->offset,
  320|   519k|	    offs, m->offset));
  321|       |
  322|   519k|	tlen = getlength(b, &offs, len);
  323|   519k|	if (tlen == DER_BAD) {
  ------------------
  |  |   62|   519k|#define DER_BAD	CAST(uint32_t, -1)
  |  |  ------------------
  |  |  |  |  452|   519k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (323:6): [True: 181k, False: 337k]
  ------------------
  324|   181k|		DPRINTF(("%s: bad tag 2\n", __func__));
  325|   181k|		return -1;
  326|   181k|	}
  327|       |
  328|   337k|	der_tag(buf, sizeof(buf), tag);
  329|   337k|	if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|   337k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (329:6): [True: 0, False: 337k]
  ------------------
  330|      0|		fprintf(stderr, "%s: tag %p got=%s exp=%s\n", __func__, b,
  331|      0|		    buf, s);
  332|   337k|	size_t slen = strlen(buf);
  333|       |
  334|   337k|	if (strncmp(buf, s, slen) != 0) {
  ------------------
  |  Branch (334:6): [True: 300k, False: 36.8k]
  ------------------
  335|   300k|		DPRINTF(("%s: no string match %s != %s\n", __func__, buf, s));
  336|   300k|		return 0;
  337|   300k|	}
  338|       |
  339|  36.8k|	s += slen;
  340|       |
  341|  38.2k|again:
  342|  38.2k|	switch (*s) {
  343|  31.9k|	case '\0':
  ------------------
  |  Branch (343:2): [True: 31.9k, False: 6.29k]
  ------------------
  344|  31.9k|		DPRINTF(("%s: EOF match\n", __func__));
  345|  31.9k|		return 1;
  346|  1.70k|	case '=':
  ------------------
  |  Branch (346:2): [True: 1.70k, False: 36.5k]
  ------------------
  347|  1.70k|		s++;
  348|  1.70k|		goto val;
  349|  4.58k|	default:
  ------------------
  |  Branch (349:2): [True: 4.58k, False: 33.6k]
  ------------------
  350|  4.58k|		if (!isdigit(CAST(unsigned char, *s))) {
  ------------------
  |  Branch (350:7): [True: 0, False: 4.58k]
  ------------------
  351|      0|			DPRINTF(("%s: no digit %c\n", __func__, *s));
  352|      0|			return 0;
  353|      0|		}
  354|       |
  355|  4.58k|		slen = 0;
  356|  4.58k|		do
  357|  7.14k|			slen = slen * 10 + *s - '0';
  358|  4.58k|		while (isdigit(CAST(unsigned char, *++s)));
  ------------------
  |  Branch (358:10): [True: 2.56k, False: 4.58k]
  ------------------
  359|  4.58k|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  4.58k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (359:7): [True: 0, False: 4.58k]
  ------------------
  360|      0|			fprintf(stderr, "%s: len %" SIZE_T_FORMAT "u %u\n",
  361|      0|			    __func__, slen, tlen);
  362|  4.58k|		if (tlen != slen) {
  ------------------
  |  Branch (362:7): [True: 3.13k, False: 1.45k]
  ------------------
  363|  3.13k|			DPRINTF(("%s: len %u != %zu\n", __func__, tlen, slen));
  364|  3.13k|			return 0;
  365|  3.13k|		}
  366|  1.45k|		goto again;
  367|  38.2k|	}
  368|  1.70k|val:
  369|  1.70k|	DPRINTF(("%s: before data %" SIZE_T_FORMAT "u %u\n", __func__, offs,
  370|  1.70k|	    tlen));
  371|  1.70k|	der_data(buf, sizeof(buf), tag, b + offs, tlen);
  372|  1.70k|	if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  1.70k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (372:6): [True: 0, False: 1.70k]
  ------------------
  373|      0|		fprintf(stderr, "%s: data %s %s\n", __func__, buf, s);
  374|  1.70k|	if (strcmp(buf, s) != 0 && strcmp("x", s) != 0) {
  ------------------
  |  Branch (374:6): [True: 1.33k, False: 373]
  |  Branch (374:29): [True: 975, False: 355]
  ------------------
  375|    975|		DPRINTF(("%s: no string match %s != %s\n", __func__, buf, s));
  376|    975|		return 0;
  377|    975|	}
  378|    728|	strlcpy(ms->ms_value.s, buf, sizeof(ms->ms_value.s));
  379|    728|	DPRINTF(("%s: complete match\n", __func__));
  380|    728|	return 1;
  381|  1.70k|}
der.c:gettag:
  150|   556k|{
  151|   556k|	uint32_t tag;
  152|       |
  153|   556k|	if (c == NULL || *p >= l)
  ------------------
  |  Branch (153:6): [True: 0, False: 556k]
  |  Branch (153:19): [True: 1.36k, False: 554k]
  ------------------
  154|  1.36k|		return DER_BAD;
  ------------------
  |  |   62|  1.36k|#define DER_BAD	CAST(uint32_t, -1)
  |  |  ------------------
  |  |  |  |  452|  1.36k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  155|       |
  156|   554k|	tag = c[(*p)++] & 0x1f;
  157|       |
  158|   554k|	if (tag != 0x1f)
  ------------------
  |  Branch (158:6): [True: 483k, False: 71.9k]
  ------------------
  159|   483k|		return tag;
  160|       |
  161|  71.9k|	if (*p >= l)
  ------------------
  |  Branch (161:6): [True: 390, False: 71.5k]
  ------------------
  162|    390|		return DER_BAD;
  ------------------
  |  |   62|    390|#define DER_BAD	CAST(uint32_t, -1)
  |  |  ------------------
  |  |  |  |  452|    390|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  163|       |
  164|  1.31G|	while (c[*p] >= 0x80) {
  ------------------
  |  Branch (164:9): [True: 1.31G, False: 69.1k]
  ------------------
  165|  1.31G|		tag = tag * 128 + c[(*p)++] - 0x80;
  166|  1.31G|		if (*p >= l)
  ------------------
  |  Branch (166:7): [True: 2.37k, False: 1.31G]
  ------------------
  167|  2.37k|			return DER_BAD;
  ------------------
  |  |   62|  2.37k|#define DER_BAD	CAST(uint32_t, -1)
  |  |  ------------------
  |  |  |  |  452|  2.37k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  168|  1.31G|	}
  169|  69.1k|	return tag;
  170|  71.5k|}
der.c:getlength:
  183|   551k|{
  184|   551k|	uint8_t digits, i;
  185|   551k|	size_t len;
  186|   551k|	int is_onebyte_result;
  187|       |
  188|   551k|	if (*p >= l) {
  ------------------
  |  Branch (188:6): [True: 2.67k, False: 549k]
  ------------------
  189|  2.67k|		DPRINTF(("%s:[1] %zu >= %zu\n", __func__, *p, l));
  190|  2.67k|		return DER_BAD;
  ------------------
  |  |   62|  2.67k|#define DER_BAD	CAST(uint32_t, -1)
  |  |  ------------------
  |  |  |  |  452|  2.67k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  191|  2.67k|	}
  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|   549k|	is_onebyte_result = (c[*p] & 0x80) == 0;
  199|   549k|	digits = c[(*p)++] & 0x7f;
  200|   549k|	if (*p + digits >= l) {
  ------------------
  |  Branch (200:6): [True: 126k, False: 423k]
  ------------------
  201|   126k|		DPRINTF(("%s:[2] %zu + %u >= %zu\n", __func__, *p, digits, l));
  202|   126k|		return DER_BAD;
  ------------------
  |  |   62|   126k|#define DER_BAD	CAST(uint32_t, -1)
  |  |  ------------------
  |  |  |  |  452|   126k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  203|   126k|	}
  204|       |
  205|   423k|	if (is_onebyte_result)
  ------------------
  |  Branch (205:6): [True: 319k, False: 103k]
  ------------------
  206|   319k|		return digits;
  207|       |
  208|       |	/*
  209|       |	 * Decode len. We've already verified that we're allowed to read
  210|       |	 * `digits` bytes.
  211|       |	 */
  212|   103k|	len = 0;
  213|  9.34M|	for (i = 0; i < digits; i++)
  ------------------
  |  Branch (213:14): [True: 9.23M, False: 103k]
  ------------------
  214|  9.23M|		len = (len << 8) | c[(*p)++];
  215|       |
  216|   103k|	if (len > UINT32_MAX - *p || *p + len > l) {
  ------------------
  |  Branch (216:6): [True: 49.4k, False: 54.0k]
  |  Branch (216:31): [True: 3.37k, False: 50.6k]
  ------------------
  217|  52.8k|		DPRINTF(("%s:[3] bad len %zu + %zu >= %zu\n",
  218|  52.8k|		    __func__, *p, len, l));
  219|  52.8k|		return DER_BAD;
  ------------------
  |  |   62|  52.8k|#define DER_BAD	CAST(uint32_t, -1)
  |  |  ------------------
  |  |  |  |  452|  52.8k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  220|  52.8k|	}
  221|  50.6k|	return CAST(uint32_t, len);
  ------------------
  |  |  452|  50.6k|#define CAST(T, b)	((T)(b))
  ------------------
  222|   103k|}
der.c:der_tag:
  226|   337k|{
  227|   337k|	if (tag < DER_TAG_LAST)
  ------------------
  |  |  115|   337k|#define	DER_TAG_LAST			0x25
  ------------------
  |  Branch (227:6): [True: 294k, False: 43.0k]
  ------------------
  228|   294k|		strlcpy(buf, der__tag[tag], len);
  229|  43.0k|	else
  230|  43.0k|		snprintf(buf, len, "%#x", tag);
  231|   337k|	return buf;
  232|   337k|}
der.c:der_data:
  237|  1.70k|{
  238|  1.70k|	uint32_t i;
  239|  1.70k|	const uint8_t *d = CAST(const uint8_t *, q);
  ------------------
  |  |  452|  1.70k|#define CAST(T, b)	((T)(b))
  ------------------
  240|  1.70k|	switch (tag) {
  241|    172|	case DER_TAG_PRINTABLE_STRING:
  ------------------
  |  |   97|    172|#define	DER_TAG_PRINTABLE_STRING	0x13
  ------------------
  |  Branch (241:2): [True: 172, False: 1.53k]
  ------------------
  242|    251|	case DER_TAG_UTF8_STRING:
  ------------------
  |  |   90|    251|#define	DER_TAG_UTF8_STRING		0x0c
  ------------------
  |  Branch (242:2): [True: 79, False: 1.62k]
  ------------------
  243|    251|	case DER_TAG_IA5_STRING:
  ------------------
  |  |  100|    251|#define	DER_TAG_IA5_STRING		0x16
  ------------------
  |  Branch (243:2): [True: 0, False: 1.70k]
  ------------------
  244|    251|		return snprintf(buf, blen, "%.*s", len, RCAST(const char *, q));
  ------------------
  |  |  453|    251|#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.70k]
  ------------------
  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.45k|	default:
  ------------------
  |  Branch (251:2): [True: 1.45k, False: 251]
  ------------------
  252|  1.45k|		break;
  253|  1.70k|	}
  254|       |
  255|  6.34k|	for (i = 0; i < len; i++) {
  ------------------
  |  Branch (255:14): [True: 4.89k, False: 1.45k]
  ------------------
  256|  4.89k|		uint32_t z = i << 1;
  257|  4.89k|		if (z < blen - 2)
  ------------------
  |  Branch (257:7): [True: 4.34k, False: 548]
  ------------------
  258|  4.34k|			snprintf(buf + z, blen - z, "%.2x", d[i]);
  259|  4.89k|	}
  260|  1.45k|	return len * 2;
  261|  1.70k|}

file_encoding:
   78|  25.5k|{
   79|  25.5k|	const unsigned char *buf = CAST(const unsigned char *, b->fbuf);
  ------------------
  |  |  452|  25.5k|#define CAST(T, b)	((T)(b))
  ------------------
   80|  25.5k|	size_t nbytes = b->flen;
   81|  25.5k|	size_t mlen;
   82|  25.5k|	int rv = 1, ucs_type;
   83|  25.5k|	file_unichar_t *udefbuf;
   84|  25.5k|	size_t udeflen;
   85|       |
   86|  25.5k|	if (buf == NULL)
  ------------------
  |  Branch (86:6): [True: 0, False: 25.5k]
  ------------------
   87|      0|		return 0;
   88|  25.5k|	if (ubuf == NULL)
  ------------------
  |  Branch (88:6): [True: 14.4k, False: 11.1k]
  ------------------
   89|  14.4k|		ubuf = &udefbuf;
   90|  25.5k|	if (ulen == NULL)
  ------------------
  |  Branch (90:6): [True: 14.4k, False: 11.1k]
  ------------------
   91|  14.4k|		ulen = &udeflen;
   92|       |
   93|  25.5k|	*type = "text";
   94|  25.5k|	*ulen = 0;
   95|  25.5k|	*code = "unknown";
   96|  25.5k|	*code_mime = "binary";
   97|       |
   98|  25.5k|	if (nbytes > ms->encoding_max)
  ------------------
  |  Branch (98:6): [True: 1.99k, False: 23.5k]
  ------------------
   99|  1.99k|		nbytes = ms->encoding_max;
  100|       |
  101|  25.5k|	mlen = (nbytes + 1) * sizeof((*ubuf)[0]);
  102|  25.5k|	*ubuf = CAST(file_unichar_t *, calloc(CAST(size_t, 1), mlen));
  ------------------
  |  |  452|  25.5k|#define CAST(T, b)	((T)(b))
  ------------------
  103|  25.5k|	if (*ubuf == NULL) {
  ------------------
  |  Branch (103:6): [True: 0, False: 25.5k]
  ------------------
  104|      0|		file_oomem(ms, mlen);
  105|      0|		goto done;
  106|      0|	}
  107|  25.5k|	if (looks_ascii(buf, nbytes, *ubuf, ulen)) {
  ------------------
  |  Branch (107:6): [True: 1.89k, False: 23.6k]
  ------------------
  108|  1.89k|		if (looks_utf7(buf, nbytes, *ubuf, ulen) > 0) {
  ------------------
  |  Branch (108:7): [True: 12, False: 1.88k]
  ------------------
  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|  1.88k|		} else {
  113|  1.88k|			DPRINTF(("ascii %" SIZE_T_FORMAT "u\n", *ulen));
  114|  1.88k|			*code = "ASCII";
  115|  1.88k|			*code_mime = "us-ascii";
  116|  1.88k|		}
  117|  23.6k|	} else if (looks_utf8_with_BOM(buf, nbytes, *ubuf, ulen) > 0) {
  ------------------
  |  Branch (117:13): [True: 11, False: 23.6k]
  ------------------
  118|     11|		DPRINTF(("utf8/bom %" SIZE_T_FORMAT "u\n", *ulen));
  119|     11|		*code = "Unicode text, UTF-8 (with BOM)";
  120|     11|		*code_mime = "utf-8";
  121|  23.6k|	} else if (file_looks_utf8(buf, nbytes, *ubuf, ulen) > 1) {
  ------------------
  |  Branch (121:13): [True: 178, False: 23.5k]
  ------------------
  122|    178|		DPRINTF(("utf8 %" SIZE_T_FORMAT "u\n", *ulen));
  123|    178|		*code = "Unicode text, UTF-8";
  124|    178|		*code_mime = "utf-8";
  125|  23.5k|	} else if ((ucs_type = looks_ucs32(buf, nbytes, *ubuf, ulen)) != 0) {
  ------------------
  |  Branch (125:13): [True: 379, False: 23.1k]
  ------------------
  126|    379|		if (ucs_type == 1) {
  ------------------
  |  Branch (126:7): [True: 195, False: 184]
  ------------------
  127|    195|			*code = "Unicode text, UTF-32, little-endian";
  128|    195|			*code_mime = "utf-32le";
  129|    195|		} else {
  130|    184|			*code = "Unicode text, UTF-32, big-endian";
  131|    184|			*code_mime = "utf-32be";
  132|    184|		}
  133|    379|		DPRINTF(("ucs32 %" SIZE_T_FORMAT "u\n", *ulen));
  134|  23.1k|	} else if ((ucs_type = looks_ucs16(buf, nbytes, *ubuf, ulen)) != 0) {
  ------------------
  |  Branch (134:13): [True: 422, False: 22.7k]
  ------------------
  135|    422|		if (ucs_type == 1) {
  ------------------
  |  Branch (135:7): [True: 263, False: 159]
  ------------------
  136|    263|			*code = "Unicode text, UTF-16, little-endian";
  137|    263|			*code_mime = "utf-16le";
  138|    263|		} else {
  139|    159|			*code = "Unicode text, UTF-16, big-endian";
  140|    159|			*code_mime = "utf-16be";
  141|    159|		}
  142|    422|		DPRINTF(("ucs16 %" SIZE_T_FORMAT "u\n", *ulen));
  143|  22.7k|	} else if (looks_latin1(buf, nbytes, *ubuf, ulen)) {
  ------------------
  |  Branch (143:13): [True: 988, False: 21.7k]
  ------------------
  144|    988|		DPRINTF(("latin1 %" SIZE_T_FORMAT "u\n", *ulen));
  145|    988|		*code = "ISO-8859";
  146|    988|		*code_mime = "iso-8859-1";
  147|  21.7k|	} else if (looks_extended(buf, nbytes, *ubuf, ulen)) {
  ------------------
  |  Branch (147:13): [True: 475, False: 21.2k]
  ------------------
  148|    475|		DPRINTF(("extended %" SIZE_T_FORMAT "u\n", *ulen));
  149|    475|		*code = "Non-ISO extended-ASCII";
  150|    475|		*code_mime = "unknown-8bit";
  151|  21.2k|	} else {
  152|  21.2k|		unsigned char *nbuf;
  153|       |
  154|  21.2k|		mlen = (nbytes + 1) * sizeof(nbuf[0]);
  155|  21.2k|		if ((nbuf = CAST(unsigned char *, malloc(mlen))) == NULL) {
  ------------------
  |  |  452|  21.2k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (155:7): [True: 0, False: 21.2k]
  ------------------
  156|      0|			file_oomem(ms, mlen);
  157|      0|			goto done;
  158|      0|		}
  159|  21.2k|		from_ebcdic(buf, nbytes, nbuf);
  160|       |
  161|  21.2k|		if (looks_ascii(nbuf, nbytes, *ubuf, ulen)) {
  ------------------
  |  Branch (161:7): [True: 98, False: 21.1k]
  ------------------
  162|     98|			DPRINTF(("ebcdic %" SIZE_T_FORMAT "u\n", *ulen));
  163|     98|			*code = "EBCDIC";
  164|     98|			*code_mime = "ebcdic";
  165|  21.1k|		} else if (looks_latin1(nbuf, nbytes, *ubuf, ulen)) {
  ------------------
  |  Branch (165:14): [True: 70, False: 21.0k]
  ------------------
  166|     70|			DPRINTF(("ebcdic/international %" SIZE_T_FORMAT "u\n",
  167|     70|			    *ulen));
  168|     70|			*code = "International EBCDIC";
  169|     70|			*code_mime = "ebcdic";
  170|  21.0k|		} else { /* Doesn't look like text at all */
  171|  21.0k|			DPRINTF(("binary\n"));
  172|  21.0k|			rv = 0;
  173|  21.0k|			*type = "binary";
  174|  21.0k|		}
  175|  21.2k|		free(nbuf);
  176|  21.2k|	}
  177|       |
  178|  25.5k| done:
  179|  25.5k|	if (ubuf == &udefbuf)
  ------------------
  |  Branch (179:6): [True: 14.4k, False: 11.1k]
  ------------------
  180|  14.4k|		free(udefbuf);
  181|       |
  182|  25.5k|	return rv;
  183|  25.5k|}
file_looks_utf8:
  358|  23.7k|{
  359|  23.7k|	size_t i;
  360|  23.7k|	int n;
  361|  23.7k|	file_unichar_t c;
  362|  23.7k|	int gotone = 0, ctrl = 0;
  363|       |
  364|  23.7k|	if (ubuf)
  ------------------
  |  Branch (364:6): [True: 23.7k, False: 0]
  ------------------
  365|  23.7k|		*ulen = 0;
  366|       |
  367|  29.9M|	for (i = 0; i < nbytes; i++) {
  ------------------
  |  Branch (367:14): [True: 29.9M, False: 1.90k]
  ------------------
  368|  29.9M|		if ((buf[i] & 0x80) == 0) {	   /* 0xxxxxxx is plain ASCII */
  ------------------
  |  Branch (368:7): [True: 29.7M, False: 200k]
  ------------------
  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|  29.7M|			if (text_chars[buf[i]] != T)
  ------------------
  |  |  238|  29.7M|#define T 1   /* character appears in plain ASCII text */
  ------------------
  |  Branch (374:8): [True: 24.9M, False: 4.85M]
  ------------------
  375|  24.9M|				ctrl = 1;
  376|       |
  377|  29.7M|			if (ubuf)
  ------------------
  |  Branch (377:8): [True: 29.7M, False: 0]
  ------------------
  378|  29.7M|				ubuf[(*ulen)++] = buf[i];
  379|  29.7M|		} else if ((buf[i] & 0x40) == 0) { /* 10xxxxxx never 1st byte */
  ------------------
  |  Branch (379:14): [True: 12.9k, False: 187k]
  ------------------
  380|  12.9k|			return -1;
  381|   187k|		} else {			   /* 11xxxxxx begins UTF-8 */
  382|   187k|			int following;
  383|   187k|			uint8_t x = first[buf[i]];
  384|   187k|			const struct accept_range *ar =
  385|   187k|			    &accept_ranges[(unsigned int)x >> 4];
  386|   187k|			if (x == XX)
  ------------------
  |  |  306|   187k|#define	XX 0xF1 // invalid: size 1
  ------------------
  |  Branch (386:8): [True: 3.46k, False: 184k]
  ------------------
  387|  3.46k|				return -1;
  388|       |
  389|   184k|			if ((buf[i] & 0x20) == 0) {		/* 110xxxxx */
  ------------------
  |  Branch (389:8): [True: 161k, False: 22.8k]
  ------------------
  390|   161k|				c = buf[i] & 0x1f;
  391|   161k|				following = 1;
  392|   161k|			} else if ((buf[i] & 0x10) == 0) {	/* 1110xxxx */
  ------------------
  |  Branch (392:15): [True: 19.5k, False: 3.30k]
  ------------------
  393|  19.5k|				c = buf[i] & 0x0f;
  394|  19.5k|				following = 2;
  395|  19.5k|			} else if ((buf[i] & 0x08) == 0) {	/* 11110xxx */
  ------------------
  |  Branch (395:15): [True: 3.30k, False: 0]
  ------------------
  396|  3.30k|				c = buf[i] & 0x07;
  397|  3.30k|				following = 3;
  398|  3.30k|			} 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|   388k|			for (n = 0; n < following; n++) {
  ------------------
  |  Branch (407:16): [True: 209k, False: 178k]
  ------------------
  408|   209k|				i++;
  409|   209k|				if (i >= nbytes)
  ------------------
  |  Branch (409:9): [True: 243, False: 209k]
  ------------------
  410|    243|					goto done;
  411|       |
  412|   209k|				if (n == 0 &&
  ------------------
  |  Branch (412:9): [True: 184k, False: 25.1k]
  ------------------
  413|   184k|				     (buf[i] < ar->lo || buf[i] > ar->hi))
  ------------------
  |  Branch (413:11): [True: 861, False: 183k]
  |  Branch (413:30): [True: 4.18k, False: 179k]
  ------------------
  414|  5.04k|					return -1;
  415|       |
  416|   204k|				if ((buf[i] & 0x80) == 0 || (buf[i] & 0x40))
  ------------------
  |  Branch (416:9): [True: 71, False: 204k]
  |  Branch (416:33): [True: 59, False: 204k]
  ------------------
  417|    130|					return -1;
  418|       |
  419|   204k|				c = (c << 6) + (buf[i] & 0x3f);
  420|   204k|			}
  421|       |
  422|   178k|			if (ubuf)
  ------------------
  |  Branch (422:8): [True: 178k, False: 0]
  ------------------
  423|   178k|				ubuf[(*ulen)++] = c;
  424|   178k|			gotone = 1;
  425|   178k|		}
  426|  29.9M|	}
  427|  2.14k|done:
  428|  2.14k|	return ctrl ? 0 : (gotone ? 2 : 1);
  ------------------
  |  Branch (428:9): [True: 1.85k, False: 295]
  |  Branch (428:21): [True: 180, False: 115]
  ------------------
  429|  23.7k|}
encoding.c:looks_ascii:
  271|  46.8k|    size_t *ulen) \
  272|  46.8k|{ \
  273|  46.8k|	size_t i; \
  274|  46.8k|\
  275|  46.8k|	*ulen = 0; \
  276|  46.8k|\
  277|  21.0M|	for (i = 0; i < nbytes; i++) { \
  ------------------
  |  Branch (277:14): [True: 21.0M, False: 1.99k]
  ------------------
  278|  21.0M|		int t = text_chars[buf[i]]; \
  279|  21.0M|\
  280|  21.0M|		if (COND) \
  ------------------
  |  Branch (280:7): [True: 44.8k, False: 20.9M]
  ------------------
  281|  21.0M|			return 0; \
  282|  21.0M|\
  283|  21.0M|		ubuf[(*ulen)++] = buf[i]; \
  284|  20.9M|	} \
  285|  46.8k|	return 1; \
  286|  46.8k|}
encoding.c:looks_latin1:
  271|  43.8k|    size_t *ulen) \
  272|  43.8k|{ \
  273|  43.8k|	size_t i; \
  274|  43.8k|\
  275|  43.8k|	*ulen = 0; \
  276|  43.8k|\
  277|  11.0M|	for (i = 0; i < nbytes; i++) { \
  ------------------
  |  Branch (277:14): [True: 11.0M, False: 1.05k]
  ------------------
  278|  11.0M|		int t = text_chars[buf[i]]; \
  279|  11.0M|\
  280|  30.5M|		if (COND) \
  ------------------
  |  Branch (280:7): [True: 8.40M, False: 2.68M]
  |  Branch (280:7): [True: 42.7k, False: 8.35M]
  ------------------
  281|  11.0M|			return 0; \
  282|  11.0M|\
  283|  11.0M|		ubuf[(*ulen)++] = buf[i]; \
  284|  11.0M|	} \
  285|  43.8k|	return 1; \
  286|  43.8k|}
encoding.c:looks_extended:
  271|  21.7k|    size_t *ulen) \
  272|  21.7k|{ \
  273|  21.7k|	size_t i; \
  274|  21.7k|\
  275|  21.7k|	*ulen = 0; \
  276|  21.7k|\
  277|  2.66M|	for (i = 0; i < nbytes; i++) { \
  ------------------
  |  Branch (277:14): [True: 2.66M, False: 475]
  ------------------
  278|  2.66M|		int t = text_chars[buf[i]]; \
  279|  2.66M|\
  280|  10.1M|		if (COND) \
  ------------------
  |  Branch (280:7): [True: 1.51M, False: 1.15M]
  |  Branch (280:7): [True: 623k, False: 891k]
  |  Branch (280:7): [True: 21.2k, False: 602k]
  ------------------
  281|  2.66M|			return 0; \
  282|  2.66M|\
  283|  2.66M|		ubuf[(*ulen)++] = buf[i]; \
  284|  2.64M|	} \
  285|  21.7k|	return 1; \
  286|  21.7k|}
encoding.c:looks_utf8_with_BOM:
  439|  23.6k|{
  440|  23.6k|	if (nbytes > 3 && buf[0] == 0xef && buf[1] == 0xbb && buf[2] == 0xbf)
  ------------------
  |  Branch (440:6): [True: 22.4k, False: 1.27k]
  |  Branch (440:20): [True: 113, False: 22.3k]
  |  Branch (440:38): [True: 102, False: 11]
  |  Branch (440:56): [True: 81, False: 21]
  ------------------
  441|     81|		return file_looks_utf8(buf + 3, nbytes - 3, ubuf, ulen);
  442|  23.6k|	else
  443|  23.6k|		return -1;
  444|  23.6k|}
encoding.c:looks_utf7:
  449|  1.89k|{
  450|  1.89k|	if (nbytes > 4 && buf[0] == '+' && buf[1] == '/' && buf[2] == 'v')
  ------------------
  |  Branch (450:6): [True: 1.12k, False: 774]
  |  Branch (450:20): [True: 44, False: 1.07k]
  |  Branch (450:37): [True: 32, False: 12]
  |  Branch (450:54): [True: 15, False: 17]
  ------------------
  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|  1.88k|	else
  463|  1.88k|		return -1;
  464|  1.89k|}
encoding.c:looks_ucs16:
  475|  23.1k|{
  476|  23.1k|	int bigend;
  477|  23.1k|	uint32_t hi;
  478|  23.1k|	size_t i;
  479|       |
  480|  23.1k|	if (nbytes < 2)
  ------------------
  |  Branch (480:6): [True: 73, False: 23.0k]
  ------------------
  481|     73|		return 0;
  482|       |
  483|  23.0k|	if (bf[0] == 0xff && bf[1] == 0xfe)
  ------------------
  |  Branch (483:6): [True: 1.32k, False: 21.7k]
  |  Branch (483:23): [True: 341, False: 982]
  ------------------
  484|    341|		bigend = 0;
  485|  22.7k|	else if (bf[0] == 0xfe && bf[1] == 0xff)
  ------------------
  |  Branch (485:11): [True: 271, False: 22.4k]
  |  Branch (485:28): [True: 228, False: 43]
  ------------------
  486|    228|		bigend = 1;
  487|  22.4k|	else
  488|  22.4k|		return 0;
  489|       |
  490|    569|	*ulen = 0;
  491|    569|	hi = 0;
  492|       |
  493|  1.12M|	for (i = 2; i + 1 < nbytes; i += 2) {
  ------------------
  |  Branch (493:14): [True: 1.12M, False: 422]
  ------------------
  494|  1.12M|		uint32_t uc;
  495|       |
  496|  1.12M|		if (bigend)
  ------------------
  |  Branch (496:7): [True: 250k, False: 876k]
  ------------------
  497|   250k|			uc = CAST(uint32_t,
  ------------------
  |  |  452|   250k|#define CAST(T, b)	((T)(b))
  ------------------
  498|  1.12M|			    bf[i + 1] | (CAST(file_unichar_t, bf[i]) << 8));
  499|   876k|		else
  500|   876k|			uc = CAST(uint32_t,
  ------------------
  |  |  452|   876k|#define CAST(T, b)	((T)(b))
  ------------------
  501|  1.12M|			    bf[i] | (CAST(file_unichar_t, bf[i + 1]) << 8));
  502|       |
  503|  1.12M|		uc &= 0xffff;
  504|       |
  505|  1.12M|		switch (uc) {
  506|      9|		case 0xfffe:
  ------------------
  |  Branch (506:3): [True: 9, False: 1.12M]
  ------------------
  507|     23|		case 0xffff:
  ------------------
  |  Branch (507:3): [True: 14, False: 1.12M]
  ------------------
  508|     23|			return 0;
  509|  1.12M|		default:
  ------------------
  |  Branch (509:3): [True: 1.12M, False: 23]
  ------------------
  510|  1.12M|			if (UCS16_NOCHAR(uc))
  ------------------
  |  |  466|  1.12M|#define UCS16_NOCHAR(c) ((c) >= 0xfdd0 && (c) <= 0xfdef)
  |  |  ------------------
  |  |  |  Branch (466:26): [True: 76.4k, False: 1.05M]
  |  |  |  Branch (466:43): [True: 15, False: 76.4k]
  |  |  ------------------
  ------------------
  511|     15|				return 0;
  512|  1.12M|			break;
  513|  1.12M|		}
  514|  1.12M|		if (hi) {
  ------------------
  |  Branch (514:7): [True: 11.0k, False: 1.11M]
  ------------------
  515|  11.0k|			if (!UCS16_LOSURR(uc))
  ------------------
  |  |  468|  11.0k|#define UCS16_LOSURR(c) ((c) >= 0xdc00 && (c) <= 0xdfff)
  |  |  ------------------
  |  |  |  Branch (468:26): [True: 11.0k, False: 45]
  |  |  |  Branch (468:43): [True: 11.0k, False: 9]
  |  |  ------------------
  ------------------
  516|     54|				return 0;
  517|  11.0k|			uc = 0x10000 + 0x400 * (hi - 1) + (uc - 0xdc00);
  518|  11.0k|			hi = 0;
  519|  11.0k|		}
  520|  1.12M|		if (NOTTEXT(uc))
  ------------------
  |  |  470|  1.12M|    ((C) < 128 && text_chars[CAST(size_t, (C))] != T && (C) != '\0')
  |  |  ------------------
  |  |  |  |  452|   632k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |                   ((C) < 128 && text_chars[CAST(size_t, (C))] != T && (C) != '\0')
  |  |  ------------------
  |  |  |  |  238|  1.75M|#define T 1   /* character appears in plain ASCII text */
  |  |  ------------------
  |  |  |  Branch (470:6): [True: 632k, False: 493k]
  |  |  |  Branch (470:19): [True: 588k, False: 44.6k]
  |  |  |  Branch (470:57): [True: 26, False: 588k]
  |  |  ------------------
  ------------------
  521|     26|			return 0;
  522|  1.12M|		ubf[(*ulen)++] = uc;
  523|  1.12M|		if (UCS16_HISURR(uc))
  ------------------
  |  |  467|  1.12M|#define UCS16_HISURR(c) ((c) >= 0xd800 && (c) <= 0xdbff)
  |  |  ------------------
  |  |  |  Branch (467:26): [True: 171k, False: 955k]
  |  |  |  Branch (467:43): [True: 11.1k, False: 160k]
  |  |  ------------------
  ------------------
  524|  11.1k|			hi = uc - 0xd800 + 1;
  525|  1.12M|		if (UCS16_LOSURR(uc))
  ------------------
  |  |  468|  1.12M|#define UCS16_LOSURR(c) ((c) >= 0xdc00 && (c) <= 0xdfff)
  |  |  ------------------
  |  |  |  Branch (468:26): [True: 160k, False: 966k]
  |  |  |  Branch (468:43): [True: 29, False: 160k]
  |  |  ------------------
  ------------------
  526|     29|			return 0;
  527|  1.12M|	}
  528|       |
  529|    422|	return 1 + bigend;
  530|    569|}
encoding.c:looks_ucs32:
  536|  23.5k|{
  537|  23.5k|	int bigend;
  538|  23.5k|	file_unichar_t uc;
  539|  23.5k|	size_t i;
  540|       |
  541|  23.5k|	if (nbytes < 4)
  ------------------
  |  Branch (541:6): [True: 1.20k, False: 22.3k]
  ------------------
  542|  1.20k|		return 0;
  543|       |
  544|  22.3k|	if (bf[0] == 0xff && bf[1] == 0xfe && bf[2] == 0 && bf[3] == 0)
  ------------------
  |  Branch (544:6): [True: 1.40k, False: 20.8k]
  |  Branch (544:23): [True: 494, False: 911]
  |  Branch (544:40): [True: 268, False: 226]
  |  Branch (544:54): [True: 210, False: 58]
  ------------------
  545|    210|		bigend = 0;
  546|  22.0k|	else if (bf[0] == 0 && bf[1] == 0 && bf[2] == 0xfe && bf[3] == 0xff)
  ------------------
  |  Branch (546:11): [True: 1.13k, False: 20.9k]
  |  Branch (546:25): [True: 672, False: 461]
  |  Branch (546:39): [True: 235, False: 437]
  |  Branch (546:56): [True: 188, False: 47]
  ------------------
  547|    188|		bigend = 1;
  548|  21.9k|	else
  549|  21.9k|		return 0;
  550|       |
  551|    398|	*ulen = 0;
  552|       |
  553|   394k|	for (i = 4; i + 3 < nbytes; i += 4) {
  ------------------
  |  Branch (553:14): [True: 393k, False: 379]
  ------------------
  554|       |		/* XXX fix to properly handle chars > 65536 */
  555|       |
  556|   393k|		if (bigend)
  ------------------
  |  Branch (556:7): [True: 38.3k, False: 355k]
  ------------------
  557|  38.3k|			ubf[(*ulen)++] = CAST(file_unichar_t, bf[i + 3])
  ------------------
  |  |  452|  38.3k|#define CAST(T, b)	((T)(b))
  ------------------
  558|  38.3k|			    | (CAST(file_unichar_t, bf[i + 2]) << 8)
  ------------------
  |  |  452|  38.3k|#define CAST(T, b)	((T)(b))
  ------------------
  559|  38.3k|			    | (CAST(file_unichar_t, bf[i + 1]) << 16)
  ------------------
  |  |  452|  38.3k|#define CAST(T, b)	((T)(b))
  ------------------
  560|  38.3k|			    | (CAST(file_unichar_t, bf[i]) << 24);
  ------------------
  |  |  452|  38.3k|#define CAST(T, b)	((T)(b))
  ------------------
  561|   355k|		else
  562|   355k|			ubf[(*ulen)++] = CAST(file_unichar_t, bf[i + 0])
  ------------------
  |  |  452|   355k|#define CAST(T, b)	((T)(b))
  ------------------
  563|   355k|			    | (CAST(file_unichar_t, bf[i + 1]) << 8) 
  ------------------
  |  |  452|   355k|#define CAST(T, b)	((T)(b))
  ------------------
  564|   355k|			    | (CAST(file_unichar_t, bf[i + 2]) << 16)
  ------------------
  |  |  452|   355k|#define CAST(T, b)	((T)(b))
  ------------------
  565|   355k|			    | (CAST(file_unichar_t, bf[i + 3]) << 24);
  ------------------
  |  |  452|   355k|#define CAST(T, b)	((T)(b))
  ------------------
  566|       |
  567|   393k|		uc = ubf[*ulen - 1];
  568|   393k|		if (uc == 0xfffe || NOTTEXT(uc))
  ------------------
  |  |  470|   393k|    ((C) < 128 && text_chars[CAST(size_t, (C))] != T && (C) != '\0')
  |  |  ------------------
  |  |  |  |  452|   200k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |                   ((C) < 128 && text_chars[CAST(size_t, (C))] != T && (C) != '\0')
  |  |  ------------------
  |  |  |  |  238|   594k|#define T 1   /* character appears in plain ASCII text */
  |  |  ------------------
  |  |  |  Branch (470:6): [True: 200k, False: 192k]
  |  |  |  Branch (470:19): [True: 199k, False: 1.51k]
  |  |  |  Branch (470:57): [True: 9, False: 199k]
  |  |  ------------------
  ------------------
  |  Branch (568:7): [True: 10, False: 393k]
  ------------------
  569|     19|			return 0;
  570|   393k|	}
  571|       |
  572|    379|	return 1 + bigend;
  573|    398|}
encoding.c:from_ebcdic:
  660|  21.2k|{
  661|  21.2k|	size_t i;
  662|       |
  663|   152M|	for (i = 0; i < nbytes; i++) {
  ------------------
  |  Branch (663:14): [True: 152M, False: 21.2k]
  ------------------
  664|   152M|		out[i] = ebcdic_to_ascii[buf[i]];
  665|   152M|	}
  666|  21.2k|}

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

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

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

file_is_json:
  423|  11.1k|{
  424|  11.1k|	const unsigned char *uc = CAST(const unsigned char *, b->fbuf);
  ------------------
  |  |  452|  11.1k|#define CAST(T, b)	((T)(b))
  ------------------
  425|  11.1k|	const unsigned char *ue = uc + b->flen;
  426|  11.1k|	size_t st[JSON_MAX];
  427|  11.1k|	int mime = ms->flags & MAGIC_MIME;
  ------------------
  |  |   44|  11.1k|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   37|  11.1k|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  ------------------
  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   43|  11.1k|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  ------------------
  ------------------
  428|  11.1k|	int jt;
  429|       |
  430|       |
  431|  11.1k|	if ((ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION)) != 0)
  ------------------
  |  |   45|  11.1k|#define	MAGIC_APPLE		0x0000800 /* Return the Apple creator/type */
  ------------------
              	if ((ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION)) != 0)
  ------------------
  |  |   46|  11.1k|#define	MAGIC_EXTENSION		0x1000000 /* Return a /-separated list of
  ------------------
  |  Branch (431:6): [True: 0, False: 11.1k]
  ------------------
  432|      0|		return 0;
  433|       |
  434|  11.1k|	memset(st, 0, sizeof(st));
  435|       |
  436|  11.1k|	if ((jt = json_parse(&uc, ue, st, 0)) == 0)
  ------------------
  |  Branch (436:6): [True: 11.1k, False: 36]
  ------------------
  437|  11.1k|		return 0;
  438|       |
  439|     36|	if (mime == MAGIC_MIME_ENCODING)
  ------------------
  |  |   43|     36|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  ------------------
  |  Branch (439:6): [True: 0, False: 36]
  ------------------
  440|      0|		return 1;
  441|     36|	if (mime) {
  ------------------
  |  Branch (441:6): [True: 0, False: 36]
  ------------------
  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|     36|	if (file_printf(ms, "%sJSON text data",
  ------------------
  |  Branch (447:6): [True: 0, False: 36]
  ------------------
  448|     36|	    jt == 1 ? "" : "New Line Delimited ") == -1)
  ------------------
  |  Branch (448:6): [True: 24, False: 12]
  ------------------
  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|     36|	return 1;
  462|     36|}
is_json.c:json_parse:
  348|  5.58M|{
  349|  5.58M|	const unsigned char *uc, *ouc;
  350|  5.58M|	int rv = 0;
  351|  5.58M|	int t;
  352|       |
  353|  5.58M|	ouc = uc = json_skip_space(*ucp, ue);
  354|  5.58M|	if (uc == ue)
  ------------------
  |  Branch (354:6): [True: 86, False: 5.58M]
  ------------------
  355|     86|		goto out;
  356|       |
  357|       |	// Avoid recursion
  358|  5.58M|	if (lvl > 500) {
  ------------------
  |  Branch (358:6): [True: 10, False: 5.58M]
  ------------------
  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|  5.58M|	DPRINTF("Parse general: ", uc, *ucp);
  ------------------
  |  |   52|  5.58M|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 5.58M]
  |  |  ------------------
  ------------------
  369|  5.58M|	switch (*uc++) {
  370|   990k|	case '"':
  ------------------
  |  Branch (370:2): [True: 990k, False: 4.59M]
  ------------------
  371|   990k|		rv = json_parse_string(&uc, ue, lvl + 1);
  372|   990k|		t = JSON_STRING;
  ------------------
  |  |   60|   990k|#define JSON_STRING	4
  ------------------
  373|   990k|		break;
  374|   402k|	case '[':
  ------------------
  |  Branch (374:2): [True: 402k, False: 5.17M]
  ------------------
  375|   402k|		rv = json_parse_array(&uc, ue, st, lvl + 1);
  376|   402k|		t = JSON_ARRAY;
  ------------------
  |  |   56|   402k|#define JSON_ARRAY	0
  ------------------
  377|   402k|		break;
  378|  53.8k|	case '{': /* '}' */
  ------------------
  |  Branch (378:2): [True: 53.8k, False: 5.52M]
  ------------------
  379|  53.8k|		rv = json_parse_object(&uc, ue, st, lvl + 1);
  380|  53.8k|		t = JSON_OBJECT;
  ------------------
  |  |   59|  53.8k|#define JSON_OBJECT	3
  ------------------
  381|  53.8k|		break;
  382|    326|	case 't':
  ------------------
  |  Branch (382:2): [True: 326, False: 5.58M]
  ------------------
  383|    326|		rv = json_parse_const(&uc, ue, "true", sizeof("true"), lvl + 1);
  384|    326|		t = JSON_CONSTANT;
  ------------------
  |  |   57|    326|#define JSON_CONSTANT	1
  ------------------
  385|    326|		break;
  386|    302|	case 'f':
  ------------------
  |  Branch (386:2): [True: 302, False: 5.58M]
  ------------------
  387|    302|		rv = json_parse_const(&uc, ue, "false", sizeof("false"),
  388|    302|		    lvl + 1);
  389|    302|		t = JSON_CONSTANT;
  ------------------
  |  |   57|    302|#define JSON_CONSTANT	1
  ------------------
  390|    302|		break;
  391|  1.61M|	case 'n':
  ------------------
  |  Branch (391:2): [True: 1.61M, False: 3.96M]
  ------------------
  392|  1.61M|		rv = json_parse_const(&uc, ue, "null", sizeof("null"), lvl + 1);
  393|  1.61M|		t = JSON_CONSTANT;
  ------------------
  |  |   57|  1.61M|#define JSON_CONSTANT	1
  ------------------
  394|  1.61M|		break;
  395|  2.51M|	default:
  ------------------
  |  Branch (395:2): [True: 2.51M, False: 3.06M]
  ------------------
  396|  2.51M|		--uc;
  397|  2.51M|		rv = json_parse_number(&uc, ue, lvl + 1);
  398|  2.51M|		t = JSON_NUMBER;
  ------------------
  |  |   58|  2.51M|#define JSON_NUMBER	2
  ------------------
  399|  2.51M|		break;
  400|  5.58M|	}
  401|  5.58M|	if (rv)
  ------------------
  |  Branch (401:6): [True: 5.56M, False: 16.8k]
  ------------------
  402|  5.56M|		st[t]++;
  403|  5.58M|	uc = json_skip_space(uc, ue);
  404|  5.58M|out:
  405|  5.58M|	DPRINTF("End general: ", uc, *ucp);
  ------------------
  |  |   52|  5.58M|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 5.58M]
  |  |  ------------------
  ------------------
  406|  5.58M|	*ucp = uc;
  407|  5.58M|	if (lvl == 0) {
  ------------------
  |  Branch (407:6): [True: 11.1k, False: 5.56M]
  ------------------
  408|  11.1k|		if (!rv)
  ------------------
  |  Branch (408:7): [True: 10.7k, False: 373]
  ------------------
  409|  10.7k|			return 0;
  410|    373|		if (uc == ue)
  ------------------
  |  Branch (410:7): [True: 107, False: 266]
  ------------------
  411|    107|			return (st[JSON_ARRAYN] || st[JSON_OBJECT]) ? 1 : 0;
  ------------------
  |  |   61|    107|#define JSON_ARRAYN	5
  ------------------
              			return (st[JSON_ARRAYN] || st[JSON_OBJECT]) ? 1 : 0;
  ------------------
  |  |   59|     95|#define JSON_OBJECT	3
  ------------------
  |  Branch (411:12): [True: 12, False: 95]
  |  Branch (411:31): [True: 12, False: 83]
  ------------------
  412|    266|		if (*ouc == *uc && json_parse(&uc, ue, st, 1))
  ------------------
  |  Branch (412:7): [True: 59, False: 207]
  |  Branch (412:22): [True: 42, False: 17]
  ------------------
  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|     33|#define JSON_OBJECT	3
  ------------------
  |  Branch (413:12): [True: 9, False: 33]
  |  Branch (413:31): [True: 3, False: 30]
  ------------------
  414|    224|		else
  415|    224|			return 0;
  416|    266|	}
  417|  5.56M|	return rv;
  418|  5.58M|}
is_json.c:json_skip_space:
  119|  17.2M|{
  120|  20.2M|	while (uc < ue && json_isspace(*uc))
  ------------------
  |  Branch (120:9): [True: 20.2M, False: 3.54k]
  |  Branch (120:20): [True: 3.05M, False: 17.2M]
  ------------------
  121|  3.05M|		uc++;
  122|  17.2M|	return uc;
  123|  17.2M|}
is_json.c:json_isspace:
   79|  20.2M|{
   80|  20.2M|	switch (uc) {
   81|   185k|	case ' ':
  ------------------
  |  Branch (81:2): [True: 185k, False: 20.1M]
  ------------------
   82|  1.17M|	case '\n':
  ------------------
  |  Branch (82:2): [True: 992k, False: 19.2M]
  ------------------
   83|  2.68M|	case '\r':
  ------------------
  |  Branch (83:2): [True: 1.50M, False: 18.7M]
  ------------------
   84|  3.05M|	case '\t':
  ------------------
  |  Branch (84:2): [True: 365k, False: 19.9M]
  ------------------
   85|  3.05M|		return 1;
   86|  17.2M|	default:
  ------------------
  |  Branch (86:2): [True: 17.2M, False: 3.05M]
  ------------------
   87|  17.2M|		return 0;
   88|  20.2M|	}
   89|  20.2M|}
is_json.c:json_parse_string:
  129|  1.05M|{
  130|  1.05M|	const unsigned char *uc = *ucp;
  131|  1.05M|	size_t i;
  132|       |
  133|  1.05M|	DPRINTF("Parse string: ", uc, *ucp);
  ------------------
  |  |   52|  1.05M|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 1.05M]
  |  |  ------------------
  ------------------
  134|  75.8M|	while (uc < ue) {
  ------------------
  |  Branch (134:9): [True: 75.8M, False: 108]
  ------------------
  135|  75.8M|		switch (*uc++) {
  136|     15|		case '\0':
  ------------------
  |  Branch (136:3): [True: 15, False: 75.8M]
  ------------------
  137|     15|			goto out;
  138|  38.8M|		case '\\':
  ------------------
  |  Branch (138:3): [True: 38.8M, False: 37.0M]
  ------------------
  139|  38.8M|			if (uc == ue)
  ------------------
  |  Branch (139:8): [True: 24, False: 38.8M]
  ------------------
  140|     24|				goto out;
  141|  38.8M|			switch (*uc++) {
  142|      0|			case '\0':
  ------------------
  |  Branch (142:4): [True: 0, False: 38.8M]
  ------------------
  143|      0|				goto out;
  144|  5.77M|			case '"':
  ------------------
  |  Branch (144:4): [True: 5.77M, False: 33.1M]
  ------------------
  145|  9.50M|			case '\\':
  ------------------
  |  Branch (145:4): [True: 3.73M, False: 35.1M]
  ------------------
  146|  20.2M|			case '/':
  ------------------
  |  Branch (146:4): [True: 10.7M, False: 28.1M]
  ------------------
  147|  25.4M|			case 'b':
  ------------------
  |  Branch (147:4): [True: 5.27M, False: 33.5M]
  ------------------
  148|  26.1M|			case 'f':
  ------------------
  |  Branch (148:4): [True: 624k, False: 38.2M]
  ------------------
  149|  29.8M|			case 'n':
  ------------------
  |  Branch (149:4): [True: 3.74M, False: 35.1M]
  ------------------
  150|  33.8M|			case 'r':
  ------------------
  |  Branch (150:4): [True: 3.99M, False: 34.8M]
  ------------------
  151|  38.2M|			case 't':
  ------------------
  |  Branch (151:4): [True: 4.36M, False: 34.5M]
  ------------------
  152|  38.2M|				continue;
  153|   657k|			case 'u':
  ------------------
  |  Branch (153:4): [True: 657k, False: 38.2M]
  ------------------
  154|   657k|				if (ue - uc < 4) {
  ------------------
  |  Branch (154:9): [True: 8, False: 657k]
  ------------------
  155|      8|					uc = ue;
  156|      8|					goto out;
  157|      8|				}
  158|  3.28M|				for (i = 0; i < 4; i++)
  ------------------
  |  Branch (158:17): [True: 2.62M, False: 657k]
  ------------------
  159|  2.62M|					if (!json_isxdigit(*uc++))
  ------------------
  |  Branch (159:10): [True: 24, False: 2.62M]
  ------------------
  160|     24|						goto out;
  161|   657k|				continue;
  162|   657k|			default:
  ------------------
  |  Branch (162:4): [True: 4, False: 38.8M]
  ------------------
  163|      4|				goto out;
  164|  38.8M|			}
  165|  1.05M|		case '"':
  ------------------
  |  Branch (165:3): [True: 1.05M, False: 74.8M]
  ------------------
  166|  1.05M|			DPRINTF("Good string: ", uc, *ucp);
  ------------------
  |  |   52|  1.05M|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 1.05M]
  |  |  ------------------
  ------------------
  167|  1.05M|			*ucp = uc;
  168|  1.05M|			return 1;
  169|  35.9M|		default:
  ------------------
  |  Branch (169:3): [True: 35.9M, False: 39.9M]
  ------------------
  170|  35.9M|			continue;
  171|  75.8M|		}
  172|  75.8M|	}
  173|    183|out:
  174|    183|	DPRINTF("Bad string: ", uc, *ucp);
  ------------------
  |  |   52|    183|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 183]
  |  |  ------------------
  ------------------
  175|    183|	*ucp = uc;
  176|    183|	return 0;
  177|  1.05M|}
is_json.c:json_isxdigit:
  105|  2.62M|{
  106|  2.62M|	if (json_isdigit(uc))
  ------------------
  |  Branch (106:6): [True: 536k, False: 2.09M]
  ------------------
  107|   536k|		return 1;
  108|  2.09M|	switch (uc) {
  109|  1.31M|	case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
  ------------------
  |  Branch (109:2): [True: 109k, False: 1.98M]
  |  Branch (109:12): [True: 505k, False: 1.58M]
  |  Branch (109:22): [True: 58.1k, False: 2.03M]
  |  Branch (109:32): [True: 505k, False: 1.58M]
  |  Branch (109:42): [True: 86.2k, False: 2.00M]
  |  Branch (109:52): [True: 49.3k, False: 2.04M]
  ------------------
  110|  2.09M|	case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
  ------------------
  |  Branch (110:2): [True: 47.3k, False: 2.04M]
  |  Branch (110:12): [True: 10.8k, False: 2.08M]
  |  Branch (110:22): [True: 29.1k, False: 2.06M]
  |  Branch (110:32): [True: 565k, False: 1.52M]
  |  Branch (110:42): [True: 62.4k, False: 2.02M]
  |  Branch (110:52): [True: 62.4k, False: 2.02M]
  ------------------
  111|  2.09M|		return 1;
  112|     24|	default:
  ------------------
  |  Branch (112:2): [True: 24, False: 2.09M]
  ------------------
  113|     24|		return 0;
  114|  2.09M|	}
  115|  2.09M|}
is_json.c:json_isdigit:
   93|  43.1M|{
   94|  43.1M|	switch (uc) {
   95|  32.9M|	case '0': case '1': case '2': case '3': case '4':
  ------------------
  |  Branch (95:2): [True: 28.3M, False: 14.7M]
  |  Branch (95:12): [True: 1.00M, False: 42.1M]
  |  Branch (95:22): [True: 1.09M, False: 42.0M]
  |  Branch (95:32): [True: 2.13M, False: 41.0M]
  |  Branch (95:42): [True: 387k, False: 42.7M]
  ------------------
   96|  33.9M|	case '5': case '6': case '7': case '8': case '9':
  ------------------
  |  Branch (96:2): [True: 143k, False: 43.0M]
  |  Branch (96:12): [True: 572k, False: 42.5M]
  |  Branch (96:22): [True: 37, False: 43.1M]
  |  Branch (96:32): [True: 222k, False: 42.9M]
  |  Branch (96:42): [True: 10, False: 43.1M]
  ------------------
   97|  33.9M|		return 1;
   98|  9.24M|	default:
  ------------------
  |  Branch (98:2): [True: 9.24M, False: 33.9M]
  ------------------
   99|  9.24M|		return 0;
  100|  43.1M|	}
  101|  43.1M|}
is_json.c:json_parse_array:
  182|   402k|{
  183|   402k|	const unsigned char *uc = *ucp;
  184|       |
  185|   402k|	DPRINTF("Parse array: ", uc, *ucp);
  ------------------
  |  |   52|   402k|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 402k]
  |  |  ------------------
  ------------------
  186|  5.90M|	while (uc < ue) {
  ------------------
  |  Branch (186:9): [True: 5.90M, False: 37]
  ------------------
  187|  5.90M|		uc = json_skip_space(uc, ue);
  188|  5.90M|		if (uc == ue)
  ------------------
  |  Branch (188:7): [True: 15, False: 5.90M]
  ------------------
  189|     15|			goto out;
  190|  5.90M|		if (*uc == ']')
  ------------------
  |  Branch (190:7): [True: 396k, False: 5.50M]
  ------------------
  191|   396k|			goto done;
  192|  5.50M|		if (!json_parse(&uc, ue, st, lvl + 1))
  ------------------
  |  Branch (192:7): [True: 5.80k, False: 5.50M]
  ------------------
  193|  5.80k|			goto out;
  194|  5.50M|		if (uc == ue)
  ------------------
  |  Branch (194:7): [True: 46, False: 5.50M]
  ------------------
  195|     46|			goto out;
  196|  5.50M|		switch (*uc) {
  197|  5.50M|		case ',':
  ------------------
  |  Branch (197:3): [True: 5.50M, False: 521]
  ------------------
  198|  5.50M|			uc++;
  199|  5.50M|			continue;
  200|    504|		case ']':
  ------------------
  |  Branch (200:3): [True: 504, False: 5.50M]
  ------------------
  201|   396k|		done:
  202|   396k|			st[JSON_ARRAYN]++;
  ------------------
  |  |   61|   396k|#define JSON_ARRAYN	5
  ------------------
  203|   396k|			DPRINTF("Good array: ", uc, *ucp);
  ------------------
  |  |   52|   396k|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 396k]
  |  |  ------------------
  ------------------
  204|   396k|			*ucp = uc + 1;
  205|   396k|			return 1;
  206|     17|		default:
  ------------------
  |  Branch (206:3): [True: 17, False: 5.50M]
  ------------------
  207|     17|			goto out;
  208|  5.50M|		}
  209|  5.50M|	}
  210|  5.91k|out:
  211|  5.91k|	DPRINTF("Bad array: ", uc,  *ucp);
  ------------------
  |  |   52|  5.91k|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 5.91k]
  |  |  ------------------
  ------------------
  212|  5.91k|	*ucp = uc;
  213|  5.91k|	return 0;
  214|   402k|}
is_json.c:json_parse_object:
  219|  53.8k|{
  220|  53.8k|	const unsigned char *uc = *ucp;
  221|  53.8k|	DPRINTF("Parse object: ", uc, *ucp);
  ------------------
  |  |   52|  53.8k|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 53.8k]
  |  |  ------------------
  ------------------
  222|   115k|	while (uc < ue) {
  ------------------
  |  Branch (222:9): [True: 115k, False: 9]
  ------------------
  223|   115k|		uc = json_skip_space(uc, ue);
  224|   115k|		if (uc == ue)
  ------------------
  |  Branch (224:7): [True: 12, False: 115k]
  ------------------
  225|     12|			goto out;
  226|   115k|		if (*uc == '}') {
  ------------------
  |  Branch (226:7): [True: 53.1k, False: 62.0k]
  ------------------
  227|  53.1k|			uc++;
  228|  53.1k|			goto done;
  229|  53.1k|		}
  230|  62.0k|		if (*uc++ != '"') {
  ------------------
  |  Branch (230:7): [True: 30, False: 62.0k]
  ------------------
  231|     30|			DPRINTF("not string", uc, *ucp);
  ------------------
  |  |   52|     30|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 30]
  |  |  ------------------
  ------------------
  232|     30|			goto out;
  233|     30|		}
  234|  62.0k|		DPRINTF("next field", uc, *ucp);
  ------------------
  |  |   52|  62.0k|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 62.0k]
  |  |  ------------------
  ------------------
  235|  62.0k|		if (!json_parse_string(&uc, ue, lvl)) {
  ------------------
  |  Branch (235:7): [True: 7, False: 62.0k]
  ------------------
  236|      7|			DPRINTF("not string", uc, *ucp);
  ------------------
  |  |   52|      7|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 7]
  |  |  ------------------
  ------------------
  237|      7|			goto out;
  238|      7|		}
  239|  62.0k|		uc = json_skip_space(uc, ue);
  240|  62.0k|		if (uc == ue)
  ------------------
  |  Branch (240:7): [True: 11, False: 62.0k]
  ------------------
  241|     11|			goto out;
  242|  62.0k|		if (*uc++ != ':') {
  ------------------
  |  Branch (242:7): [True: 25, False: 62.0k]
  ------------------
  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|  62.0k|		if (!json_parse(&uc, ue, st, lvl + 1)) {
  ------------------
  |  Branch (246:7): [True: 377, False: 61.6k]
  ------------------
  247|    377|			DPRINTF("not json", uc, *ucp);
  ------------------
  |  |   52|    377|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 377]
  |  |  ------------------
  ------------------
  248|    377|			goto out;
  249|    377|		}
  250|  61.6k|		if (uc == ue)
  ------------------
  |  Branch (250:7): [True: 3, False: 61.6k]
  ------------------
  251|      3|			goto out;
  252|  61.6k|		switch (*uc++) {
  253|  61.4k|		case ',':
  ------------------
  |  Branch (253:3): [True: 61.4k, False: 227]
  ------------------
  254|  61.4k|			continue;
  255|    222|		case '}': /* { */
  ------------------
  |  Branch (255:3): [True: 222, False: 61.4k]
  ------------------
  256|  53.3k|		done:
  257|  53.3k|			DPRINTF("Good object: ", uc, *ucp);
  ------------------
  |  |   52|  53.3k|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 53.3k]
  |  |  ------------------
  ------------------
  258|  53.3k|			*ucp = uc;
  259|  53.3k|			return 1;
  260|      5|		default:
  ------------------
  |  Branch (260:3): [True: 5, False: 61.6k]
  ------------------
  261|      5|			DPRINTF("not more", uc, *ucp);
  ------------------
  |  |   52|      5|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 5]
  |  |  ------------------
  ------------------
  262|      5|			*ucp = uc - 1;
  263|      5|			goto out;
  264|  61.6k|		}
  265|  61.6k|	}
  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|  53.8k|}
is_json.c:json_parse_const:
  328|  1.61M|{
  329|  1.61M|	const unsigned char *uc = *ucp;
  330|       |
  331|  1.61M|	DPRINTF("Parse const: ", uc, *ucp);
  ------------------
  |  |   52|  1.61M|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 1.61M]
  |  |  ------------------
  ------------------
  332|  1.61M|	*ucp += --len - 1;
  333|  1.61M|	if (*ucp > ue)
  ------------------
  |  Branch (333:6): [True: 58, False: 1.61M]
  ------------------
  334|     58|		*ucp = ue;
  335|  6.47M|	for (; uc < ue && --len;) {
  ------------------
  |  Branch (335:9): [True: 6.47M, False: 54]
  |  Branch (335:20): [True: 4.85M, False: 1.61M]
  ------------------
  336|  4.85M|		if (*uc++ != *++str) {
  ------------------
  |  Branch (336:7): [True: 55, False: 4.85M]
  ------------------
  337|     55|			DPRINTF("Bad const: ", uc, *ucp);
  ------------------
  |  |   52|     55|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 55]
  |  |  ------------------
  ------------------
  338|     55|			return 0;
  339|     55|		}
  340|  4.85M|	}
  341|  1.61M|	DPRINTF("Good const: ", uc, *ucp);
  ------------------
  |  |   52|  1.61M|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 1.61M]
  |  |  ------------------
  ------------------
  342|  1.61M|	return 1;
  343|  1.61M|}
is_json.c:json_parse_number:
  276|  2.51M|{
  277|  2.51M|	const unsigned char *uc = *ucp;
  278|  2.51M|	int got = 0;
  279|       |
  280|  2.51M|	DPRINTF("Parse number: ", uc, *ucp);
  ------------------
  |  |   52|  2.51M|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 2.51M]
  |  |  ------------------
  ------------------
  281|  2.51M|	if (uc == ue)
  ------------------
  |  Branch (281:6): [True: 0, False: 2.51M]
  ------------------
  282|      0|		return 0;
  283|  2.51M|	if (*uc == '-')
  ------------------
  |  Branch (283:6): [True: 460k, False: 2.05M]
  ------------------
  284|   460k|		uc++;
  285|       |
  286|  26.9M|	for (; uc < ue; uc++) {
  ------------------
  |  Branch (286:9): [True: 26.9M, False: 51]
  ------------------
  287|  26.9M|		if (!json_isdigit(*uc))
  ------------------
  |  Branch (287:7): [True: 2.51M, False: 24.4M]
  ------------------
  288|  2.51M|			break;
  289|  24.4M|		got = 1;
  290|  24.4M|	}
  291|  2.51M|	if (uc == ue)
  ------------------
  |  Branch (291:6): [True: 51, False: 2.51M]
  ------------------
  292|     51|		goto out;
  293|  2.51M|	if (*uc == '.')
  ------------------
  |  Branch (293:6): [True: 143k, False: 2.37M]
  ------------------
  294|   143k|		uc++;
  295|  8.47M|	for (; uc < ue; uc++) {
  ------------------
  |  Branch (295:9): [True: 8.47M, False: 19]
  ------------------
  296|  8.47M|		if (!json_isdigit(*uc))
  ------------------
  |  Branch (296:7): [True: 2.51M, False: 5.96M]
  ------------------
  297|  2.51M|			break;
  298|  5.96M|		got = 1;
  299|  5.96M|	}
  300|  2.51M|	if (uc == ue)
  ------------------
  |  Branch (300:6): [True: 19, False: 2.51M]
  ------------------
  301|     19|		goto out;
  302|  2.51M|	if (got && (*uc == 'e' || *uc == 'E')) {
  ------------------
  |  Branch (302:6): [True: 2.50M, False: 10.1k]
  |  Branch (302:14): [True: 1.88M, False: 616k]
  |  Branch (302:28): [True: 233k, False: 383k]
  ------------------
  303|  2.12M|		uc++;
  304|  2.12M|		got = 0;
  305|  2.12M|		if (uc == ue)
  ------------------
  |  Branch (305:7): [True: 10, False: 2.12M]
  ------------------
  306|     10|			goto out;
  307|  2.12M|		if (*uc == '+' || *uc == '-')
  ------------------
  |  Branch (307:7): [True: 8.23k, False: 2.11M]
  |  Branch (307:21): [True: 1.31M, False: 796k]
  ------------------
  308|  1.32M|			uc++;
  309|  5.12M|		for (; uc < ue; uc++) {
  ------------------
  |  Branch (309:10): [True: 5.12M, False: 24]
  ------------------
  310|  5.12M|			if (!json_isdigit(*uc))
  ------------------
  |  Branch (310:8): [True: 2.12M, False: 3.00M]
  ------------------
  311|  2.12M|				break;
  312|  3.00M|			got = 1;
  313|  3.00M|		}
  314|  2.12M|	}
  315|  2.51M|out:
  316|  2.51M|	if (!got)
  ------------------
  |  Branch (316:6): [True: 10.2k, False: 2.50M]
  ------------------
  317|  10.2k|		DPRINTF("Bad number: ", uc, *ucp);
  ------------------
  |  |   52|  10.2k|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 10.2k]
  |  |  ------------------
  ------------------
  318|  2.50M|	else
  319|  2.50M|		DPRINTF("Good number: ", uc, *ucp);
  ------------------
  |  |   52|  2.50M|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 2.50M]
  |  |  ------------------
  ------------------
  320|  2.51M|	*ucp = uc;
  321|  2.51M|	return got;
  322|  2.51M|}

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

file_is_tar:
   64|  11.1k|{
   65|  11.1k|	const unsigned char *buf = CAST(const unsigned char *, b->fbuf);
  ------------------
  |  |  452|  11.1k|#define CAST(T, b)	((T)(b))
  ------------------
   66|  11.1k|	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|  11.1k|	int tar;
   72|  11.1k|	int mime = ms->flags & MAGIC_MIME;
  ------------------
  |  |   44|  11.1k|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   37|  11.1k|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  ------------------
  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   43|  11.1k|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  ------------------
  ------------------
   73|       |
   74|  11.1k|	if ((ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION)) != 0)
  ------------------
  |  |   45|  11.1k|#define	MAGIC_APPLE		0x0000800 /* Return the Apple creator/type */
  ------------------
              	if ((ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION)) != 0)
  ------------------
  |  |   46|  11.1k|#define	MAGIC_EXTENSION		0x1000000 /* Return a /-separated list of
  ------------------
  |  Branch (74:6): [True: 0, False: 11.1k]
  ------------------
   75|      0|		return 0;
   76|       |
   77|  11.1k|	tar = is_tar(buf, nbytes);
   78|  11.1k|	if (tar < 1 || tar > 3)
  ------------------
  |  Branch (78:6): [True: 11.1k, False: 34]
  |  Branch (78:17): [True: 0, False: 34]
  ------------------
   79|  11.1k|		return 0;
   80|       |
   81|     34|	if (mime == MAGIC_MIME_ENCODING)
  ------------------
  |  |   43|     34|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  ------------------
  |  Branch (81:6): [True: 0, False: 34]
  ------------------
   82|      0|		return 1;
   83|       |
   84|     34|	if (file_printf(ms, "%s", mime ? "application/x-tar" :
  ------------------
  |  Branch (84:6): [True: 0, False: 34]
  |  Branch (84:28): [True: 0, False: 34]
  ------------------
   85|     34|	    tartype[tar - 1]) == -1)
   86|      0|		return -1;
   87|       |
   88|     34|	return 1;
   89|     34|}
is_tar.c:is_tar:
  100|  11.1k|{
  101|  11.1k|	static const char gpkg_match[] = "/gpkg-1";
  102|       |
  103|  11.1k|	const union record *header = RCAST(const union record *,
  ------------------
  |  |  453|  11.1k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
  104|  11.1k|	    RCAST(const void *, buf));
  105|  11.1k|	size_t i;
  106|  11.1k|	int sum, recsum;
  107|  11.1k|	const unsigned char *p, *ep;
  108|  11.1k|	const char *nulp;
  109|       |
  110|  11.1k|	if (nbytes < sizeof(*header))
  ------------------
  |  Branch (110:6): [True: 7.56k, False: 3.58k]
  ------------------
  111|  7.56k|		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|  3.58k|	nulp = CAST(const char *,
  ------------------
  |  |  452|  3.58k|#define CAST(T, b)	((T)(b))
  ------------------
  117|  3.58k|	    memchr(header->header.name, 0, sizeof(header->header.name)));
  118|  3.58k|	if (nulp != NULL && nulp >= header->header.name + sizeof(gpkg_match) &&
  ------------------
  |  Branch (118:6): [True: 3.14k, False: 440]
  |  Branch (118:22): [True: 2.17k, False: 966]
  ------------------
  119|  2.17k|	    memcmp(nulp - sizeof(gpkg_match) + 1, gpkg_match,
  ------------------
  |  Branch (119:6): [True: 33, False: 2.14k]
  ------------------
  120|  2.17k|	    sizeof(gpkg_match)) == 0)
  121|     33|	    return 0;
  122|       |
  123|  3.55k|	recsum = from_oct(header->header.chksum, sizeof(header->header.chksum));
  124|       |
  125|  3.55k|	sum = 0;
  126|  3.55k|	p = header->charptr;
  127|  3.55k|	ep = header->charptr + sizeof(*header);
  128|  1.82M|	while (p < ep)
  ------------------
  |  Branch (128:9): [True: 1.81M, False: 3.55k]
  ------------------
  129|  1.81M|		sum += *p++;
  130|       |
  131|       |	/* Adjust checksum to count the "chksum" field as blanks. */
  132|  31.9k|	for (i = 0; i < sizeof(header->header.chksum); i++)
  ------------------
  |  Branch (132:14): [True: 28.4k, False: 3.55k]
  ------------------
  133|  28.4k|		sum -= header->header.chksum[i];
  134|  3.55k|	sum += ' ' * sizeof(header->header.chksum);
  135|       |
  136|  3.55k|	if (sum != recsum)
  ------------------
  |  Branch (136:6): [True: 3.51k, False: 34]
  ------------------
  137|  3.51k|		return 0;	/* Not a tar archive */
  138|       |
  139|     34|	if (strncmp(header->header.magic, GNUTMAGIC,
  ------------------
  |  |   73|     34|#define	GNUTMAGIC	"ustar  "	/* 7 chars and a null */
  ------------------
  |  Branch (139:6): [True: 3, False: 31]
  ------------------
  140|     34|	    sizeof(header->header.magic)) == 0)
  141|      3|		return 3;		/* GNU Unix Standard tar archive */
  142|       |
  143|     31|	if (strncmp(header->header.magic, TMAGIC,
  ------------------
  |  |   72|     31|#define	TMAGIC		"ustar"		/* 5 chars and a null */
  ------------------
  |  Branch (143:6): [True: 3, False: 28]
  ------------------
  144|     31|	    sizeof(header->header.magic)) == 0)
  145|      3|		return 2;		/* Unix Standard tar archive */
  146|       |
  147|     28|	return 1;			/* Old fashioned tar archive */
  148|     31|}
is_tar.c:from_oct:
  158|  3.55k|{
  159|  3.55k|	int	value;
  160|       |
  161|  4.16k|	while (digs > 0 && isspace(CAST(unsigned char, *where))) {	/* Skip spaces */
  ------------------
  |  Branch (161:9): [True: 4.10k, False: 62]
  |  Branch (161:21): [True: 617, False: 3.48k]
  ------------------
  162|    617|		where++;
  163|    617|		digs--;
  164|    617|	}
  165|  3.55k|	if (digs == 0)
  ------------------
  |  Branch (165:6): [True: 62, False: 3.48k]
  ------------------
  166|     62|		return -1;		/* All blank field */
  167|  3.48k|	value = 0;
  168|  4.09k|	while (digs > 0 && isodigit(*where)) {	/* Scan til non-octal */
  ------------------
  |  |   51|  4.04k|#define	isodigit(c)	( ((c) >= '0') && ((c) <= '7') )
  |  |  ------------------
  |  |  |  Branch (51:23): [True: 1.24k, False: 2.79k]
  |  |  |  Branch (51:39): [True: 602, False: 646]
  |  |  ------------------
  ------------------
  |  Branch (168:9): [True: 4.04k, False: 46]
  ------------------
  169|    602|		value = (value << 3) | (*where++ - '0');
  170|    602|		digs--;
  171|    602|	}
  172|       |
  173|  3.48k|	if (digs > 0 && *where && !isspace(CAST(unsigned char, *where)))
  ------------------
  |  Branch (173:6): [True: 3.44k, False: 46]
  |  Branch (173:18): [True: 1.71k, False: 1.72k]
  |  Branch (173:28): [True: 1.70k, False: 11]
  ------------------
  174|  1.70k|		return -1;			/* Ended on non-(space/NUL) */
  175|       |
  176|  1.78k|	return value;
  177|  3.48k|}

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;
  ------------------
  |  |  187|      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);
  ------------------
  |  |  187|      2|#define	FILE_LOAD	0
  ------------------
  323|      2|}
magic_buffer:
  553|  7.61k|{
  554|  7.61k|	if (ms == NULL)
  ------------------
  |  Branch (554:6): [True: 0, False: 7.61k]
  ------------------
  555|      0|		return NULL;
  556|  7.61k|	if (file_reset(ms, 1) == -1)
  ------------------
  |  Branch (556:6): [True: 0, False: 7.61k]
  ------------------
  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|  7.61k|	if (file_buffer(ms, -1, NULL, NULL, buf, nb) == -1) {
  ------------------
  |  Branch (562:6): [True: 240, False: 7.37k]
  ------------------
  563|    240|		return NULL;
  564|    240|	}
  565|  7.37k|	return file_getbuffer(ms);
  566|  7.61k|}
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|}

file_fmtdatetime:
  311|  4.43k|{
  312|  4.43k|	char *pp;
  313|  4.43k|	time_t t;
  314|  4.43k|	struct tm *tm, tmz;
  315|       |
  316|  4.43k|	if (flags & FILE_T_WINDOWS) {
  ------------------
  |  |  541|  4.43k|#define FILE_T_WINDOWS	2
  ------------------
  |  Branch (316:6): [True: 1.67k, False: 2.75k]
  ------------------
  317|  1.67k|		struct timespec ts;
  318|  1.67k|		cdf_timestamp_to_timespec(&ts, CAST(cdf_timestamp_t, v));
  ------------------
  |  |  452|  1.67k|#define CAST(T, b)	((T)(b))
  ------------------
  319|  1.67k|		t = ts.tv_sec;
  320|  2.75k|	} else {
  321|       |		// XXX: perhaps detect and print something if overflow
  322|       |		// on 32 bit time_t?
  323|  2.75k|		t = CAST(time_t, v);
  ------------------
  |  |  452|  2.75k|#define CAST(T, b)	((T)(b))
  ------------------
  324|  2.75k|	}
  325|       |
  326|  4.43k|	if (t > MAX_CTIME)
  ------------------
  |  |  173|  4.43k|    CAST(time_t, sizeof(time_t) > 4 ? 0x3afff487cfULL : 0x7fffffffULL)
  |  |  ------------------
  |  |  |  |  452|  8.86k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 4.43k, Folded]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (326:6): [True: 1.27k, False: 3.15k]
  ------------------
  327|  1.27k|		goto out;
  328|       |
  329|  3.15k|	if (flags & FILE_T_LOCAL) {
  ------------------
  |  |  540|  3.15k|#define FILE_T_LOCAL	1
  ------------------
  |  Branch (329:6): [True: 728, False: 2.43k]
  ------------------
  330|    728|		tzset();
  331|    728|		tm = localtime_r(&t, &tmz);
  332|  2.43k|	} else {
  333|  2.43k|		tm = gmtime_r(&t, &tmz);
  334|  2.43k|	}
  335|  3.15k|	if (tm == NULL)
  ------------------
  |  Branch (335:6): [True: 379, False: 2.77k]
  ------------------
  336|    379|		goto out;
  337|  2.77k|	pp = asctime_r(tm, buf);
  338|       |
  339|  2.77k|	if (pp == NULL)
  ------------------
  |  Branch (339:6): [True: 314, False: 2.46k]
  ------------------
  340|    314|		goto out;
  341|  2.46k|	pp[strcspn(pp, "\n")] = '\0';
  342|  2.46k|	return pp;
  343|  1.96k|out:
  344|  1.96k|	strlcpy(buf, "*Invalid datetime*", bsize);
  345|  1.96k|	return buf;
  346|  2.77k|}
file_fmtdate:
  354|    292|{
  355|    292|	struct tm tm;
  356|       |
  357|    292|	memset(&tm, 0, sizeof(tm));
  358|    292|	tm.tm_mday = v & 0x1f;
  359|    292|	tm.tm_mon = ((v >> 5) & 0xf) - 1;
  360|       |	// Sanity check because some OS's coredump with invalid values.
  361|       |	// Yes, Cygwin I am looking at you!
  362|    292|	if (tm.tm_mon < 0 || tm.tm_mon > 11)
  ------------------
  |  Branch (362:6): [True: 102, False: 190]
  |  Branch (362:23): [True: 93, False: 97]
  ------------------
  363|    195|		tm.tm_mon = 0;
  364|    292|	tm.tm_year = (v >> 9) + 80;
  365|       |
  366|    292|	if (strftime(buf, bsize, "%b %d %Y", &tm) == 0)
  ------------------
  |  Branch (366:6): [True: 0, False: 292]
  ------------------
  367|      0|		goto out;
  368|       |
  369|    292|	return buf;
  370|      0|out:
  371|      0|	strlcpy(buf, "*Invalid date*", bsize);
  372|      0|	return buf;
  373|    292|}
file_fmttime:
  377|    292|{
  378|    292|	struct tm tm;
  379|       |
  380|    292|	memset(&tm, 0, sizeof(tm));
  381|    292|	tm.tm_sec = (v & 0x1f) * 2;
  382|    292|	tm.tm_min = ((v >> 5) & 0x3f);
  383|    292|	tm.tm_hour = (v >> 11);
  384|       |
  385|    292|	if (strftime(buf, bsize, "%T", &tm) == 0)
  ------------------
  |  Branch (385:6): [True: 0, False: 292]
  ------------------
  386|      0|		goto out;
  387|       |
  388|    292|	return buf;
  389|      0|out:
  390|      0|	strlcpy(buf, "*Invalid time*", bsize);
  391|      0|	return buf;
  392|       |
  393|    292|}

file_trycdf:
  562|  11.1k|{
  563|  11.1k|	int fd = b->fd;
  564|  11.1k|	const unsigned char *buf = CAST(const unsigned char *, b->fbuf);
  ------------------
  |  |  452|  11.1k|#define CAST(T, b)	((T)(b))
  ------------------
  565|  11.1k|	size_t nbytes = b->flen;
  566|  11.1k|	cdf_info_t info;
  567|  11.1k|	cdf_header_t h;
  568|  11.1k|	cdf_sat_t sat, ssat;
  569|  11.1k|	cdf_stream_t sst, scn;
  570|  11.1k|	cdf_dir_t dir;
  571|  11.1k|	int i;
  572|  11.1k|	const char *expn = "";
  573|  11.1k|	const cdf_directory_t *root_storage;
  574|       |
  575|  11.1k|	scn.sst_tab = NULL;
  576|  11.1k|	info.i_fd = fd;
  577|  11.1k|	info.i_buf = buf;
  578|  11.1k|	info.i_len = nbytes;
  579|  11.1k|	if (ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION))
  ------------------
  |  |   45|  11.1k|#define	MAGIC_APPLE		0x0000800 /* Return the Apple creator/type */
  ------------------
              	if (ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION))
  ------------------
  |  |   46|  11.1k|#define	MAGIC_EXTENSION		0x1000000 /* Return a /-separated list of
  ------------------
  |  Branch (579:6): [True: 0, False: 11.1k]
  ------------------
  580|      0|		return 0;
  581|  11.1k|	if (cdf_read_header(&info, &h) == -1)
  ------------------
  |  Branch (581:6): [True: 9.46k, False: 1.69k]
  ------------------
  582|  9.46k|		return 0;
  583|       |#ifdef CDF_DEBUG
  584|       |	cdf_dump_header(&h);
  585|       |#endif
  586|       |
  587|  1.69k|	if ((i = cdf_read_sat(&info, &h, &sat)) == -1) {
  ------------------
  |  Branch (587:6): [True: 159, False: 1.53k]
  ------------------
  588|    159|		expn = "Can't read SAT";
  589|    159|		goto out0;
  590|    159|	}
  591|       |#ifdef CDF_DEBUG
  592|       |	cdf_dump_sat("SAT", &sat, CDF_SEC_SIZE(&h));
  593|       |#endif
  594|       |
  595|  1.53k|	if ((i = cdf_read_ssat(&info, &h, &sat, &ssat)) == -1) {
  ------------------
  |  Branch (595:6): [True: 190, False: 1.34k]
  ------------------
  596|    190|		expn = "Can't read SSAT";
  597|    190|		goto out1;
  598|    190|	}
  599|       |#ifdef CDF_DEBUG
  600|       |	cdf_dump_sat("SSAT", &ssat, CDF_SHORT_SEC_SIZE(&h));
  601|       |#endif
  602|       |
  603|  1.34k|	if ((i = cdf_read_dir(&info, &h, &sat, &dir)) == -1) {
  ------------------
  |  Branch (603:6): [True: 110, False: 1.23k]
  ------------------
  604|    110|		expn = "Can't read directory";
  605|    110|		goto out2;
  606|    110|	}
  607|       |
  608|  1.23k|	if ((i = cdf_read_short_stream(&info, &h, &sat, &dir, &sst,
  ------------------
  |  Branch (608:6): [True: 77, False: 1.15k]
  ------------------
  609|  1.23k|	    &root_storage)) == -1) {
  610|     77|		expn = "Cannot read short stream";
  611|     77|		goto out3;
  612|     77|	}
  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.15k|	if (cdf_read_user_stream(&info, &h, &sat, &ssat, &sst, &dir,
  ------------------
  |  Branch (628:6): [True: 36, False: 1.12k]
  ------------------
  629|  1.15k|	    "FileHeader", &scn) != -1) {
  630|     36|#define HWP5_SIGNATURE "HWP Document File"
  631|     36|		if (scn.sst_len * scn.sst_ss >= sizeof(HWP5_SIGNATURE) - 1
  ------------------
  |  |  630|     36|#define HWP5_SIGNATURE "HWP Document File"
  ------------------
  |  Branch (631:7): [True: 27, False: 9]
  ------------------
  632|     27|		    && memcmp(scn.sst_tab, HWP5_SIGNATURE,
  ------------------
  |  |  630|     27|#define HWP5_SIGNATURE "HWP Document File"
  ------------------
  |  Branch (632:10): [True: 1, False: 26]
  ------------------
  633|     27|		    sizeof(HWP5_SIGNATURE) - 1) == 0) {
  ------------------
  |  |  630|     27|#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|     35|		} else {
  645|     35|		    cdf_zero_stream(&scn);
  646|     35|		}
  647|     36|	}
  648|       |
  649|  1.15k|	if ((i = cdf_read_summary_info(&info, &h, &sat, &ssat, &sst, &dir,
  ------------------
  |  Branch (649:6): [True: 387, False: 768]
  ------------------
  650|  1.15k|	    &scn)) == -1) {
  651|    387|		if (errno != ESRCH) {
  ------------------
  |  Branch (651:7): [True: 84, False: 303]
  ------------------
  652|     84|			expn = "Cannot read summary info";
  653|     84|		}
  654|    768|	} else {
  655|    768|		i = cdf_check_summary_info(ms, &info, &h,
  656|    768|		    &sat, &ssat, &sst, &dir, &scn, root_storage, &expn);
  657|    768|		cdf_zero_stream(&scn);
  658|    768|	}
  659|  1.15k|	if (i <= 0) {
  ------------------
  |  Branch (659:6): [True: 978, False: 177]
  ------------------
  660|    978|		if ((i = cdf_read_doc_summary_info(&info, &h, &sat, &ssat,
  ------------------
  |  Branch (660:7): [True: 831, False: 147]
  ------------------
  661|    978|		    &sst, &dir, &scn)) == -1) {
  662|    831|			if (errno != ESRCH) {
  ------------------
  |  Branch (662:8): [True: 38, False: 793]
  ------------------
  663|     38|				expn = "Cannot read summary info";
  664|     38|			}
  665|    831|		} else {
  666|    147|			i = cdf_check_summary_info(ms, &info, &h, &sat, &ssat,
  667|    147|			    &sst, &dir, &scn, root_storage, &expn);
  668|    147|		}
  669|    978|	}
  670|  1.15k|	if (i <= 0) {
  ------------------
  |  Branch (670:6): [True: 976, False: 179]
  ------------------
  671|    976|		i = cdf_file_dir_info(ms, &dir);
  672|    976|		if (i < 0)
  ------------------
  |  Branch (672:7): [True: 966, False: 10]
  ------------------
  673|    966|			expn = "Cannot read section info";
  674|    976|	}
  675|  1.15k|out5:
  676|  1.15k|	cdf_zero_stream(&scn);
  677|  1.15k|	cdf_zero_stream(&sst);
  678|  1.23k|out3:
  679|  1.23k|	free(dir.dir_tab);
  680|  1.34k|out2:
  681|  1.34k|	free(ssat.sat_tab);
  682|  1.53k|out1:
  683|  1.53k|	free(sat.sat_tab);
  684|  1.69k|out0:
  685|       |	/* If we handled it already, return */
  686|  1.69k|	if (i != -1)
  ------------------
  |  Branch (686:6): [True: 190, False: 1.50k]
  ------------------
  687|    190|		return i;
  688|       |	/* Provide a default handler */
  689|  1.50k|	if (NOTMIME(ms)) {
  ------------------
  |  |   42|  1.50k|#define NOTMIME(ms) (((ms)->flags & MAGIC_MIME) == 0)
  |  |  ------------------
  |  |  |  |   44|  1.50k|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|  1.50k|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  |  |  ------------------
  |  |  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|  1.50k|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (42:21): [True: 1.50k, False: 0]
  |  |  ------------------
  ------------------
  690|  1.50k|		if (file_printf(ms,
  ------------------
  |  Branch (690:7): [True: 0, False: 1.50k]
  ------------------
  691|  1.50k|		    "Composite Document File V2 Document") == -1)
  692|      0|			return -1;
  693|  1.50k|		if (*expn)
  ------------------
  |  Branch (693:7): [True: 1.50k, False: 0]
  ------------------
  694|  1.50k|			if (file_printf(ms, ", %s", expn) == -1)
  ------------------
  |  Branch (694:8): [True: 0, False: 1.50k]
  ------------------
  695|      0|				return -1;
  696|  1.50k|	} 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.50k|	return 1;
  702|  1.50k|}
readcdf.c:cdf_check_summary_info:
  396|    915|{
  397|    915|	int i;
  398|    915|	const char *str = NULL;
  399|    915|	cdf_directory_t *d;
  400|    915|	char name[__arraycount(d->d_name)];
  401|    915|	size_t j, k;
  402|       |
  403|       |#ifdef CDF_DEBUG
  404|       |	cdf_dump_summary_info(h, scn);
  405|       |#endif
  406|    915|	if ((i = cdf_file_summary_info(ms, h, scn, root_storage)) < 0) {
  ------------------
  |  Branch (406:6): [True: 736, False: 179]
  ------------------
  407|    736|	    *expn = "Can't expand summary_info";
  408|    736|	    return i;
  409|    736|	}
  410|    179|	if (i == 1)
  ------------------
  |  Branch (410:6): [True: 179, False: 0]
  ------------------
  411|    179|		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]));
  ------------------
  |  |  452|      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|    915|{
  305|    915|	cdf_summary_info_header_t si;
  306|    915|	cdf_property_info_t *info;
  307|    915|	size_t count;
  308|    915|	int m;
  309|       |
  310|    915|	if (cdf_unpack_summary_info(sst, h, &si, &info, &count) == -1)
  ------------------
  |  Branch (310:6): [True: 531, False: 384]
  ------------------
  311|    531|		return -1;
  312|       |
  313|    384|	if (NOTMIME(ms)) {
  ------------------
  |  |   42|    384|#define NOTMIME(ms) (((ms)->flags & MAGIC_MIME) == 0)
  |  |  ------------------
  |  |  |  |   44|    384|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|    384|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  |  |  ------------------
  |  |  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|    384|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (42:21): [True: 384, False: 0]
  |  |  ------------------
  ------------------
  314|    384|		const char *str;
  315|       |
  316|    384|		if (file_printf(ms, "Composite Document File V2 Document")
  ------------------
  |  Branch (316:7): [True: 0, False: 384]
  ------------------
  317|    384|		    == -1)
  318|      0|			return -1;
  319|       |
  320|    384|		if (file_printf(ms, ", %s Endian",
  ------------------
  |  Branch (320:7): [True: 0, False: 384]
  ------------------
  321|    384|		    si.si_byte_order == 0xfffe ?  "Little" : "Big") == -1)
  ------------------
  |  Branch (321:7): [True: 3, False: 381]
  ------------------
  322|      0|			return -2;
  323|    384|		switch (si.si_os) {
  324|      8|		case 2:
  ------------------
  |  Branch (324:3): [True: 8, False: 376]
  ------------------
  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)
  ------------------
  |  |  452|      8|#define CAST(T, b)	((T)(b))
  ------------------
  328|      0|				return -2;
  329|      8|			break;
  330|     12|		case 1:
  ------------------
  |  Branch (330:3): [True: 12, False: 372]
  ------------------
  331|     12|			if (file_printf(ms, ", Os: MacOS, Version %d.%d",
  ------------------
  |  Branch (331:8): [True: 0, False: 12]
  ------------------
  332|     12|			    CAST(uint32_t, si.si_os_version) >> 8,
  ------------------
  |  |  452|     12|#define CAST(T, b)	((T)(b))
  ------------------
  333|     12|			    si.si_os_version & 0xff) == -1)
  334|      0|				return -2;
  335|     12|			break;
  336|    364|		default:
  ------------------
  |  Branch (336:3): [True: 364, False: 20]
  ------------------
  337|    364|			if (file_printf(ms, ", Os %d, Version: %d.%d", si.si_os,
  ------------------
  |  Branch (337:8): [True: 0, False: 364]
  ------------------
  338|    364|			    si.si_os_version & 0xff,
  339|    364|			    CAST(uint32_t, si.si_os_version) >> 8) == -1)
  ------------------
  |  |  452|    364|#define CAST(T, b)	((T)(b))
  ------------------
  340|      0|				return -2;
  341|    364|			break;
  342|    384|		}
  343|    384|		if (root_storage) {
  ------------------
  |  Branch (343:7): [True: 142, False: 242]
  ------------------
  344|    142|			str = cdf_clsid_to_mime(root_storage->d_storage_uuid,
  345|    142|			    clsid2desc);
  346|    142|			if (str) {
  ------------------
  |  Branch (346:8): [True: 1, False: 141]
  ------------------
  347|      1|				if (file_printf(ms, ", %s", str) == -1)
  ------------------
  |  Branch (347:9): [True: 0, False: 1]
  ------------------
  348|      0|					return -2;
  349|      1|			}
  350|    142|		}
  351|    384|	}
  352|       |
  353|    384|	m = cdf_file_property_info(ms, info, count, root_storage);
  354|    384|	free(info);
  355|       |
  356|    384|	return m == -1 ? -2 : m;
  ------------------
  |  Branch (356:9): [True: 205, False: 179]
  ------------------
  357|    384|}
readcdf.c:cdf_clsid_to_mime:
   97|    142|{
   98|    142|	size_t i;
   99|    283|	for (i = 0; cv[i].mime != NULL; i++) {
  ------------------
  |  Branch (99:14): [True: 142, False: 141]
  ------------------
  100|    142|		if (clsid[0] == cv[i].clsid[0] && clsid[1] == cv[i].clsid[1])
  ------------------
  |  Branch (100:7): [True: 66, False: 76]
  |  Branch (100:37): [True: 1, False: 65]
  ------------------
  101|      1|			return cv[i].mime;
  102|    142|	}
  103|       |#ifdef CDF_DEBUG
  104|       |	fprintf(stderr, "unknown mime %" PRIx64 ", %" PRIx64 "\n", clsid[0],
  105|       |	    clsid[1]);
  106|       |#endif
  107|    141|	return NULL;
  108|    142|}
readcdf.c:cdf_file_property_info:
  150|    384|{
  151|    384|	size_t i;
  152|    384|	cdf_timestamp_t tp;
  153|    384|	struct timespec ts;
  154|    384|	char buf[64];
  155|    384|	const char *str = NULL;
  156|    384|	const char *s, *e;
  157|    384|	int len;
  158|       |
  159|    384|	if (!NOTMIME(ms) && root_storage)
  ------------------
  |  |   42|    768|#define NOTMIME(ms) (((ms)->flags & MAGIC_MIME) == 0)
  |  |  ------------------
  |  |  |  |   44|    384|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|    384|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  |  |  ------------------
  |  |  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|    384|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (159:6): [True: 0, False: 384]
  |  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.45k|	for (i = 0; i < count; i++) {
  ------------------
  |  Branch (163:14): [True: 1.28k, False: 179]
  ------------------
  164|  1.28k|		cdf_print_property_name(buf, sizeof(buf), info[i].pi_id);
  165|  1.28k|		switch (info[i].pi_type) {
  166|     66|		case CDF_NULL:
  ------------------
  |  |  198|     66|#define CDF_NULL		0x00000001
  ------------------
  |  Branch (166:3): [True: 66, False: 1.21k]
  ------------------
  167|     66|			break;
  168|     38|		case CDF_SIGNED16:
  ------------------
  |  |  199|     38|#define CDF_SIGNED16		0x00000002
  ------------------
  |  Branch (168:3): [True: 38, False: 1.24k]
  ------------------
  169|     38|			if (NOTMIME(ms) && file_printf(ms, ", %s: %hd", buf,
  ------------------
  |  |   42|     76|#define NOTMIME(ms) (((ms)->flags & MAGIC_MIME) == 0)
  |  |  ------------------
  |  |  |  |   44|     38|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|     38|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  |  |  ------------------
  |  |  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|     38|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (42:21): [True: 38, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (169:23): [True: 0, False: 38]
  ------------------
  170|     38|			    info[i].pi_s16) == -1)
  ------------------
  |  |  187|     38|#define pi_s16	pi_val._pi_s16
  ------------------
  171|      0|				return -1;
  172|     38|			break;
  173|     68|		case CDF_SIGNED32:
  ------------------
  |  |  200|     68|#define CDF_SIGNED32		0x00000003
  ------------------
  |  Branch (173:3): [True: 68, False: 1.21k]
  ------------------
  174|     68|			if (NOTMIME(ms) && file_printf(ms, ", %s: %d", buf,
  ------------------
  |  |   42|    136|#define NOTMIME(ms) (((ms)->flags & MAGIC_MIME) == 0)
  |  |  ------------------
  |  |  |  |   44|     68|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|     68|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  |  |  ------------------
  |  |  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|     68|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (42:21): [True: 68, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (174:23): [True: 0, False: 68]
  ------------------
  175|     68|			    info[i].pi_s32) == -1)
  ------------------
  |  |  185|     68|#define pi_s32	pi_val._pi_s32
  ------------------
  176|      0|				return -1;
  177|     68|			break;
  178|     68|		case CDF_UNSIGNED32:
  ------------------
  |  |  215|     54|#define CDF_UNSIGNED32		0x00000013
  ------------------
  |  Branch (178:3): [True: 54, False: 1.22k]
  ------------------
  179|     54|			if (NOTMIME(ms) && file_printf(ms, ", %s: %u", buf,
  ------------------
  |  |   42|    108|#define NOTMIME(ms) (((ms)->flags & MAGIC_MIME) == 0)
  |  |  ------------------
  |  |  |  |   44|     54|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|     54|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  |  |  ------------------
  |  |  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|     54|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (42:21): [True: 54, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (179:23): [True: 0, False: 54]
  ------------------
  180|     54|			    info[i].pi_u32) == -1)
  ------------------
  |  |  184|     54|#define pi_u32	pi_val._pi_u32
  ------------------
  181|      0|				return -1;
  182|     54|			break;
  183|     81|		case CDF_FLOAT:
  ------------------
  |  |  201|     81|#define CDF_FLOAT		0x00000004
  ------------------
  |  Branch (183:3): [True: 81, False: 1.19k]
  ------------------
  184|     81|			if (NOTMIME(ms) && file_printf(ms, ", %s: %g", buf,
  ------------------
  |  |   42|    162|#define NOTMIME(ms) (((ms)->flags & MAGIC_MIME) == 0)
  |  |  ------------------
  |  |  |  |   44|     81|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|     81|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  |  |  ------------------
  |  |  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|     81|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (42:21): [True: 81, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (184:23): [True: 0, False: 81]
  ------------------
  185|     81|			    info[i].pi_f) == -1)
  ------------------
  |  |  188|     81|#define pi_f	pi_val._pi_f
  ------------------
  186|      0|				return -1;
  187|     81|			break;
  188|     81|		case CDF_DOUBLE:
  ------------------
  |  |  202|     51|#define CDF_DOUBLE		0x00000005
  ------------------
  |  Branch (188:3): [True: 51, False: 1.22k]
  ------------------
  189|     51|			if (NOTMIME(ms) && file_printf(ms, ", %s: %g", buf,
  ------------------
  |  |   42|    102|#define NOTMIME(ms) (((ms)->flags & MAGIC_MIME) == 0)
  |  |  ------------------
  |  |  |  |   44|     51|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|     51|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  |  |  ------------------
  |  |  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|     51|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (42:21): [True: 51, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (189:23): [True: 0, False: 51]
  ------------------
  190|     51|			    info[i].pi_d) == -1)
  ------------------
  |  |  189|     51|#define pi_d	pi_val._pi_d
  ------------------
  191|      0|				return -1;
  192|     51|			break;
  193|    154|		case CDF_LENGTH32_STRING:
  ------------------
  |  |  226|    154|#define CDF_LENGTH32_STRING	0x0000001e
  ------------------
  |  Branch (193:3): [True: 154, False: 1.12k]
  ------------------
  194|    229|		case CDF_LENGTH32_WSTRING:
  ------------------
  |  |  227|    229|#define CDF_LENGTH32_WSTRING	0x0000001f
  ------------------
  |  Branch (194:3): [True: 75, False: 1.20k]
  ------------------
  195|    229|			len = info[i].pi_str.s_len;
  ------------------
  |  |  191|    229|#define pi_str	pi_val._pi_str
  ------------------
  196|    229|			if (len > 1) {
  ------------------
  |  Branch (196:8): [True: 193, False: 36]
  ------------------
  197|    193|				char vbuf[1024];
  198|    193|				size_t j, k = 1;
  199|       |
  200|    193|				if (info[i].pi_type == CDF_LENGTH32_WSTRING)
  ------------------
  |  |  227|    193|#define CDF_LENGTH32_WSTRING	0x0000001f
  ------------------
  |  Branch (200:9): [True: 67, False: 126]
  ------------------
  201|     67|				    k++;
  202|    193|				s = info[i].pi_str.s_buf;
  ------------------
  |  |  191|    193|#define pi_str	pi_val._pi_str
  ------------------
  203|    193|				e = info[i].pi_str.s_buf + len;
  ------------------
  |  |  191|    193|#define pi_str	pi_val._pi_str
  ------------------
  204|  33.0k|				for (j = 0; s < e && j < sizeof(vbuf)
  ------------------
  |  Branch (204:17): [True: 33.0k, False: 42]
  |  Branch (204:26): [True: 33.0k, False: 12]
  ------------------
  205|  33.0k|				    && len--; s += k) {
  ------------------
  |  Branch (205:12): [True: 33.0k, False: 0]
  ------------------
  206|  33.0k|					if (*s == '\0')
  ------------------
  |  Branch (206:10): [True: 139, False: 32.8k]
  ------------------
  207|    139|						break;
  208|  32.8k|					if (isprint(CAST(unsigned char, *s)))
  ------------------
  |  Branch (208:10): [True: 29.1k, False: 3.73k]
  ------------------
  209|  29.1k|						vbuf[j++] = *s;
  210|  32.8k|				}
  211|    193|				if (j == sizeof(vbuf))
  ------------------
  |  Branch (211:9): [True: 12, False: 181]
  ------------------
  212|     12|					--j;
  213|    193|				vbuf[j] = '\0';
  214|    193|				if (NOTMIME(ms)) {
  ------------------
  |  |   42|    193|#define NOTMIME(ms) (((ms)->flags & MAGIC_MIME) == 0)
  |  |  ------------------
  |  |  |  |   44|    193|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|    193|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  |  |  ------------------
  |  |  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|    193|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (42:21): [True: 193, False: 0]
  |  |  ------------------
  ------------------
  215|    193|					if (vbuf[0]) {
  ------------------
  |  Branch (215:10): [True: 136, False: 57]
  ------------------
  216|    136|						if (file_printf(ms, ", %s: %s",
  ------------------
  |  Branch (216:11): [True: 8, False: 128]
  ------------------
  217|    136|						    buf, vbuf) == -1)
  218|      8|							return -1;
  219|    136|					}
  220|    193|				} 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) {
  ------------------
  |  |  262|      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|    193|			}
  230|    221|			break;
  231|    453|		case CDF_FILETIME:
  ------------------
  |  |  228|    453|#define CDF_FILETIME		0x00000040
  ------------------
  |  Branch (231:3): [True: 453, False: 827]
  ------------------
  232|    453|			tp = info[i].pi_tp;
  ------------------
  |  |  190|    453|#define pi_tp	pi_val._pi_tp
  ------------------
  233|    453|			if (tp != 0) {
  ------------------
  |  Branch (233:8): [True: 417, False: 36]
  ------------------
  234|    417|				char tbuf[64];
  235|    417|				if (tp < 1000000000000000LL) {
  ------------------
  |  Branch (235:9): [True: 256, False: 161]
  ------------------
  236|    256|					cdf_print_elapsed_time(tbuf,
  237|    256|					    sizeof(tbuf), tp);
  238|    256|					if (NOTMIME(ms) && file_printf(ms,
  ------------------
  |  |   42|    512|#define NOTMIME(ms) (((ms)->flags & MAGIC_MIME) == 0)
  |  |  ------------------
  |  |  |  |   44|    256|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|    256|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  |  |  ------------------
  |  |  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|    256|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (42:21): [True: 256, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (238:25): [True: 0, False: 256]
  ------------------
  239|    256|					    ", %s: %s", buf, tbuf) == -1)
  240|      0|						return -1;
  241|    256|				} else {
  242|    161|					char *c, *ec;
  243|    161|					cdf_timestamp_to_timespec(&ts, tp);
  244|    161|					c = cdf_ctime(&ts.tv_sec, tbuf);
  245|    161|					if (c != NULL &&
  ------------------
  |  Branch (245:10): [True: 161, False: 0]
  ------------------
  246|    161|					    (ec = strchr(c, '\n')) != NULL)
  ------------------
  |  Branch (246:10): [True: 161, False: 0]
  ------------------
  247|    161|						*ec = '\0';
  248|       |
  249|    161|					if (NOTMIME(ms) && file_printf(ms,
  ------------------
  |  |   42|    322|#define NOTMIME(ms) (((ms)->flags & MAGIC_MIME) == 0)
  |  |  ------------------
  |  |  |  |   44|    161|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|    161|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  |  |  ------------------
  |  |  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|    161|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (42:21): [True: 161, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (249:25): [True: 0, False: 161]
  ------------------
  250|    161|					    ", %s: %s", buf, c) == -1)
  251|      0|						return -1;
  252|    161|				}
  253|    417|			}
  254|    453|			break;
  255|    453|		case CDF_CLIPBOARD:
  ------------------
  |  |  235|     43|#define CDF_CLIPBOARD		0x00000047
  ------------------
  |  Branch (255:3): [True: 43, False: 1.23k]
  ------------------
  256|     43|			break;
  257|    197|		default:
  ------------------
  |  Branch (257:3): [True: 197, False: 1.08k]
  ------------------
  258|    197|			return -1;
  259|  1.28k|		}
  260|  1.28k|	}
  261|    179|	if (ms->flags & MAGIC_MIME_TYPE) {
  ------------------
  |  |   37|    179|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  ------------------
  |  Branch (261:6): [True: 0, False: 179]
  ------------------
  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|    179|	return 1;
  268|    179|}
readcdf.c:cdf_file_dir_info:
  518|    976|{
  519|    976|	size_t sd, i, j;
  520|    976|	uint16_t *dir_name;
  521|    976|	int dir_type;
  522|    976|	const char* section_name;
  523|       |
  524|  9.02k|	for (i = 0; i < dir->dir_len; i++) {
  ------------------
  |  Branch (524:14): [True: 8.05k, False: 966]
  ------------------
  525|  8.05k|		dir_name = dir->dir_tab[i].d_name;
  526|  8.05k|		dir_type = dir->dir_tab[i].d_type;
  527|       |
  528|  56.3k|		for (sd = 0; sd < __arraycount(sectioninfo); sd++) {
  ------------------
  |  |  130|  56.3k|#define __arraycount(a) (sizeof(a) / sizeof(a[0]))
  ------------------
  |  Branch (528:16): [True: 48.3k, False: 8.04k]
  ------------------
  529|  48.3k|			const struct sinfo *si = &sectioninfo[sd];
  530|   120k|			for (j = 0; si->sections[j]; j++) {
  ------------------
  |  Branch (530:16): [True: 72.4k, False: 48.3k]
  ------------------
  531|  72.4k|				if (si->sections[j] == NULL)
  ------------------
  |  Branch (531:9): [True: 0, False: 72.4k]
  ------------------
  532|      0|					continue;
  533|  72.4k|				section_name = si->sections[j];
  534|  72.4k|				if (si->types[j] != dir_type ||
  ------------------
  |  Branch (534:9): [True: 62.1k, False: 10.3k]
  ------------------
  535|  10.3k|				    cdf_namecmp(section_name, dir_name,
  ------------------
  |  Branch (535:9): [True: 10.2k, False: 10]
  ------------------
  536|  10.3k|					strlen(section_name) + 1) != 0)
  537|  72.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|     10|				if (NOTMIME(ms)) {
  ------------------
  |  |   42|     10|#define NOTMIME(ms) (((ms)->flags & MAGIC_MIME) == 0)
  |  |  ------------------
  |  |  |  |   44|     10|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|     10|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  |  |  ------------------
  |  |  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|     10|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (42:21): [True: 10, False: 0]
  |  |  ------------------
  ------------------
  545|     10|					if (file_printf(ms, "CDFV2 %s",
  ------------------
  |  Branch (545:10): [True: 0, False: 10]
  ------------------
  546|     10|					    si->name) == -1)
  547|      0|						return -1;
  548|     10|				} 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|     10|				return 1;
  554|     10|			}
  555|  48.3k|		}
  556|  8.05k|	}
  557|    966|	return -1;
  558|    976|}

file_softmagic:
  130|  13.3k|{
  131|  13.3k|	struct mlist *ml;
  132|  13.3k|	int rv = 0, printed_something = 0, need_separator = 0, firstline = 1;
  133|  13.3k|	uint16_t nc, ic;
  134|       |
  135|  13.3k|	if (name_count == NULL) {
  ------------------
  |  Branch (135:6): [True: 13.3k, False: 0]
  ------------------
  136|  13.3k|		nc = 0;
  137|  13.3k|		name_count = &nc;
  138|  13.3k|	}
  139|  13.3k|	if (indir_count == NULL) {
  ------------------
  |  Branch (139:6): [True: 13.3k, False: 0]
  ------------------
  140|  13.3k|		ic = 0;
  141|  13.3k|		indir_count = &ic;
  142|  13.3k|	}
  143|       |
  144|  26.4k|	for (ml = ms->mlist[0]->next; ml != ms->mlist[0]; ml = ml->next) {
  ------------------
  |  Branch (144:32): [True: 13.3k, False: 13.0k]
  ------------------
  145|  13.3k|		int ret = match(ms, ml->magic, ml->magic_rxcomp, ml->nmagic, b,
  146|  13.3k|		    0, mode, text, 0, indir_count, name_count,
  147|  13.3k|		    &printed_something, &need_separator, &firstline,
  148|  13.3k|		    NULL, NULL);
  149|  13.3k|		switch (ret) {
  150|    293|		case -1:
  ------------------
  |  Branch (150:3): [True: 293, False: 13.0k]
  ------------------
  151|    293|			return ret;
  152|  5.13k|		case 0:
  ------------------
  |  Branch (152:3): [True: 5.13k, False: 8.22k]
  ------------------
  153|  5.13k|			continue;
  154|  7.93k|		default:
  ------------------
  |  Branch (154:3): [True: 7.93k, False: 5.42k]
  ------------------
  155|  7.93k|			if ((ms->flags & MAGIC_CONTINUE) == 0)
  ------------------
  |  |   38|  7.93k|#define	MAGIC_CONTINUE		0x0000020 /* Return all matches */
  ------------------
  |  Branch (155:8): [True: 0, False: 7.93k]
  ------------------
  156|      0|				return ret;
  157|  7.93k|			rv = ret;
  158|  7.93k|			break;
  159|  13.3k|		}
  160|  13.3k|	}
  161|       |
  162|  13.0k|	return rv;
  163|  13.3k|}
softmagic.c:match:
  222|  96.6k|{
  223|  96.6k|	uint32_t magindex = 0;
  224|  96.6k|	unsigned int cont_level = 0;
  225|  96.6k|	int found_matchv = 0; /* if a match is found it is set to 1*/
  226|  96.6k|	int returnvalv = 0, e;
  227|  96.6k|	struct buffer bb;
  228|  96.6k|	int print = (ms->flags & MAGIC_NODESC) == 0;
  ------------------
  |  |   52|  96.6k|#define MAGIC_NODESC		(MAGIC_EXTENSION|MAGIC_MIME|MAGIC_APPLE)
  |  |  ------------------
  |  |  |  |   46|  96.6k|#define	MAGIC_EXTENSION		0x1000000 /* Return a /-separated list of
  |  |  ------------------
  |  |               #define MAGIC_NODESC		(MAGIC_EXTENSION|MAGIC_MIME|MAGIC_APPLE)
  |  |  ------------------
  |  |  |  |   44|  96.6k|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|  96.6k|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  |  |  ------------------
  |  |  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|  96.6k|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define MAGIC_NODESC		(MAGIC_EXTENSION|MAGIC_MIME|MAGIC_APPLE)
  |  |  ------------------
  |  |  |  |   45|  96.6k|#define	MAGIC_APPLE		0x0000800 /* Return the Apple creator/type */
  |  |  ------------------
  ------------------
  229|       |
  230|  96.6k|	(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|  96.6k|	if (returnval == NULL)
  ------------------
  |  Branch (235:6): [True: 44.2k, False: 52.4k]
  ------------------
  236|  44.2k|		returnval = &returnvalv;
  237|  96.6k|	if (found_match == NULL)
  ------------------
  |  Branch (237:6): [True: 44.2k, False: 52.4k]
  ------------------
  238|  44.2k|		found_match = &found_matchv;
  239|       |
  240|  96.6k|	if (file_check_mem(ms, cont_level) == -1)
  ------------------
  |  Branch (240:6): [True: 0, False: 96.6k]
  ------------------
  241|      0|		return -1;
  242|       |
  243|   167M|	for (magindex = 0; magindex < nmagic; magindex++) {
  ------------------
  |  Branch (243:21): [True: 167M, False: 87.9k]
  ------------------
  244|   167M|		int flush = 0;
  245|   167M|		struct magic *m = &magic[magindex];
  246|   167M|		file_regex_t **m_rxcomp = &magic_rxcomp[magindex];
  247|       |
  248|   167M|		if (m->type != FILE_NAME)
  ------------------
  |  |  290|   167M|#define				FILE_NAME		45
  ------------------
  |  Branch (248:7): [True: 167M, False: 52.4k]
  ------------------
  249|   167M|		if ((IS_STRING(m->type) &&
  ------------------
  |  |  310|   334M|	((t) == FILE_STRING || \
  |  |  ------------------
  |  |  |  |  250|   334M|#define				FILE_STRING		5
  |  |  ------------------
  |  |  |  Branch (310:3): [True: 102M, False: 65.0M]
  |  |  ------------------
  |  |  311|   167M|	 (t) == FILE_PSTRING || \
  |  |  ------------------
  |  |  |  |  258|   232M|#define				FILE_PSTRING		13
  |  |  ------------------
  |  |  |  Branch (311:3): [True: 43.8k, False: 65.0M]
  |  |  ------------------
  |  |  312|   167M|	 (t) == FILE_BESTRING16 || \
  |  |  ------------------
  |  |  |  |  263|   232M|#define				FILE_BESTRING16		18
  |  |  ------------------
  |  |  |  Branch (312:3): [True: 0, False: 65.0M]
  |  |  ------------------
  |  |  313|   167M|	 (t) == FILE_LESTRING16 || \
  |  |  ------------------
  |  |  |  |  264|   232M|#define				FILE_LESTRING16		19
  |  |  ------------------
  |  |  |  Branch (313:3): [True: 87.7k, False: 64.9M]
  |  |  ------------------
  |  |  314|   167M|	 (t) == FILE_REGEX || \
  |  |  ------------------
  |  |  |  |  262|   232M|#define				FILE_REGEX		17
  |  |  ------------------
  |  |  |  Branch (314:3): [True: 3.17M, False: 61.7M]
  |  |  ------------------
  |  |  315|   167M|	 (t) == FILE_SEARCH || \
  |  |  ------------------
  |  |  |  |  265|   229M|#define				FILE_SEARCH		20
  |  |  ------------------
  |  |  |  Branch (315:3): [True: 11.3M, False: 50.3M]
  |  |  ------------------
  |  |  316|   167M|	 (t) == FILE_INDIRECT || \
  |  |  ------------------
  |  |  |  |  286|   217M|#define				FILE_INDIRECT		41
  |  |  ------------------
  |  |  |  Branch (316:3): [True: 0, False: 50.3M]
  |  |  ------------------
  |  |  317|   167M|	 (t) == FILE_NAME || \
  |  |  ------------------
  |  |  |  |  290|   217M|#define				FILE_NAME		45
  |  |  ------------------
  |  |  |  Branch (317:3): [True: 0, False: 50.3M]
  |  |  ------------------
  |  |  318|   167M|	 (t) == FILE_USE || \
  |  |  ------------------
  |  |  |  |  291|   217M|#define				FILE_USE		46
  |  |  ------------------
  |  |  |  Branch (318:3): [True: 0, False: 50.3M]
  |  |  ------------------
  |  |  319|   334M|	 (t) == FILE_OCTAL)
  |  |  ------------------
  |  |  |  |  306|  50.3M|#define				FILE_OCTAL		61
  |  |  ------------------
  |  |  |  Branch (319:3): [True: 0, False: 50.3M]
  |  |  ------------------
  ------------------
  250|   116M|#define FLT (STRING_BINTEST | STRING_TEXTTEST)
  251|   116M|		     ((text && (m->str_flags & FLT) == STRING_BINTEST) ||
  ------------------
  |  |  382|  12.1M|#define str_flags _u._s._flags
  ------------------
              		     ((text && (m->str_flags & FLT) == STRING_BINTEST) ||
  ------------------
  |  |  250|  12.1M|#define FLT (STRING_BINTEST | STRING_TEXTTEST)
  |  |  ------------------
  |  |  |  |  402|  12.1M|#define STRING_BINTEST				BIT(6)
  |  |  |  |  ------------------
  |  |  |  |  |  |  395|  12.1M|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define FLT (STRING_BINTEST | STRING_TEXTTEST)
  |  |  ------------------
  |  |  |  |  401|  12.1M|#define STRING_TEXTTEST				BIT(5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  395|  12.1M|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
              		     ((text && (m->str_flags & FLT) == STRING_BINTEST) ||
  ------------------
  |  |  402|  12.1M|#define STRING_BINTEST				BIT(6)
  |  |  ------------------
  |  |  |  |  395|  12.1M|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (251:10): [True: 12.1M, False: 104M]
  |  Branch (251:18): [True: 491k, False: 11.6M]
  ------------------
  252|   116M|		      (!text && (m->str_flags & FLT) == STRING_TEXTTEST))) ||
  ------------------
  |  |  382|   104M|#define str_flags _u._s._flags
  ------------------
              		      (!text && (m->str_flags & FLT) == STRING_TEXTTEST))) ||
  ------------------
  |  |  250|   104M|#define FLT (STRING_BINTEST | STRING_TEXTTEST)
  |  |  ------------------
  |  |  |  |  402|   104M|#define STRING_BINTEST				BIT(6)
  |  |  |  |  ------------------
  |  |  |  |  |  |  395|   104M|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define FLT (STRING_BINTEST | STRING_TEXTTEST)
  |  |  ------------------
  |  |  |  |  401|   104M|#define STRING_TEXTTEST				BIT(5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  395|   104M|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
              		      (!text && (m->str_flags & FLT) == STRING_TEXTTEST))) ||
  ------------------
  |  |  401|   104M|#define STRING_TEXTTEST				BIT(5)
  |  |  ------------------
  |  |  |  |  395|   104M|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (252:10): [True: 104M, False: 11.6M]
  |  Branch (252:19): [True: 5.12M, False: 99.6M]
  ------------------
  253|   161M|		    (m->flag & mode) != mode) {
  ------------------
  |  Branch (253:7): [True: 19.3M, False: 142M]
  ------------------
  254|   166M|flush:
  255|       |			/* Skip sub-tests */
  256|   749M|			while (magindex < nmagic - 1 &&
  ------------------
  |  Branch (256:11): [True: 749M, False: 4.75k]
  ------------------
  257|   749M|			    magic[magindex + 1].cont_level != 0) {
  ------------------
  |  Branch (257:8): [True: 582M, False: 166M]
  ------------------
  258|   582M|				magindex++;
  259|   582M|			}
  260|   166M|			cont_level = 0;
  261|   166M|			continue; /* Skip to next top-level test*/
  262|  24.9M|		}
  263|       |
  264|   142M|		if (msetoffset(ms, m, &bb, b, offset, cont_level) == -1) {
  ------------------
  |  Branch (264:7): [True: 87.0k, False: 142M]
  ------------------
  265|  87.0k|			if (b->elen == FILE_BADSIZE)
  ------------------
  |  |  175|  87.0k|#define FILE_BADSIZE CAST(size_t, ~0ul)
  |  |  ------------------
  |  |  |  |  452|  87.0k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (265:8): [True: 0, False: 87.0k]
  ------------------
  266|      0|				continue;
  267|  87.0k|			else
  268|  87.0k|				goto flush;
  269|  87.0k|		}
  270|   142M|		ms->line = m->lineno;
  271|       |
  272|       |		/* if main entry matches, print it... */
  273|   142M|		switch (mget(ms, m, b, &bb, offset, cont_level,
  274|   142M|		    mode, text, flip, indir_count, name_count,
  275|   142M|		    printed_something, need_separator, firstline, returnval,
  276|   142M|		    found_match))
  277|   142M|		{
  278|    172|		case -1:
  ------------------
  |  Branch (278:3): [True: 172, False: 142M]
  ------------------
  279|    172|			return -1;
  280|  15.6M|		case 0:
  ------------------
  |  Branch (280:3): [True: 15.6M, False: 126M]
  ------------------
  281|  15.6M|			flush = m->reln != '!';
  282|  15.6M|			break;
  283|   126M|		default:
  ------------------
  |  Branch (283:3): [True: 126M, False: 15.6M]
  ------------------
  284|   126M|			if (m->type == FILE_INDIRECT) {
  ------------------
  |  |  286|   126M|#define				FILE_INDIRECT		41
  ------------------
  |  Branch (284:8): [True: 0, False: 126M]
  ------------------
  285|      0|				*found_match = 1;
  286|      0|				*returnval = 1;
  287|      0|			}
  288|       |
  289|   126M|			switch (magiccheck(ms, m, m_rxcomp)) {
  290|      0|			case -1:
  ------------------
  |  Branch (290:4): [True: 0, False: 126M]
  ------------------
  291|      0|				return -1;
  292|   126M|			case 0:
  ------------------
  |  Branch (292:4): [True: 126M, False: 539k]
  ------------------
  293|   126M|				flush++;
  294|   126M|				break;
  295|   539k|			default:
  ------------------
  |  Branch (295:4): [True: 539k, False: 126M]
  ------------------
  296|   539k|				flush = 0;
  297|   539k|				break;
  298|   126M|			}
  299|   126M|			break;
  300|   142M|		}
  301|   142M|		if (flush) {
  ------------------
  |  Branch (301:7): [True: 141M, False: 539k]
  ------------------
  302|       |			/*
  303|       |			 * main entry didn't match,
  304|       |			 * flush its continuations
  305|       |			 */
  306|   141M|			goto flush;
  307|   141M|		}
  308|       |
  309|   539k|		if ((e = handle_annotation(ms, m, *firstline)) != 0)
  ------------------
  |  Branch (309:7): [True: 0, False: 539k]
  ------------------
  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|   539k|		if (*m->desc) {
  ------------------
  |  Branch (323:7): [True: 14.6k, False: 524k]
  ------------------
  324|  14.6k|			*found_match = 1;
  325|  14.6k|			if (print) {
  ------------------
  |  Branch (325:8): [True: 14.6k, False: 0]
  ------------------
  326|  14.6k|				*returnval = 1;
  327|  14.6k|				*need_separator = 1;
  328|  14.6k|				*printed_something = 1;
  329|  14.6k|				if (print_sep(ms, *firstline) == -1)
  ------------------
  |  Branch (329:9): [True: 0, False: 14.6k]
  ------------------
  330|      0|					return -1;
  331|  14.6k|				if (mprint(ms, m) == -1)
  ------------------
  |  Branch (331:9): [True: 0, False: 14.6k]
  ------------------
  332|      0|					return -1;
  333|  14.6k|			}
  334|  14.6k|		}
  335|       |
  336|   539k|		switch (moffset(ms, m, bb.flen, offset,
  337|   539k|		    &ms->c.li[cont_level].off)) {
  338|  23.2k|		case -1:
  ------------------
  |  Branch (338:3): [True: 23.2k, False: 515k]
  ------------------
  339|  23.2k|		case 0:
  ------------------
  |  Branch (339:3): [True: 0, False: 539k]
  ------------------
  340|  23.2k|			goto flush;
  341|   515k|		default:
  ------------------
  |  Branch (341:3): [True: 515k, False: 23.2k]
  ------------------
  342|   515k|			break;
  343|   539k|		}
  344|       |
  345|       |		/* and any continuations that match */
  346|   515k|		if (file_check_mem(ms, ++cont_level) == -1)
  ------------------
  |  Branch (346:7): [True: 0, False: 515k]
  ------------------
  347|      0|			return -1;
  348|       |
  349|  5.95M|		while (magindex + 1 < nmagic &&
  ------------------
  |  Branch (349:10): [True: 5.87M, False: 83.1k]
  ------------------
  350|  5.87M|		    magic[magindex + 1].cont_level != 0) {
  ------------------
  |  Branch (350:7): [True: 5.45M, False: 423k]
  ------------------
  351|  5.45M|			m = &magic[++magindex];
  352|  5.45M|			m_rxcomp = &magic_rxcomp[magindex];
  353|  5.45M|			ms->line = m->lineno; /* for messages */
  354|       |
  355|  5.45M|			if (cont_level < m->cont_level)
  ------------------
  |  Branch (355:8): [True: 3.97M, False: 1.47M]
  ------------------
  356|  3.97M|				continue;
  357|  1.47M|			if (cont_level > m->cont_level) {
  ------------------
  |  Branch (357:8): [True: 98.4k, False: 1.38M]
  ------------------
  358|       |				/*
  359|       |				 * We're at the end of the level
  360|       |				 * "cont_level" continuations.
  361|       |				 */
  362|  98.4k|				cont_level = m->cont_level;
  363|  98.4k|			}
  364|  1.47M|			if (msetoffset(ms, m, &bb, b, offset, cont_level)
  ------------------
  |  Branch (364:8): [True: 121, False: 1.47M]
  ------------------
  365|  1.47M|			    == -1) {
  366|    121|				if (b->elen == FILE_BADSIZE)
  ------------------
  |  |  175|    121|#define FILE_BADSIZE CAST(size_t, ~0ul)
  |  |  ------------------
  |  |  |  |  452|    121|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (366:9): [True: 0, False: 121]
  ------------------
  367|      0|					continue;
  368|    121|				else
  369|    121|					goto flush;
  370|    121|			}
  371|  1.47M|			if (m->flag & OFFADD) {
  ------------------
  |  |  227|  1.47M|#define OFFADD		0x02	/* if '>&' or '>...(&' appears */
  ------------------
  |  Branch (371:8): [True: 188k, False: 1.29M]
  ------------------
  372|   188k|				if (cont_level == 0) {
  ------------------
  |  Branch (372:9): [True: 0, False: 188k]
  ------------------
  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|   188k|				ms->offset +=
  380|   188k|				    ms->c.li[cont_level - 1].off;
  381|   188k|			}
  382|       |
  383|  1.47M|#ifdef ENABLE_CONDITIONALS
  384|  1.47M|			if (m->cond == COND_ELSE ||
  ------------------
  |  |  363|  2.95M|#define				COND_ELSE	3
  ------------------
  |  Branch (384:8): [True: 0, False: 1.47M]
  ------------------
  385|  1.47M|			    m->cond == COND_ELIF) {
  ------------------
  |  |  362|  1.47M|#define				COND_ELIF	2
  ------------------
  |  Branch (385:8): [True: 0, False: 1.47M]
  ------------------
  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.47M|#endif
  390|  1.47M|			switch (mget(ms, m, b, &bb, offset,
  391|  1.47M|			    cont_level, mode, text, flip, indir_count,
  392|  1.47M|			    name_count, printed_something, need_separator,
  393|  1.47M|			    firstline, returnval, found_match)) {
  394|  8.60k|			case -1:
  ------------------
  |  Branch (394:4): [True: 8.60k, False: 1.47M]
  ------------------
  395|  8.60k|				return -1;
  396|   101k|			case 0:
  ------------------
  |  Branch (396:4): [True: 101k, False: 1.37M]
  ------------------
  397|   101k|				if (m->reln != '!')
  ------------------
  |  Branch (397:9): [True: 99.9k, False: 1.57k]
  ------------------
  398|  99.9k|					continue;
  399|  1.57k|				flush = 1;
  400|  1.57k|				break;
  401|  1.36M|			default:
  ------------------
  |  Branch (401:4): [True: 1.36M, False: 110k]
  ------------------
  402|  1.36M|				if (m->type == FILE_INDIRECT) {
  ------------------
  |  |  286|  1.36M|#define				FILE_INDIRECT		41
  ------------------
  |  Branch (402:9): [True: 15.8k, False: 1.35M]
  ------------------
  403|  15.8k|					*found_match = 1;
  404|  15.8k|					*returnval = 1;
  405|  15.8k|				}
  406|  1.36M|				flush = 0;
  407|  1.36M|				break;
  408|  1.47M|			}
  409|       |
  410|  1.37M|			switch (flush ? 1 : magiccheck(ms, m, m_rxcomp)) {
  ------------------
  |  Branch (410:12): [True: 1.57k, False: 1.36M]
  ------------------
  411|      0|			case -1:
  ------------------
  |  Branch (411:4): [True: 0, False: 1.37M]
  ------------------
  412|      0|				return -1;
  413|   981k|			case 0:
  ------------------
  |  Branch (413:4): [True: 981k, False: 389k]
  ------------------
  414|   981k|#ifdef ENABLE_CONDITIONALS
  415|   981k|				ms->c.li[cont_level].last_match = 0;
  416|   981k|#endif
  417|   981k|				break;
  418|   389k|			default:
  ------------------
  |  Branch (418:4): [True: 389k, False: 981k]
  ------------------
  419|   389k|#ifdef ENABLE_CONDITIONALS
  420|   389k|				ms->c.li[cont_level].last_match = 1;
  421|   389k|#endif
  422|   389k|				if (m->type == FILE_CLEAR)
  ------------------
  |  |  292|   389k|#define				FILE_CLEAR		47
  ------------------
  |  Branch (422:9): [True: 1.49k, False: 388k]
  ------------------
  423|  1.49k|					ms->c.li[cont_level].got_match = 0;
  424|   388k|				else if (ms->c.li[cont_level].got_match) {
  ------------------
  |  Branch (424:14): [True: 73.8k, False: 314k]
  ------------------
  425|  73.8k|					if (m->type == FILE_DEFAULT)
  ------------------
  |  |  248|  73.8k|#define				FILE_DEFAULT		3
  ------------------
  |  Branch (425:10): [True: 1.32k, False: 72.4k]
  ------------------
  426|  1.32k|						break;
  427|  73.8k|				} else
  428|   314k|					ms->c.li[cont_level].got_match = 1;
  429|       |
  430|   388k|				if ((e = handle_annotation(ms, m, *firstline))
  ------------------
  |  Branch (430:9): [True: 0, False: 388k]
  ------------------
  431|   388k|				    != 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|   388k|				if (*m->desc) {
  ------------------
  |  Branch (439:9): [True: 85.4k, False: 302k]
  ------------------
  440|  85.4k|					*found_match = 1;
  441|  85.4k|				}
  442|   388k|				if (print && *m->desc) {
  ------------------
  |  Branch (442:9): [True: 388k, False: 0]
  |  Branch (442:18): [True: 85.4k, False: 302k]
  ------------------
  443|  85.4k|					*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|  85.4k|					if (!*printed_something) {
  ------------------
  |  Branch (455:10): [True: 14.2k, False: 71.2k]
  ------------------
  456|  14.2k|						*printed_something = 1;
  457|  14.2k|						if (print_sep(ms, *firstline)
  ------------------
  |  Branch (457:11): [True: 0, False: 14.2k]
  ------------------
  458|  14.2k|						    == -1)
  459|      0|							return -1;
  460|  14.2k|					}
  461|       |					/* space if previous printed */
  462|  85.4k|					if (*need_separator
  ------------------
  |  Branch (462:10): [True: 81.7k, False: 3.64k]
  ------------------
  463|  81.7k|					    && (m->flag & NOSPACE) == 0) {
  ------------------
  |  |  230|  81.7k|#define NOSPACE		0x10	/* suppress space character before output */
  ------------------
  |  Branch (463:13): [True: 33.4k, False: 48.3k]
  ------------------
  464|  33.4k|						if (file_printf(ms, " ") == -1)
  ------------------
  |  Branch (464:11): [True: 0, False: 33.4k]
  ------------------
  465|      0|							return -1;
  466|  33.4k|					}
  467|  85.4k|					if (mprint(ms, m) == -1)
  ------------------
  |  Branch (467:10): [True: 0, False: 85.4k]
  ------------------
  468|      0|						return -1;
  469|  85.4k|					*need_separator = 1;
  470|  85.4k|				}
  471|       |
  472|   388k|				switch (moffset(ms, m, bb.flen, offset,
  473|   388k|				    &ms->c.li[cont_level].off)) {
  474|  3.78k|				case -1:
  ------------------
  |  Branch (474:5): [True: 3.78k, False: 384k]
  ------------------
  475|  3.78k|				case 0:
  ------------------
  |  Branch (475:5): [True: 0, False: 388k]
  ------------------
  476|  3.78k|					cont_level--;
  477|  3.78k|					break;
  478|   384k|				default:
  ------------------
  |  Branch (478:5): [True: 384k, False: 3.78k]
  ------------------
  479|   384k|					break;
  480|   388k|				}
  481|       |
  482|       |				/*
  483|       |				 * If we see any continuations
  484|       |				 * at a higher level,
  485|       |				 * process them.
  486|       |				 */
  487|   388k|				if (file_check_mem(ms, ++cont_level) == -1)
  ------------------
  |  Branch (487:9): [True: 0, False: 388k]
  ------------------
  488|      0|					return -1;
  489|   388k|				break;
  490|  1.37M|			}
  491|  1.37M|		}
  492|   507k|		if (*printed_something) {
  ------------------
  |  Branch (492:7): [True: 50.8k, False: 456k]
  ------------------
  493|  50.8k|			*firstline = 0;
  494|  50.8k|		}
  495|   507k|		if (*found_match) {
  ------------------
  |  Branch (495:7): [True: 252k, False: 254k]
  ------------------
  496|   252k|			if ((ms->flags & MAGIC_CONTINUE) == 0)
  ------------------
  |  |   38|   252k|#define	MAGIC_CONTINUE		0x0000020 /* Return all matches */
  ------------------
  |  Branch (496:8): [True: 0, False: 252k]
  ------------------
  497|      0|				return *returnval;
  498|       |			// So that we print a separator
  499|   252k|			*printed_something = 0;
  500|   252k|			*firstline = 0;
  501|   252k|		}
  502|   507k|		cont_level = 0;
  503|   507k|	}
  504|  87.9k|	return *returnval;
  505|  96.6k|}
softmagic.c:msetoffset:
 1571|   143M|{
 1572|   143M|	int32_t offset;
 1573|   143M|	if (m->flag & OFFNEGATIVE) {
  ------------------
  |  |  234|   143M|#define OFFNEGATIVE	0x80	/* relative to the end of file */
  ------------------
  |  Branch (1573:6): [True: 451k, False: 143M]
  ------------------
 1574|   451k|		offset = -m->offset;
 1575|   451k|		if (cont_level > 0) {
  ------------------
  |  Branch (1575:7): [True: 37.6k, False: 413k]
  ------------------
 1576|  37.6k|			if (m->flag & (OFFADD|INDIROFFADD))
  ------------------
  |  |  227|  37.6k|#define OFFADD		0x02	/* if '>&' or '>...(&' appears */
  ------------------
              			if (m->flag & (OFFADD|INDIROFFADD))
  ------------------
  |  |  228|  37.6k|#define INDIROFFADD	0x04	/* if '>&(' appears */
  ------------------
  |  Branch (1576:8): [True: 33.1k, False: 4.54k]
  ------------------
 1577|  33.1k|				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|  37.6k|		}
 1584|   418k|		if (buffer_fill(b) == -1)
  ------------------
  |  Branch (1584:7): [True: 0, False: 418k]
  ------------------
 1585|      0|			return -1;
 1586|   418k|		if (o != 0) {
  ------------------
  |  Branch (1586:7): [True: 42, False: 418k]
  ------------------
 1587|       |			// Not yet!
 1588|     42|			file_magerror(ms, "non zero offset %" SIZE_T_FORMAT
 1589|     42|			    "u at level %u", o, cont_level);
 1590|     42|			return -1;
 1591|     42|		}
 1592|   418k|		if (b->fd == -1) {
  ------------------
  |  Branch (1592:7): [True: 418k, False: 0]
  ------------------
 1593|   418k|			if (CAST(size_t, m->offset) > b->flen)
  ------------------
  |  |  452|   418k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (1593:8): [True: 87.1k, False: 330k]
  ------------------
 1594|  87.1k|				return -1;
 1595|   330k|			ms->eoffset = ms->offset =
 1596|   330k|			    CAST(int32_t, b->flen - m->offset);
  ------------------
  |  |  452|   330k|#define CAST(T, b)	((T)(b))
  ------------------
 1597|   330k|		} else {
 1598|      0|			if (CAST(size_t, m->offset) > b->elen)
  ------------------
  |  |  452|      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);
  ------------------
  |  |  452|      0|#define CAST(T, b)	((T)(b))
  ------------------
 1603|      0|		}
 1604|   143M|	} else {
 1605|   143M|		offset = m->offset;
 1606|   143M|		if ((m->flag & OFFPOSITIVE) || cont_level == 0) {
  ------------------
  |  |  235|   143M|#define OFFPOSITIVE	0x100	/* relative to the beginning of file */
  ------------------
  |  Branch (1606:7): [True: 49, False: 143M]
  |  Branch (1606:34): [True: 141M, False: 1.44M]
  ------------------
 1607|   142M|normal:
 1608|       |			// XXX: Pass real fd, then who frees bb?
 1609|   142M|			buffer_init(bb, -1, NULL, b->fbuf, b->flen);
 1610|   142M|			ms->offset = offset;
 1611|   142M|			ms->eoffset = 0;
 1612|   142M|		} else {
 1613|  1.44M|			ms->offset = ms->eoffset + offset;
 1614|  1.44M|		}
 1615|   143M|	}
 1616|   143M|	if ((ms->flags & MAGIC_DEBUG) != 0) {
  ------------------
  |  |   33|   143M|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1616:6): [True: 0, False: 143M]
  ------------------
 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|   143M|	return 0;
 1624|   143M|}
softmagic.c:mget:
 1654|   143M|{
 1655|   143M|	uint32_t eoffset, offset = ms->offset;
 1656|   143M|	struct buffer sbb;
 1657|   143M|	intmax_t lhs;
 1658|   143M|	file_pushbuf_t *pb;
 1659|   143M|	int rv, oneed_separator, in_type, nfound_match;
 1660|   143M|	char *rbuf;
 1661|   143M|	union VALUETYPE *p = &ms->ms_value;
 1662|   143M|	struct mlist ml, *mlp;
 1663|   143M|	struct cont c;
 1664|   143M|	const unsigned char *s = CAST(const unsigned char *, bb->fbuf);
  ------------------
  |  |  452|   143M|#define CAST(T, b)	((T)(b))
  ------------------
 1665|   143M|	size_t nbytes = bb->flen;
 1666|       |
 1667|   143M|	if (*indir_count >= ms->indir_max) {
  ------------------
  |  Branch (1667:6): [True: 170, False: 143M]
  ------------------
 1668|    170|		file_error(ms, 0, "indirect count (%hu) exceeded",
 1669|    170|		    *indir_count);
 1670|    170|		return -1;
 1671|    170|	}
 1672|       |
 1673|   143M|	if (*name_count >= ms->name_max) {
  ------------------
  |  Branch (1673:6): [True: 2, False: 143M]
  ------------------
 1674|      2|		file_error(ms, 0, "name use count (%hu) exceeded",
 1675|      2|		    *name_count);
 1676|      2|		return -1;
 1677|      2|	}
 1678|       |
 1679|       |
 1680|   143M|	if (mcopy(ms, p, m->type, m->flag & INDIR, s,
  ------------------
  |  |  226|   143M|#define INDIR		0x01	/* if '(...)' appears */
  ------------------
  |  Branch (1680:6): [True: 0, False: 143M]
  ------------------
 1681|   143M|	    CAST(uint32_t, offset + o), CAST(uint32_t, nbytes), m) == -1)
  ------------------
  |  |  452|   143M|#define CAST(T, b)	((T)(b))
  ------------------
              	    CAST(uint32_t, offset + o), CAST(uint32_t, nbytes), m) == -1)
  ------------------
  |  |  452|   143M|#define CAST(T, b)	((T)(b))
  ------------------
 1682|      0|		return -1;
 1683|       |
 1684|   143M|	if ((ms->flags & MAGIC_DEBUG) != 0) {
  ------------------
  |  |   33|   143M|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1684:6): [True: 0, False: 143M]
  ------------------
 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)),
  ------------------
  |  |  453|      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|   143M|	if (m->flag & INDIR) {
  ------------------
  |  |  226|   143M|#define INDIR		0x01	/* if '(...)' appears */
  ------------------
  |  Branch (1697:6): [True: 969k, False: 142M]
  ------------------
 1698|   969k|		intmax_t off = m->in_offset;
 1699|   969k|		const int sgn = m->in_op & FILE_OPSIGNED;
  ------------------
  |  |  355|   969k|#define				FILE_OPSIGNED	0x20
  ------------------
 1700|   969k|		if (m->in_op & FILE_OPINDIRECT) {
  ------------------
  |  |  357|   969k|#define				FILE_OPINDIRECT	0x80
  ------------------
  |  Branch (1700:7): [True: 553, False: 969k]
  ------------------
 1701|    553|			uint8_t *hb;
 1702|    553|			uint16_t hs;
 1703|    553|			uint32_t hl;
 1704|    553|			int op;
 1705|       |
 1706|    553|			if (offset_oob(nbytes, offset + off, 0))
  ------------------
  |  Branch (1706:8): [True: 90, False: 463]
  ------------------
 1707|     90|				return 0;
 1708|    463|			hb = CCAST(uint8_t *, s + offset + off);
  ------------------
  |  |  454|    463|#define CCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 1709|    463|			switch (op = cvt_flip(m->in_type, flip)) {
 1710|      0|			case FILE_BYTE:
  ------------------
  |  |  246|      0|#define 			FILE_BYTE		1
  ------------------
  |  Branch (1710:4): [True: 0, False: 463]
  ------------------
 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)) : \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|      0|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1714|      0|				break;
 1715|      0|			case FILE_SHORT:
  ------------------
  |  |  247|      0|#define				FILE_SHORT		2
  ------------------
  |  Branch (1715:4): [True: 0, False: 463]
  ------------------
 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)) : \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|      0|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1720|      0|				break;
 1721|      0|			case FILE_BESHORT:
  ------------------
  |  |  252|      0|#define				FILE_BESHORT		7
  ------------------
  |  Branch (1721:4): [True: 0, False: 463]
  ------------------
 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)) : \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|      0|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1725|      0|				break;
 1726|      0|			case FILE_LESHORT:
  ------------------
  |  |  255|      0|#define				FILE_LESHORT		10
  ------------------
  |  Branch (1726:4): [True: 0, False: 463]
  ------------------
 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)) : \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|      0|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1730|      0|				break;
 1731|      0|			case FILE_LONG:
  ------------------
  |  |  249|      0|#define				FILE_LONG		4
  ------------------
  |  Branch (1731:4): [True: 0, False: 463]
  ------------------
 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)) : \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|      0|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1736|      0|				break;
 1737|      0|			case FILE_BELONG:
  ------------------
  |  |  253|      0|#define				FILE_BELONG		8
  ------------------
  |  Branch (1737:4): [True: 0, False: 463]
  ------------------
 1738|      0|			case FILE_BEID3:
  ------------------
  |  |  284|      0|#define				FILE_BEID3		39
  ------------------
  |  Branch (1738:4): [True: 0, False: 463]
  ------------------
 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)) : \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|      0|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1742|      0|				break;
 1743|      0|			case FILE_LEID3:
  ------------------
  |  |  285|      0|#define				FILE_LEID3		40
  ------------------
  |  Branch (1743:4): [True: 0, False: 463]
  ------------------
 1744|    463|			case FILE_LELONG:
  ------------------
  |  |  256|    463|#define				FILE_LELONG		11
  ------------------
  |  Branch (1744:4): [True: 463, False: 0]
  ------------------
 1745|    463|				if (offset_oob(nbytes, offset + off, 4))
  ------------------
  |  Branch (1745:9): [True: 70, False: 393]
  ------------------
 1746|     70|					return 0;
 1747|    393|				off = SEXT(sgn,32,LE32(hb));
  ------------------
  |  |  108|    393|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 393]
  |  |  ------------------
  |  |  109|    393|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|    393|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  452|    393|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1748|    393|				break;
 1749|      0|			case FILE_MELONG:
  ------------------
  |  |  268|      0|#define				FILE_MELONG		23
  ------------------
  |  Branch (1749:4): [True: 0, False: 463]
  ------------------
 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)) : \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|      0|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1753|      0|				break;
 1754|      0|			case FILE_BEQUAD:
  ------------------
  |  |  271|      0|#define				FILE_BEQUAD		26
  ------------------
  |  Branch (1754:4): [True: 0, False: 463]
  ------------------
 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)) : \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|      0|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1758|      0|				break;
 1759|      0|			case FILE_LEQUAD:
  ------------------
  |  |  270|      0|#define				FILE_LEQUAD		25
  ------------------
  |  Branch (1759:4): [True: 0, False: 463]
  ------------------
 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)) : \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|      0|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1763|      0|				break;
 1764|      0|			case FILE_OCTAL:
  ------------------
  |  |  306|      0|#define				FILE_OCTAL		61
  ------------------
  |  Branch (1764:4): [True: 0, False: 463]
  ------------------
 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)) : \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|      0|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1768|      0|				break;
 1769|      0|			default:
  ------------------
  |  Branch (1769:4): [True: 0, False: 463]
  ------------------
 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|    463|			}
 1774|    393|			if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|    393|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1774:8): [True: 0, False: 393]
  ------------------
 1775|      0|				fprintf(stderr, "indirect offs=%jd\n", off);
 1776|    393|		}
 1777|   969k|		switch (in_type = cvt_flip(m->in_type, flip)) {
 1778|  18.9k|		case FILE_BYTE:
  ------------------
  |  |  246|  18.9k|#define 			FILE_BYTE		1
  ------------------
  |  Branch (1778:3): [True: 18.9k, False: 950k]
  ------------------
 1779|  18.9k|			if (offset_oob(nbytes, offset, 1))
  ------------------
  |  Branch (1779:8): [True: 34, False: 18.8k]
  ------------------
 1780|     34|				return 0;
 1781|  18.8k|			if (do_ops(ms, m, &offset, SEXT(sgn,8,p->b), off))
  ------------------
  |  |  108|  18.8k|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 18.8k]
  |  |  ------------------
  |  |  109|  18.8k|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|  18.8k|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  452|  18.8k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (1781:8): [True: 0, False: 18.8k]
  ------------------
 1782|      0|				return 0;
 1783|  18.8k|			break;
 1784|  18.8k|		case FILE_BESHORT:
  ------------------
  |  |  252|  14.4k|#define				FILE_BESHORT		7
  ------------------
  |  Branch (1784:3): [True: 14.4k, False: 955k]
  ------------------
 1785|  14.4k|			if (offset_oob(nbytes, offset, 2))
  ------------------
  |  Branch (1785:8): [True: 157, False: 14.2k]
  ------------------
 1786|    157|				return 0;
 1787|  14.2k|			if (do_ops(ms, m, &offset, SEXT(sgn,16,BE16(p->hs)), off))
  ------------------
  |  |  108|  14.2k|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 14.2k]
  |  |  ------------------
  |  |  109|  14.2k|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|  14.2k|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  452|  14.2k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (1787:8): [True: 0, False: 14.2k]
  ------------------
 1788|      0|				return 0;
 1789|  14.2k|			break;
 1790|  14.2k|		case FILE_LESHORT:
  ------------------
  |  |  255|  7.79k|#define				FILE_LESHORT		10
  ------------------
  |  Branch (1790:3): [True: 7.79k, False: 961k]
  ------------------
 1791|  7.79k|			if (offset_oob(nbytes, offset, 2))
  ------------------
  |  Branch (1791:8): [True: 1.07k, False: 6.72k]
  ------------------
 1792|  1.07k|				return 0;
 1793|  6.72k|			if (do_ops(ms, m, &offset, SEXT(sgn,16,LE16(p->hs)), off))
  ------------------
  |  |  108|  6.72k|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 6.72k]
  |  |  ------------------
  |  |  109|  6.72k|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|  6.72k|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  452|  6.72k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (1793:8): [True: 0, False: 6.72k]
  ------------------
 1794|      0|				return 0;
 1795|  6.72k|			break;
 1796|  6.72k|		case FILE_SHORT:
  ------------------
  |  |  247|      0|#define				FILE_SHORT		2
  ------------------
  |  Branch (1796:3): [True: 0, False: 969k]
  ------------------
 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)) : \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|      0|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (1799:8): [True: 0, False: 0]
  ------------------
 1800|      0|				return 0;
 1801|      0|			break;
 1802|  2.37k|		case FILE_BELONG:
  ------------------
  |  |  253|  2.37k|#define				FILE_BELONG		8
  ------------------
  |  Branch (1802:3): [True: 2.37k, False: 967k]
  ------------------
 1803|  2.51k|		case FILE_BEID3:
  ------------------
  |  |  284|  2.51k|#define				FILE_BEID3		39
  ------------------
  |  Branch (1803:3): [True: 146, False: 969k]
  ------------------
 1804|  2.51k|			if (offset_oob(nbytes, offset, 4))
  ------------------
  |  Branch (1804:8): [True: 146, False: 2.37k]
  ------------------
 1805|    146|				return 0;
 1806|  2.37k|			lhs = BE32(p->hl);
  ------------------
  |  |   95|  2.37k|#define BE32(p) ( \
  |  |   96|  2.37k|    (CAST(uint32_t, (p)[0])<<24)| \
  |  |  ------------------
  |  |  |  |  452|  2.37k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   97|  2.37k|    (CAST(uint32_t, (p)[1])<<16)| \
  |  |  ------------------
  |  |  |  |  452|  2.37k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   98|  2.37k|    (CAST(uint32_t, (p)[2])<<8)| \
  |  |  ------------------
  |  |  |  |  452|  2.37k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   99|  2.37k|    (CAST(uint32_t, (p)[3])))
  |  |  ------------------
  |  |  |  |  452|  2.37k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1807|  2.37k|			if (in_type == FILE_BEID3)
  ------------------
  |  |  284|  2.37k|#define				FILE_BEID3		39
  ------------------
  |  Branch (1807:8): [True: 108, False: 2.26k]
  ------------------
 1808|    108|				lhs = cvt_id3(ms, CAST(uint32_t, lhs));
  ------------------
  |  |  452|    108|#define CAST(T, b)	((T)(b))
  ------------------
 1809|  2.37k|			if (do_ops(ms, m, &offset, SEXT(sgn,32,lhs), off))
  ------------------
  |  |  108|  2.37k|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 2.37k]
  |  |  ------------------
  |  |  109|  2.37k|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|  2.37k|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  452|  2.37k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (1809:8): [True: 282, False: 2.09k]
  ------------------
 1810|    282|				return 0;
 1811|  2.09k|			break;
 1812|   921k|		case FILE_LELONG:
  ------------------
  |  |  256|   921k|#define				FILE_LELONG		11
  ------------------
  |  Branch (1812:3): [True: 921k, False: 48.1k]
  ------------------
 1813|   921k|		case FILE_LEID3:
  ------------------
  |  |  285|   921k|#define				FILE_LEID3		40
  ------------------
  |  Branch (1813:3): [True: 0, False: 969k]
  ------------------
 1814|   921k|			if (offset_oob(nbytes, offset, 4))
  ------------------
  |  Branch (1814:8): [True: 311k, False: 609k]
  ------------------
 1815|   311k|				return 0;
 1816|   609k|			lhs = LE32(p->hl);
  ------------------
  |  |   90|   609k|#define LE32(p) ( \
  |  |   91|   609k|    (CAST(uint32_t, (p)[3])<<24)| \
  |  |  ------------------
  |  |  |  |  452|   609k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   92|   609k|    (CAST(uint32_t, (p)[2])<<16)| \
  |  |  ------------------
  |  |  |  |  452|   609k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   93|   609k|    (CAST(uint32_t, (p)[1])<<8)| \
  |  |  ------------------
  |  |  |  |  452|   609k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   94|   609k|    (CAST(uint32_t, (p)[0])))
  |  |  ------------------
  |  |  |  |  452|   609k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1817|   609k|			if (in_type == FILE_LEID3)
  ------------------
  |  |  285|   609k|#define				FILE_LEID3		40
  ------------------
  |  Branch (1817:8): [True: 0, False: 609k]
  ------------------
 1818|      0|				lhs = cvt_id3(ms, CAST(uint32_t, lhs));
  ------------------
  |  |  452|      0|#define CAST(T, b)	((T)(b))
  ------------------
 1819|   609k|			if (do_ops(ms, m, &offset, SEXT(sgn,32,lhs), off))
  ------------------
  |  |  108|   609k|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 609k]
  |  |  ------------------
  |  |  109|   609k|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|   609k|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  452|   609k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (1819:8): [True: 5.21k, False: 604k]
  ------------------
 1820|  5.21k|				return 0;
 1821|   604k|			break;
 1822|   604k|		case FILE_MELONG:
  ------------------
  |  |  268|      0|#define				FILE_MELONG		23
  ------------------
  |  Branch (1822:3): [True: 0, False: 969k]
  ------------------
 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)) : \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|      0|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (1825:8): [True: 0, False: 0]
  ------------------
 1826|      0|				return 0;
 1827|      0|			break;
 1828|    351|		case FILE_LONG:
  ------------------
  |  |  249|    351|#define				FILE_LONG		4
  ------------------
  |  Branch (1828:3): [True: 351, False: 969k]
  ------------------
 1829|    351|			if (offset_oob(nbytes, offset, 4))
  ------------------
  |  Branch (1829:8): [True: 74, False: 277]
  ------------------
 1830|     74|				return 0;
 1831|    277|			if (do_ops(ms, m, &offset, SEXT(sgn,32,p->l), off))
  ------------------
  |  |  108|    277|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 277]
  |  |  ------------------
  |  |  109|    277|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|    277|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  452|    277|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (1831:8): [True: 86, False: 191]
  ------------------
 1832|     86|				return 0;
 1833|    191|			break;
 1834|  3.56k|		case FILE_LEQUAD:
  ------------------
  |  |  270|  3.56k|#define				FILE_LEQUAD		25
  ------------------
  |  Branch (1834:3): [True: 3.56k, False: 966k]
  ------------------
 1835|  3.56k|			if (offset_oob(nbytes, offset, 8))
  ------------------
  |  Branch (1835:8): [True: 148, False: 3.41k]
  ------------------
 1836|    148|				return 0;
 1837|  3.41k|			if (do_ops(ms, m, &offset, SEXT(sgn,64,LE64(p->hq)), off))	
  ------------------
  |  |  108|  3.41k|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 3.41k]
  |  |  ------------------
  |  |  109|  3.41k|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|  3.41k|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  452|  3.41k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (1837:8): [True: 1.32k, False: 2.09k]
  ------------------
 1838|  1.32k|				return 0;
 1839|  2.09k|			break;
 1840|  2.09k|		case FILE_BEQUAD:
  ------------------
  |  |  271|    245|#define				FILE_BEQUAD		26
  ------------------
  |  Branch (1840:3): [True: 245, False: 969k]
  ------------------
 1841|    245|			if (offset_oob(nbytes, offset, 8))
  ------------------
  |  Branch (1841:8): [True: 0, False: 245]
  ------------------
 1842|      0|				return 0;
 1843|    245|			if (do_ops(ms, m, &offset, SEXT(sgn,64,BE64(p->hq)), off))
  ------------------
  |  |  108|    245|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 245]
  |  |  ------------------
  |  |  109|    245|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|    245|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  452|    245|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (1843:8): [True: 119, False: 126]
  ------------------
 1844|    119|				return 0;
 1845|    126|			break;
 1846|    337|		case FILE_OCTAL:
  ------------------
  |  |  306|    337|#define				FILE_OCTAL		61
  ------------------
  |  Branch (1846:3): [True: 337, False: 969k]
  ------------------
 1847|    337|			if (offset_oob(nbytes, offset, m->vallen))
  ------------------
  |  Branch (1847:8): [True: 137, False: 200]
  ------------------
 1848|    137|				return 0;
 1849|    200|			if(do_ops(ms, m, &offset,
  ------------------
  |  Branch (1849:7): [True: 69, False: 131]
  ------------------
 1850|    200|			    SEXT(sgn,64,strtoull(p->s, NULL, 8)), off))
  ------------------
  |  |  108|    200|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 200]
  |  |  ------------------
  |  |  109|    200|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|    200|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  452|    200|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1851|     69|				return 0;
 1852|    131|			break;
 1853|    131|		default:
  ------------------
  |  Branch (1853:3): [True: 0, False: 969k]
  ------------------
 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|   969k|		}
 1858|       |
 1859|   649k|		if (m->flag & INDIROFFADD) {
  ------------------
  |  |  228|   649k|#define INDIROFFADD	0x04	/* if '>&(' appears */
  ------------------
  |  Branch (1859:7): [True: 3.90k, False: 645k]
  ------------------
 1860|  3.90k|			if (cont_level == 0) {
  ------------------
  |  Branch (1860:8): [True: 0, False: 3.90k]
  ------------------
 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|  3.90k|			offset += ms->c.li[cont_level - 1].off;
 1867|  3.90k|			if (offset == 0) {
  ------------------
  |  Branch (1867:8): [True: 176, False: 3.73k]
  ------------------
 1868|    176|				if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|    176|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1868:9): [True: 0, False: 176]
  ------------------
 1869|      0|					fprintf(stderr,
 1870|      0|					    "indirect *zero* offset\n");
 1871|    176|				return 0;
 1872|    176|			}
 1873|  3.73k|			if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  3.73k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1873:8): [True: 0, False: 3.73k]
  ------------------
 1874|      0|				fprintf(stderr, "indirect +offs=%u\n", offset);
 1875|  3.73k|		}
 1876|   648k|		if (mcopy(ms, p, m->type, 0, s, offset, nbytes, m) == -1)
  ------------------
  |  Branch (1876:7): [True: 0, False: 648k]
  ------------------
 1877|      0|			return -1;
 1878|   648k|		ms->offset = offset;
 1879|       |
 1880|   648k|		if ((ms->flags & MAGIC_DEBUG) != 0) {
  ------------------
  |  |   33|   648k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1880:7): [True: 0, False: 648k]
  ------------------
 1881|      0|			mdebug(offset, RCAST(char *, RCAST(void *, p)),
  ------------------
  |  |  453|      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|   648k|	}
 1888|       |
 1889|       |	/* Verify we have enough data to match magic type */
 1890|   143M|	switch (m->type) {
 1891|  2.36M|	case FILE_BYTE:
  ------------------
  |  |  246|  2.36M|#define 			FILE_BYTE		1
  ------------------
  |  Branch (1891:2): [True: 2.36M, False: 141M]
  ------------------
 1892|  2.36M|		if (offset_oob(nbytes, offset, 1))
  ------------------
  |  Branch (1892:7): [True: 172k, False: 2.19M]
  ------------------
 1893|   172k|			return 0;
 1894|  2.19M|		break;
 1895|       |
 1896|  2.73M|	case FILE_SHORT:
  ------------------
  |  |  247|  2.73M|#define				FILE_SHORT		2
  ------------------
  |  Branch (1896:2): [True: 2.73M, False: 140M]
  ------------------
 1897|  8.45M|	case FILE_BESHORT:
  ------------------
  |  |  252|  8.45M|#define				FILE_BESHORT		7
  ------------------
  |  Branch (1897:2): [True: 5.72M, False: 137M]
  ------------------
 1898|  13.7M|	case FILE_LESHORT:
  ------------------
  |  |  255|  13.7M|#define				FILE_LESHORT		10
  ------------------
  |  Branch (1898:2): [True: 5.30M, False: 138M]
  ------------------
 1899|  13.7M|		if (offset_oob(nbytes, offset, 2))
  ------------------
  |  Branch (1899:7): [True: 905k, False: 12.8M]
  ------------------
 1900|   905k|			return 0;
 1901|  12.8M|		break;
 1902|       |
 1903|  12.8M|	case FILE_LONG:
  ------------------
  |  |  249|  2.11M|#define				FILE_LONG		4
  ------------------
  |  Branch (1903:2): [True: 2.11M, False: 141M]
  ------------------
 1904|  19.8M|	case FILE_BELONG:
  ------------------
  |  |  253|  19.8M|#define				FILE_BELONG		8
  ------------------
  |  Branch (1904:2): [True: 17.6M, False: 125M]
  ------------------
 1905|  29.1M|	case FILE_LELONG:
  ------------------
  |  |  256|  29.1M|#define				FILE_LELONG		11
  ------------------
  |  Branch (1905:2): [True: 9.34M, False: 134M]
  ------------------
 1906|  29.1M|	case FILE_MELONG:
  ------------------
  |  |  268|  29.1M|#define				FILE_MELONG		23
  ------------------
  |  Branch (1906:2): [True: 38, False: 143M]
  ------------------
 1907|  29.1M|	case FILE_DATE:
  ------------------
  |  |  251|  29.1M|#define				FILE_DATE		6
  ------------------
  |  Branch (1907:2): [True: 0, False: 143M]
  ------------------
 1908|  29.1M|	case FILE_BEDATE:
  ------------------
  |  |  254|  29.1M|#define				FILE_BEDATE		9
  ------------------
  |  Branch (1908:2): [True: 477, False: 143M]
  ------------------
 1909|  29.1M|	case FILE_LEDATE:
  ------------------
  |  |  257|  29.1M|#define				FILE_LEDATE		12
  ------------------
  |  Branch (1909:2): [True: 159, False: 143M]
  ------------------
 1910|  29.1M|	case FILE_MEDATE:
  ------------------
  |  |  266|  29.1M|#define				FILE_MEDATE		21
  ------------------
  |  Branch (1910:2): [True: 174, False: 143M]
  ------------------
 1911|  29.1M|	case FILE_LDATE:
  ------------------
  |  |  259|  29.1M|#define				FILE_LDATE		14
  ------------------
  |  Branch (1911:2): [True: 0, False: 143M]
  ------------------
 1912|  29.1M|	case FILE_BELDATE:
  ------------------
  |  |  260|  29.1M|#define				FILE_BELDATE		15
  ------------------
  |  Branch (1912:2): [True: 465, False: 143M]
  ------------------
 1913|  29.1M|	case FILE_LELDATE:
  ------------------
  |  |  261|  29.1M|#define				FILE_LELDATE		16
  ------------------
  |  Branch (1913:2): [True: 114, False: 143M]
  ------------------
 1914|  29.1M|	case FILE_MELDATE:
  ------------------
  |  |  267|  29.1M|#define				FILE_MELDATE		22
  ------------------
  |  Branch (1914:2): [True: 0, False: 143M]
  ------------------
 1915|  29.1M|	case FILE_FLOAT:
  ------------------
  |  |  278|  29.1M|#define				FILE_FLOAT		33
  ------------------
  |  Branch (1915:2): [True: 0, False: 143M]
  ------------------
 1916|  29.1M|	case FILE_BEFLOAT:
  ------------------
  |  |  279|  29.1M|#define				FILE_BEFLOAT		34
  ------------------
  |  Branch (1916:2): [True: 0, False: 143M]
  ------------------
 1917|  29.1M|	case FILE_LEFLOAT:
  ------------------
  |  |  280|  29.1M|#define				FILE_LEFLOAT		35
  ------------------
  |  Branch (1917:2): [True: 10.4k, False: 143M]
  ------------------
 1918|  29.1M|		if (offset_oob(nbytes, offset, 4))
  ------------------
  |  Branch (1918:7): [True: 1.97M, False: 27.1M]
  ------------------
 1919|  1.97M|			return 0;
 1920|  27.1M|		break;
 1921|       |
 1922|  27.1M|	case FILE_DOUBLE:
  ------------------
  |  |  281|      0|#define				FILE_DOUBLE		36
  ------------------
  |  Branch (1922:2): [True: 0, False: 143M]
  ------------------
 1923|    215|	case FILE_BEDOUBLE:
  ------------------
  |  |  282|    215|#define				FILE_BEDOUBLE		37
  ------------------
  |  Branch (1923:2): [True: 215, False: 143M]
  ------------------
 1924|  1.11k|	case FILE_LEDOUBLE:
  ------------------
  |  |  283|  1.11k|#define				FILE_LEDOUBLE		38
  ------------------
  |  Branch (1924:2): [True: 895, False: 143M]
  ------------------
 1925|  1.11k|		if (offset_oob(nbytes, offset, 8))
  ------------------
  |  Branch (1925:7): [True: 379, False: 731]
  ------------------
 1926|    379|			return 0;
 1927|    731|		break;
 1928|       |
 1929|    731|	case FILE_LEGUID:
  ------------------
  |  |  295|      0|#define				FILE_LEGUID		50
  ------------------
  |  Branch (1929:2): [True: 0, False: 143M]
  ------------------
 1930|    135|	case FILE_BEGUID:
  ------------------
  |  |  296|    135|#define				FILE_BEGUID		51
  ------------------
  |  Branch (1930:2): [True: 135, False: 143M]
  ------------------
 1931|   328k|	case FILE_GUID:
  ------------------
  |  |  294|   328k|#define				FILE_GUID		49
  ------------------
  |  Branch (1931:2): [True: 328k, False: 143M]
  ------------------
 1932|   328k|		if (offset_oob(nbytes, offset, 16))
  ------------------
  |  Branch (1932:7): [True: 22.4k, False: 305k]
  ------------------
 1933|  22.4k|			return 0;
 1934|   305k|		break;
 1935|       |
 1936|  92.9M|	case FILE_STRING:
  ------------------
  |  |  250|  92.9M|#define				FILE_STRING		5
  ------------------
  |  Branch (1936:2): [True: 92.9M, False: 50.5M]
  ------------------
 1937|  92.9M|	case FILE_PSTRING:
  ------------------
  |  |  258|  92.9M|#define				FILE_PSTRING		13
  ------------------
  |  Branch (1937:2): [True: 45.2k, False: 143M]
  ------------------
 1938|  94.2M|	case FILE_SEARCH:
  ------------------
  |  |  265|  94.2M|#define				FILE_SEARCH		20
  ------------------
  |  Branch (1938:2): [True: 1.27M, False: 142M]
  ------------------
 1939|  94.2M|	case FILE_OCTAL:
  ------------------
  |  |  306|  94.2M|#define				FILE_OCTAL		61
  ------------------
  |  Branch (1939:2): [True: 0, False: 143M]
  ------------------
 1940|  94.2M|		if (offset_oob(nbytes, offset, m->vallen))
  ------------------
  |  Branch (1940:7): [True: 12.3M, False: 81.9M]
  ------------------
 1941|  12.3M|			return 0;
 1942|  81.9M|		break;
 1943|       |
 1944|  81.9M|	case FILE_REGEX:
  ------------------
  |  |  262|   323k|#define				FILE_REGEX		17
  ------------------
  |  Branch (1944:2): [True: 323k, False: 143M]
  ------------------
 1945|   323k|		if (nbytes < offset)
  ------------------
  |  Branch (1945:7): [True: 817, False: 322k]
  ------------------
 1946|    817|			return 0;
 1947|   322k|		break;
 1948|       |
 1949|   322k|	case FILE_INDIRECT:
  ------------------
  |  |  286|  32.9k|#define				FILE_INDIRECT		41
  ------------------
  |  Branch (1949:2): [True: 32.9k, False: 143M]
  ------------------
 1950|  32.9k|		if (m->str_flags & INDIRECT_RELATIVE)
  ------------------
  |  |  382|  32.9k|#define str_flags _u._s._flags
  ------------------
              		if (m->str_flags & INDIRECT_RELATIVE)
  ------------------
  |  |  435|  32.9k|#define	INDIRECT_RELATIVE			BIT(0)
  |  |  ------------------
  |  |  |  |  395|  32.9k|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (1950:7): [True: 2.49k, False: 30.4k]
  ------------------
 1951|  2.49k|			offset += CAST(uint32_t, o);
  ------------------
  |  |  452|  2.49k|#define CAST(T, b)	((T)(b))
  ------------------
 1952|  32.9k|		if (offset == 0)
  ------------------
  |  Branch (1952:7): [True: 593, False: 32.3k]
  ------------------
 1953|    593|			return 0;
 1954|       |
 1955|  32.3k|		if (nbytes < offset)
  ------------------
  |  Branch (1955:7): [True: 1.45k, False: 30.9k]
  ------------------
 1956|  1.45k|			return 0;
 1957|       |
 1958|  30.9k|		if ((pb = file_push_buffer(ms)) == NULL)
  ------------------
  |  Branch (1958:7): [True: 7, False: 30.9k]
  ------------------
 1959|      7|			return -1;
 1960|       |
 1961|  30.9k|		(*indir_count)++;
 1962|  30.9k|		sbb = *b;
 1963|  30.9k|		sbb.fbuf = s + offset;
 1964|  30.9k|		sbb.flen = nbytes - offset;
 1965|  30.9k|		sbb.ebuf = NULL;
 1966|  30.9k|		sbb.elen = 0;
 1967|  30.9k|		rv = -1;
 1968|  37.9k|		for (mlp = ms->mlist[0]->next; mlp != ms->mlist[0];
  ------------------
  |  Branch (1968:34): [True: 30.9k, False: 7.04k]
  ------------------
 1969|  30.9k|		    mlp = mlp->next)
 1970|  30.9k|		{
 1971|  30.9k|			if ((rv = match(ms, mlp->magic, mlp->magic_rxcomp,
  ------------------
  |  Branch (1971:8): [True: 23.8k, False: 7.04k]
  ------------------
 1972|  30.9k|			    mlp->nmagic, &sbb, 0, BINTEST, text, 0, indir_count,
  ------------------
  |  |  231|  30.9k|#define BINTEST		0x20	/* test is for a binary type (set only
  ------------------
 1973|  30.9k|			    name_count, printed_something, need_separator,
 1974|  30.9k|			    firstline, NULL, NULL)) != 0)
 1975|  23.8k|				break;
 1976|  30.9k|		}
 1977|  30.9k|		buffer_fini(&sbb);
 1978|       |
 1979|  30.9k|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  30.9k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1979:7): [True: 0, False: 30.9k]
  ------------------
 1980|      0|			fprintf(stderr, "indirect @offs=%u[%d]\n", offset, rv);
 1981|       |
 1982|  30.9k|		rbuf = file_pop_buffer(ms, pb);
 1983|  30.9k|		if (rbuf == NULL && ms->event_flags & EVENT_HAD_ERR)
  ------------------
  |  |  487|  12.4k|#define 		EVENT_HAD_ERR		0x01
  ------------------
  |  Branch (1983:7): [True: 12.4k, False: 18.4k]
  |  Branch (1983:23): [True: 7.86k, False: 4.54k]
  ------------------
 1984|  7.86k|			return -1;
 1985|       |
 1986|  23.0k|		if (rv == 1) {
  ------------------
  |  Branch (1986:7): [True: 16.0k, False: 7.04k]
  ------------------
 1987|  16.0k|			if ((ms->flags & MAGIC_NODESC) == 0 &&
  ------------------
  |  |   52|  16.0k|#define MAGIC_NODESC		(MAGIC_EXTENSION|MAGIC_MIME|MAGIC_APPLE)
  |  |  ------------------
  |  |  |  |   46|  16.0k|#define	MAGIC_EXTENSION		0x1000000 /* Return a /-separated list of
  |  |  ------------------
  |  |               #define MAGIC_NODESC		(MAGIC_EXTENSION|MAGIC_MIME|MAGIC_APPLE)
  |  |  ------------------
  |  |  |  |   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 */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define MAGIC_NODESC		(MAGIC_EXTENSION|MAGIC_MIME|MAGIC_APPLE)
  |  |  ------------------
  |  |  |  |   45|  16.0k|#define	MAGIC_APPLE		0x0000800 /* Return the Apple creator/type */
  |  |  ------------------
  ------------------
  |  Branch (1987:8): [True: 16.0k, False: 0]
  ------------------
 1988|  16.0k|			    file_printf(ms, F(ms, m->desc, "%u"), offset) == -1)
  ------------------
  |  |  167|  16.0k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (1988:8): [True: 0, False: 16.0k]
  ------------------
 1989|      0|			{
 1990|      0|				free(rbuf);
 1991|      0|				return -1;
 1992|      0|			}
 1993|  16.0k|			if (file_printf(ms, "%s", rbuf) == -1) {
  ------------------
  |  Branch (1993:8): [True: 107, False: 15.8k]
  ------------------
 1994|    107|				free(rbuf);
 1995|    107|				return -1;
 1996|    107|			}
 1997|  16.0k|		}
 1998|  22.9k|		free(rbuf);
 1999|  22.9k|		return rv;
 2000|       |
 2001|  54.1k|	case FILE_USE:
  ------------------
  |  |  291|  54.1k|#define				FILE_USE		46
  ------------------
  |  Branch (2001:2): [True: 54.1k, False: 143M]
  ------------------
 2002|  54.1k|		if (nbytes < offset)
  ------------------
  |  Branch (2002:7): [True: 1.74k, False: 52.4k]
  ------------------
 2003|  1.74k|			return 0;
 2004|  52.4k|		rbuf = m->value.s;
 2005|  52.4k|		if (*rbuf == '^') {
  ------------------
  |  Branch (2005:7): [True: 822, False: 51.5k]
  ------------------
 2006|    822|			rbuf++;
 2007|    822|			flip = !flip;
 2008|    822|		}
 2009|  52.4k|		if (file_magicfind(ms, rbuf, &ml) == -1) {
  ------------------
  |  Branch (2009:7): [True: 0, False: 52.4k]
  ------------------
 2010|      0|			file_error(ms, 0, "cannot find entry `%s'", rbuf);
 2011|      0|			return -1;
 2012|      0|		}
 2013|  52.4k|		if (save_cont(ms, &c) == -1) {
  ------------------
  |  Branch (2013:7): [True: 0, False: 52.4k]
  ------------------
 2014|      0|			file_error(ms, errno, "can't allocate continuation");
 2015|      0|			return -1;
 2016|      0|		}
 2017|       |
 2018|  52.4k|		oneed_separator = *need_separator;
 2019|  52.4k|		if (m->flag & NOSPACE)
  ------------------
  |  |  230|  52.4k|#define NOSPACE		0x10	/* suppress space character before output */
  ------------------
  |  Branch (2019:7): [True: 1.55k, False: 50.8k]
  ------------------
 2020|  1.55k|			*need_separator = 0;
 2021|       |
 2022|  52.4k|		nfound_match = 0;
 2023|  52.4k|		(*name_count)++;
 2024|  52.4k|		eoffset = ms->eoffset;
 2025|  52.4k|		rv = match(ms, ml.magic, ml.magic_rxcomp, ml.nmagic, b,
 2026|  52.4k|		    offset + o, mode, text, flip, indir_count, name_count,
 2027|  52.4k|		    printed_something, need_separator, firstline, returnval,
 2028|  52.4k|		    &nfound_match);
 2029|  52.4k|		ms->ms_value.q = nfound_match;
 2030|  52.4k|		(*name_count)--;
 2031|  52.4k|		*found_match |= nfound_match;
 2032|       |
 2033|  52.4k|		restore_cont(ms, &c);
 2034|       |
 2035|  52.4k|		if (rv != 1)
  ------------------
  |  Branch (2035:7): [True: 13.1k, False: 39.2k]
  ------------------
 2036|  13.1k|		    *need_separator = oneed_separator;
 2037|  52.4k|		ms->offset = offset;
 2038|  52.4k|		ms->eoffset = eoffset;
 2039|  52.4k|		return rv ? rv : *found_match;
  ------------------
  |  Branch (2039:10): [True: 39.9k, False: 12.5k]
  ------------------
 2040|       |
 2041|  52.4k|	case FILE_NAME:
  ------------------
  |  |  290|  52.4k|#define				FILE_NAME		45
  ------------------
  |  Branch (2041:2): [True: 52.4k, False: 143M]
  ------------------
 2042|  52.4k|		if (ms->flags & MAGIC_NODESC)
  ------------------
  |  |   52|  52.4k|#define MAGIC_NODESC		(MAGIC_EXTENSION|MAGIC_MIME|MAGIC_APPLE)
  |  |  ------------------
  |  |  |  |   46|  52.4k|#define	MAGIC_EXTENSION		0x1000000 /* Return a /-separated list of
  |  |  ------------------
  |  |               #define MAGIC_NODESC		(MAGIC_EXTENSION|MAGIC_MIME|MAGIC_APPLE)
  |  |  ------------------
  |  |  |  |   44|  52.4k|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|  52.4k|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  |  |  ------------------
  |  |  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|  52.4k|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define MAGIC_NODESC		(MAGIC_EXTENSION|MAGIC_MIME|MAGIC_APPLE)
  |  |  ------------------
  |  |  |  |   45|  52.4k|#define	MAGIC_APPLE		0x0000800 /* Return the Apple creator/type */
  |  |  ------------------
  ------------------
  |  Branch (2042:7): [True: 0, False: 52.4k]
  ------------------
 2043|      0|			return 1;
 2044|  52.4k|		if (file_printf(ms, "%s", m->desc) == -1)
  ------------------
  |  Branch (2044:7): [True: 0, False: 52.4k]
  ------------------
 2045|      0|			return -1;
 2046|  52.4k|		return 1;
 2047|   523k|	case FILE_DER:
  ------------------
  |  |  293|   523k|#define				FILE_DER		48
  ------------------
  |  Branch (2047:2): [True: 523k, False: 142M]
  ------------------
 2048|   532k|	case FILE_DEFAULT:	/* nothing to check */
  ------------------
  |  |  248|   532k|#define				FILE_DEFAULT		3
  ------------------
  |  Branch (2048:2): [True: 8.45k, False: 143M]
  ------------------
 2049|   533k|	case FILE_CLEAR:
  ------------------
  |  |  292|   533k|#define				FILE_CLEAR		47
  ------------------
  |  Branch (2049:2): [True: 1.49k, False: 143M]
  ------------------
 2050|  3.13M|	default:
  ------------------
  |  Branch (2050:2): [True: 2.59M, False: 140M]
  ------------------
 2051|  3.13M|		break;
 2052|   143M|	}
 2053|   127M|	if (!mconvert(ms, m, flip))
  ------------------
  |  Branch (2053:6): [True: 96, False: 127M]
  ------------------
 2054|     96|		return 0;
 2055|   127M|	return 1;
 2056|   127M|}
softmagic.c:mcopy:
 1380|   144M|{
 1381|   144M|	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|   144M|	if (indir == 0) {
  ------------------
  |  Branch (1386:6): [True: 143M, False: 969k]
  ------------------
 1387|   143M|		switch (type) {
 1388|   523k|		case FILE_DER:
  ------------------
  |  |  293|   523k|#define				FILE_DER		48
  ------------------
  |  Branch (1388:3): [True: 523k, False: 142M]
  ------------------
 1389|  1.79M|		case FILE_SEARCH:
  ------------------
  |  |  265|  1.79M|#define				FILE_SEARCH		20
  ------------------
  |  Branch (1389:3): [True: 1.27M, False: 142M]
  ------------------
 1390|  1.79M|			if (offset > nbytes)
  ------------------
  |  Branch (1390:8): [True: 62.9k, False: 1.73M]
  ------------------
 1391|  62.9k|				offset = CAST(uint32_t, nbytes);
  ------------------
  |  |  452|  62.9k|#define CAST(T, b)	((T)(b))
  ------------------
 1392|  1.79M|			ms->search.s = RCAST(const char *, s) + offset;
  ------------------
  |  |  453|  1.79M|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 1393|  1.79M|			ms->search.s_len = nbytes - offset;
 1394|  1.79M|			ms->search.offset = offset;
 1395|  1.79M|			return 0;
 1396|       |
 1397|   323k|		case FILE_REGEX: {
  ------------------
  |  |  262|   323k|#define				FILE_REGEX		17
  ------------------
  |  Branch (1397:3): [True: 323k, False: 143M]
  ------------------
 1398|   323k|			const char *b;
 1399|   323k|			const char *c;
 1400|   323k|			const char *last;	/* end of search region */
 1401|   323k|			const char *buf;	/* start of search region */
 1402|   323k|			const char *end;
 1403|   323k|			size_t lines, linecnt, bytecnt;
 1404|       |
 1405|   323k|			if (s == NULL || nbytes < offset) {
  ------------------
  |  Branch (1405:8): [True: 0, False: 323k]
  |  Branch (1405:21): [True: 817, False: 322k]
  ------------------
 1406|    817|				ms->search.s_len = 0;
 1407|    817|				ms->search.s = NULL;
 1408|    817|				return 0;
 1409|    817|			}
 1410|       |
 1411|   322k|			if (m->str_flags & REGEX_LINE_COUNT) {
  ------------------
  |  |  382|   322k|#define str_flags _u._s._flags
  ------------------
              			if (m->str_flags & REGEX_LINE_COUNT) {
  ------------------
  |  |  409|   322k|#define REGEX_LINE_COUNT			BIT(11)
  |  |  ------------------
  |  |  |  |  395|   322k|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (1411:8): [True: 58.2k, False: 264k]
  ------------------
 1412|  58.2k|				linecnt = m->str_range;
  ------------------
  |  |  381|  58.2k|#define str_range _u._s._count
  ------------------
 1413|  58.2k|				bytecnt = linecnt * 80;
 1414|   264k|			} else {
 1415|   264k|				linecnt = 0;
 1416|   264k|				bytecnt = m->str_range;
  ------------------
  |  |  381|   264k|#define str_range _u._s._count
  ------------------
 1417|   264k|			}
 1418|       |
 1419|   322k|			if (bytecnt == 0 || bytecnt > nbytes - offset)
  ------------------
  |  Branch (1419:8): [True: 239k, False: 83.2k]
  |  Branch (1419:24): [True: 67.9k, False: 15.2k]
  ------------------
 1420|   307k|				bytecnt = nbytes - offset;
 1421|   322k|			if (bytecnt > ms->regex_max)
  ------------------
  |  Branch (1421:8): [True: 69.9k, False: 252k]
  ------------------
 1422|  69.9k|				bytecnt = ms->regex_max;
 1423|       |
 1424|   322k|			buf = RCAST(const char *, s) + offset;
  ------------------
  |  |  453|   322k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 1425|   322k|			end = last = RCAST(const char *, s) + bytecnt + offset;
  ------------------
  |  |  453|   322k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 1426|       |			/* mget() guarantees buf <= last */
 1427|   532k|			for (lines = linecnt, b = buf; lines && b < end &&
  ------------------
  |  Branch (1427:35): [True: 265k, False: 266k]
  |  Branch (1427:44): [True: 262k, False: 3.24k]
  ------------------
 1428|   262k|			     ((b = CAST(const char *,
  ------------------
  |  |  452|   262k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (1428:10): [True: 150k, False: 112k]
  ------------------
 1429|   262k|				 memchr(c = b, '\n', CAST(size_t, (end - b)))))
 1430|   112k|			     || (b = CAST(const char *,
  ------------------
  |  |  452|   112k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (1430:12): [True: 59.2k, False: 52.7k]
  ------------------
 1431|   112k|				 memchr(c, '\r', CAST(size_t, (end - c))))));
 1432|   322k|			     lines--, b++) {
 1433|   209k|				if (b < end - 1 && b[0] == '\r' && b[1] == '\n')
  ------------------
  |  Branch (1433:9): [True: 206k, False: 2.65k]
  |  Branch (1433:24): [True: 58.3k, False: 148k]
  |  Branch (1433:40): [True: 0, False: 58.3k]
  ------------------
 1434|      0|					b++;
 1435|   209k|				if (b < end - 1 && b[0] == '\n')
  ------------------
  |  Branch (1435:9): [True: 206k, False: 2.65k]
  |  Branch (1435:24): [True: 148k, False: 58.3k]
  ------------------
 1436|   148k|					b++;
 1437|   209k|				last = b;
 1438|   209k|			}
 1439|   322k|			if (lines)
  ------------------
  |  Branch (1439:8): [True: 56.0k, False: 266k]
  ------------------
 1440|  56.0k|				last = end;
 1441|       |
 1442|   322k|			ms->search.s = buf;
 1443|   322k|			ms->search.s_len = last - buf;
 1444|   322k|			ms->search.offset = offset;
 1445|   322k|			ms->search.rm_len = 0;
 1446|   322k|			return 0;
 1447|   323k|		}
 1448|    119|		case FILE_BESTRING16:
  ------------------
  |  |  263|    119|#define				FILE_BESTRING16		18
  ------------------
  |  Branch (1448:3): [True: 119, False: 143M]
  ------------------
 1449|  84.1k|		case FILE_LESTRING16: {
  ------------------
  |  |  264|  84.1k|#define				FILE_LESTRING16		19
  ------------------
  |  Branch (1449:3): [True: 84.0k, False: 143M]
  ------------------
 1450|  84.1k|			const unsigned char *src = s + offset;
 1451|  84.1k|			const unsigned char *esrc = s + nbytes;
 1452|  84.1k|			char *dst = p->s;
 1453|  84.1k|			char *edst = &p->s[sizeof(p->s) - 1];
 1454|       |
 1455|  84.1k|			if (type == FILE_BESTRING16)
  ------------------
  |  |  263|  84.1k|#define				FILE_BESTRING16		18
  ------------------
  |  Branch (1455:8): [True: 119, False: 84.0k]
  ------------------
 1456|    119|				src++;
 1457|       |
 1458|       |			/* check that offset is within range */
 1459|  84.1k|			if (offset >= nbytes)
  ------------------
  |  Branch (1459:8): [True: 1.02k, False: 83.1k]
  ------------------
 1460|  1.02k|				break;
 1461|  6.04M|			for (/*EMPTY*/; src < esrc; src += 2, dst++) {
  ------------------
  |  Branch (1461:20): [True: 6.00M, False: 42.4k]
  ------------------
 1462|  6.00M|				if (dst < edst)
  ------------------
  |  Branch (1462:9): [True: 5.96M, False: 40.6k]
  ------------------
 1463|  5.96M|					*dst = *src;
 1464|  40.6k|				else
 1465|  40.6k|					break;
 1466|  5.96M|				if (*dst == '\0') {
  ------------------
  |  Branch (1466:9): [True: 2.82M, False: 3.13M]
  ------------------
 1467|  2.82M|					if (type == FILE_BESTRING16 ?
  ------------------
  |  |  263|  2.82M|#define				FILE_BESTRING16		18
  ------------------
  |  Branch (1467:10): [True: 3.31k, False: 2.82M]
  |  Branch (1467:10): [True: 445k, False: 2.37M]
  ------------------
 1468|  3.31k|					    *(src - 1) != '\0' :
 1469|  2.82M|					    ((src + 1 < esrc) &&
  ------------------
  |  Branch (1469:11): [True: 2.81M, False: 4.42k]
  ------------------
 1470|  2.81M|					    *(src + 1) != '\0'))
  ------------------
  |  Branch (1470:10): [True: 445k, False: 2.37M]
  ------------------
 1471|   445k|						*dst = ' ';
 1472|  2.82M|				}
 1473|  5.96M|			}
 1474|  83.1k|			*edst = '\0';
 1475|  83.1k|			*dst = '\0';
 1476|  83.1k|			return 0;
 1477|  84.1k|		}
 1478|  92.9M|		case FILE_STRING:	/* XXX - these two should not need */
  ------------------
  |  |  250|  92.9M|#define				FILE_STRING		5
  ------------------
  |  Branch (1478:3): [True: 92.9M, False: 50.5M]
  ------------------
 1479|  92.9M|		case FILE_PSTRING:	/* to copy anything, but do anyway. */
  ------------------
  |  |  258|  92.9M|#define				FILE_PSTRING		13
  ------------------
  |  Branch (1479:3): [True: 45.2k, False: 143M]
  ------------------
 1480|  92.9M|			if (m->str_range != 0 && m->str_range < sizeof(*p))
  ------------------
  |  |  381|  92.9M|#define str_range _u._s._count
  ------------------
              			if (m->str_range != 0 && m->str_range < sizeof(*p))
  ------------------
  |  |  381|  81.2k|#define str_range _u._s._count
  ------------------
  |  Branch (1480:8): [True: 81.2k, False: 92.8M]
  |  Branch (1480:29): [True: 81.2k, False: 0]
  ------------------
 1481|  81.2k|				size = m->str_range;
  ------------------
  |  |  381|  81.2k|#define str_range _u._s._count
  ------------------
 1482|  92.9M|			break;
 1483|  48.2M|		default:
  ------------------
  |  Branch (1483:3): [True: 48.2M, False: 95.1M]
  ------------------
 1484|  48.2M|			break;
 1485|   143M|		}
 1486|   143M|	}
 1487|       |
 1488|   142M|	if (type == FILE_OFFSET) {
  ------------------
  |  |  297|   142M|#define				FILE_OFFSET		52
  ------------------
  |  Branch (1488:6): [True: 4.66k, False: 142M]
  ------------------
 1489|  4.66k|		(void)memset(p, '\0', sizeof(*p));
 1490|  4.66k|		p->q = offset;
 1491|  4.66k|		return 0;
 1492|  4.66k|	}
 1493|       |
 1494|   142M|	if (offset >= nbytes) {
  ------------------
  |  Branch (1494:6): [True: 6.89M, False: 135M]
  ------------------
 1495|  6.89M|		(void)memset(p, '\0', sizeof(*p));
 1496|  6.89M|		return 0;
 1497|  6.89M|	}
 1498|   135M|	if (nbytes - offset < size)
  ------------------
  |  Branch (1498:6): [True: 64.8M, False: 70.4M]
  ------------------
 1499|  64.8M|		nbytes = nbytes - offset;
 1500|  70.4M|	else
 1501|  70.4M|		nbytes = size;
 1502|       |
 1503|   135M|	(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|   135M|	if (nbytes < sizeof(*p))
  ------------------
  |  Branch (1509:6): [True: 64.9M, False: 70.3M]
  ------------------
 1510|  64.9M|		(void)memset(RCAST(char *, RCAST(void *, p)) + nbytes, '\0',
  ------------------
  |  |  453|  64.9M|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 1511|  64.9M|		    sizeof(*p) - nbytes);
 1512|   135M|	return 0;
 1513|   142M|}
softmagic.c:offset_oob:
  114|   140M| {
  115|   140M|	if (o < 0)
  ------------------
  |  Branch (115:6): [True: 0, False: 140M]
  ------------------
  116|      0|		return 1;
  117|   140M|        if ((uintmax_t)o > n)
  ------------------
  |  Branch (117:13): [True: 6.25M, False: 134M]
  ------------------
  118|  6.25M|		return 1;
  119|   134M|        return i > n - (uintmax_t)o;
  120|   140M|}
softmagic.c:cvt_flip:
 1028|   128M|{
 1029|   128M|	if (flip == 0)
  ------------------
  |  Branch (1029:6): [True: 128M, False: 21.3k]
  ------------------
 1030|   128M|		return type;
 1031|  21.3k|	switch (type) {
 1032|      5|	case FILE_BESHORT:
  ------------------
  |  |  252|      5|#define				FILE_BESHORT		7
  ------------------
  |  Branch (1032:2): [True: 5, False: 21.3k]
  ------------------
 1033|      5|		return FILE_LESHORT;
  ------------------
  |  |  255|      5|#define				FILE_LESHORT		10
  ------------------
 1034|  3.76k|	case FILE_BELONG:
  ------------------
  |  |  253|  3.76k|#define				FILE_BELONG		8
  ------------------
  |  Branch (1034:2): [True: 3.76k, False: 17.6k]
  ------------------
 1035|  3.76k|		return FILE_LELONG;
  ------------------
  |  |  256|  3.76k|#define				FILE_LELONG		11
  ------------------
 1036|    104|	case FILE_BEDATE:
  ------------------
  |  |  254|    104|#define				FILE_BEDATE		9
  ------------------
  |  Branch (1036:2): [True: 104, False: 21.2k]
  ------------------
 1037|    104|		return FILE_LEDATE;
  ------------------
  |  |  257|    104|#define				FILE_LEDATE		12
  ------------------
 1038|      0|	case FILE_BELDATE:
  ------------------
  |  |  260|      0|#define				FILE_BELDATE		15
  ------------------
  |  Branch (1038:2): [True: 0, False: 21.3k]
  ------------------
 1039|      0|		return FILE_LELDATE;
  ------------------
  |  |  261|      0|#define				FILE_LELDATE		16
  ------------------
 1040|      0|	case FILE_BEQUAD:
  ------------------
  |  |  271|      0|#define				FILE_BEQUAD		26
  ------------------
  |  Branch (1040:2): [True: 0, False: 21.3k]
  ------------------
 1041|      0|		return FILE_LEQUAD;
  ------------------
  |  |  270|      0|#define				FILE_LEQUAD		25
  ------------------
 1042|    480|	case FILE_BEQDATE:
  ------------------
  |  |  274|    480|#define				FILE_BEQDATE		29
  ------------------
  |  Branch (1042:2): [True: 480, False: 20.8k]
  ------------------
 1043|    480|		return FILE_LEQDATE;
  ------------------
  |  |  273|    480|#define				FILE_LEQDATE		28
  ------------------
 1044|      0|	case FILE_BEQLDATE:
  ------------------
  |  |  277|      0|#define				FILE_BEQLDATE		32
  ------------------
  |  Branch (1044:2): [True: 0, False: 21.3k]
  ------------------
 1045|      0|		return FILE_LEQLDATE;
  ------------------
  |  |  276|      0|#define				FILE_LEQLDATE		31
  ------------------
 1046|      0|	case FILE_BEQWDATE:
  ------------------
  |  |  289|      0|#define				FILE_BEQWDATE		44
  ------------------
  |  Branch (1046:2): [True: 0, False: 21.3k]
  ------------------
 1047|      0|		return FILE_LEQWDATE;
  ------------------
  |  |  288|      0|#define				FILE_LEQWDATE		43
  ------------------
 1048|  10.4k|	case FILE_LESHORT:
  ------------------
  |  |  255|  10.4k|#define				FILE_LESHORT		10
  ------------------
  |  Branch (1048:2): [True: 10.4k, False: 10.9k]
  ------------------
 1049|  10.4k|		return FILE_BESHORT;
  ------------------
  |  |  252|  10.4k|#define				FILE_BESHORT		7
  ------------------
 1050|  2.97k|	case FILE_LELONG:
  ------------------
  |  |  256|  2.97k|#define				FILE_LELONG		11
  ------------------
  |  Branch (1050:2): [True: 2.97k, False: 18.4k]
  ------------------
 1051|  2.97k|		return FILE_BELONG;
  ------------------
  |  |  253|  2.97k|#define				FILE_BELONG		8
  ------------------
 1052|     25|	case FILE_LEDATE:
  ------------------
  |  |  257|     25|#define				FILE_LEDATE		12
  ------------------
  |  Branch (1052:2): [True: 25, False: 21.3k]
  ------------------
 1053|     25|		return FILE_BEDATE;
  ------------------
  |  |  254|     25|#define				FILE_BEDATE		9
  ------------------
 1054|      0|	case FILE_LELDATE:
  ------------------
  |  |  261|      0|#define				FILE_LELDATE		16
  ------------------
  |  Branch (1054:2): [True: 0, False: 21.3k]
  ------------------
 1055|      0|		return FILE_BELDATE;
  ------------------
  |  |  260|      0|#define				FILE_BELDATE		15
  ------------------
 1056|    776|	case FILE_LEQUAD:
  ------------------
  |  |  270|    776|#define				FILE_LEQUAD		25
  ------------------
  |  Branch (1056:2): [True: 776, False: 20.5k]
  ------------------
 1057|    776|		return FILE_BEQUAD;
  ------------------
  |  |  271|    776|#define				FILE_BEQUAD		26
  ------------------
 1058|      0|	case FILE_LEQDATE:
  ------------------
  |  |  273|      0|#define				FILE_LEQDATE		28
  ------------------
  |  Branch (1058:2): [True: 0, False: 21.3k]
  ------------------
 1059|      0|		return FILE_BEQDATE;
  ------------------
  |  |  274|      0|#define				FILE_BEQDATE		29
  ------------------
 1060|    193|	case FILE_LEQLDATE:
  ------------------
  |  |  276|    193|#define				FILE_LEQLDATE		31
  ------------------
  |  Branch (1060:2): [True: 193, False: 21.1k]
  ------------------
 1061|    193|		return FILE_BEQLDATE;
  ------------------
  |  |  277|    193|#define				FILE_BEQLDATE		32
  ------------------
 1062|      0|	case FILE_LEQWDATE:
  ------------------
  |  |  288|      0|#define				FILE_LEQWDATE		43
  ------------------
  |  Branch (1062:2): [True: 0, False: 21.3k]
  ------------------
 1063|      0|		return FILE_BEQWDATE;
  ------------------
  |  |  289|      0|#define				FILE_BEQWDATE		44
  ------------------
 1064|      0|	case FILE_BEFLOAT:
  ------------------
  |  |  279|      0|#define				FILE_BEFLOAT		34
  ------------------
  |  Branch (1064:2): [True: 0, False: 21.3k]
  ------------------
 1065|      0|		return FILE_LEFLOAT;
  ------------------
  |  |  280|      0|#define				FILE_LEFLOAT		35
  ------------------
 1066|      0|	case FILE_LEFLOAT:
  ------------------
  |  |  280|      0|#define				FILE_LEFLOAT		35
  ------------------
  |  Branch (1066:2): [True: 0, False: 21.3k]
  ------------------
 1067|      0|		return FILE_BEFLOAT;
  ------------------
  |  |  279|      0|#define				FILE_BEFLOAT		34
  ------------------
 1068|      0|	case FILE_BEDOUBLE:
  ------------------
  |  |  282|      0|#define				FILE_BEDOUBLE		37
  ------------------
  |  Branch (1068:2): [True: 0, False: 21.3k]
  ------------------
 1069|      0|		return FILE_LEDOUBLE;
  ------------------
  |  |  283|      0|#define				FILE_LEDOUBLE		38
  ------------------
 1070|      0|	case FILE_LEDOUBLE:
  ------------------
  |  |  283|      0|#define				FILE_LEDOUBLE		38
  ------------------
  |  Branch (1070:2): [True: 0, False: 21.3k]
  ------------------
 1071|      0|		return FILE_BEDOUBLE;
  ------------------
  |  |  282|      0|#define				FILE_BEDOUBLE		37
  ------------------
 1072|      0|	case FILE_BEMSDOSDATE:
  ------------------
  |  |  302|      0|#define				FILE_BEMSDOSDATE	57
  ------------------
  |  Branch (1072:2): [True: 0, False: 21.3k]
  ------------------
 1073|      0|		return FILE_LEMSDOSDATE;
  ------------------
  |  |  301|      0|#define				FILE_LEMSDOSDATE	56
  ------------------
 1074|      0|	case FILE_LEMSDOSDATE:
  ------------------
  |  |  301|      0|#define				FILE_LEMSDOSDATE	56
  ------------------
  |  Branch (1074:2): [True: 0, False: 21.3k]
  ------------------
 1075|      0|		return FILE_BEMSDOSDATE;
  ------------------
  |  |  302|      0|#define				FILE_BEMSDOSDATE	57
  ------------------
 1076|      0|	case FILE_BEMSDOSTIME:
  ------------------
  |  |  305|      0|#define				FILE_BEMSDOSTIME	60
  ------------------
  |  Branch (1076:2): [True: 0, False: 21.3k]
  ------------------
 1077|      0|		return FILE_LEMSDOSTIME;
  ------------------
  |  |  304|      0|#define				FILE_LEMSDOSTIME	59
  ------------------
 1078|      0|	case FILE_LEMSDOSTIME:
  ------------------
  |  |  304|      0|#define				FILE_LEMSDOSTIME	59
  ------------------
  |  Branch (1078:2): [True: 0, False: 21.3k]
  ------------------
 1079|      0|		return FILE_BEMSDOSTIME;
  ------------------
  |  |  305|      0|#define				FILE_BEMSDOSTIME	60
  ------------------
 1080|  2.63k|	default:
  ------------------
  |  Branch (1080:2): [True: 2.63k, False: 18.7k]
  ------------------
 1081|  2.63k|		return type;
 1082|  21.3k|	}
 1083|  21.3k|}
softmagic.c:do_ops:
 1518|   656k|{
 1519|   656k|	intmax_t offset;
 1520|       |	// On purpose not INTMAX_MAX
 1521|   656k|	if (lhs >= UINT_MAX || lhs <= INT_MIN ||
  ------------------
  |  Branch (1521:6): [True: 6.27k, False: 649k]
  |  Branch (1521:25): [True: 411, False: 649k]
  ------------------
 1522|   649k|	    off >= UINT_MAX || off <= INT_MIN) {
  ------------------
  |  Branch (1522:6): [True: 66, False: 649k]
  |  Branch (1522:25): [True: 0, False: 649k]
  ------------------
 1523|  6.74k|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  6.74k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1523:7): [True: 0, False: 6.74k]
  ------------------
 1524|      0|			fprintf(stderr, "lhs/off overflow %jd %jd\n", lhs, off);
 1525|  6.74k|		return 1;
 1526|  6.74k|	}
 1527|       |	   
 1528|   649k|	if (off) {
  ------------------
  |  Branch (1528:6): [True: 61.1k, False: 588k]
  ------------------
 1529|  61.1k|		switch (m->in_op & FILE_OPS_MASK) {
  ------------------
  |  |  352|  61.1k|#define				FILE_OPS_MASK	0x07 /* mask for above ops */
  ------------------
  |  Branch (1529:11): [True: 61.1k, False: 0]
  ------------------
 1530|     75|		case FILE_OPAND:
  ------------------
  |  |  344|     75|#define				FILE_OPAND	0
  ------------------
  |  Branch (1530:3): [True: 75, False: 61.0k]
  ------------------
 1531|     75|			offset = lhs & off;
 1532|     75|			break;
 1533|      0|		case FILE_OPOR:
  ------------------
  |  |  345|      0|#define				FILE_OPOR	1
  ------------------
  |  Branch (1533:3): [True: 0, False: 61.1k]
  ------------------
 1534|      0|			offset = lhs | off;
 1535|      0|			break;
 1536|      0|		case FILE_OPXOR:
  ------------------
  |  |  346|      0|#define				FILE_OPXOR	2
  ------------------
  |  Branch (1536:3): [True: 0, False: 61.1k]
  ------------------
 1537|      0|			offset = lhs ^ off;
 1538|      0|			break;
 1539|  54.1k|		case FILE_OPADD:
  ------------------
  |  |  347|  54.1k|#define				FILE_OPADD	3
  ------------------
  |  Branch (1539:3): [True: 54.1k, False: 6.96k]
  ------------------
 1540|  54.1k|			offset = lhs + off;
 1541|  54.1k|			break;
 1542|  1.00k|		case FILE_OPMINUS:
  ------------------
  |  |  348|  1.00k|#define				FILE_OPMINUS	4
  ------------------
  |  Branch (1542:3): [True: 1.00k, False: 60.1k]
  ------------------
 1543|  1.00k|			offset = lhs - off;
 1544|  1.00k|			break;
 1545|  5.85k|		case FILE_OPMULTIPLY:
  ------------------
  |  |  349|  5.85k|#define				FILE_OPMULTIPLY	5
  ------------------
  |  Branch (1545:3): [True: 5.85k, False: 55.2k]
  ------------------
 1546|  5.85k|			offset = lhs * off;
 1547|  5.85k|			break;
 1548|     39|		case FILE_OPDIVIDE:
  ------------------
  |  |  350|     39|#define				FILE_OPDIVIDE	6
  ------------------
  |  Branch (1548:3): [True: 39, False: 61.0k]
  ------------------
 1549|     39|			offset = lhs / off;
 1550|     39|			break;
 1551|      0|		case FILE_OPMODULO:
  ------------------
  |  |  351|      0|#define				FILE_OPMODULO	7
  ------------------
  |  Branch (1551:3): [True: 0, False: 61.1k]
  ------------------
 1552|      0|			offset = lhs % off;
 1553|      0|			break;
 1554|  61.1k|		}
 1555|  61.1k|	} else
 1556|   588k|		offset = lhs;
 1557|   649k|	if (m->in_op & FILE_OPINVERSE)
  ------------------
  |  |  356|   649k|#define				FILE_OPINVERSE	0x40
  ------------------
  |  Branch (1557:6): [True: 0, False: 649k]
  ------------------
 1558|      0|		offset = ~offset;
 1559|   649k|	if (offset >= UINT_MAX) {
  ------------------
  |  Branch (1559:6): [True: 345, False: 649k]
  ------------------
 1560|    345|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|    345|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1560:7): [True: 0, False: 345]
  ------------------
 1561|      0|			fprintf(stderr, "offset overflow %jd\n", offset);
 1562|    345|		return 1;
 1563|    345|	}
 1564|   649k|	*rv = CAST(uint32_t, offset);
  ------------------
  |  |  452|   649k|#define CAST(T, b)	((T)(b))
  ------------------
 1565|   649k|	return 0;
 1566|   649k|}
softmagic.c:cvt_id3:
 1016|    108|{
 1017|    108|	v = ((((v >>  0) & 0x7f) <<  0) |
 1018|    108|	     (((v >>  8) & 0x7f) <<  7) |
 1019|    108|	     (((v >> 16) & 0x7f) << 14) |
 1020|    108|	     (((v >> 24) & 0x7f) << 21));
 1021|    108|	if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|    108|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1021:6): [True: 0, False: 108]
  ------------------
 1022|      0|		fprintf(stderr, "id3 offs=%u\n", v);
 1023|    108|	return v;
 1024|    108|}
softmagic.c:file_fmtcheck:
  172|   113k|{
  173|   113k|	const char *ptr;
  174|       |
  175|   113k|	if (strchr(desc, '%') == NULL)
  ------------------
  |  Branch (175:6): [True: 60.7k, False: 52.2k]
  ------------------
  176|  60.7k|		return desc;
  177|       |
  178|  52.2k|	ptr = fmtcheck(desc, def);
  179|  52.2k|	if (ptr == def)
  ------------------
  |  Branch (179:6): [True: 0, False: 52.2k]
  ------------------
  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|  52.2k|	return ptr;
  184|   113k|}
softmagic.c:save_cont:
 1628|  52.4k|{
 1629|  52.4k|	size_t len;
 1630|  52.4k|	*c = ms->c;
 1631|  52.4k|	len = c->len * sizeof(*c->li);
 1632|  52.4k|	ms->c.li = CAST(struct level_info *, malloc(len));
  ------------------
  |  |  452|  52.4k|#define CAST(T, b)	((T)(b))
  ------------------
 1633|  52.4k|	if (ms->c.li == NULL) {
  ------------------
  |  Branch (1633:6): [True: 0, False: 52.4k]
  ------------------
 1634|      0|		ms->c = *c;
 1635|      0|		return -1;
 1636|      0|	}
 1637|  52.4k|	memcpy(ms->c.li, c->li, len);
 1638|  52.4k|	return 0;
 1639|  52.4k|}
softmagic.c:restore_cont:
 1643|  52.4k|{
 1644|  52.4k|	free(ms->c.li);
 1645|  52.4k|	ms->c = *c;
 1646|  52.4k|}
softmagic.c:mconvert:
 1205|   127M|{
 1206|   127M|	union VALUETYPE *p = &ms->ms_value;
 1207|       |
 1208|   127M|	switch (cvt_flip(m->type, flip)) {
 1209|  2.19M|	case FILE_BYTE:
  ------------------
  |  |  246|  2.19M|#define 			FILE_BYTE		1
  ------------------
  |  Branch (1209:2): [True: 2.19M, False: 125M]
  ------------------
 1210|  2.19M|		if (cvt_8(p, m) == -1)
  ------------------
  |  Branch (1210:7): [True: 0, False: 2.19M]
  ------------------
 1211|      0|			goto out;
 1212|  2.19M|		return 1;
 1213|  2.34M|	case FILE_SHORT:
  ------------------
  |  |  247|  2.34M|#define				FILE_SHORT		2
  ------------------
  |  Branch (1213:2): [True: 2.34M, False: 125M]
  ------------------
 1214|  2.34M|	case FILE_MSDOSDATE:
  ------------------
  |  |  300|  2.34M|#define				FILE_MSDOSDATE		55
  ------------------
  |  Branch (1214:2): [True: 0, False: 127M]
  ------------------
 1215|  2.34M|	case FILE_MSDOSTIME:
  ------------------
  |  |  303|  2.34M|#define				FILE_MSDOSTIME		58
  ------------------
  |  Branch (1215:2): [True: 0, False: 127M]
  ------------------
 1216|  2.34M|		if (cvt_16(p, m) == -1)
  ------------------
  |  Branch (1216:7): [True: 0, False: 2.34M]
  ------------------
 1217|      0|			goto out;
 1218|  2.34M|		return 1;
 1219|  2.01M|	case FILE_LONG:
  ------------------
  |  |  249|  2.01M|#define				FILE_LONG		4
  ------------------
  |  Branch (1219:2): [True: 2.01M, False: 125M]
  ------------------
 1220|  2.01M|	case FILE_DATE:
  ------------------
  |  |  251|  2.01M|#define				FILE_DATE		6
  ------------------
  |  Branch (1220:2): [True: 0, False: 127M]
  ------------------
 1221|  2.01M|	case FILE_LDATE:
  ------------------
  |  |  259|  2.01M|#define				FILE_LDATE		14
  ------------------
  |  Branch (1221:2): [True: 0, False: 127M]
  ------------------
 1222|  2.01M|		if (cvt_32(p, m) == -1)
  ------------------
  |  Branch (1222:7): [True: 0, False: 2.01M]
  ------------------
 1223|      0|			goto out;
 1224|  2.01M|		return 1;
 1225|  85.0k|	case FILE_QUAD:
  ------------------
  |  |  269|  85.0k|#define				FILE_QUAD		24
  ------------------
  |  Branch (1225:2): [True: 85.0k, False: 127M]
  ------------------
 1226|  85.0k|	case FILE_QDATE:
  ------------------
  |  |  272|  85.0k|#define				FILE_QDATE		27
  ------------------
  |  Branch (1226:2): [True: 0, False: 127M]
  ------------------
 1227|  85.0k|	case FILE_QLDATE:
  ------------------
  |  |  275|  85.0k|#define				FILE_QLDATE		30
  ------------------
  |  Branch (1227:2): [True: 0, False: 127M]
  ------------------
 1228|  85.2k|	case FILE_QWDATE:
  ------------------
  |  |  287|  85.2k|#define				FILE_QWDATE		42
  ------------------
  |  Branch (1228:2): [True: 206, False: 127M]
  ------------------
 1229|  89.9k|	case FILE_OFFSET:
  ------------------
  |  |  297|  89.9k|#define				FILE_OFFSET		52
  ------------------
  |  Branch (1229:2): [True: 4.66k, False: 127M]
  ------------------
 1230|  89.9k|		if (cvt_64(p, m) == -1)
  ------------------
  |  Branch (1230:7): [True: 0, False: 89.9k]
  ------------------
 1231|      0|			goto out;
 1232|  89.9k|		return 1;
 1233|  81.0M|	case FILE_STRING:
  ------------------
  |  |  250|  81.0M|#define				FILE_STRING		5
  ------------------
  |  Branch (1233:2): [True: 81.0M, False: 46.8M]
  ------------------
 1234|  81.0M|	case FILE_BESTRING16:
  ------------------
  |  |  263|  81.0M|#define				FILE_BESTRING16		18
  ------------------
  |  Branch (1234:2): [True: 119, False: 127M]
  ------------------
 1235|  81.1M|	case FILE_LESTRING16:
  ------------------
  |  |  264|  81.1M|#define				FILE_LESTRING16		19
  ------------------
  |  Branch (1235:2): [True: 84.0k, False: 127M]
  ------------------
 1236|  81.1M|	case FILE_OCTAL: {
  ------------------
  |  |  306|  81.1M|#define				FILE_OCTAL		61
  ------------------
  |  Branch (1236:2): [True: 0, False: 127M]
  ------------------
 1237|       |		/* Null terminate and eat *trailing* return */
 1238|  81.1M|		p->s[sizeof(p->s) - 1] = '\0';
 1239|  81.1M|		return 1;
 1240|  81.1M|	}
 1241|  36.5k|	case FILE_PSTRING: {
  ------------------
  |  |  258|  36.5k|#define				FILE_PSTRING		13
  ------------------
  |  Branch (1241:2): [True: 36.5k, False: 127M]
  ------------------
 1242|  36.5k|		char *ptr1, *ptr2;
 1243|  36.5k|		size_t len, sz = file_pstring_length_size(ms, m);
 1244|  36.5k|		if (sz == FILE_BADSIZE)
  ------------------
  |  |  175|  36.5k|#define FILE_BADSIZE CAST(size_t, ~0ul)
  |  |  ------------------
  |  |  |  |  452|  36.5k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (1244:7): [True: 0, False: 36.5k]
  ------------------
 1245|      0|			return 0;
 1246|  36.5k|		ptr1 = p->s;
 1247|  36.5k|		ptr2 = ptr1 + sz;
 1248|  36.5k|		len = file_pstring_get_length(ms, m, ptr1);
 1249|  36.5k|		if (len == FILE_BADSIZE)
  ------------------
  |  |  175|  36.5k|#define FILE_BADSIZE CAST(size_t, ~0ul)
  |  |  ------------------
  |  |  |  |  452|  36.5k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (1249:7): [True: 96, False: 36.4k]
  ------------------
 1250|     96|			return 0;
 1251|  36.4k|		sz = sizeof(p->s) - sz; /* maximum length of string */
 1252|  36.4k|		if (len >= sz) {
  ------------------
  |  Branch (1252:7): [True: 6.88k, False: 29.5k]
  ------------------
 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|  6.88k|			len = sz;
 1262|  6.88k|		}
 1263|  2.84M|		while (len--)
  ------------------
  |  Branch (1263:10): [True: 2.80M, False: 36.4k]
  ------------------
 1264|  2.80M|			*ptr1++ = *ptr2++;
 1265|  36.4k|		*ptr1 = '\0';
 1266|  36.4k|		return 1;
 1267|  36.5k|	}
 1268|  5.45M|	case FILE_BESHORT:
  ------------------
  |  |  252|  5.45M|#define				FILE_BESHORT		7
  ------------------
  |  Branch (1268:2): [True: 5.45M, False: 122M]
  ------------------
 1269|  5.45M|	case FILE_BEMSDOSDATE:
  ------------------
  |  |  302|  5.45M|#define				FILE_BEMSDOSDATE	57
  ------------------
  |  Branch (1269:2): [True: 0, False: 127M]
  ------------------
 1270|  5.45M|	case FILE_BEMSDOSTIME:
  ------------------
  |  |  305|  5.45M|#define				FILE_BEMSDOSTIME	60
  ------------------
  |  Branch (1270:2): [True: 0, False: 127M]
  ------------------
 1271|  5.45M|		p->h = CAST(short, BE16(p->hs));
  ------------------
  |  |  452|  5.45M|#define CAST(T, b)	((T)(b))
  ------------------
 1272|  5.45M|		if (cvt_16(p, m) == -1)
  ------------------
  |  Branch (1272:7): [True: 0, False: 5.45M]
  ------------------
 1273|      0|			goto out;
 1274|  5.45M|		return 1;
 1275|  16.6M|	case FILE_BELONG:
  ------------------
  |  |  253|  16.6M|#define				FILE_BELONG		8
  ------------------
  |  Branch (1275:2): [True: 16.6M, False: 111M]
  ------------------
 1276|  16.6M|	case FILE_BEDATE:
  ------------------
  |  |  254|  16.6M|#define				FILE_BEDATE		9
  ------------------
  |  Branch (1276:2): [True: 350, False: 127M]
  ------------------
 1277|  16.6M|	case FILE_BELDATE:
  ------------------
  |  |  260|  16.6M|#define				FILE_BELDATE		15
  ------------------
  |  Branch (1277:2): [True: 430, False: 127M]
  ------------------
 1278|  16.6M|		p->l = CAST(int32_t, BE32(p->hl));
  ------------------
  |  |  452|  16.6M|#define CAST(T, b)	((T)(b))
  ------------------
 1279|  16.6M|		if (cvt_32(p, m) == -1)
  ------------------
  |  Branch (1279:7): [True: 0, False: 16.6M]
  ------------------
 1280|      0|			goto out;
 1281|  16.6M|		return 1;
 1282|  1.33M|	case FILE_BEQUAD:
  ------------------
  |  |  271|  1.33M|#define				FILE_BEQUAD		26
  ------------------
  |  Branch (1282:2): [True: 1.33M, False: 126M]
  ------------------
 1283|  1.33M|	case FILE_BEQDATE:
  ------------------
  |  |  274|  1.33M|#define				FILE_BEQDATE		29
  ------------------
  |  Branch (1283:2): [True: 522, False: 127M]
  ------------------
 1284|  1.33M|	case FILE_BEQLDATE:
  ------------------
  |  |  277|  1.33M|#define				FILE_BEQLDATE		32
  ------------------
  |  Branch (1284:2): [True: 380, False: 127M]
  ------------------
 1285|  1.33M|	case FILE_BEQWDATE:
  ------------------
  |  |  289|  1.33M|#define				FILE_BEQWDATE		44
  ------------------
  |  Branch (1285:2): [True: 0, False: 127M]
  ------------------
 1286|  1.33M|		p->q = CAST(uint64_t, BE64(p->hq));
  ------------------
  |  |  452|  1.33M|#define CAST(T, b)	((T)(b))
  ------------------
 1287|  1.33M|		if (cvt_64(p, m) == -1)
  ------------------
  |  Branch (1287:7): [True: 0, False: 1.33M]
  ------------------
 1288|      0|			goto out;
 1289|  1.33M|		return 1;
 1290|  5.05M|	case FILE_LESHORT:
  ------------------
  |  |  255|  5.05M|#define				FILE_LESHORT		10
  ------------------
  |  Branch (1290:2): [True: 5.05M, False: 122M]
  ------------------
 1291|  5.05M|	case FILE_LEMSDOSDATE:
  ------------------
  |  |  301|  5.05M|#define				FILE_LEMSDOSDATE	56
  ------------------
  |  Branch (1291:2): [True: 292, False: 127M]
  ------------------
 1292|  5.05M|	case FILE_LEMSDOSTIME:
  ------------------
  |  |  304|  5.05M|#define				FILE_LEMSDOSTIME	59
  ------------------
  |  Branch (1292:2): [True: 292, False: 127M]
  ------------------
 1293|  5.05M|		p->h = CAST(short, LE16(p->hs));
  ------------------
  |  |  452|  5.05M|#define CAST(T, b)	((T)(b))
  ------------------
 1294|  5.05M|		if (cvt_16(p, m) == -1)
  ------------------
  |  Branch (1294:7): [True: 0, False: 5.05M]
  ------------------
 1295|      0|			goto out;
 1296|  5.05M|		return 1;
 1297|  8.52M|	case FILE_LELONG:
  ------------------
  |  |  256|  8.52M|#define				FILE_LELONG		11
  ------------------
  |  Branch (1297:2): [True: 8.52M, False: 119M]
  ------------------
 1298|  8.52M|	case FILE_LEDATE:
  ------------------
  |  |  257|  8.52M|#define				FILE_LEDATE		12
  ------------------
  |  Branch (1298:2): [True: 233, False: 127M]
  ------------------
 1299|  8.52M|	case FILE_LELDATE:
  ------------------
  |  |  261|  8.52M|#define				FILE_LELDATE		16
  ------------------
  |  Branch (1299:2): [True: 92, False: 127M]
  ------------------
 1300|  8.52M|		p->l = CAST(int32_t, LE32(p->hl));
  ------------------
  |  |  452|  8.52M|#define CAST(T, b)	((T)(b))
  ------------------
 1301|  8.52M|		if (cvt_32(p, m) == -1)
  ------------------
  |  Branch (1301:7): [True: 0, False: 8.52M]
  ------------------
 1302|      0|			goto out;
 1303|  8.52M|		return 1;
 1304|  1.08M|	case FILE_LEQUAD:
  ------------------
  |  |  270|  1.08M|#define				FILE_LEQUAD		25
  ------------------
  |  Branch (1304:2): [True: 1.08M, False: 126M]
  ------------------
 1305|  1.08M|	case FILE_LEQDATE:
  ------------------
  |  |  273|  1.08M|#define				FILE_LEQDATE		28
  ------------------
  |  Branch (1305:2): [True: 517, False: 127M]
  ------------------
 1306|  1.08M|	case FILE_LEQLDATE:
  ------------------
  |  |  276|  1.08M|#define				FILE_LEQLDATE		31
  ------------------
  |  Branch (1306:2): [True: 265, False: 127M]
  ------------------
 1307|  1.08M|	case FILE_LEQWDATE:
  ------------------
  |  |  288|  1.08M|#define				FILE_LEQWDATE		43
  ------------------
  |  Branch (1307:2): [True: 1.86k, False: 127M]
  ------------------
 1308|  1.08M|		p->q = CAST(uint64_t, LE64(p->hq));
  ------------------
  |  |  452|  1.08M|#define CAST(T, b)	((T)(b))
  ------------------
 1309|  1.08M|		if (cvt_64(p, m) == -1)
  ------------------
  |  Branch (1309:7): [True: 0, False: 1.08M]
  ------------------
 1310|      0|			goto out;
 1311|  1.08M|		return 1;
 1312|     38|	case FILE_MELONG:
  ------------------
  |  |  268|     38|#define				FILE_MELONG		23
  ------------------
  |  Branch (1312:2): [True: 38, False: 127M]
  ------------------
 1313|    212|	case FILE_MEDATE:
  ------------------
  |  |  266|    212|#define				FILE_MEDATE		21
  ------------------
  |  Branch (1313:2): [True: 174, False: 127M]
  ------------------
 1314|    212|	case FILE_MELDATE:
  ------------------
  |  |  267|    212|#define				FILE_MELDATE		22
  ------------------
  |  Branch (1314:2): [True: 0, False: 127M]
  ------------------
 1315|    212|		p->l = CAST(int32_t, ME32(p->hl));
  ------------------
  |  |  452|    212|#define CAST(T, b)	((T)(b))
  ------------------
 1316|    212|		if (cvt_32(p, m) == -1)
  ------------------
  |  Branch (1316:7): [True: 0, False: 212]
  ------------------
 1317|      0|			goto out;
 1318|    212|		return 1;
 1319|      0|	case FILE_FLOAT:
  ------------------
  |  |  278|      0|#define				FILE_FLOAT		33
  ------------------
  |  Branch (1319:2): [True: 0, False: 127M]
  ------------------
 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:
  ------------------
  |  |  279|      0|#define				FILE_BEFLOAT		34
  ------------------
  |  Branch (1323:2): [True: 0, False: 127M]
  ------------------
 1324|      0|		p->l = BE32(p->hl);
  ------------------
  |  |   95|      0|#define BE32(p) ( \
  |  |   96|      0|    (CAST(uint32_t, (p)[0])<<24)| \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   97|      0|    (CAST(uint32_t, (p)[1])<<16)| \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   98|      0|    (CAST(uint32_t, (p)[2])<<8)| \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   99|      0|    (CAST(uint32_t, (p)[3])))
  |  |  ------------------
  |  |  |  |  452|      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.4k|	case FILE_LEFLOAT:
  ------------------
  |  |  280|  10.4k|#define				FILE_LEFLOAT		35
  ------------------
  |  Branch (1328:2): [True: 10.4k, False: 127M]
  ------------------
 1329|  10.4k|		p->l = LE32(p->hl);
  ------------------
  |  |   90|  10.4k|#define LE32(p) ( \
  |  |   91|  10.4k|    (CAST(uint32_t, (p)[3])<<24)| \
  |  |  ------------------
  |  |  |  |  452|  10.4k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   92|  10.4k|    (CAST(uint32_t, (p)[2])<<16)| \
  |  |  ------------------
  |  |  |  |  452|  10.4k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   93|  10.4k|    (CAST(uint32_t, (p)[1])<<8)| \
  |  |  ------------------
  |  |  |  |  452|  10.4k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   94|  10.4k|    (CAST(uint32_t, (p)[0])))
  |  |  ------------------
  |  |  |  |  452|  10.4k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1330|  10.4k|		if (cvt_float(p, m) == -1)
  ------------------
  |  Branch (1330:7): [True: 0, False: 10.4k]
  ------------------
 1331|      0|			goto out;
 1332|  10.4k|		return 1;
 1333|      0|	case FILE_DOUBLE:
  ------------------
  |  |  281|      0|#define				FILE_DOUBLE		36
  ------------------
  |  Branch (1333:2): [True: 0, False: 127M]
  ------------------
 1334|      0|		if (cvt_double(p, m) == -1)
  ------------------
  |  Branch (1334:7): [True: 0, False: 0]
  ------------------
 1335|      0|			goto out;
 1336|      0|		return 1;
 1337|    181|	case FILE_BEDOUBLE:
  ------------------
  |  |  282|    181|#define				FILE_BEDOUBLE		37
  ------------------
  |  Branch (1337:2): [True: 181, False: 127M]
  ------------------
 1338|    181|		p->q = BE64(p->hq);
  ------------------
  |  |   72|    181|#define BE64(p) ( \
  |  |   73|    181|    (CAST(uint64_t, (p)[0])<<56)| \
  |  |  ------------------
  |  |  |  |  452|    181|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   74|    181|    (CAST(uint64_t, (p)[1])<<48)| \
  |  |  ------------------
  |  |  |  |  452|    181|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   75|    181|    (CAST(uint64_t, (p)[2])<<40)| \
  |  |  ------------------
  |  |  |  |  452|    181|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   76|    181|    (CAST(uint64_t, (p)[3])<<32)| \
  |  |  ------------------
  |  |  |  |  452|    181|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   77|    181|    (CAST(uint64_t, (p)[4])<<24)| \
  |  |  ------------------
  |  |  |  |  452|    181|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   78|    181|    (CAST(uint64_t, (p)[5])<<16)| \
  |  |  ------------------
  |  |  |  |  452|    181|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   79|    181|    (CAST(uint64_t, (p)[6])<<8)| \
  |  |  ------------------
  |  |  |  |  452|    181|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   80|    181|    (CAST(uint64_t, (p)[7])))
  |  |  ------------------
  |  |  |  |  452|    181|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1339|    181|		if (cvt_double(p, m) == -1)
  ------------------
  |  Branch (1339:7): [True: 0, False: 181]
  ------------------
 1340|      0|			goto out;
 1341|    181|		return 1;
 1342|    550|	case FILE_LEDOUBLE:
  ------------------
  |  |  283|    550|#define				FILE_LEDOUBLE		38
  ------------------
  |  Branch (1342:2): [True: 550, False: 127M]
  ------------------
 1343|    550|		p->q = LE64(p->hq);
  ------------------
  |  |   81|    550|#define LE64(p) ( \
  |  |   82|    550|    (CAST(uint64_t, (p)[7])<<56)| \
  |  |  ------------------
  |  |  |  |  452|    550|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   83|    550|    (CAST(uint64_t, (p)[6])<<48)| \
  |  |  ------------------
  |  |  |  |  452|    550|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   84|    550|    (CAST(uint64_t, (p)[5])<<40)| \
  |  |  ------------------
  |  |  |  |  452|    550|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   85|    550|    (CAST(uint64_t, (p)[4])<<32)| \
  |  |  ------------------
  |  |  |  |  452|    550|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   86|    550|    (CAST(uint64_t, (p)[3])<<24)| \
  |  |  ------------------
  |  |  |  |  452|    550|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   87|    550|    (CAST(uint64_t, (p)[2])<<16)| \
  |  |  ------------------
  |  |  |  |  452|    550|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   88|    550|    (CAST(uint64_t, (p)[1])<<8)| \
  |  |  ------------------
  |  |  |  |  452|    550|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   89|    550|    (CAST(uint64_t, (p)[0])))
  |  |  ------------------
  |  |  |  |  452|    550|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1344|    550|		if (cvt_double(p, m) == -1)
  ------------------
  |  Branch (1344:7): [True: 0, False: 550]
  ------------------
 1345|      0|			goto out;
 1346|    550|		return 1;
 1347|   322k|	case FILE_REGEX:
  ------------------
  |  |  262|   322k|#define				FILE_REGEX		17
  ------------------
  |  Branch (1347:2): [True: 322k, False: 127M]
  ------------------
 1348|  1.16M|	case FILE_SEARCH:
  ------------------
  |  |  265|  1.16M|#define				FILE_SEARCH		20
  ------------------
  |  Branch (1348:2): [True: 846k, False: 127M]
  ------------------
 1349|  1.17M|	case FILE_DEFAULT:
  ------------------
  |  |  248|  1.17M|#define				FILE_DEFAULT		3
  ------------------
  |  Branch (1349:2): [True: 8.45k, False: 127M]
  ------------------
 1350|  1.17M|	case FILE_CLEAR:
  ------------------
  |  |  292|  1.17M|#define				FILE_CLEAR		47
  ------------------
  |  Branch (1350:2): [True: 1.49k, False: 127M]
  ------------------
 1351|  1.17M|	case FILE_NAME:
  ------------------
  |  |  290|  1.17M|#define				FILE_NAME		45
  ------------------
  |  Branch (1351:2): [True: 0, False: 127M]
  ------------------
 1352|  1.17M|	case FILE_USE:
  ------------------
  |  |  291|  1.17M|#define				FILE_USE		46
  ------------------
  |  Branch (1352:2): [True: 0, False: 127M]
  ------------------
 1353|  1.70M|	case FILE_DER:
  ------------------
  |  |  293|  1.70M|#define				FILE_DER		48
  ------------------
  |  Branch (1353:2): [True: 523k, False: 127M]
  ------------------
 1354|  2.00M|	case FILE_GUID:
  ------------------
  |  |  294|  2.00M|#define				FILE_GUID		49
  ------------------
  |  Branch (1354:2): [True: 305k, False: 127M]
  ------------------
 1355|  2.00M|	case FILE_LEGUID:
  ------------------
  |  |  295|  2.00M|#define				FILE_LEGUID		50
  ------------------
  |  Branch (1355:2): [True: 0, False: 127M]
  ------------------
 1356|  2.00M|	case FILE_BEGUID:
  ------------------
  |  |  296|  2.00M|#define				FILE_BEGUID		51
  ------------------
  |  Branch (1356:2): [True: 62, False: 127M]
  ------------------
 1357|  2.00M|		return 1;
 1358|      0|	default:
  ------------------
  |  Branch (1358:2): [True: 0, False: 127M]
  ------------------
 1359|      0|		file_magerror(ms, "invalid type %d in mconvert()", m->type);
 1360|      0|		return 0;
 1361|   127M|	}
 1362|      0|out:
 1363|      0|	file_magerror(ms, "zerodivide/overflow/underflow in mconvert()");
 1364|      0|	return 0;
 1365|   127M|}
softmagic.c:cvt_8:
 1139|  2.19M|{
 1140|  2.19M|	DO_CVT(m, b, 8);
  ------------------
  |  | 1131|  2.19M|	if ((m)->flag & UNSIGNED) { \
  |  |  ------------------
  |  |  |  |  229|  2.19M|#define UNSIGNED	0x08	/* comparison is unsigned */
  |  |  ------------------
  |  |  |  Branch (1131:6): [True: 998k, False: 1.19M]
  |  |  ------------------
  |  | 1132|   998k|		DO_CVT1(fld, uint##size##_t, size, 0); \
  |  |  ------------------
  |  |  |  | 1094|   998k|	if (m->num_mask) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|   998k|#define num_mask _u._mask
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1094:6): [True: 144k, False: 853k]
  |  |  |  |  ------------------
  |  |  |  | 1095|   998k|		switch (m->mask_op & FILE_OPS_MASK) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|   144k|#define				FILE_OPS_MASK	0x07 /* mask for above ops */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:11): [True: 144k, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1096|   126k|		case FILE_OPAND: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  344|   126k|#define				FILE_OPAND	0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1096:3): [True: 126k, False: 17.9k]
  |  |  |  |  ------------------
  |  |  |  | 1097|   126k|			p->fld &= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|   126k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1098|   126k|			break; \
  |  |  |  | 1099|      0|		case FILE_OPOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  345|      0|#define				FILE_OPOR	1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1099:3): [True: 0, False: 144k]
  |  |  |  |  ------------------
  |  |  |  | 1100|      0|			p->fld |= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1101|      0|			break; \
  |  |  |  | 1102|      0|		case FILE_OPXOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  346|      0|#define				FILE_OPXOR	2
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:3): [True: 0, False: 144k]
  |  |  |  |  ------------------
  |  |  |  | 1103|      0|			p->fld ^= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1104|      0|			break; \
  |  |  |  | 1105|      0|		case FILE_OPADD: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  347|      0|#define				FILE_OPADD	3
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1105:3): [True: 0, False: 144k]
  |  |  |  |  ------------------
  |  |  |  | 1106|      0|			p->fld += CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1107|      0|			break; \
  |  |  |  | 1108|  17.4k|		case FILE_OPMINUS: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  348|  17.4k|#define				FILE_OPMINUS	4
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1108:3): [True: 17.4k, False: 127k]
  |  |  |  |  ------------------
  |  |  |  | 1109|  17.4k|			p->fld -= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|  17.4k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1110|  17.4k|			break; \
  |  |  |  | 1111|      0|		case FILE_OPMULTIPLY: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  349|      0|#define				FILE_OPMULTIPLY	5
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1111:3): [True: 0, False: 144k]
  |  |  |  |  ------------------
  |  |  |  | 1112|      0|			p->fld *= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1113|      0|			break; \
  |  |  |  | 1114|    248|		case FILE_OPDIVIDE: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  350|    248|#define				FILE_OPDIVIDE	6
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1114:3): [True: 248, False: 144k]
  |  |  |  |  ------------------
  |  |  |  | 1115|    248|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|    248|	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|    248|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1087:6): [Folded, False: 248]
  |  |  |  |  |  |  |  Branch (1087:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1087:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1088|    248|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|    248|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|    248|		return -1; \
  |  |  |  |  |  | 1090|    248|	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|    248|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1090:6): [Folded, False: 248]
  |  |  |  |  |  |  |  Branch (1090:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1090:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1091|    248|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|    248|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1091:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1092|    248|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1116|    248|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|    248|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1116:8): [True: 0, False: 248]
  |  |  |  |  ------------------
  |  |  |  | 1117|    248|				return -1; \
  |  |  |  | 1118|    248|			p->fld /= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|    248|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1119|    248|			break; \
  |  |  |  | 1120|    248|		case FILE_OPMODULO: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  351|    247|#define				FILE_OPMODULO	7
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:3): [True: 247, False: 144k]
  |  |  |  |  ------------------
  |  |  |  | 1121|    247|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|    247|	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|    247|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1087:6): [Folded, False: 247]
  |  |  |  |  |  |  |  Branch (1087:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1087:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1088|    247|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|    247|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|    247|		return -1; \
  |  |  |  |  |  | 1090|    247|	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|    247|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1090:6): [Folded, False: 247]
  |  |  |  |  |  |  |  Branch (1090:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1090:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1091|    247|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|    247|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1091:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1092|    247|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1122|    247|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|    247|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:8): [True: 0, False: 247]
  |  |  |  |  ------------------
  |  |  |  | 1123|    247|				return -1; \
  |  |  |  | 1124|    247|			p->fld %= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|    247|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1125|    247|			break; \
  |  |  |  | 1126|   144k|		} \
  |  |  |  | 1127|   998k|	if (m->mask_op & FILE_OPINVERSE) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  356|   998k|#define				FILE_OPINVERSE	0x40
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1127:6): [True: 0, False: 998k]
  |  |  |  |  ------------------
  |  |  |  | 1128|   998k|		p->fld = ~p->fld \
  |  |  ------------------
  |  | 1133|  1.19M|	} else { \
  |  | 1134|  1.19M|		DO_CVT1(s##fld, int##size##_t, size, 1); \
  |  |  ------------------
  |  |  |  | 1094|  1.19M|	if (m->num_mask) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|  1.19M|#define num_mask _u._mask
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1094:6): [True: 59.3k, False: 1.13M]
  |  |  |  |  ------------------
  |  |  |  | 1095|  1.19M|		switch (m->mask_op & FILE_OPS_MASK) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|  59.3k|#define				FILE_OPS_MASK	0x07 /* mask for above ops */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:11): [True: 59.3k, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1096|  48.1k|		case FILE_OPAND: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  344|  48.1k|#define				FILE_OPAND	0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1096:3): [True: 48.1k, False: 11.2k]
  |  |  |  |  ------------------
  |  |  |  | 1097|  48.1k|			p->fld &= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|  48.1k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1098|  48.1k|			break; \
  |  |  |  | 1099|      0|		case FILE_OPOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  345|      0|#define				FILE_OPOR	1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1099:3): [True: 0, False: 59.3k]
  |  |  |  |  ------------------
  |  |  |  | 1100|      0|			p->fld |= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1101|      0|			break; \
  |  |  |  | 1102|      0|		case FILE_OPXOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  346|      0|#define				FILE_OPXOR	2
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:3): [True: 0, False: 59.3k]
  |  |  |  |  ------------------
  |  |  |  | 1103|      0|			p->fld ^= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1104|      0|			break; \
  |  |  |  | 1105|      0|		case FILE_OPADD: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  347|      0|#define				FILE_OPADD	3
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1105:3): [True: 0, False: 59.3k]
  |  |  |  |  ------------------
  |  |  |  | 1106|      0|			p->fld += CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1107|      0|			break; \
  |  |  |  | 1108|  11.1k|		case FILE_OPMINUS: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  348|  11.1k|#define				FILE_OPMINUS	4
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1108:3): [True: 11.1k, False: 48.2k]
  |  |  |  |  ------------------
  |  |  |  | 1109|  11.1k|			p->fld -= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|  11.1k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1110|  11.1k|			break; \
  |  |  |  | 1111|      0|		case FILE_OPMULTIPLY: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  349|      0|#define				FILE_OPMULTIPLY	5
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1111:3): [True: 0, False: 59.3k]
  |  |  |  |  ------------------
  |  |  |  | 1112|      0|			p->fld *= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1113|      0|			break; \
  |  |  |  | 1114|     79|		case FILE_OPDIVIDE: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  350|     79|#define				FILE_OPDIVIDE	6
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1114:3): [True: 79, False: 59.2k]
  |  |  |  |  ------------------
  |  |  |  | 1115|     79|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|     79|	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|     79|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1087:6): [Folded, False: 79]
  |  |  |  |  |  |  |  Branch (1087:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1087:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1088|     79|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|     79|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|     79|		return -1; \
  |  |  |  |  |  | 1090|     79|	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|     79|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1090:6): [Folded, False: 79]
  |  |  |  |  |  |  |  Branch (1090:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1090:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1091|     79|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|     79|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1091:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1092|     79|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1116|     79|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|     79|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1116:8): [True: 0, False: 79]
  |  |  |  |  ------------------
  |  |  |  | 1117|     79|				return -1; \
  |  |  |  | 1118|     79|			p->fld /= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|     79|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1119|     79|			break; \
  |  |  |  | 1120|     79|		case FILE_OPMODULO: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  351|      0|#define				FILE_OPMODULO	7
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:3): [True: 0, False: 59.3k]
  |  |  |  |  ------------------
  |  |  |  | 1121|      0|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|      0|	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      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)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      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) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      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)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      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) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      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); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1125|      0|			break; \
  |  |  |  | 1126|  59.3k|		} \
  |  |  |  | 1127|  1.19M|	if (m->mask_op & FILE_OPINVERSE) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  356|  1.19M|#define				FILE_OPINVERSE	0x40
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1127:6): [True: 0, False: 1.19M]
  |  |  |  |  ------------------
  |  |  |  | 1128|  1.19M|		p->fld = ~p->fld \
  |  |  ------------------
  |  | 1135|  1.19M|	}
  ------------------
 1141|  2.19M|	return 0;
 1142|  2.19M|}
softmagic.c:cvt_16:
 1146|  12.8M|{
 1147|  12.8M|	DO_CVT(m, h, 16);
  ------------------
  |  | 1131|  12.8M|	if ((m)->flag & UNSIGNED) { \
  |  |  ------------------
  |  |  |  |  229|  12.8M|#define UNSIGNED	0x08	/* comparison is unsigned */
  |  |  ------------------
  |  |  |  Branch (1131:6): [True: 1.62M, False: 11.2M]
  |  |  ------------------
  |  | 1132|  1.62M|		DO_CVT1(fld, uint##size##_t, size, 0); \
  |  |  ------------------
  |  |  |  | 1094|  1.62M|	if (m->num_mask) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|  1.62M|#define num_mask _u._mask
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1094:6): [True: 165k, False: 1.46M]
  |  |  |  |  ------------------
  |  |  |  | 1095|  1.62M|		switch (m->mask_op & FILE_OPS_MASK) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|   165k|#define				FILE_OPS_MASK	0x07 /* mask for above ops */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:11): [True: 165k, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1096|   164k|		case FILE_OPAND: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  344|   164k|#define				FILE_OPAND	0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1096:3): [True: 164k, False: 833]
  |  |  |  |  ------------------
  |  |  |  | 1097|   164k|			p->fld &= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|   164k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1098|   164k|			break; \
  |  |  |  | 1099|      0|		case FILE_OPOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  345|      0|#define				FILE_OPOR	1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1099:3): [True: 0, False: 165k]
  |  |  |  |  ------------------
  |  |  |  | 1100|      0|			p->fld |= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1101|      0|			break; \
  |  |  |  | 1102|      0|		case FILE_OPXOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  346|      0|#define				FILE_OPXOR	2
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:3): [True: 0, False: 165k]
  |  |  |  |  ------------------
  |  |  |  | 1103|      0|			p->fld ^= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1104|      0|			break; \
  |  |  |  | 1105|     74|		case FILE_OPADD: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  347|     74|#define				FILE_OPADD	3
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1105:3): [True: 74, False: 164k]
  |  |  |  |  ------------------
  |  |  |  | 1106|     74|			p->fld += CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|     74|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1107|     74|			break; \
  |  |  |  | 1108|    119|		case FILE_OPMINUS: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  348|    119|#define				FILE_OPMINUS	4
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1108:3): [True: 119, False: 164k]
  |  |  |  |  ------------------
  |  |  |  | 1109|    119|			p->fld -= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|    119|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1110|    119|			break; \
  |  |  |  | 1111|     79|		case FILE_OPMULTIPLY: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  349|     79|#define				FILE_OPMULTIPLY	5
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1111:3): [True: 79, False: 164k]
  |  |  |  |  ------------------
  |  |  |  | 1112|     79|			p->fld *= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|     79|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1113|     79|			break; \
  |  |  |  | 1114|    465|		case FILE_OPDIVIDE: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  350|    465|#define				FILE_OPDIVIDE	6
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1114:3): [True: 465, False: 164k]
  |  |  |  |  ------------------
  |  |  |  | 1115|    465|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|    465|	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|    465|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1087:6): [Folded, False: 465]
  |  |  |  |  |  |  |  Branch (1087:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1087:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1088|    465|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|    465|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|    465|		return -1; \
  |  |  |  |  |  | 1090|    465|	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|    465|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1090:6): [Folded, False: 465]
  |  |  |  |  |  |  |  Branch (1090:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1090:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1091|    465|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|    465|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1091:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1092|    465|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1116|    465|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|    465|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1116:8): [True: 0, False: 465]
  |  |  |  |  ------------------
  |  |  |  | 1117|    465|				return -1; \
  |  |  |  | 1118|    465|			p->fld /= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|    465|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1119|    465|			break; \
  |  |  |  | 1120|    465|		case FILE_OPMODULO: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  351|     96|#define				FILE_OPMODULO	7
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:3): [True: 96, False: 164k]
  |  |  |  |  ------------------
  |  |  |  | 1121|     96|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|     96|	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|     96|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1087:6): [Folded, False: 96]
  |  |  |  |  |  |  |  Branch (1087:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1087:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1088|     96|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|     96|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|     96|		return -1; \
  |  |  |  |  |  | 1090|     96|	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|     96|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1090:6): [Folded, False: 96]
  |  |  |  |  |  |  |  Branch (1090:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1090:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1091|     96|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|     96|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1091:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1092|     96|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1122|     96|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|     96|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:8): [True: 0, False: 96]
  |  |  |  |  ------------------
  |  |  |  | 1123|     96|				return -1; \
  |  |  |  | 1124|     96|			p->fld %= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|     96|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1125|     96|			break; \
  |  |  |  | 1126|   165k|		} \
  |  |  |  | 1127|  1.62M|	if (m->mask_op & FILE_OPINVERSE) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  356|  1.62M|#define				FILE_OPINVERSE	0x40
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1127:6): [True: 0, False: 1.62M]
  |  |  |  |  ------------------
  |  |  |  | 1128|  1.62M|		p->fld = ~p->fld \
  |  |  ------------------
  |  | 1133|  11.2M|	} else { \
  |  | 1134|  11.2M|		DO_CVT1(s##fld, int##size##_t, size, 1); \
  |  |  ------------------
  |  |  |  | 1094|  11.2M|	if (m->num_mask) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|  11.2M|#define num_mask _u._mask
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1094:6): [True: 593k, False: 10.6M]
  |  |  |  |  ------------------
  |  |  |  | 1095|  11.2M|		switch (m->mask_op & FILE_OPS_MASK) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|   593k|#define				FILE_OPS_MASK	0x07 /* mask for above ops */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:11): [True: 593k, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1096|   562k|		case FILE_OPAND: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  344|   562k|#define				FILE_OPAND	0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1096:3): [True: 562k, False: 31.3k]
  |  |  |  |  ------------------
  |  |  |  | 1097|   562k|			p->fld &= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|   562k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1098|   562k|			break; \
  |  |  |  | 1099|      0|		case FILE_OPOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  345|      0|#define				FILE_OPOR	1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1099:3): [True: 0, False: 593k]
  |  |  |  |  ------------------
  |  |  |  | 1100|      0|			p->fld |= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1101|      0|			break; \
  |  |  |  | 1102|      0|		case FILE_OPXOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  346|      0|#define				FILE_OPXOR	2
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:3): [True: 0, False: 593k]
  |  |  |  |  ------------------
  |  |  |  | 1103|      0|			p->fld ^= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1104|      0|			break; \
  |  |  |  | 1105|     99|		case FILE_OPADD: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  347|     99|#define				FILE_OPADD	3
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1105:3): [True: 99, False: 593k]
  |  |  |  |  ------------------
  |  |  |  | 1106|     99|			p->fld += CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|     99|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1107|     99|			break; \
  |  |  |  | 1108|      0|		case FILE_OPMINUS: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  348|      0|#define				FILE_OPMINUS	4
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1108:3): [True: 0, False: 593k]
  |  |  |  |  ------------------
  |  |  |  | 1109|      0|			p->fld -= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1110|      0|			break; \
  |  |  |  | 1111|      0|		case FILE_OPMULTIPLY: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  349|      0|#define				FILE_OPMULTIPLY	5
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1111:3): [True: 0, False: 593k]
  |  |  |  |  ------------------
  |  |  |  | 1112|      0|			p->fld *= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1113|      0|			break; \
  |  |  |  | 1114|     66|		case FILE_OPDIVIDE: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  350|     66|#define				FILE_OPDIVIDE	6
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1114:3): [True: 66, False: 593k]
  |  |  |  |  ------------------
  |  |  |  | 1115|     66|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|     66|	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|     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)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|     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) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|     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)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|     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) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|     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); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|     66|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1119|     66|			break; \
  |  |  |  | 1120|  31.2k|		case FILE_OPMODULO: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  351|  31.2k|#define				FILE_OPMODULO	7
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:3): [True: 31.2k, False: 562k]
  |  |  |  |  ------------------
  |  |  |  | 1121|  31.2k|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|  31.2k|	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|  31.2k|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1087:6): [Folded, False: 31.2k]
  |  |  |  |  |  |  |  Branch (1087:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1087:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1088|  31.2k|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|  31.2k|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|  31.2k|		return -1; \
  |  |  |  |  |  | 1090|  31.2k|	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|  31.2k|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1090:6): [Folded, False: 31.2k]
  |  |  |  |  |  |  |  Branch (1090:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1090:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1091|  31.2k|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|  31.2k|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1091:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1092|  31.2k|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1122|  31.2k|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|  31.2k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:8): [True: 0, False: 31.2k]
  |  |  |  |  ------------------
  |  |  |  | 1123|  31.2k|				return -1; \
  |  |  |  | 1124|  31.2k|			p->fld %= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|  31.2k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1125|  31.2k|			break; \
  |  |  |  | 1126|   593k|		} \
  |  |  |  | 1127|  11.2M|	if (m->mask_op & FILE_OPINVERSE) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  356|  11.2M|#define				FILE_OPINVERSE	0x40
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1127:6): [True: 0, False: 11.2M]
  |  |  |  |  ------------------
  |  |  |  | 1128|  11.2M|		p->fld = ~p->fld \
  |  |  ------------------
  |  | 1135|  11.2M|	}
  ------------------
 1148|  12.8M|	return 0;
 1149|  12.8M|}
softmagic.c:cvt_32:
 1153|  27.1M|{
 1154|  27.1M|	DO_CVT(m, l, 32);
  ------------------
  |  | 1131|  27.1M|	if ((m)->flag & UNSIGNED) { \
  |  |  ------------------
  |  |  |  |  229|  27.1M|#define UNSIGNED	0x08	/* comparison is unsigned */
  |  |  ------------------
  |  |  |  Branch (1131:6): [True: 4.03M, False: 23.1M]
  |  |  ------------------
  |  | 1132|  4.03M|		DO_CVT1(fld, uint##size##_t, size, 0); \
  |  |  ------------------
  |  |  |  | 1094|  4.03M|	if (m->num_mask) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|  4.03M|#define num_mask _u._mask
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1094:6): [True: 606k, False: 3.42M]
  |  |  |  |  ------------------
  |  |  |  | 1095|  4.03M|		switch (m->mask_op & FILE_OPS_MASK) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|   606k|#define				FILE_OPS_MASK	0x07 /* mask for above ops */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:11): [True: 606k, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1096|   605k|		case FILE_OPAND: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  344|   605k|#define				FILE_OPAND	0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1096:3): [True: 605k, False: 1.10k]
  |  |  |  |  ------------------
  |  |  |  | 1097|   605k|			p->fld &= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|   605k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1098|   605k|			break; \
  |  |  |  | 1099|      0|		case FILE_OPOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  345|      0|#define				FILE_OPOR	1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1099:3): [True: 0, False: 606k]
  |  |  |  |  ------------------
  |  |  |  | 1100|      0|			p->fld |= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1101|      0|			break; \
  |  |  |  | 1102|     92|		case FILE_OPXOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  346|     92|#define				FILE_OPXOR	2
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:3): [True: 92, False: 606k]
  |  |  |  |  ------------------
  |  |  |  | 1103|     92|			p->fld ^= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|     92|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1104|     92|			break; \
  |  |  |  | 1105|    267|		case FILE_OPADD: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  347|    267|#define				FILE_OPADD	3
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1105:3): [True: 267, False: 605k]
  |  |  |  |  ------------------
  |  |  |  | 1106|    267|			p->fld += CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|    267|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1107|    267|			break; \
  |  |  |  | 1108|      0|		case FILE_OPMINUS: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  348|      0|#define				FILE_OPMINUS	4
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1108:3): [True: 0, False: 606k]
  |  |  |  |  ------------------
  |  |  |  | 1109|      0|			p->fld -= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1110|      0|			break; \
  |  |  |  | 1111|      0|		case FILE_OPMULTIPLY: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  349|      0|#define				FILE_OPMULTIPLY	5
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1111:3): [True: 0, False: 606k]
  |  |  |  |  ------------------
  |  |  |  | 1112|      0|			p->fld *= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1113|      0|			break; \
  |  |  |  | 1114|    497|		case FILE_OPDIVIDE: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  350|    497|#define				FILE_OPDIVIDE	6
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1114:3): [True: 497, False: 605k]
  |  |  |  |  ------------------
  |  |  |  | 1115|    497|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|    497|	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|    497|#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|    497|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|    497|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|    497|		return -1; \
  |  |  |  |  |  | 1090|    497|	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|    497|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1090:6): [Folded, False: 497]
  |  |  |  |  |  |  |  Branch (1090:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1090:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1091|    497|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|    497|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1091:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1092|    497|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1116|    497|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|    497|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1116:8): [True: 0, False: 497]
  |  |  |  |  ------------------
  |  |  |  | 1117|    497|				return -1; \
  |  |  |  | 1118|    497|			p->fld /= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|    497|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1119|    497|			break; \
  |  |  |  | 1120|    497|		case FILE_OPMODULO: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  351|    252|#define				FILE_OPMODULO	7
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:3): [True: 252, False: 605k]
  |  |  |  |  ------------------
  |  |  |  | 1121|    252|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|    252|	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|    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)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|    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) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|    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)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|    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) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|    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); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|    252|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1125|    252|			break; \
  |  |  |  | 1126|   606k|		} \
  |  |  |  | 1127|  4.03M|	if (m->mask_op & FILE_OPINVERSE) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  356|  4.03M|#define				FILE_OPINVERSE	0x40
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1127:6): [True: 0, False: 4.03M]
  |  |  |  |  ------------------
  |  |  |  | 1128|  4.03M|		p->fld = ~p->fld \
  |  |  ------------------
  |  | 1133|  23.1M|	} else { \
  |  | 1134|  23.1M|		DO_CVT1(s##fld, int##size##_t, size, 1); \
  |  |  ------------------
  |  |  |  | 1094|  23.1M|	if (m->num_mask) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|  23.1M|#define num_mask _u._mask
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1094:6): [True: 4.02M, False: 19.1M]
  |  |  |  |  ------------------
  |  |  |  | 1095|  23.1M|		switch (m->mask_op & FILE_OPS_MASK) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|  4.02M|#define				FILE_OPS_MASK	0x07 /* mask for above ops */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:11): [True: 4.02M, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1096|  4.01M|		case FILE_OPAND: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  344|  4.01M|#define				FILE_OPAND	0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1096:3): [True: 4.01M, False: 678]
  |  |  |  |  ------------------
  |  |  |  | 1097|  4.01M|			p->fld &= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|  4.01M|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1098|  4.01M|			break; \
  |  |  |  | 1099|      0|		case FILE_OPOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  345|      0|#define				FILE_OPOR	1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1099:3): [True: 0, False: 4.02M]
  |  |  |  |  ------------------
  |  |  |  | 1100|      0|			p->fld |= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1101|      0|			break; \
  |  |  |  | 1102|      0|		case FILE_OPXOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  346|      0|#define				FILE_OPXOR	2
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:3): [True: 0, False: 4.02M]
  |  |  |  |  ------------------
  |  |  |  | 1103|      0|			p->fld ^= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1104|      0|			break; \
  |  |  |  | 1105|     92|		case FILE_OPADD: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  347|     92|#define				FILE_OPADD	3
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1105:3): [True: 92, False: 4.02M]
  |  |  |  |  ------------------
  |  |  |  | 1106|     92|			p->fld += CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|     92|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1107|     92|			break; \
  |  |  |  | 1108|    388|		case FILE_OPMINUS: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  348|    388|#define				FILE_OPMINUS	4
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1108:3): [True: 388, False: 4.01M]
  |  |  |  |  ------------------
  |  |  |  | 1109|    388|			p->fld -= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|    388|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1110|    388|			break; \
  |  |  |  | 1111|      0|		case FILE_OPMULTIPLY: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  349|      0|#define				FILE_OPMULTIPLY	5
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1111:3): [True: 0, False: 4.02M]
  |  |  |  |  ------------------
  |  |  |  | 1112|      0|			p->fld *= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1113|      0|			break; \
  |  |  |  | 1114|      0|		case FILE_OPDIVIDE: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  350|      0|#define				FILE_OPDIVIDE	6
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1114:3): [True: 0, False: 4.02M]
  |  |  |  |  ------------------
  |  |  |  | 1115|      0|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|      0|	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      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)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      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) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      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)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      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) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      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); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1119|      0|			break; \
  |  |  |  | 1120|    198|		case FILE_OPMODULO: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  351|    198|#define				FILE_OPMODULO	7
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:3): [True: 198, False: 4.01M]
  |  |  |  |  ------------------
  |  |  |  | 1121|    198|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|    198|	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|    198|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|    396|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1087:6): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1087:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1087:28): [True: 81, False: 117]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1088|    198|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|     81|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|    279|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:9): [True: 0, False: 81]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|    198|		return -1; \
  |  |  |  |  |  | 1090|    198|	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|    198|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1090:6): [Folded, False: 198]
  |  |  |  |  |  |  |  Branch (1090:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1090:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1091|    198|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|    198|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1091:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1092|    198|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1122|    198|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|    198|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:8): [True: 0, False: 198]
  |  |  |  |  ------------------
  |  |  |  | 1123|    198|				return -1; \
  |  |  |  | 1124|    198|			p->fld %= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|    198|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1125|    198|			break; \
  |  |  |  | 1126|  4.02M|		} \
  |  |  |  | 1127|  23.1M|	if (m->mask_op & FILE_OPINVERSE) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  356|  23.1M|#define				FILE_OPINVERSE	0x40
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1127:6): [True: 0, False: 23.1M]
  |  |  |  |  ------------------
  |  |  |  | 1128|  23.1M|		p->fld = ~p->fld \
  |  |  ------------------
  |  | 1135|  23.1M|	}
  ------------------
 1155|  27.1M|	return 0;
 1156|  27.1M|}
softmagic.c:cvt_64:
 1160|  2.51M|{
 1161|  2.51M|	DO_CVT(m, q, 64);
  ------------------
  |  | 1131|  2.51M|	if ((m)->flag & UNSIGNED) { \
  |  |  ------------------
  |  |  |  |  229|  2.51M|#define UNSIGNED	0x08	/* comparison is unsigned */
  |  |  ------------------
  |  |  |  Branch (1131:6): [True: 962k, False: 1.55M]
  |  |  ------------------
  |  | 1132|   962k|		DO_CVT1(fld, uint##size##_t, size, 0); \
  |  |  ------------------
  |  |  |  | 1094|   962k|	if (m->num_mask) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|   962k|#define num_mask _u._mask
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1094:6): [True: 292k, False: 669k]
  |  |  |  |  ------------------
  |  |  |  | 1095|   962k|		switch (m->mask_op & FILE_OPS_MASK) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|   292k|#define				FILE_OPS_MASK	0x07 /* mask for above ops */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:11): [True: 292k, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1096|   292k|		case FILE_OPAND: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  344|   292k|#define				FILE_OPAND	0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1096:3): [True: 292k, False: 95]
  |  |  |  |  ------------------
  |  |  |  | 1097|   292k|			p->fld &= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|   292k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1098|   292k|			break; \
  |  |  |  | 1099|      0|		case FILE_OPOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  345|      0|#define				FILE_OPOR	1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1099:3): [True: 0, False: 292k]
  |  |  |  |  ------------------
  |  |  |  | 1100|      0|			p->fld |= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1101|      0|			break; \
  |  |  |  | 1102|      0|		case FILE_OPXOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  346|      0|#define				FILE_OPXOR	2
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:3): [True: 0, False: 292k]
  |  |  |  |  ------------------
  |  |  |  | 1103|      0|			p->fld ^= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1104|      0|			break; \
  |  |  |  | 1105|     61|		case FILE_OPADD: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  347|     61|#define				FILE_OPADD	3
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1105:3): [True: 61, False: 292k]
  |  |  |  |  ------------------
  |  |  |  | 1106|     61|			p->fld += CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|     61|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1107|     61|			break; \
  |  |  |  | 1108|      0|		case FILE_OPMINUS: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  348|      0|#define				FILE_OPMINUS	4
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1108:3): [True: 0, False: 292k]
  |  |  |  |  ------------------
  |  |  |  | 1109|      0|			p->fld -= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1110|      0|			break; \
  |  |  |  | 1111|      0|		case FILE_OPMULTIPLY: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  349|      0|#define				FILE_OPMULTIPLY	5
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1111:3): [True: 0, False: 292k]
  |  |  |  |  ------------------
  |  |  |  | 1112|      0|			p->fld *= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1113|      0|			break; \
  |  |  |  | 1114|     34|		case FILE_OPDIVIDE: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  350|     34|#define				FILE_OPDIVIDE	6
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1114:3): [True: 34, False: 292k]
  |  |  |  |  ------------------
  |  |  |  | 1115|     34|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|     34|	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|     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)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|     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) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|     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)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|     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) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|     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); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|     34|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1119|     34|			break; \
  |  |  |  | 1120|     34|		case FILE_OPMODULO: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  351|      0|#define				FILE_OPMODULO	7
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:3): [True: 0, False: 292k]
  |  |  |  |  ------------------
  |  |  |  | 1121|      0|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|      0|	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      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)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      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) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      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)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      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) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      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); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1125|      0|			break; \
  |  |  |  | 1126|   292k|		} \
  |  |  |  | 1127|   962k|	if (m->mask_op & FILE_OPINVERSE) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  356|   962k|#define				FILE_OPINVERSE	0x40
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1127:6): [True: 0, False: 962k]
  |  |  |  |  ------------------
  |  |  |  | 1128|   962k|		p->fld = ~p->fld \
  |  |  ------------------
  |  | 1133|  1.55M|	} else { \
  |  | 1134|  1.55M|		DO_CVT1(s##fld, int##size##_t, size, 1); \
  |  |  ------------------
  |  |  |  | 1094|  1.55M|	if (m->num_mask) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|  1.55M|#define num_mask _u._mask
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1094:6): [True: 1.75k, False: 1.54M]
  |  |  |  |  ------------------
  |  |  |  | 1095|  1.55M|		switch (m->mask_op & FILE_OPS_MASK) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|  1.75k|#define				FILE_OPS_MASK	0x07 /* mask for above ops */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:11): [True: 1.75k, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1096|     36|		case FILE_OPAND: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  344|     36|#define				FILE_OPAND	0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1096:3): [True: 36, False: 1.72k]
  |  |  |  |  ------------------
  |  |  |  | 1097|     36|			p->fld &= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|     36|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1098|     36|			break; \
  |  |  |  | 1099|      0|		case FILE_OPOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  345|      0|#define				FILE_OPOR	1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1099:3): [True: 0, False: 1.75k]
  |  |  |  |  ------------------
  |  |  |  | 1100|      0|			p->fld |= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1101|      0|			break; \
  |  |  |  | 1102|      0|		case FILE_OPXOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  346|      0|#define				FILE_OPXOR	2
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:3): [True: 0, False: 1.75k]
  |  |  |  |  ------------------
  |  |  |  | 1103|      0|			p->fld ^= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1104|      0|			break; \
  |  |  |  | 1105|      0|		case FILE_OPADD: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  347|      0|#define				FILE_OPADD	3
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1105:3): [True: 0, False: 1.75k]
  |  |  |  |  ------------------
  |  |  |  | 1106|      0|			p->fld += CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1107|      0|			break; \
  |  |  |  | 1108|      0|		case FILE_OPMINUS: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  348|      0|#define				FILE_OPMINUS	4
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1108:3): [True: 0, False: 1.75k]
  |  |  |  |  ------------------
  |  |  |  | 1109|      0|			p->fld -= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1110|      0|			break; \
  |  |  |  | 1111|      0|		case FILE_OPMULTIPLY: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  349|      0|#define				FILE_OPMULTIPLY	5
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1111:3): [True: 0, False: 1.75k]
  |  |  |  |  ------------------
  |  |  |  | 1112|      0|			p->fld *= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1113|      0|			break; \
  |  |  |  | 1114|    187|		case FILE_OPDIVIDE: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  350|    187|#define				FILE_OPDIVIDE	6
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1114:3): [True: 187, False: 1.57k]
  |  |  |  |  ------------------
  |  |  |  | 1115|    187|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|    187|	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|    187|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1087:6): [Folded, False: 187]
  |  |  |  |  |  |  |  Branch (1087:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1087:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1088|    187|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|    187|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|    187|		return -1; \
  |  |  |  |  |  | 1090|    187|	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|    187|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|    374|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1090:6): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1090:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1090:28): [True: 34, False: 153]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1091|    187|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|     34|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|    221|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1091:9): [True: 0, False: 34]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1092|    187|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1116|    187|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|    187|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1116:8): [True: 0, False: 187]
  |  |  |  |  ------------------
  |  |  |  | 1117|    187|				return -1; \
  |  |  |  | 1118|    187|			p->fld /= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|    187|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1119|    187|			break; \
  |  |  |  | 1120|  1.53k|		case FILE_OPMODULO: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  351|  1.53k|#define				FILE_OPMODULO	7
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:3): [True: 1.53k, False: 223]
  |  |  |  |  ------------------
  |  |  |  | 1121|  1.53k|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|  1.53k|	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|  1.53k|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1087:6): [Folded, False: 1.53k]
  |  |  |  |  |  |  |  Branch (1087:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1087:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1088|  1.53k|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|  1.53k|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|  1.53k|		return -1; \
  |  |  |  |  |  | 1090|  1.53k|	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|  1.53k|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|  3.07k|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1090:6): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1090:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1090:28): [True: 0, False: 1.53k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1091|  1.53k|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|  1.53k|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1091:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1092|  1.53k|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1122|  1.53k|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|  1.53k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:8): [True: 0, False: 1.53k]
  |  |  |  |  ------------------
  |  |  |  | 1123|  1.53k|				return -1; \
  |  |  |  | 1124|  1.53k|			p->fld %= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|  1.53k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1125|  1.53k|			break; \
  |  |  |  | 1126|  1.75k|		} \
  |  |  |  | 1127|  1.55M|	if (m->mask_op & FILE_OPINVERSE) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  356|  1.55M|#define				FILE_OPINVERSE	0x40
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1127:6): [True: 0, False: 1.55M]
  |  |  |  |  ------------------
  |  |  |  | 1128|  1.55M|		p->fld = ~p->fld \
  |  |  ------------------
  |  | 1135|  1.55M|	}
  ------------------
 1162|  2.51M|	return 0;
 1163|  2.51M|}
softmagic.c:cvt_float:
 1186|  10.4k|{
 1187|  10.4k|	DO_CVT2(f, float);
  ------------------
  |  | 1166|  10.4k|	if (m->num_mask) \
  |  |  ------------------
  |  |  |  |  380|  10.4k|#define num_mask _u._mask
  |  |  ------------------
  |  |  |  Branch (1166:6): [True: 0, False: 10.4k]
  |  |  ------------------
  |  | 1167|  10.4k|		switch (m->mask_op & FILE_OPS_MASK) { \
  |  |  ------------------
  |  |  |  |  352|      0|#define				FILE_OPS_MASK	0x07 /* mask for above ops */
  |  |  ------------------
  |  |  |  Branch (1167:11): [True: 0, False: 0]
  |  |  ------------------
  |  | 1168|      0|		case FILE_OPADD: \
  |  |  ------------------
  |  |  |  |  347|      0|#define				FILE_OPADD	3
  |  |  ------------------
  |  |  |  Branch (1168:3): [True: 0, False: 0]
  |  |  ------------------
  |  | 1169|      0|			p->fld += CAST(type, m->num_mask); \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  | 1170|      0|			break; \
  |  | 1171|      0|		case FILE_OPMINUS: \
  |  |  ------------------
  |  |  |  |  348|      0|#define				FILE_OPMINUS	4
  |  |  ------------------
  |  |  |  Branch (1171:3): [True: 0, False: 0]
  |  |  ------------------
  |  | 1172|      0|			p->fld -= CAST(type, m->num_mask); \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  | 1173|      0|			break; \
  |  | 1174|      0|		case FILE_OPMULTIPLY: \
  |  |  ------------------
  |  |  |  |  349|      0|#define				FILE_OPMULTIPLY	5
  |  |  ------------------
  |  |  |  Branch (1174:3): [True: 0, False: 0]
  |  |  ------------------
  |  | 1175|      0|			p->fld *= CAST(type, m->num_mask); \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  | 1176|      0|			break; \
  |  | 1177|      0|		case FILE_OPDIVIDE: \
  |  |  ------------------
  |  |  |  |  350|      0|#define				FILE_OPDIVIDE	6
  |  |  ------------------
  |  |  |  Branch (1177:3): [True: 0, False: 0]
  |  |  ------------------
  |  | 1178|      0|			if (CAST(type, m->num_mask) == 0) \
  |  |  ------------------
  |  |  |  |  452|      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); \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  | 1181|      0|			break; \
  |  | 1182|      0|		} \
  ------------------
 1188|  10.4k|	return 0;
 1189|  10.4k|}
softmagic.c:cvt_double:
 1193|    731|{
 1194|    731|	DO_CVT2(d, double);
  ------------------
  |  | 1166|    731|	if (m->num_mask) \
  |  |  ------------------
  |  |  |  |  380|    731|#define num_mask _u._mask
  |  |  ------------------
  |  |  |  Branch (1166:6): [True: 0, False: 731]
  |  |  ------------------
  |  | 1167|    731|		switch (m->mask_op & FILE_OPS_MASK) { \
  |  |  ------------------
  |  |  |  |  352|      0|#define				FILE_OPS_MASK	0x07 /* mask for above ops */
  |  |  ------------------
  |  |  |  Branch (1167:11): [True: 0, False: 0]
  |  |  ------------------
  |  | 1168|      0|		case FILE_OPADD: \
  |  |  ------------------
  |  |  |  |  347|      0|#define				FILE_OPADD	3
  |  |  ------------------
  |  |  |  Branch (1168:3): [True: 0, False: 0]
  |  |  ------------------
  |  | 1169|      0|			p->fld += CAST(type, m->num_mask); \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  | 1170|      0|			break; \
  |  | 1171|      0|		case FILE_OPMINUS: \
  |  |  ------------------
  |  |  |  |  348|      0|#define				FILE_OPMINUS	4
  |  |  ------------------
  |  |  |  Branch (1171:3): [True: 0, False: 0]
  |  |  ------------------
  |  | 1172|      0|			p->fld -= CAST(type, m->num_mask); \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  | 1173|      0|			break; \
  |  | 1174|      0|		case FILE_OPMULTIPLY: \
  |  |  ------------------
  |  |  |  |  349|      0|#define				FILE_OPMULTIPLY	5
  |  |  ------------------
  |  |  |  Branch (1174:3): [True: 0, False: 0]
  |  |  ------------------
  |  | 1175|      0|			p->fld *= CAST(type, m->num_mask); \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  | 1176|      0|			break; \
  |  | 1177|      0|		case FILE_OPDIVIDE: \
  |  |  ------------------
  |  |  |  |  350|      0|#define				FILE_OPDIVIDE	6
  |  |  ------------------
  |  |  |  Branch (1177:3): [True: 0, False: 0]
  |  |  ------------------
  |  | 1178|      0|			if (CAST(type, m->num_mask) == 0) \
  |  |  ------------------
  |  |  |  |  452|      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); \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  | 1181|      0|			break; \
  |  | 1182|      0|		} \
  ------------------
 1195|    731|	return 0;
 1196|    731|}
softmagic.c:magiccheck:
 2171|   128M|{
 2172|   128M|	uint64_t l = m->value.q;
 2173|   128M|	uint64_t v;
 2174|   128M|	float fl, fv;
 2175|   128M|	double dl, dv;
 2176|   128M|	int matched;
 2177|   128M|	union VALUETYPE *p = &ms->ms_value;
 2178|       |
 2179|   128M|	switch (m->type) {
 2180|  2.19M|	case FILE_BYTE:
  ------------------
  |  |  246|  2.19M|#define 			FILE_BYTE		1
  ------------------
  |  Branch (2180:2): [True: 2.19M, False: 125M]
  ------------------
 2181|  2.19M|		v = p->b;
 2182|  2.19M|		break;
 2183|       |
 2184|  2.34M|	case FILE_SHORT:
  ------------------
  |  |  247|  2.34M|#define				FILE_SHORT		2
  ------------------
  |  Branch (2184:2): [True: 2.34M, False: 125M]
  ------------------
 2185|  7.79M|	case FILE_BESHORT:
  ------------------
  |  |  252|  7.79M|#define				FILE_BESHORT		7
  ------------------
  |  Branch (2185:2): [True: 5.44M, False: 122M]
  ------------------
 2186|  12.8M|	case FILE_LESHORT:
  ------------------
  |  |  255|  12.8M|#define				FILE_LESHORT		10
  ------------------
  |  Branch (2186:2): [True: 5.06M, False: 122M]
  ------------------
 2187|  12.8M|	case FILE_MSDOSDATE:
  ------------------
  |  |  300|  12.8M|#define				FILE_MSDOSDATE		55
  ------------------
  |  Branch (2187:2): [True: 0, False: 128M]
  ------------------
 2188|  12.8M|	case FILE_LEMSDOSDATE:
  ------------------
  |  |  301|  12.8M|#define				FILE_LEMSDOSDATE	56
  ------------------
  |  Branch (2188:2): [True: 292, False: 128M]
  ------------------
 2189|  12.8M|	case FILE_BEMSDOSDATE:
  ------------------
  |  |  302|  12.8M|#define				FILE_BEMSDOSDATE	57
  ------------------
  |  Branch (2189:2): [True: 0, False: 128M]
  ------------------
 2190|  12.8M|	case FILE_MSDOSTIME:
  ------------------
  |  |  303|  12.8M|#define				FILE_MSDOSTIME		58
  ------------------
  |  Branch (2190:2): [True: 0, False: 128M]
  ------------------
 2191|  12.8M|	case FILE_LEMSDOSTIME:
  ------------------
  |  |  304|  12.8M|#define				FILE_LEMSDOSTIME	59
  ------------------
  |  Branch (2191:2): [True: 292, False: 128M]
  ------------------
 2192|  12.8M|	case FILE_BEMSDOSTIME:
  ------------------
  |  |  305|  12.8M|#define				FILE_BEMSDOSTIME	60
  ------------------
  |  Branch (2192:2): [True: 0, False: 128M]
  ------------------
 2193|  12.8M|		v = p->h;
 2194|  12.8M|		break;
 2195|       |
 2196|  2.01M|	case FILE_LONG:
  ------------------
  |  |  249|  2.01M|#define				FILE_LONG		4
  ------------------
  |  Branch (2196:2): [True: 2.01M, False: 125M]
  ------------------
 2197|  18.6M|	case FILE_BELONG:
  ------------------
  |  |  253|  18.6M|#define				FILE_BELONG		8
  ------------------
  |  Branch (2197:2): [True: 16.6M, False: 111M]
  ------------------
 2198|  27.1M|	case FILE_LELONG:
  ------------------
  |  |  256|  27.1M|#define				FILE_LELONG		11
  ------------------
  |  Branch (2198:2): [True: 8.52M, False: 119M]
  ------------------
 2199|  27.1M|	case FILE_MELONG:
  ------------------
  |  |  268|  27.1M|#define				FILE_MELONG		23
  ------------------
  |  Branch (2199:2): [True: 38, False: 128M]
  ------------------
 2200|  27.1M|	case FILE_DATE:
  ------------------
  |  |  251|  27.1M|#define				FILE_DATE		6
  ------------------
  |  Branch (2200:2): [True: 0, False: 128M]
  ------------------
 2201|  27.1M|	case FILE_BEDATE:
  ------------------
  |  |  254|  27.1M|#define				FILE_BEDATE		9
  ------------------
  |  Branch (2201:2): [True: 429, False: 128M]
  ------------------
 2202|  27.1M|	case FILE_LEDATE:
  ------------------
  |  |  257|  27.1M|#define				FILE_LEDATE		12
  ------------------
  |  Branch (2202:2): [True: 154, False: 128M]
  ------------------
 2203|  27.1M|	case FILE_MEDATE:
  ------------------
  |  |  266|  27.1M|#define				FILE_MEDATE		21
  ------------------
  |  Branch (2203:2): [True: 174, False: 128M]
  ------------------
 2204|  27.1M|	case FILE_LDATE:
  ------------------
  |  |  259|  27.1M|#define				FILE_LDATE		14
  ------------------
  |  Branch (2204:2): [True: 0, False: 128M]
  ------------------
 2205|  27.1M|	case FILE_BELDATE:
  ------------------
  |  |  260|  27.1M|#define				FILE_BELDATE		15
  ------------------
  |  Branch (2205:2): [True: 430, False: 128M]
  ------------------
 2206|  27.1M|	case FILE_LELDATE:
  ------------------
  |  |  261|  27.1M|#define				FILE_LELDATE		16
  ------------------
  |  Branch (2206:2): [True: 92, False: 128M]
  ------------------
 2207|  27.1M|	case FILE_MELDATE:
  ------------------
  |  |  267|  27.1M|#define				FILE_MELDATE		22
  ------------------
  |  Branch (2207:2): [True: 0, False: 128M]
  ------------------
 2208|  27.1M|		v = p->l;
 2209|  27.1M|		break;
 2210|       |
 2211|  85.0k|	case FILE_QUAD:
  ------------------
  |  |  269|  85.0k|#define				FILE_QUAD		24
  ------------------
  |  Branch (2211:2): [True: 85.0k, False: 127M]
  ------------------
 2212|  1.16M|	case FILE_LEQUAD:
  ------------------
  |  |  270|  1.16M|#define				FILE_LEQUAD		25
  ------------------
  |  Branch (2212:2): [True: 1.08M, False: 126M]
  ------------------
 2213|  2.50M|	case FILE_BEQUAD:
  ------------------
  |  |  271|  2.50M|#define				FILE_BEQUAD		26
  ------------------
  |  Branch (2213:2): [True: 1.33M, False: 126M]
  ------------------
 2214|  2.50M|	case FILE_QDATE:
  ------------------
  |  |  272|  2.50M|#define				FILE_QDATE		27
  ------------------
  |  Branch (2214:2): [True: 0, False: 128M]
  ------------------
 2215|  2.50M|	case FILE_BEQDATE:
  ------------------
  |  |  274|  2.50M|#define				FILE_BEQDATE		29
  ------------------
  |  Branch (2215:2): [True: 1.00k, False: 128M]
  ------------------
 2216|  2.50M|	case FILE_LEQDATE:
  ------------------
  |  |  273|  2.50M|#define				FILE_LEQDATE		28
  ------------------
  |  Branch (2216:2): [True: 37, False: 128M]
  ------------------
 2217|  2.50M|	case FILE_QLDATE:
  ------------------
  |  |  275|  2.50M|#define				FILE_QLDATE		30
  ------------------
  |  Branch (2217:2): [True: 0, False: 128M]
  ------------------
 2218|  2.50M|	case FILE_BEQLDATE:
  ------------------
  |  |  277|  2.50M|#define				FILE_BEQLDATE		32
  ------------------
  |  Branch (2218:2): [True: 187, False: 128M]
  ------------------
 2219|  2.50M|	case FILE_LEQLDATE:
  ------------------
  |  |  276|  2.50M|#define				FILE_LEQLDATE		31
  ------------------
  |  Branch (2219:2): [True: 458, False: 128M]
  ------------------
 2220|  2.50M|	case FILE_QWDATE:
  ------------------
  |  |  287|  2.50M|#define				FILE_QWDATE		42
  ------------------
  |  Branch (2220:2): [True: 206, False: 128M]
  ------------------
 2221|  2.50M|	case FILE_BEQWDATE:
  ------------------
  |  |  289|  2.50M|#define				FILE_BEQWDATE		44
  ------------------
  |  Branch (2221:2): [True: 0, False: 128M]
  ------------------
 2222|  2.50M|	case FILE_LEQWDATE:
  ------------------
  |  |  288|  2.50M|#define				FILE_LEQWDATE		43
  ------------------
  |  Branch (2222:2): [True: 1.86k, False: 128M]
  ------------------
 2223|  2.51M|	case FILE_OFFSET:
  ------------------
  |  |  297|  2.51M|#define				FILE_OFFSET		52
  ------------------
  |  Branch (2223:2): [True: 4.66k, False: 128M]
  ------------------
 2224|  2.51M|		v = p->q;
 2225|  2.51M|		break;
 2226|       |
 2227|      0|	case FILE_FLOAT:
  ------------------
  |  |  278|      0|#define				FILE_FLOAT		33
  ------------------
  |  Branch (2227:2): [True: 0, False: 128M]
  ------------------
 2228|      0|	case FILE_BEFLOAT:
  ------------------
  |  |  279|      0|#define				FILE_BEFLOAT		34
  ------------------
  |  Branch (2228:2): [True: 0, False: 128M]
  ------------------
 2229|  10.4k|	case FILE_LEFLOAT:
  ------------------
  |  |  280|  10.4k|#define				FILE_LEFLOAT		35
  ------------------
  |  Branch (2229:2): [True: 10.4k, False: 127M]
  ------------------
 2230|  10.4k|		fl = m->value.f;
 2231|  10.4k|		fv = p->f;
 2232|  10.4k|		switch (m->reln) {
 2233|  1.45k|		case 'x':
  ------------------
  |  Branch (2233:3): [True: 1.45k, False: 9.00k]
  ------------------
 2234|  1.45k|			matched = 1;
 2235|  1.45k|			break;
 2236|       |
 2237|      0|		case '!':
  ------------------
  |  Branch (2237:3): [True: 0, False: 10.4k]
  ------------------
 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.4k]
  ------------------
 2242|      0|			matched = isunordered(fl, fv) ? 0 : fv == fl;
  ------------------
  |  Branch (2242:14): [True: 0, False: 0]
  ------------------
 2243|      0|			break;
 2244|       |
 2245|  9.00k|		case '>':
  ------------------
  |  Branch (2245:3): [True: 9.00k, False: 1.45k]
  ------------------
 2246|  9.00k|			matched = isgreater(fv, fl);
 2247|  9.00k|			break;
 2248|       |
 2249|      0|		case '<':
  ------------------
  |  Branch (2249:3): [True: 0, False: 10.4k]
  ------------------
 2250|      0|			matched = isless(fv, fl);
 2251|      0|			break;
 2252|       |
 2253|      0|		default:
  ------------------
  |  Branch (2253:3): [True: 0, False: 10.4k]
  ------------------
 2254|      0|			file_magerror(ms, "cannot happen with float: "
 2255|      0|			    "invalid relation `%c'", m->reln);
 2256|      0|			return -1;
 2257|  10.4k|		}
 2258|  10.4k|		return matched;
 2259|       |
 2260|      0|	case FILE_DOUBLE:
  ------------------
  |  |  281|      0|#define				FILE_DOUBLE		36
  ------------------
  |  Branch (2260:2): [True: 0, False: 128M]
  ------------------
 2261|    181|	case FILE_BEDOUBLE:
  ------------------
  |  |  282|    181|#define				FILE_BEDOUBLE		37
  ------------------
  |  Branch (2261:2): [True: 181, False: 128M]
  ------------------
 2262|    731|	case FILE_LEDOUBLE:
  ------------------
  |  |  283|    731|#define				FILE_LEDOUBLE		38
  ------------------
  |  Branch (2262:2): [True: 550, False: 128M]
  ------------------
 2263|    731|		dl = m->value.d;
 2264|    731|		dv = p->d;
 2265|    731|		switch (m->reln) {
 2266|    446|		case 'x':
  ------------------
  |  Branch (2266:3): [True: 446, False: 285]
  ------------------
 2267|    446|			matched = 1;
 2268|    446|			break;
 2269|       |
 2270|      0|		case '!':
  ------------------
  |  Branch (2270:3): [True: 0, False: 731]
  ------------------
 2271|      0|			matched = isunordered(dv, dl) ? 1 : dv != dl;
  ------------------
  |  Branch (2271:14): [True: 0, False: 0]
  ------------------
 2272|      0|			break;
 2273|       |
 2274|    285|		case '=':
  ------------------
  |  Branch (2274:3): [True: 285, False: 446]
  ------------------
 2275|    285|			matched = isunordered(dv, dl) ? 0 : dv == dl;
  ------------------
  |  Branch (2275:14): [True: 118, False: 167]
  ------------------
 2276|    285|			break;
 2277|       |
 2278|      0|		case '>':
  ------------------
  |  Branch (2278:3): [True: 0, False: 731]
  ------------------
 2279|      0|			matched = isgreater(dv, dl);
 2280|      0|			break;
 2281|       |
 2282|      0|		case '<':
  ------------------
  |  Branch (2282:3): [True: 0, False: 731]
  ------------------
 2283|      0|			matched = isless(dv, dl);
 2284|      0|			break;
 2285|       |
 2286|      0|		default:
  ------------------
  |  Branch (2286:3): [True: 0, False: 731]
  ------------------
 2287|      0|			file_magerror(ms, "cannot happen with double: "
 2288|      0|			    "invalid relation `%c'", m->reln);
 2289|      0|			return -1;
 2290|    731|		}
 2291|    731|		return matched;
 2292|       |
 2293|  8.45k|	case FILE_DEFAULT:
  ------------------
  |  |  248|  8.45k|#define				FILE_DEFAULT		3
  ------------------
  |  Branch (2293:2): [True: 8.45k, False: 127M]
  ------------------
 2294|  9.94k|	case FILE_CLEAR:
  ------------------
  |  |  292|  9.94k|#define				FILE_CLEAR		47
  ------------------
  |  Branch (2294:2): [True: 1.49k, False: 128M]
  ------------------
 2295|  9.94k|		l = 0;
 2296|  9.94k|		v = 0;
 2297|  9.94k|		break;
 2298|       |
 2299|  81.0M|	case FILE_STRING:
  ------------------
  |  |  250|  81.0M|#define				FILE_STRING		5
  ------------------
  |  Branch (2299:2): [True: 81.0M, False: 46.9M]
  ------------------
 2300|  81.0M|	case FILE_PSTRING:
  ------------------
  |  |  258|  81.0M|#define				FILE_PSTRING		13
  ------------------
  |  Branch (2300:2): [True: 36.4k, False: 127M]
  ------------------
 2301|  81.0M|	case FILE_OCTAL:
  ------------------
  |  |  306|  81.0M|#define				FILE_OCTAL		61
  ------------------
  |  Branch (2301:2): [True: 0, False: 128M]
  ------------------
 2302|  81.0M|		l = 0;
 2303|  81.0M|		v = file_strncmp(m->value.s, p->s, CAST(size_t, m->vallen),
  ------------------
  |  |  452|  81.0M|#define CAST(T, b)	((T)(b))
  ------------------
 2304|  81.0M|		    sizeof(p->s), m->str_flags);
  ------------------
  |  |  382|  81.0M|#define str_flags _u._s._flags
  ------------------
 2305|  81.0M|		break;
 2306|       |
 2307|    119|	case FILE_BESTRING16:
  ------------------
  |  |  263|    119|#define				FILE_BESTRING16		18
  ------------------
  |  Branch (2307:2): [True: 119, False: 128M]
  ------------------
 2308|  84.1k|	case FILE_LESTRING16:
  ------------------
  |  |  264|  84.1k|#define				FILE_LESTRING16		19
  ------------------
  |  Branch (2308:2): [True: 84.0k, False: 127M]
  ------------------
 2309|  84.1k|		l = 0;
 2310|  84.1k|		v = file_strncmp16(m->value.s, p->s, CAST(size_t, m->vallen),
  ------------------
  |  |  452|  84.1k|#define CAST(T, b)	((T)(b))
  ------------------
 2311|  84.1k|		    sizeof(p->s), m->str_flags);
  ------------------
  |  |  382|  84.1k|#define str_flags _u._s._flags
  ------------------
 2312|  84.1k|		break;
 2313|       |
 2314|   846k|	case FILE_SEARCH: { /* search ms->search.s for the string m->value.s */
  ------------------
  |  |  265|   846k|#define				FILE_SEARCH		20
  ------------------
  |  Branch (2314:2): [True: 846k, False: 127M]
  ------------------
 2315|   846k|		size_t slen;
 2316|   846k|		size_t idx;
 2317|       |
 2318|   846k|		if (ms->search.s == NULL)
  ------------------
  |  Branch (2318:7): [True: 0, False: 846k]
  ------------------
 2319|      0|			return 0;
 2320|       |
 2321|   846k|		slen = MIN(m->vallen, sizeof(m->value.s));
  ------------------
  |  Branch (2321:10): [True: 846k, False: 0]
  ------------------
 2322|   846k|		l = 0;
 2323|   846k|		v = 0;
 2324|   846k|		if ((ms->flags & MAGIC_DEBUG) != 0) {
  ------------------
  |  |   33|   846k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2324:7): [True: 0, False: 846k]
  ------------------
 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|   846k|#ifdef HAVE_MEMMEM
 2335|   846k|		if (slen > 0 && m->str_flags == 0) {
  ------------------
  |  |  382|   846k|#define str_flags _u._s._flags
  ------------------
  |  Branch (2335:7): [True: 846k, False: 0]
  |  Branch (2335:19): [True: 373k, False: 472k]
  ------------------
 2336|   373k|			const char *found;
 2337|   373k|			idx = m->str_range + slen;
  ------------------
  |  |  381|   373k|#define str_range _u._s._count
  ------------------
 2338|   373k|			if (m->str_range == 0 || ms->search.s_len < idx)
  ------------------
  |  |  381|   373k|#define str_range _u._s._count
  ------------------
  |  Branch (2338:8): [True: 4.17k, False: 369k]
  |  Branch (2338:29): [True: 98.2k, False: 271k]
  ------------------
 2339|   102k|				idx = ms->search.s_len;
 2340|   373k|			found = CAST(const char *, memmem(ms->search.s, idx,
  ------------------
  |  |  452|   373k|#define CAST(T, b)	((T)(b))
  ------------------
 2341|   373k|			    m->value.s, slen));
 2342|   373k|			if ((ms->flags & MAGIC_DEBUG) != 0) {
  ------------------
  |  |   33|   373k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2342:8): [True: 0, False: 373k]
  ------------------
 2343|      0|				fprintf(stderr, "] %sfound\n",
 2344|      0|				    found ? "" : "not ");
  ------------------
  |  Branch (2344:9): [True: 0, False: 0]
  ------------------
 2345|      0|			}
 2346|   373k|			if (!found) {
  ------------------
  |  Branch (2346:8): [True: 371k, False: 2.51k]
  ------------------
 2347|   371k|				v = 1;
 2348|   371k|				break;
 2349|   371k|			}
 2350|  2.51k|			idx = found - ms->search.s;
 2351|  2.51k|			ms->search.offset += idx;
 2352|  2.51k|			ms->search.rm_len = ms->search.s_len - idx;
 2353|  2.51k|			break;
 2354|   373k|		}
 2355|   472k|#endif
 2356|       |
 2357|  2.71G|		for (idx = 0; m->str_range == 0 || idx < m->str_range; idx++) {
  ------------------
  |  |  381|  2.71G|#define str_range _u._s._count
  ------------------
              		for (idx = 0; m->str_range == 0 || idx < m->str_range; idx++) {
  ------------------
  |  |  381|  2.71G|#define str_range _u._s._count
  ------------------
  |  Branch (2357:17): [True: 0, False: 2.71G]
  |  Branch (2357:38): [True: 2.70G, False: 318k]
  ------------------
 2358|  2.70G|			if (slen + idx > ms->search.s_len) {
  ------------------
  |  Branch (2358:8): [True: 134k, False: 2.70G]
  ------------------
 2359|   134k|				v = 1;
 2360|   134k|				break;
 2361|   134k|			}
 2362|       |
 2363|  2.70G|			v = file_strncmp(m->value.s, ms->search.s + idx, slen,
 2364|  2.70G|			    ms->search.s_len - idx, m->str_flags);
  ------------------
  |  |  382|  2.70G|#define str_flags _u._s._flags
  ------------------
 2365|  2.70G|			if (v == 0) {	/* found match */
  ------------------
  |  Branch (2365:8): [True: 19.2k, False: 2.70G]
  ------------------
 2366|  19.2k|				ms->search.offset += idx;
 2367|  19.2k|				ms->search.rm_len = ms->search.s_len - idx;
 2368|  19.2k|				break;
 2369|  19.2k|			}
 2370|  2.70G|		}
 2371|   472k|		if ((ms->flags & MAGIC_DEBUG) != 0) {
  ------------------
  |  |   33|   472k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2371:7): [True: 0, False: 472k]
  ------------------
 2372|      0|			fprintf(stderr, "] %sfound\n", v == 0 ? "" : "not ");
  ------------------
  |  Branch (2372:35): [True: 0, False: 0]
  ------------------
 2373|      0|		}
 2374|   472k|		break;
 2375|   846k|	}
 2376|   322k|	case FILE_REGEX: {
  ------------------
  |  |  262|   322k|#define				FILE_REGEX		17
  ------------------
  |  Branch (2376:2): [True: 322k, False: 127M]
  ------------------
 2377|   322k|		int rc;
 2378|   322k|		file_regex_t *rx = *m_cache;
 2379|   322k|		const char *search;
 2380|   322k|		regmatch_t pmatch;
 2381|   322k|		size_t slen = ms->search.s_len;
 2382|   322k|		char *copy;
 2383|       |
 2384|   322k|		if (ms->search.s == NULL)
  ------------------
  |  Branch (2384:7): [True: 0, False: 322k]
  ------------------
 2385|      0|			return 0;
 2386|       |
 2387|   322k|		if (rx == NULL) {
  ------------------
  |  Branch (2387:7): [True: 154, False: 322k]
  ------------------
 2388|    154|			rx = *m_cache = alloc_regex(ms, m);
 2389|    154|			if (rx == NULL)
  ------------------
  |  Branch (2389:8): [True: 0, False: 154]
  ------------------
 2390|      0|				return -1;
 2391|    154|		}
 2392|   322k|		l = 0;
 2393|   322k|		if (slen != 0) {
  ------------------
  |  Branch (2393:7): [True: 321k, False: 1.68k]
  ------------------
 2394|   321k|		    copy = CAST(char *, malloc(slen));
  ------------------
  |  |  452|   321k|#define CAST(T, b)	((T)(b))
  ------------------
 2395|   321k|		    if (copy == NULL)  {
  ------------------
  |  Branch (2395:11): [True: 0, False: 321k]
  ------------------
 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|   321k|		    memcpy(copy, ms->search.s, slen);
 2402|   321k|		    copy[--slen] = '\0';
 2403|   321k|		    search = copy;
 2404|   321k|		} else {
 2405|  1.68k|		    search = CCAST(char *, "");
  ------------------
  |  |  454|  1.68k|#define CCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 2406|  1.68k|		    copy = NULL;
 2407|  1.68k|		}
 2408|   322k|		rc = file_regexec(ms, rx, RCAST(const char *, search),
  ------------------
  |  |  453|   322k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 2409|   322k|		    1, &pmatch, 0);
 2410|   322k|		free(copy);
 2411|   322k|		switch (rc) {
 2412|  3.75k|		case 0:
  ------------------
  |  Branch (2412:3): [True: 3.75k, False: 319k]
  ------------------
 2413|  3.75k|			ms->search.s += CAST(int, pmatch.rm_so);
  ------------------
  |  |  452|  3.75k|#define CAST(T, b)	((T)(b))
  ------------------
 2414|  3.75k|			ms->search.offset += CAST(size_t, pmatch.rm_so);
  ------------------
  |  |  452|  3.75k|#define CAST(T, b)	((T)(b))
  ------------------
 2415|  3.75k|			ms->search.rm_len = CAST(size_t,
  ------------------
  |  |  452|  3.75k|#define CAST(T, b)	((T)(b))
  ------------------
 2416|  3.75k|			    pmatch.rm_eo - pmatch.rm_so);
 2417|  3.75k|			v = 0;
 2418|  3.75k|			break;
 2419|       |
 2420|   319k|		case REG_NOMATCH:
  ------------------
  |  Branch (2420:3): [True: 319k, False: 3.75k]
  ------------------
 2421|   319k|			v = 1;
 2422|   319k|			break;
 2423|       |
 2424|      0|		default:
  ------------------
  |  Branch (2424:3): [True: 0, False: 322k]
  ------------------
 2425|      0|			return -1;
 2426|   322k|		}
 2427|   322k|		break;
 2428|   322k|	}
 2429|   322k|	case FILE_USE:
  ------------------
  |  |  291|  39.2k|#define				FILE_USE		46
  ------------------
  |  Branch (2429:2): [True: 39.2k, False: 127M]
  ------------------
 2430|  39.2k|		return ms->ms_value.q != 0;
 2431|  52.4k|	case FILE_NAME:
  ------------------
  |  |  290|  52.4k|#define				FILE_NAME		45
  ------------------
  |  Branch (2431:2): [True: 52.4k, False: 127M]
  ------------------
 2432|  68.3k|	case FILE_INDIRECT:
  ------------------
  |  |  286|  68.3k|#define				FILE_INDIRECT		41
  ------------------
  |  Branch (2432:2): [True: 15.8k, False: 127M]
  ------------------
 2433|  68.3k|		return 1;
 2434|   523k|	case FILE_DER:
  ------------------
  |  |  293|   523k|#define				FILE_DER		48
  ------------------
  |  Branch (2434:2): [True: 523k, False: 127M]
  ------------------
 2435|   523k|		matched = der_cmp(ms, m);
 2436|   523k|		if (matched == -1) {
  ------------------
  |  Branch (2436:7): [True: 186k, False: 337k]
  ------------------
 2437|   186k|			if ((ms->flags & MAGIC_DEBUG) != 0) {
  ------------------
  |  |   33|   186k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2437:8): [True: 0, False: 186k]
  ------------------
 2438|      0|				(void) fprintf(stderr,
 2439|      0|				    "EOF comparing DER entries\n");
 2440|      0|			}
 2441|   186k|			return 0;
 2442|   186k|		}
 2443|   337k|		return matched;
 2444|     62|	case FILE_BEGUID:
  ------------------
  |  |  296|     62|#define				FILE_BEGUID		51
  ------------------
  |  Branch (2444:2): [True: 62, False: 128M]
  ------------------
 2445|     62|	case FILE_LEGUID:
  ------------------
  |  |  295|     62|#define				FILE_LEGUID		50
  ------------------
  |  Branch (2445:2): [True: 0, False: 128M]
  ------------------
 2446|   305k|	case FILE_GUID:
  ------------------
  |  |  294|   305k|#define				FILE_GUID		49
  ------------------
  |  Branch (2446:2): [True: 305k, False: 127M]
  ------------------
 2447|   305k|		l = 0;
 2448|   305k|		v = memcmp(m->value.guid, p->guid, sizeof(p->guid));
 2449|   305k|		break;
 2450|      0|	default:
  ------------------
  |  Branch (2450:2): [True: 0, False: 128M]
  ------------------
 2451|      0|		file_magerror(ms, "invalid type %d in magiccheck()", m->type);
 2452|      0|		return -1;
 2453|   128M|	}
 2454|       |
 2455|   127M|	v = file_signextend(ms, m, v);
 2456|       |
 2457|   127M|	switch (m->reln) {
 2458|  87.0k|	case 'x':
  ------------------
  |  Branch (2458:2): [True: 87.0k, False: 127M]
  ------------------
 2459|  87.0k|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  87.0k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2459:7): [True: 0, False: 87.0k]
  ------------------
 2460|      0|			(void) fprintf(stderr, "%" INT64_T_FORMAT
 2461|      0|			    "u == *any* = 1", CAST(unsigned long long, v));
  ------------------
  |  |  452|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2462|  87.0k|		matched = 1;
 2463|  87.0k|		break;
 2464|       |
 2465|  66.0k|	case '!':
  ------------------
  |  Branch (2465:2): [True: 66.0k, False: 127M]
  ------------------
 2466|  66.0k|		matched = v != l;
 2467|  66.0k|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  66.0k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2467:7): [True: 0, False: 66.0k]
  ------------------
 2468|      0|			(void) fprintf(stderr, "%" INT64_T_FORMAT "u != %"
 2469|      0|			    INT64_T_FORMAT "u = %d",
 2470|      0|			    CAST(unsigned long long, v),
  ------------------
  |  |  452|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2471|      0|			    CAST(unsigned long long, l), matched);
  ------------------
  |  |  452|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2472|  66.0k|		break;
 2473|       |
 2474|   126M|	case '=':
  ------------------
  |  Branch (2474:2): [True: 126M, False: 940k]
  ------------------
 2475|   126M|		matched = v == l;
 2476|   126M|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|   126M|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2476:7): [True: 0, False: 126M]
  ------------------
 2477|      0|			(void) fprintf(stderr, "%" INT64_T_FORMAT "u == %"
 2478|      0|			    INT64_T_FORMAT "u = %d",
 2479|      0|			    CAST(unsigned long long, v),
  ------------------
  |  |  452|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2480|      0|			    CAST(unsigned long long, l), matched);
  ------------------
  |  |  452|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2481|   126M|		break;
 2482|       |
 2483|   286k|	case '>':
  ------------------
  |  Branch (2483:2): [True: 286k, False: 127M]
  ------------------
 2484|   286k|		if (m->flag & UNSIGNED) {
  ------------------
  |  |  229|   286k|#define UNSIGNED	0x08	/* comparison is unsigned */
  ------------------
  |  Branch (2484:7): [True: 207k, False: 79.1k]
  ------------------
 2485|   207k|			matched = v > l;
 2486|   207k|			if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|   207k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2486:8): [True: 0, False: 207k]
  ------------------
 2487|      0|				(void) fprintf(stderr, "%" INT64_T_FORMAT
 2488|      0|				    "u > %" INT64_T_FORMAT "u = %d",
 2489|      0|				    CAST(unsigned long long, v),
  ------------------
  |  |  452|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2490|      0|				    CAST(unsigned long long, l), matched);
  ------------------
  |  |  452|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2491|   207k|		}
 2492|  79.1k|		else {
 2493|  79.1k|			matched = CAST(int64_t, v) > CAST(int64_t, l);
  ------------------
  |  |  452|  79.1k|#define CAST(T, b)	((T)(b))
  ------------------
              			matched = CAST(int64_t, v) > CAST(int64_t, l);
  ------------------
  |  |  452|  79.1k|#define CAST(T, b)	((T)(b))
  ------------------
 2494|  79.1k|			if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  79.1k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2494:8): [True: 0, False: 79.1k]
  ------------------
 2495|      0|				(void) fprintf(stderr, "%" INT64_T_FORMAT
 2496|      0|				    "d > %" INT64_T_FORMAT "d = %d",
 2497|      0|				    CAST(long long, v),
  ------------------
  |  |  452|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2498|      0|				    CAST(long long, l), matched);
  ------------------
  |  |  452|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2499|  79.1k|		}
 2500|   286k|		break;
 2501|       |
 2502|   456k|	case '<':
  ------------------
  |  Branch (2502:2): [True: 456k, False: 126M]
  ------------------
 2503|   456k|		if (m->flag & UNSIGNED) {
  ------------------
  |  |  229|   456k|#define UNSIGNED	0x08	/* comparison is unsigned */
  ------------------
  |  Branch (2503:7): [True: 383k, False: 73.0k]
  ------------------
 2504|   383k|			matched = v < l;
 2505|   383k|			if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|   383k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2505:8): [True: 0, False: 383k]
  ------------------
 2506|      0|				(void) fprintf(stderr, "%" INT64_T_FORMAT
 2507|      0|				    "u < %" INT64_T_FORMAT "u = %d",
 2508|      0|				    CAST(unsigned long long, v),
  ------------------
  |  |  452|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2509|      0|				    CAST(unsigned long long, l), matched);
  ------------------
  |  |  452|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2510|   383k|		}
 2511|  73.0k|		else {
 2512|  73.0k|			matched = CAST(int64_t, v) < CAST(int64_t, l);
  ------------------
  |  |  452|  73.0k|#define CAST(T, b)	((T)(b))
  ------------------
              			matched = CAST(int64_t, v) < CAST(int64_t, l);
  ------------------
  |  |  452|  73.0k|#define CAST(T, b)	((T)(b))
  ------------------
 2513|  73.0k|			if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  73.0k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2513:8): [True: 0, False: 73.0k]
  ------------------
 2514|      0|				(void) fprintf(stderr, "%" INT64_T_FORMAT
 2515|      0|				    "d < %" INT64_T_FORMAT "d = %d",
 2516|      0|				     CAST(long long, v),
  ------------------
  |  |  452|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2517|      0|				     CAST(long long, l), matched);
  ------------------
  |  |  452|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2518|  73.0k|		}
 2519|   456k|		break;
 2520|       |
 2521|  43.7k|	case '&':
  ------------------
  |  Branch (2521:2): [True: 43.7k, False: 127M]
  ------------------
 2522|  43.7k|		matched = (v & l) == l;
 2523|  43.7k|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  43.7k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2523:7): [True: 0, False: 43.7k]
  ------------------
 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),
  ------------------
  |  |  452|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2527|      0|			    CAST(unsigned long long, l),
  ------------------
  |  |  452|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2528|      0|			    CAST(unsigned long long, l),
  ------------------
  |  |  452|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2529|      0|			    matched);
 2530|  43.7k|		break;
 2531|       |
 2532|    939|	case '^':
  ------------------
  |  Branch (2532:2): [True: 939, False: 127M]
  ------------------
 2533|    939|		matched = (v & l) != l;
 2534|    939|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|    939|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2534:7): [True: 0, False: 939]
  ------------------
 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),
  ------------------
  |  |  452|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2538|      0|			    CAST(unsigned long long, l),
  ------------------
  |  |  452|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2539|      0|			    CAST(unsigned long long, l), matched);
  ------------------
  |  |  452|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2540|    939|		break;
 2541|       |
 2542|      0|	default:
  ------------------
  |  Branch (2542:2): [True: 0, False: 127M]
  ------------------
 2543|      0|		file_magerror(ms, "cannot happen: invalid relation `%c'",
 2544|      0|		    m->reln);
 2545|      0|		return -1;
 2546|   127M|	}
 2547|   127M|	if ((ms->flags & MAGIC_DEBUG) != 0) {
  ------------------
  |  |   33|   127M|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2547:6): [True: 0, False: 127M]
  ------------------
 2548|      0|		(void) fprintf(stderr, " strength=%zu\n",
 2549|      0|		    file_magic_strength(m, 1));
 2550|      0|	}
 2551|       |
 2552|   127M|	return matched;
 2553|   127M|}
softmagic.c:file_strncmp:
 2061|  2.79G|{
 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|  2.79G|	const unsigned char *a = RCAST(const unsigned char *, s1);
  ------------------
  |  |  453|  2.79G|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 2069|  2.79G|	const unsigned char *b = RCAST(const unsigned char *, s2);
  ------------------
  |  |  453|  2.79G|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 2070|  2.79G|	uint32_t ws = flags & (STRING_COMPACT_WHITESPACE |
  ------------------
  |  |  396|  2.79G|#define STRING_COMPACT_WHITESPACE		BIT(0)
  |  |  ------------------
  |  |  |  |  395|  2.79G|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
 2071|  2.79G|	    STRING_COMPACT_OPTIONAL_WHITESPACE);
  ------------------
  |  |  397|  2.79G|#define STRING_COMPACT_OPTIONAL_WHITESPACE	BIT(1)
  |  |  ------------------
  |  |  |  |  395|  2.79G|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
 2072|  2.79G|	const unsigned char *eb = b + (ws ? maxlen : len);
  ------------------
  |  Branch (2072:33): [True: 103M, False: 2.68G]
  ------------------
 2073|  2.79G|	uint64_t v;
 2074|       |
 2075|       |	/*
 2076|       |	 * What we want here is v = strncmp(s1, s2, len),
 2077|       |	 * but ignoring any nulls.
 2078|       |	 */
 2079|  2.79G|	v = 0;
 2080|  2.79G|	len++;
 2081|  2.79G|	if (0L == flags) { /* normal string: do it fast */
  ------------------
  |  Branch (2081:6): [True: 76.8M, False: 2.71G]
  ------------------
 2082|  79.0M|		while (--len > 0)
  ------------------
  |  Branch (2082:10): [True: 79.0M, False: 26.6k]
  ------------------
 2083|  79.0M|			if ((v = *b++ - *a++) != '\0')
  ------------------
  |  Branch (2083:8): [True: 76.8M, False: 2.19M]
  ------------------
 2084|  76.8M|				break;
 2085|  76.8M|	}
 2086|  2.71G|	else { /* combine the others */
 2087|  2.71G|		while (--len > 0) {
  ------------------
  |  Branch (2087:10): [True: 2.71G, False: 60.2k]
  ------------------
 2088|  2.71G|			if (b >= eb) {
  ------------------
  |  Branch (2088:8): [True: 164k, False: 2.71G]
  ------------------
 2089|   164k|				v = 1;
 2090|   164k|				break;
 2091|   164k|			}
 2092|  2.71G|			if ((flags & STRING_IGNORE_LOWERCASE) &&
  ------------------
  |  |  398|  2.71G|#define STRING_IGNORE_LOWERCASE			BIT(2)
  |  |  ------------------
  |  |  |  |  395|  2.71G|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (2092:8): [True: 105M, False: 2.61G]
  ------------------
 2093|  2.71G|			    islower(*a)) {
  ------------------
  |  Branch (2093:8): [True: 5.51M, False: 99.8M]
  ------------------
 2094|  5.51M|				if ((v = tolower(*b++) - *a++) != '\0')
  ------------------
  |  Branch (2094:9): [True: 5.50M, False: 19.2k]
  |  Branch (2094:14): [True: 0, False: 0]
  |  Branch (2094:14): [Folded, False: 0]
  |  Branch (2094:14): [Folded, False: 5.51M]
  ------------------
 2095|  5.50M|					break;
 2096|  5.51M|			}
 2097|  2.71G|			else if ((flags & STRING_IGNORE_UPPERCASE) &&
  ------------------
  |  |  399|  2.71G|#define STRING_IGNORE_UPPERCASE			BIT(3)
  |  |  ------------------
  |  |  |  |  395|  2.71G|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (2097:13): [True: 15.3k, False: 2.71G]
  ------------------
 2098|  2.71G|			    isupper(*a)) {
  ------------------
  |  Branch (2098:8): [True: 14.7k, False: 513]
  ------------------
 2099|  14.7k|				if ((v = toupper(*b++) - *a++) != '\0')
  ------------------
  |  Branch (2099:9): [True: 14.6k, False: 115]
  |  Branch (2099:14): [True: 0, False: 0]
  |  Branch (2099:14): [Folded, False: 0]
  |  Branch (2099:14): [Folded, False: 14.7k]
  ------------------
 2100|  14.6k|					break;
 2101|  14.7k|			}
 2102|  2.71G|			else if ((flags & STRING_COMPACT_WHITESPACE) &&
  ------------------
  |  |  396|  2.71G|#define STRING_COMPACT_WHITESPACE		BIT(0)
  |  |  ------------------
  |  |  |  |  395|  2.71G|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (2102:13): [True: 88.1M, False: 2.62G]
  ------------------
 2103|  2.71G|			    isspace(*a)) {
  ------------------
  |  Branch (2103:8): [True: 1.71M, False: 86.4M]
  ------------------
 2104|  1.71M|				a++;
 2105|  1.71M|				if (isspace(*b)) {
  ------------------
  |  Branch (2105:9): [True: 211k, False: 1.50M]
  ------------------
 2106|   211k|					b++;
 2107|   211k|					if (!isspace(*a))
  ------------------
  |  Branch (2107:10): [True: 211k, False: 0]
  ------------------
 2108|  6.23G|						while (b < eb && isspace(*b))
  ------------------
  |  Branch (2108:14): [True: 6.23G, False: 164k]
  |  Branch (2108:24): [True: 6.23G, False: 46.6k]
  ------------------
 2109|  6.23G|							b++;
 2110|   211k|				}
 2111|  1.50M|				else {
 2112|  1.50M|					v = 1;
 2113|  1.50M|					break;
 2114|  1.50M|				}
 2115|  1.71M|			}
 2116|  2.71G|			else if ((flags & STRING_COMPACT_OPTIONAL_WHITESPACE) &&
  ------------------
  |  |  397|  2.71G|#define STRING_COMPACT_OPTIONAL_WHITESPACE	BIT(1)
  |  |  ------------------
  |  |  |  |  395|  2.71G|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (2116:13): [True: 15.6M, False: 2.69G]
  ------------------
 2117|  2.71G|			    isspace(*a)) {
  ------------------
  |  Branch (2117:8): [True: 2.58k, False: 15.5M]
  ------------------
 2118|  2.58k|				a++;
 2119|   392k|				while (b < eb && isspace(*b))
  ------------------
  |  Branch (2119:12): [True: 392k, False: 46]
  |  Branch (2119:22): [True: 390k, False: 2.54k]
  ------------------
 2120|   390k|					b++;
 2121|  2.58k|			}
 2122|  2.71G|			else {
 2123|  2.71G|				if ((v = *b++ - *a++) != '\0')
  ------------------
  |  Branch (2123:9): [True: 2.70G, False: 4.35M]
  ------------------
 2124|  2.70G|					break;
 2125|  2.71G|			}
 2126|  2.71G|		}
 2127|  2.71G|		if (len == 0 && v == 0 && (flags & STRING_FULL_WORD)) {
  ------------------
  |  |  414|  60.2k|#define	STRING_FULL_WORD			BIT(14)
  |  |  ------------------
  |  |  |  |  395|  60.2k|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (2127:7): [True: 60.2k, False: 2.71G]
  |  Branch (2127:19): [True: 60.2k, False: 0]
  |  Branch (2127:29): [True: 139, False: 60.0k]
  ------------------
 2128|    139|			if (*b && !isspace(*b))
  ------------------
  |  Branch (2128:8): [True: 102, False: 37]
  |  Branch (2128:14): [True: 68, False: 34]
  ------------------
 2129|     68|				v = 1;
 2130|    139|		}
 2131|  2.71G|	}
 2132|  2.79G|	return v;
 2133|  2.79G|}
softmagic.c:file_strncmp16:
 2138|  84.1k|{
 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|  84.1k|	flags = 0;
 2145|  84.1k|	return file_strncmp(a, b, len, maxlen, flags);
 2146|  84.1k|}
softmagic.c:alloc_regex:
 2150|    154|{
 2151|    154|	int rc;
 2152|    154|	file_regex_t *rx = CAST(file_regex_t *, malloc(sizeof(*rx)));
  ------------------
  |  |  452|    154|#define CAST(T, b)	((T)(b))
  ------------------
 2153|       |
 2154|    154|	if (rx == NULL) {
  ------------------
  |  Branch (2154:6): [True: 0, False: 154]
  ------------------
 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|    154|	rc = file_regcomp(ms, rx, m->value.s, REG_EXTENDED | REG_NEWLINE |
 2161|    154|	    REGEX_ICASE(m));
  ------------------
  |  |  432|    154|#define	REGEX_ICASE(m) (((m)->str_flags & STRING_IGNORE_CASE) ? REG_ICASE : 0)
  |  |  ------------------
  |  |  |  |  382|    154|#define str_flags _u._s._flags
  |  |  ------------------
  |  |               #define	REGEX_ICASE(m) (((m)->str_flags & STRING_IGNORE_CASE) ? REG_ICASE : 0)
  |  |  ------------------
  |  |  |  |  431|    154|#define STRING_IGNORE_CASE		(STRING_IGNORE_LOWERCASE|STRING_IGNORE_UPPERCASE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  398|    154|#define STRING_IGNORE_LOWERCASE			BIT(2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  395|    154|#define BIT(A)   (1 << (A))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define STRING_IGNORE_CASE		(STRING_IGNORE_LOWERCASE|STRING_IGNORE_UPPERCASE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  399|    154|#define STRING_IGNORE_UPPERCASE			BIT(3)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  395|    154|#define BIT(A)   (1 << (A))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (432:25): [True: 19, False: 135]
  |  |  ------------------
  ------------------
 2162|    154|	if (rc == 0)
  ------------------
  |  Branch (2162:6): [True: 154, False: 0]
  ------------------
 2163|    154|		return rx;
 2164|       |
 2165|      0|	free(rx);
 2166|       |	return NULL;
 2167|    154|}
softmagic.c:handle_annotation:
 2557|   927k|{
 2558|   927k|	if ((ms->flags & MAGIC_APPLE) && m->apple[0]) {
  ------------------
  |  |   45|   927k|#define	MAGIC_APPLE		0x0000800 /* Return the Apple creator/type */
  ------------------
  |  Branch (2558:6): [True: 0, False: 927k]
  |  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|   927k|	if ((ms->flags & MAGIC_EXTENSION) && m->ext[0]) {
  ------------------
  |  |   46|   927k|#define	MAGIC_EXTENSION		0x1000000 /* Return a /-separated list of
  ------------------
  |  Branch (2567:6): [True: 0, False: 927k]
  |  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|   927k|	if ((ms->flags & MAGIC_MIME_TYPE) && m->mimetype[0]) {
  ------------------
  |  |   37|   927k|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  ------------------
  |  Branch (2576:6): [True: 0, False: 927k]
  |  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|   927k|	return 0;
 2592|   927k|}
softmagic.c:varexpand:
  549|   100k|{
  550|   100k|	const char *ptr, *sptr, *e, *t, *ee, *et;
  551|   100k|	size_t l;
  552|       |
  553|   100k|	for (sptr = str; (ptr = strstr(sptr, "${")) != NULL;) {
  ------------------
  |  Branch (553:19): [True: 55, False: 100k]
  ------------------
  554|     55|		l = CAST(size_t, ptr - sptr);
  ------------------
  |  |  452|     55|#define CAST(T, b)	((T)(b))
  ------------------
  555|     55|		if (l >= len)
  ------------------
  |  Branch (555:7): [True: 0, False: 55]
  ------------------
  556|      0|			return -1;
  557|     55|		memcpy(buf, sptr, l);
  558|     55|		buf += l;
  559|     55|		len -= l;
  560|     55|		ptr += 2;
  561|     55|		if (!*ptr || ptr[1] != '?')
  ------------------
  |  Branch (561:7): [True: 0, False: 55]
  |  Branch (561:16): [True: 0, False: 55]
  ------------------
  562|      0|			return -1;
  563|    825|		for (et = t = ptr + 2; *et && *et != ':'; et++)
  ------------------
  |  Branch (563:26): [True: 825, False: 0]
  |  Branch (563:33): [True: 770, False: 55]
  ------------------
  564|    770|			continue;
  565|     55|		if (*et != ':')
  ------------------
  |  Branch (565:7): [True: 0, False: 55]
  ------------------
  566|      0|			return -1;
  567|    770|		for (ee = e = et + 1; *ee && *ee != '}'; ee++)
  ------------------
  |  Branch (567:25): [True: 770, False: 0]
  |  Branch (567:32): [True: 715, False: 55]
  ------------------
  568|    715|			continue;
  569|     55|		if (*ee != '}')
  ------------------
  |  Branch (569:7): [True: 0, False: 55]
  ------------------
  570|      0|			return -1;
  571|     55|		switch (*ptr) {
  572|     55|		case 'x':
  ------------------
  |  Branch (572:3): [True: 55, False: 0]
  ------------------
  573|     55|			if (ms->mode & 0111) {
  ------------------
  |  Branch (573:8): [True: 0, False: 55]
  ------------------
  574|      0|				ptr = t;
  575|      0|				l = et - t;
  576|     55|			} else {
  577|     55|				ptr = e;
  578|     55|				l = ee - e;
  579|     55|			}
  580|     55|			break;
  581|      0|		default:
  ------------------
  |  Branch (581:3): [True: 0, False: 55]
  ------------------
  582|      0|			return -1;
  583|     55|		}
  584|     55|		if (l >= len)
  ------------------
  |  Branch (584:7): [True: 0, False: 55]
  ------------------
  585|      0|			return -1;
  586|     55|		memcpy(buf, ptr, l);
  587|     55|		buf += l;
  588|     55|		len -= l;
  589|     55|		sptr = ee + 1;
  590|     55|	}
  591|       |
  592|   100k|	l = strlen(sptr);
  593|   100k|	if (l >= len)
  ------------------
  |  Branch (593:6): [True: 0, False: 100k]
  ------------------
  594|      0|		return -1;
  595|       |
  596|   100k|	memcpy(buf, sptr, l);
  597|   100k|	buf[l] = '\0';
  598|   100k|	return 0;
  599|   100k|}
softmagic.c:print_sep:
 2596|  28.8k|{
 2597|  28.8k|	if (firstline)
  ------------------
  |  Branch (2597:6): [True: 8.76k, False: 20.0k]
  ------------------
 2598|  8.76k|		return 0;
 2599|       |	/*
 2600|       |	 * we found another match
 2601|       |	 * put a newline and '-' to do some simple formatting
 2602|       |	 */
 2603|  20.0k|	return file_separator(ms);
 2604|  28.8k|}
softmagic.c:mprint:
  604|   100k|{
  605|   100k|	uint64_t v;
  606|   100k|	float vf;
  607|   100k|	double vd;
  608|   100k| 	char buf[128], tbuf[26], sbuf[512], ebuf[512];
  609|   100k|	const char *desc;
  610|   100k|	union VALUETYPE *p = &ms->ms_value;
  611|       |
  612|   100k|	if (varexpand(ms, ebuf, sizeof(ebuf), m->desc) == -1)
  ------------------
  |  Branch (612:6): [True: 0, False: 100k]
  ------------------
  613|      0|		desc = m->desc;
  614|   100k|	else
  615|   100k|		desc = ebuf;
  616|       |
  617|   100k|#define	PRINTER(value, format, stype, utype)	\
  618|   100k|	v = file_signextend(ms, m, CAST(uint64_t, value)); \
  619|   100k|	switch (check_fmt(ms, desc)) { \
  620|   100k|	case -1: \
  621|   100k|		return -1; \
  622|   100k|	case 1: \
  623|   100k|		if (m->flag & UNSIGNED) { \
  624|   100k|			(void)snprintf(buf, sizeof(buf), "%" format "u", \
  625|   100k|			    CAST(utype, v)); \
  626|   100k|		} else { \
  627|   100k|			(void)snprintf(buf, sizeof(buf), "%" format "d", \
  628|   100k|			    CAST(stype, v)); \
  629|   100k|		} \
  630|   100k|		if (file_printf(ms, F(ms, desc, "%s"), buf) == -1) \
  631|   100k|			return -1; \
  632|   100k|		break; \
  633|   100k|	default: \
  634|   100k|		if (m->flag & UNSIGNED) { \
  635|   100k|		       if (file_printf(ms, F(ms, desc, "%" format "u"), \
  636|   100k|			   CAST(utype, v)) == -1) \
  637|   100k|			   return -1; \
  638|   100k|		} else { \
  639|   100k|		       if (file_printf(ms, F(ms, desc, "%" format "d"), \
  640|   100k|			   CAST(stype, v)) == -1) \
  641|   100k|			   return -1; \
  642|   100k|		} \
  643|   100k|		break; \
  644|   100k|	} \
  645|   100k|	break
  646|       |
  647|   100k|  	switch (m->type) {
  648|  12.3k|  	case FILE_BYTE:
  ------------------
  |  |  246|  12.3k|#define 			FILE_BYTE		1
  ------------------
  |  Branch (648:4): [True: 12.3k, False: 87.6k]
  ------------------
  649|  12.3k|		PRINTER(p->b, "", int8_t, uint8_t);
  ------------------
  |  |  618|  12.3k|	v = file_signextend(ms, m, CAST(uint64_t, value)); \
  |  |  ------------------
  |  |  |  |  452|  12.3k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  619|  12.3k|	switch (check_fmt(ms, desc)) { \
  |  |  620|      0|	case -1: \
  |  |  ------------------
  |  |  |  Branch (620:2): [True: 0, False: 12.3k]
  |  |  ------------------
  |  |  621|      0|		return -1; \
  |  |  622|      0|	case 1: \
  |  |  ------------------
  |  |  |  Branch (622:2): [True: 0, False: 12.3k]
  |  |  ------------------
  |  |  623|      0|		if (m->flag & UNSIGNED) { \
  |  |  ------------------
  |  |  |  |  229|      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)); \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  626|      0|		} else { \
  |  |  627|      0|			(void)snprintf(buf, sizeof(buf), "%" format "d", \
  |  |  628|      0|			    CAST(stype, v)); \
  |  |  ------------------
  |  |  |  |  452|      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|  12.3k|	default: \
  |  |  ------------------
  |  |  |  Branch (633:2): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |  634|  12.3k|		if (m->flag & UNSIGNED) { \
  |  |  ------------------
  |  |  |  |  229|  12.3k|#define UNSIGNED	0x08	/* comparison is unsigned */
  |  |  ------------------
  |  |  |  Branch (634:7): [True: 5.98k, False: 6.39k]
  |  |  ------------------
  |  |  635|  5.98k|		       if (file_printf(ms, F(ms, desc, "%" format "u"), \
  |  |  ------------------
  |  |  |  |  167|  5.98k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  Branch (635:14): [True: 0, False: 5.98k]
  |  |  ------------------
  |  |  636|  5.98k|			   CAST(utype, v)) == -1) \
  |  |  ------------------
  |  |  |  |  452|  5.98k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  637|  5.98k|			   return -1; \
  |  |  638|  6.39k|		} else { \
  |  |  639|  6.39k|		       if (file_printf(ms, F(ms, desc, "%" format "d"), \
  |  |  ------------------
  |  |  |  |  167|  6.39k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  Branch (639:14): [True: 0, False: 6.39k]
  |  |  ------------------
  |  |  640|  6.39k|			   CAST(stype, v)) == -1) \
  |  |  ------------------
  |  |  |  |  452|  6.39k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  641|  6.39k|			   return -1; \
  |  |  642|  6.39k|		} \
  |  |  643|  12.3k|		break; \
  |  |  644|  12.3k|	} \
  |  |  645|  12.3k|	break
  ------------------
  650|       |
  651|  12.3k|  	case FILE_SHORT:
  ------------------
  |  |  247|  1.97k|#define				FILE_SHORT		2
  ------------------
  |  Branch (651:4): [True: 1.97k, False: 98.0k]
  ------------------
  652|  10.1k|  	case FILE_BESHORT:
  ------------------
  |  |  252|  10.1k|#define				FILE_BESHORT		7
  ------------------
  |  Branch (652:4): [True: 8.21k, False: 91.8k]
  ------------------
  653|  20.4k|  	case FILE_LESHORT:
  ------------------
  |  |  255|  20.4k|#define				FILE_LESHORT		10
  ------------------
  |  Branch (653:4): [True: 10.2k, False: 89.7k]
  ------------------
  654|  20.4k|		PRINTER(p->h, "", int16_t, uint16_t);
  ------------------
  |  |  618|  20.4k|	v = file_signextend(ms, m, CAST(uint64_t, value)); \
  |  |  ------------------
  |  |  |  |  452|  20.4k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  619|  20.4k|	switch (check_fmt(ms, desc)) { \
  |  |  620|      0|	case -1: \
  |  |  ------------------
  |  |  |  Branch (620:2): [True: 0, False: 20.4k]
  |  |  ------------------
  |  |  621|      0|		return -1; \
  |  |  622|      0|	case 1: \
  |  |  ------------------
  |  |  |  Branch (622:2): [True: 0, False: 20.4k]
  |  |  ------------------
  |  |  623|      0|		if (m->flag & UNSIGNED) { \
  |  |  ------------------
  |  |  |  |  229|      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)); \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  626|      0|		} else { \
  |  |  627|      0|			(void)snprintf(buf, sizeof(buf), "%" format "d", \
  |  |  628|      0|			    CAST(stype, v)); \
  |  |  ------------------
  |  |  |  |  452|      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|  20.4k|	default: \
  |  |  ------------------
  |  |  |  Branch (633:2): [True: 20.4k, False: 0]
  |  |  ------------------
  |  |  634|  20.4k|		if (m->flag & UNSIGNED) { \
  |  |  ------------------
  |  |  |  |  229|  20.4k|#define UNSIGNED	0x08	/* comparison is unsigned */
  |  |  ------------------
  |  |  |  Branch (634:7): [True: 12.2k, False: 8.19k]
  |  |  ------------------
  |  |  635|  12.2k|		       if (file_printf(ms, F(ms, desc, "%" format "u"), \
  |  |  ------------------
  |  |  |  |  167|  12.2k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  Branch (635:14): [True: 0, False: 12.2k]
  |  |  ------------------
  |  |  636|  12.2k|			   CAST(utype, v)) == -1) \
  |  |  ------------------
  |  |  |  |  452|  12.2k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  637|  12.2k|			   return -1; \
  |  |  638|  12.2k|		} else { \
  |  |  639|  8.19k|		       if (file_printf(ms, F(ms, desc, "%" format "d"), \
  |  |  ------------------
  |  |  |  |  167|  8.19k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  Branch (639:14): [True: 0, False: 8.19k]
  |  |  ------------------
  |  |  640|  8.19k|			   CAST(stype, v)) == -1) \
  |  |  ------------------
  |  |  |  |  452|  8.19k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  641|  8.19k|			   return -1; \
  |  |  642|  8.19k|		} \
  |  |  643|  20.4k|		break; \
  |  |  644|  20.4k|	} \
  |  |  645|  20.4k|	break
  ------------------
  655|       |
  656|  20.4k|  	case FILE_LONG:
  ------------------
  |  |  249|    668|#define				FILE_LONG		4
  ------------------
  |  Branch (656:4): [True: 668, False: 99.3k]
  ------------------
  657|  8.97k|  	case FILE_BELONG:
  ------------------
  |  |  253|  8.97k|#define				FILE_BELONG		8
  ------------------
  |  Branch (657:4): [True: 8.30k, False: 91.7k]
  ------------------
  658|  27.3k|  	case FILE_LELONG:
  ------------------
  |  |  256|  27.3k|#define				FILE_LELONG		11
  ------------------
  |  Branch (658:4): [True: 18.3k, False: 81.7k]
  ------------------
  659|  27.3k|  	case FILE_MELONG:
  ------------------
  |  |  268|  27.3k|#define				FILE_MELONG		23
  ------------------
  |  Branch (659:4): [True: 38, False: 100k]
  ------------------
  660|  27.3k|		PRINTER(p->l, "", int32_t, uint32_t);
  ------------------
  |  |  618|  27.3k|	v = file_signextend(ms, m, CAST(uint64_t, value)); \
  |  |  ------------------
  |  |  |  |  452|  27.3k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  619|  27.3k|	switch (check_fmt(ms, desc)) { \
  |  |  620|      0|	case -1: \
  |  |  ------------------
  |  |  |  Branch (620:2): [True: 0, False: 27.3k]
  |  |  ------------------
  |  |  621|      0|		return -1; \
  |  |  622|      0|	case 1: \
  |  |  ------------------
  |  |  |  Branch (622:2): [True: 0, False: 27.3k]
  |  |  ------------------
  |  |  623|      0|		if (m->flag & UNSIGNED) { \
  |  |  ------------------
  |  |  |  |  229|      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)); \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  626|      0|		} else { \
  |  |  627|      0|			(void)snprintf(buf, sizeof(buf), "%" format "d", \
  |  |  628|      0|			    CAST(stype, v)); \
  |  |  ------------------
  |  |  |  |  452|      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|  27.3k|	default: \
  |  |  ------------------
  |  |  |  Branch (633:2): [True: 27.3k, False: 0]
  |  |  ------------------
  |  |  634|  27.3k|		if (m->flag & UNSIGNED) { \
  |  |  ------------------
  |  |  |  |  229|  27.3k|#define UNSIGNED	0x08	/* comparison is unsigned */
  |  |  ------------------
  |  |  |  Branch (634:7): [True: 6.67k, False: 20.6k]
  |  |  ------------------
  |  |  635|  6.67k|		       if (file_printf(ms, F(ms, desc, "%" format "u"), \
  |  |  ------------------
  |  |  |  |  167|  6.67k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  Branch (635:14): [True: 0, False: 6.67k]
  |  |  ------------------
  |  |  636|  6.67k|			   CAST(utype, v)) == -1) \
  |  |  ------------------
  |  |  |  |  452|  6.67k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  637|  6.67k|			   return -1; \
  |  |  638|  20.6k|		} else { \
  |  |  639|  20.6k|		       if (file_printf(ms, F(ms, desc, "%" format "d"), \
  |  |  ------------------
  |  |  |  |  167|  20.6k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  Branch (639:14): [True: 0, False: 20.6k]
  |  |  ------------------
  |  |  640|  20.6k|			   CAST(stype, v)) == -1) \
  |  |  ------------------
  |  |  |  |  452|  20.6k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  641|  20.6k|			   return -1; \
  |  |  642|  20.6k|		} \
  |  |  643|  27.3k|		break; \
  |  |  644|  27.3k|	} \
  |  |  645|  27.3k|	break
  ------------------
  661|       |
  662|  27.3k|  	case FILE_QUAD:
  ------------------
  |  |  269|    110|#define				FILE_QUAD		24
  ------------------
  |  Branch (662:4): [True: 110, False: 99.9k]
  ------------------
  663|  1.04k|  	case FILE_BEQUAD:
  ------------------
  |  |  271|  1.04k|#define				FILE_BEQUAD		26
  ------------------
  |  Branch (663:4): [True: 932, False: 99.1k]
  ------------------
  664|  3.49k|  	case FILE_LEQUAD:
  ------------------
  |  |  270|  3.49k|#define				FILE_LEQUAD		25
  ------------------
  |  Branch (664:4): [True: 2.45k, False: 97.5k]
  ------------------
  665|  3.56k|	case FILE_OFFSET:
  ------------------
  |  |  297|  3.56k|#define				FILE_OFFSET		52
  ------------------
  |  Branch (665:2): [True: 62, False: 99.9k]
  ------------------
  666|  3.56k|		PRINTER(p->q, INT64_T_FORMAT, long long, unsigned long long);
  ------------------
  |  |  618|  3.56k|	v = file_signextend(ms, m, CAST(uint64_t, value)); \
  |  |  ------------------
  |  |  |  |  452|  3.56k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  619|  3.56k|	switch (check_fmt(ms, desc)) { \
  |  |  620|      0|	case -1: \
  |  |  ------------------
  |  |  |  Branch (620:2): [True: 0, False: 3.56k]
  |  |  ------------------
  |  |  621|      0|		return -1; \
  |  |  622|      0|	case 1: \
  |  |  ------------------
  |  |  |  Branch (622:2): [True: 0, False: 3.56k]
  |  |  ------------------
  |  |  623|      0|		if (m->flag & UNSIGNED) { \
  |  |  ------------------
  |  |  |  |  229|      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)); \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  626|      0|		} else { \
  |  |  627|      0|			(void)snprintf(buf, sizeof(buf), "%" format "d", \
  |  |  628|      0|			    CAST(stype, v)); \
  |  |  ------------------
  |  |  |  |  452|      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.56k|	default: \
  |  |  ------------------
  |  |  |  Branch (633:2): [True: 3.56k, False: 0]
  |  |  ------------------
  |  |  634|  3.56k|		if (m->flag & UNSIGNED) { \
  |  |  ------------------
  |  |  |  |  229|  3.56k|#define UNSIGNED	0x08	/* comparison is unsigned */
  |  |  ------------------
  |  |  |  Branch (634:7): [True: 1.01k, False: 2.54k]
  |  |  ------------------
  |  |  635|  1.01k|		       if (file_printf(ms, F(ms, desc, "%" format "u"), \
  |  |  ------------------
  |  |  |  |  167|  1.01k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  Branch (635:14): [True: 0, False: 1.01k]
  |  |  ------------------
  |  |  636|  1.01k|			   CAST(utype, v)) == -1) \
  |  |  ------------------
  |  |  |  |  452|  1.01k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  637|  1.01k|			   return -1; \
  |  |  638|  2.54k|		} else { \
  |  |  639|  2.54k|		       if (file_printf(ms, F(ms, desc, "%" format "d"), \
  |  |  ------------------
  |  |  |  |  167|  2.54k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  Branch (639:14): [True: 0, False: 2.54k]
  |  |  ------------------
  |  |  640|  2.54k|			   CAST(stype, v)) == -1) \
  |  |  ------------------
  |  |  |  |  452|  2.54k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  641|  2.54k|			   return -1; \
  |  |  642|  2.54k|		} \
  |  |  643|  3.56k|		break; \
  |  |  644|  3.56k|	} \
  |  |  645|  3.56k|	break
  ------------------
  667|       |
  668|  19.8k|  	case FILE_STRING:
  ------------------
  |  |  250|  19.8k|#define				FILE_STRING		5
  ------------------
  |  Branch (668:4): [True: 19.8k, False: 80.2k]
  ------------------
  669|  23.0k|  	case FILE_PSTRING:
  ------------------
  |  |  258|  23.0k|#define				FILE_PSTRING		13
  ------------------
  |  Branch (669:4): [True: 3.25k, False: 96.7k]
  ------------------
  670|  23.1k|  	case FILE_BESTRING16:
  ------------------
  |  |  263|  23.1k|#define				FILE_BESTRING16		18
  ------------------
  |  Branch (670:4): [True: 119, False: 99.9k]
  ------------------
  671|  23.6k|  	case FILE_LESTRING16:
  ------------------
  |  |  264|  23.6k|#define				FILE_LESTRING16		19
  ------------------
  |  Branch (671:4): [True: 460, False: 99.5k]
  ------------------
  672|  23.6k|		if (m->reln == '=' || m->reln == '!') {
  ------------------
  |  Branch (672:7): [True: 10.2k, False: 13.3k]
  |  Branch (672:25): [True: 259, False: 13.0k]
  ------------------
  673|  10.5k|			if (file_printf(ms, F(ms, desc, "%s"),
  ------------------
  |  |  167|  10.5k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (673:8): [True: 0, False: 10.5k]
  ------------------
  674|  10.5k|			    file_printable(ms, sbuf, sizeof(sbuf), m->value.s,
  675|  10.5k|			    sizeof(m->value.s))) == -1)
  676|      0|				return -1;
  677|  10.5k|		}
  678|  13.0k|		else {
  679|  13.0k|			char *str = p->s;
  680|       |
  681|       |			/* compute t before we mangle the string? */
  682|       |
  683|  13.0k|			if (*m->value.s == '\0')
  ------------------
  |  Branch (683:8): [True: 11.2k, False: 1.88k]
  ------------------
  684|  11.2k|				str[strcspn(str, "\r\n")] = '\0';
  685|       |
  686|  13.0k|			if (m->str_flags & STRING_TRIM)
  ------------------
  |  |  382|  13.0k|#define str_flags _u._s._flags
  ------------------
              			if (m->str_flags & STRING_TRIM)
  ------------------
  |  |  413|  13.0k|#define	STRING_TRIM				BIT(13)
  |  |  ------------------
  |  |  |  |  395|  13.0k|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (686:8): [True: 504, False: 12.5k]
  ------------------
  687|    504|				str = file_strtrim(str);
  688|       |
  689|  13.0k|			if (file_printf(ms, F(ms, desc, "%s"),
  ------------------
  |  |  167|  13.0k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (689:8): [True: 0, False: 13.0k]
  ------------------
  690|  13.0k|			    file_printable(ms, sbuf, sizeof(sbuf), str,
  691|  13.0k|				sizeof(p->s) - (str - p->s))) == -1)
  692|      0|				return -1;
  693|       |
  694|  13.0k|			if (m->type == FILE_PSTRING) {
  ------------------
  |  |  258|  13.0k|#define				FILE_PSTRING		13
  ------------------
  |  Branch (694:8): [True: 3.14k, False: 9.95k]
  ------------------
  695|  3.14k|				size_t l = file_pstring_length_size(ms, m);
  696|  3.14k|				if (l == FILE_BADSIZE)
  ------------------
  |  |  175|  3.14k|#define FILE_BADSIZE CAST(size_t, ~0ul)
  |  |  ------------------
  |  |  |  |  452|  3.14k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (696:9): [True: 0, False: 3.14k]
  ------------------
  697|      0|					return -1;
  698|  3.14k|			}
  699|  13.0k|		}
  700|  23.6k|		break;
  701|       |
  702|  23.6k|	case FILE_DATE:
  ------------------
  |  |  251|      0|#define				FILE_DATE		6
  ------------------
  |  Branch (702:2): [True: 0, False: 100k]
  ------------------
  703|    291|	case FILE_BEDATE:
  ------------------
  |  |  254|    291|#define				FILE_BEDATE		9
  ------------------
  |  Branch (703:2): [True: 291, False: 99.7k]
  ------------------
  704|    421|	case FILE_LEDATE:
  ------------------
  |  |  257|    421|#define				FILE_LEDATE		12
  ------------------
  |  Branch (704:2): [True: 130, False: 99.9k]
  ------------------
  705|    595|	case FILE_MEDATE:
  ------------------
  |  |  266|    595|#define				FILE_MEDATE		21
  ------------------
  |  Branch (705:2): [True: 174, False: 99.8k]
  ------------------
  706|    595|		if (file_printf(ms, F(ms, desc, "%s"),
  ------------------
  |  |  167|    595|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (706:7): [True: 0, False: 595]
  ------------------
  707|    595|		    file_fmtdatetime(tbuf, sizeof(tbuf), p->l, 0)) == -1)
  708|      0|			return -1;
  709|    595|		break;
  710|       |
  711|    595|	case FILE_LDATE:
  ------------------
  |  |  259|      0|#define				FILE_LDATE		14
  ------------------
  |  Branch (711:2): [True: 0, False: 100k]
  ------------------
  712|    387|	case FILE_BELDATE:
  ------------------
  |  |  260|    387|#define				FILE_BELDATE		15
  ------------------
  |  Branch (712:2): [True: 387, False: 99.6k]
  ------------------
  713|    479|	case FILE_LELDATE:
  ------------------
  |  |  261|    479|#define				FILE_LELDATE		16
  ------------------
  |  Branch (713:2): [True: 92, False: 99.9k]
  ------------------
  714|    479|	case FILE_MELDATE:
  ------------------
  |  |  267|    479|#define				FILE_MELDATE		22
  ------------------
  |  Branch (714:2): [True: 0, False: 100k]
  ------------------
  715|    479|		if (file_printf(ms, F(ms, desc, "%s"),
  ------------------
  |  |  167|    479|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (715:7): [True: 0, False: 479]
  ------------------
  716|    479|		    file_fmtdatetime(tbuf, sizeof(tbuf), p->l, FILE_T_LOCAL))
  ------------------
  |  |  540|    479|#define FILE_T_LOCAL	1
  ------------------
  717|    479|			== -1)
  718|      0|			return -1;
  719|    479|		break;
  720|       |
  721|    479|	case FILE_QDATE:
  ------------------
  |  |  272|      0|#define				FILE_QDATE		27
  ------------------
  |  Branch (721:2): [True: 0, False: 100k]
  ------------------
  722|  1.00k|	case FILE_BEQDATE:
  ------------------
  |  |  274|  1.00k|#define				FILE_BEQDATE		29
  ------------------
  |  Branch (722:2): [True: 1.00k, False: 99.0k]
  ------------------
  723|  1.03k|	case FILE_LEQDATE:
  ------------------
  |  |  273|  1.03k|#define				FILE_LEQDATE		28
  ------------------
  |  Branch (723:2): [True: 37, False: 100k]
  ------------------
  724|  1.03k|		if (file_printf(ms, F(ms, desc, "%s"),
  ------------------
  |  |  167|  1.03k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (724:7): [True: 0, False: 1.03k]
  ------------------
  725|  1.03k|		    file_fmtdatetime(tbuf, sizeof(tbuf), p->q, 0)) == -1)
  726|      0|			return -1;
  727|  1.03k|		break;
  728|       |
  729|  1.03k|	case FILE_QLDATE:
  ------------------
  |  |  275|      0|#define				FILE_QLDATE		30
  ------------------
  |  Branch (729:2): [True: 0, False: 100k]
  ------------------
  730|    187|	case FILE_BEQLDATE:
  ------------------
  |  |  277|    187|#define				FILE_BEQLDATE		32
  ------------------
  |  Branch (730:2): [True: 187, False: 99.8k]
  ------------------
  731|    645|	case FILE_LEQLDATE:
  ------------------
  |  |  276|    645|#define				FILE_LEQLDATE		31
  ------------------
  |  Branch (731:2): [True: 458, False: 99.5k]
  ------------------
  732|    645|		if (file_printf(ms, F(ms, desc, "%s"),
  ------------------
  |  |  167|    645|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (732:7): [True: 0, False: 645]
  ------------------
  733|    645|		    file_fmtdatetime(tbuf, sizeof(tbuf), p->q, FILE_T_LOCAL)) == -1)
  ------------------
  |  |  540|    645|#define FILE_T_LOCAL	1
  ------------------
  734|      0|			return -1;
  735|    645|		break;
  736|       |
  737|    645|	case FILE_QWDATE:
  ------------------
  |  |  287|    206|#define				FILE_QWDATE		42
  ------------------
  |  Branch (737:2): [True: 206, False: 99.8k]
  ------------------
  738|    206|	case FILE_BEQWDATE:
  ------------------
  |  |  289|    206|#define				FILE_BEQWDATE		44
  ------------------
  |  Branch (738:2): [True: 0, False: 100k]
  ------------------
  739|  1.67k|	case FILE_LEQWDATE:
  ------------------
  |  |  288|  1.67k|#define				FILE_LEQWDATE		43
  ------------------
  |  Branch (739:2): [True: 1.47k, False: 98.5k]
  ------------------
  740|  1.67k|		if (file_printf(ms, F(ms, desc, "%s"),
  ------------------
  |  |  167|  1.67k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (740:7): [True: 0, False: 1.67k]
  ------------------
  741|  1.67k|		    file_fmtdatetime(tbuf, sizeof(tbuf), p->q, FILE_T_WINDOWS))
  ------------------
  |  |  541|  1.67k|#define FILE_T_WINDOWS	2
  ------------------
  742|  1.67k|		    == -1)
  743|      0|			return -1;
  744|  1.67k|		break;
  745|       |
  746|  1.67k|	case FILE_FLOAT:
  ------------------
  |  |  278|      0|#define				FILE_FLOAT		33
  ------------------
  |  Branch (746:2): [True: 0, False: 100k]
  ------------------
  747|      0|	case FILE_BEFLOAT:
  ------------------
  |  |  279|      0|#define				FILE_BEFLOAT		34
  ------------------
  |  Branch (747:2): [True: 0, False: 100k]
  ------------------
  748|  1.94k|	case FILE_LEFLOAT:
  ------------------
  |  |  280|  1.94k|#define				FILE_LEFLOAT		35
  ------------------
  |  Branch (748:2): [True: 1.94k, False: 98.1k]
  ------------------
  749|  1.94k|		vf = p->f;
  750|  1.94k|		switch (check_fmt(ms, desc)) {
  751|      0|		case -1:
  ------------------
  |  Branch (751:3): [True: 0, False: 1.94k]
  ------------------
  752|      0|			return -1;
  753|      0|		case 1:
  ------------------
  |  Branch (753:3): [True: 0, False: 1.94k]
  ------------------
  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|  1.94k|		default:
  ------------------
  |  Branch (758:3): [True: 1.94k, False: 0]
  ------------------
  759|  1.94k|			if (file_printf(ms, F(ms, desc, "%g"), vf) == -1)
  ------------------
  |  |  167|  1.94k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (759:8): [True: 0, False: 1.94k]
  ------------------
  760|      0|				return -1;
  761|  1.94k|			break;
  762|  1.94k|		}
  763|  1.94k|  		break;
  764|       |
  765|  1.94k|	case FILE_DOUBLE:
  ------------------
  |  |  281|      0|#define				FILE_DOUBLE		36
  ------------------
  |  Branch (765:2): [True: 0, False: 100k]
  ------------------
  766|      0|	case FILE_BEDOUBLE:
  ------------------
  |  |  282|      0|#define				FILE_BEDOUBLE		37
  ------------------
  |  Branch (766:2): [True: 0, False: 100k]
  ------------------
  767|    446|	case FILE_LEDOUBLE:
  ------------------
  |  |  283|    446|#define				FILE_LEDOUBLE		38
  ------------------
  |  Branch (767:2): [True: 446, False: 99.5k]
  ------------------
  768|    446|		vd = p->d;
  769|    446|		switch (check_fmt(ms, desc)) {
  770|      0|		case -1:
  ------------------
  |  Branch (770:3): [True: 0, False: 446]
  ------------------
  771|      0|			return -1;
  772|      0|		case 1:
  ------------------
  |  Branch (772:3): [True: 0, False: 446]
  ------------------
  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|    446|		default:
  ------------------
  |  Branch (777:3): [True: 446, False: 0]
  ------------------
  778|    446|			if (file_printf(ms, F(ms, desc, "%g"), vd) == -1)
  ------------------
  |  |  167|    446|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (778:8): [True: 0, False: 446]
  ------------------
  779|      0|				return -1;
  780|    446|			break;
  781|    446|		}
  782|    446|  		break;
  783|       |
  784|    446|	case FILE_SEARCH:
  ------------------
  |  |  265|    388|#define				FILE_SEARCH		20
  ------------------
  |  Branch (784:2): [True: 388, False: 99.6k]
  ------------------
  785|  1.32k|	case FILE_REGEX: {
  ------------------
  |  |  262|  1.32k|#define				FILE_REGEX		17
  ------------------
  |  Branch (785:2): [True: 941, False: 99.0k]
  ------------------
  786|  1.32k|		char *cp, *scp;
  787|  1.32k|		int rval;
  788|       |
  789|  1.32k|		if (ms->search.s == NULL)
  ------------------
  |  Branch (789:7): [True: 0, False: 1.32k]
  ------------------
  790|      0|			break;
  791|       |
  792|  1.32k|		cp = strndup(RCAST(const char *, ms->search.s),
  ------------------
  |  |  453|  1.32k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
  793|  1.32k|		    ms->search.rm_len);
  794|  1.32k|		if (cp == NULL) {
  ------------------
  |  Branch (794:7): [True: 0, False: 1.32k]
  ------------------
  795|      0|			file_oomem(ms, ms->search.rm_len);
  796|      0|			return -1;
  797|      0|		}
  798|  1.32k|		scp = (m->str_flags & STRING_TRIM) ? file_strtrim(cp) : cp;
  ------------------
  |  |  382|  1.32k|#define str_flags _u._s._flags
  ------------------
              		scp = (m->str_flags & STRING_TRIM) ? file_strtrim(cp) : cp;
  ------------------
  |  |  413|  1.32k|#define	STRING_TRIM				BIT(13)
  |  |  ------------------
  |  |  |  |  395|  1.32k|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (798:9): [True: 70, False: 1.25k]
  ------------------
  799|       |
  800|  1.32k|		rval = file_printf(ms, F(ms, desc, "%s"), file_printable(ms,
  ------------------
  |  |  167|  1.32k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  801|  1.32k|		    sbuf, sizeof(sbuf), scp, ms->search.rm_len));
  802|  1.32k|		free(cp);
  803|       |
  804|  1.32k|		if (rval == -1)
  ------------------
  |  Branch (804:7): [True: 0, False: 1.32k]
  ------------------
  805|      0|			return -1;
  806|  1.32k|		break;
  807|  1.32k|	}
  808|       |
  809|  1.67k|	case FILE_DEFAULT:
  ------------------
  |  |  248|  1.67k|#define				FILE_DEFAULT		3
  ------------------
  |  Branch (809:2): [True: 1.67k, False: 98.3k]
  ------------------
  810|  1.86k|	case FILE_CLEAR:
  ------------------
  |  |  292|  1.86k|#define				FILE_CLEAR		47
  ------------------
  |  Branch (810:2): [True: 195, False: 99.8k]
  ------------------
  811|  1.86k|	  	if (file_printf(ms, "%s", m->desc) == -1)
  ------------------
  |  Branch (811:9): [True: 0, False: 1.86k]
  ------------------
  812|      0|			return -1;
  813|  1.86k|		break;
  814|       |
  815|  1.86k|	case FILE_INDIRECT:
  ------------------
  |  |  286|    123|#define				FILE_INDIRECT		41
  ------------------
  |  Branch (815:2): [True: 123, False: 99.9k]
  ------------------
  816|    166|	case FILE_USE:
  ------------------
  |  |  291|    166|#define				FILE_USE		46
  ------------------
  |  Branch (816:2): [True: 43, False: 99.9k]
  ------------------
  817|  1.16k|	case FILE_NAME:
  ------------------
  |  |  290|  1.16k|#define				FILE_NAME		45
  ------------------
  |  Branch (817:2): [True: 999, False: 99.0k]
  ------------------
  818|  1.16k|		break;
  819|    612|	case FILE_DER:
  ------------------
  |  |  293|    612|#define				FILE_DER		48
  ------------------
  |  Branch (819:2): [True: 612, False: 99.4k]
  ------------------
  820|    612|		if (file_printf(ms, F(ms, desc, "%s"),
  ------------------
  |  |  167|    612|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (820:7): [True: 0, False: 612]
  ------------------
  821|    612|		    file_printable(ms, sbuf, sizeof(sbuf), ms->ms_value.s,
  822|    612|			sizeof(ms->ms_value.s))) == -1)
  823|      0|			return -1;
  824|    612|		break;
  825|    612|	case FILE_GUID:
  ------------------
  |  |  294|    181|#define				FILE_GUID		49
  ------------------
  |  Branch (825:2): [True: 181, False: 99.8k]
  ------------------
  826|    181|	case FILE_LEGUID:
  ------------------
  |  |  295|    181|#define				FILE_LEGUID		50
  ------------------
  |  Branch (826:2): [True: 0, False: 100k]
  ------------------
  827|    181|		(void) file_print_leguid(buf, sizeof(buf), ms->ms_value.guid);
  828|    181|		if (file_printf(ms, F(ms, desc, "%s"), buf) == -1)
  ------------------
  |  |  167|    181|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (828:7): [True: 0, False: 181]
  ------------------
  829|      0|			return -1;
  830|    181|		break;
  831|    181|	case FILE_BEGUID:
  ------------------
  |  |  296|     62|#define				FILE_BEGUID		51
  ------------------
  |  Branch (831:2): [True: 62, False: 99.9k]
  ------------------
  832|     62|		(void) file_print_beguid(buf, sizeof(buf), ms->ms_value.guid);
  833|     62|		if (file_printf(ms, F(ms, desc, "%s"), buf) == -1)
  ------------------
  |  |  167|     62|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (833:7): [True: 0, False: 62]
  ------------------
  834|      0|			return -1;
  835|     62|		break;
  836|     62|	case FILE_MSDOSDATE:
  ------------------
  |  |  300|      0|#define				FILE_MSDOSDATE		55
  ------------------
  |  Branch (836:2): [True: 0, False: 100k]
  ------------------
  837|      0|	case FILE_BEMSDOSDATE:
  ------------------
  |  |  302|      0|#define				FILE_BEMSDOSDATE	57
  ------------------
  |  Branch (837:2): [True: 0, False: 100k]
  ------------------
  838|    292|	case FILE_LEMSDOSDATE:
  ------------------
  |  |  301|    292|#define				FILE_LEMSDOSDATE	56
  ------------------
  |  Branch (838:2): [True: 292, False: 99.7k]
  ------------------
  839|    292|		if (file_printf(ms, F(ms, desc, "%s"),
  ------------------
  |  |  167|    292|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (839:7): [True: 0, False: 292]
  ------------------
  840|    292|		    file_fmtdate(tbuf, sizeof(tbuf), p->h)) == -1)
  841|      0|			return -1;
  842|    292|		break;
  843|    292|	case FILE_MSDOSTIME:
  ------------------
  |  |  303|      0|#define				FILE_MSDOSTIME		58
  ------------------
  |  Branch (843:2): [True: 0, False: 100k]
  ------------------
  844|      0|	case FILE_BEMSDOSTIME:
  ------------------
  |  |  305|      0|#define				FILE_BEMSDOSTIME	60
  ------------------
  |  Branch (844:2): [True: 0, False: 100k]
  ------------------
  845|    292|	case FILE_LEMSDOSTIME:
  ------------------
  |  |  304|    292|#define				FILE_LEMSDOSTIME	59
  ------------------
  |  Branch (845:2): [True: 292, False: 99.7k]
  ------------------
  846|    292|		if (file_printf(ms, F(ms, desc, "%s"),
  ------------------
  |  |  167|    292|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (846:7): [True: 0, False: 292]
  ------------------
  847|    292|		    file_fmttime(tbuf, sizeof(tbuf), p->h)) == -1)
  848|      0|			return -1;
  849|    292|		break;
  850|    292|	case FILE_OCTAL:
  ------------------
  |  |  306|      0|#define				FILE_OCTAL		61
  ------------------
  |  Branch (850:2): [True: 0, False: 100k]
  ------------------
  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: 100k]
  ------------------
  856|      0|		file_magerror(ms, "invalid m->type (%d) in mprint()", m->type);
  857|      0|		return -1;
  858|   100k|	}
  859|   100k|	return 0;
  860|   100k|}
softmagic.c:check_fmt:
  509|  66.1k|{
  510|  66.1k|	file_regex_t rx;
  511|  66.1k|	int rc;
  512|  66.1k|        const char* pat = "%[-0-9\\.]*s";
  513|       |
  514|  66.1k|	if (strchr(fmt, '%') == NULL)
  ------------------
  |  Branch (514:6): [True: 30.7k, False: 35.4k]
  ------------------
  515|  30.7k|		return 0;
  516|       |
  517|  35.4k|	rc = file_regcomp(ms, &rx, pat, REG_EXTENDED|REG_NOSUB);
  518|  35.4k|	if (rc != 0)
  ------------------
  |  Branch (518:6): [True: 0, False: 35.4k]
  ------------------
  519|      0|		return -1;
  520|  35.4k|	rc = !file_regexec(ms, &rx, fmt, 0, 0, 0);
  521|  35.4k|	file_regfree(&rx);
  522|  35.4k|	return rc;
  523|  35.4k|}
softmagic.c:moffset:
  865|   927k|{
  866|   927k|	int32_t o;
  867|   927k|	size_t vlen;
  868|       |
  869|   927k|  	switch (m->type) {
  870|   298k|  	case FILE_BYTE:
  ------------------
  |  |  246|   298k|#define 			FILE_BYTE		1
  ------------------
  |  Branch (870:4): [True: 298k, False: 628k]
  ------------------
  871|   298k|		o = CAST(int32_t, (ms->offset + sizeof(char)));
  ------------------
  |  |  452|   298k|#define CAST(T, b)	((T)(b))
  ------------------
  872|   298k|		break;
  873|       |
  874|  27.3k|  	case FILE_SHORT:
  ------------------
  |  |  247|  27.3k|#define				FILE_SHORT		2
  ------------------
  |  Branch (874:4): [True: 27.3k, False: 900k]
  ------------------
  875|  82.8k|  	case FILE_BESHORT:
  ------------------
  |  |  252|  82.8k|#define				FILE_BESHORT		7
  ------------------
  |  Branch (875:4): [True: 55.4k, False: 871k]
  ------------------
  876|   149k|  	case FILE_LESHORT:
  ------------------
  |  |  255|   149k|#define				FILE_LESHORT		10
  ------------------
  |  Branch (876:4): [True: 66.7k, False: 860k]
  ------------------
  877|   149k|	case FILE_MSDOSDATE:
  ------------------
  |  |  300|   149k|#define				FILE_MSDOSDATE		55
  ------------------
  |  Branch (877:2): [True: 0, False: 927k]
  ------------------
  878|   149k|	case FILE_LEMSDOSDATE:
  ------------------
  |  |  301|   149k|#define				FILE_LEMSDOSDATE	56
  ------------------
  |  Branch (878:2): [True: 292, False: 927k]
  ------------------
  879|   149k|	case FILE_BEMSDOSDATE:
  ------------------
  |  |  302|   149k|#define				FILE_BEMSDOSDATE	57
  ------------------
  |  Branch (879:2): [True: 0, False: 927k]
  ------------------
  880|   149k|	case FILE_MSDOSTIME:
  ------------------
  |  |  303|   149k|#define				FILE_MSDOSTIME		58
  ------------------
  |  Branch (880:2): [True: 0, False: 927k]
  ------------------
  881|   150k|	case FILE_LEMSDOSTIME:
  ------------------
  |  |  304|   150k|#define				FILE_LEMSDOSTIME	59
  ------------------
  |  Branch (881:2): [True: 292, False: 927k]
  ------------------
  882|   150k|	case FILE_BEMSDOSTIME:
  ------------------
  |  |  305|   150k|#define				FILE_BEMSDOSTIME	60
  ------------------
  |  Branch (882:2): [True: 0, False: 927k]
  ------------------
  883|   150k|		o = CAST(int32_t, (ms->offset + sizeof(short)));
  ------------------
  |  |  452|   150k|#define CAST(T, b)	((T)(b))
  ------------------
  884|   150k|		break;
  885|       |
  886|  11.6k|  	case FILE_LONG:
  ------------------
  |  |  249|  11.6k|#define				FILE_LONG		4
  ------------------
  |  Branch (886:4): [True: 11.6k, False: 915k]
  ------------------
  887|   105k|  	case FILE_BELONG:
  ------------------
  |  |  253|   105k|#define				FILE_BELONG		8
  ------------------
  |  Branch (887:4): [True: 93.4k, False: 834k]
  ------------------
  888|   196k|  	case FILE_LELONG:
  ------------------
  |  |  256|   196k|#define				FILE_LELONG		11
  ------------------
  |  Branch (888:4): [True: 91.8k, False: 835k]
  ------------------
  889|   196k|  	case FILE_MELONG:
  ------------------
  |  |  268|   196k|#define				FILE_MELONG		23
  ------------------
  |  Branch (889:4): [True: 38, False: 927k]
  ------------------
  890|   196k|		o = CAST(int32_t, (ms->offset + sizeof(int32_t)));
  ------------------
  |  |  452|   196k|#define CAST(T, b)	((T)(b))
  ------------------
  891|   196k|		break;
  892|       |
  893|  30.9k|  	case FILE_QUAD:
  ------------------
  |  |  269|  30.9k|#define				FILE_QUAD		24
  ------------------
  |  Branch (893:4): [True: 30.9k, False: 896k]
  ------------------
  894|  36.2k|  	case FILE_BEQUAD:
  ------------------
  |  |  271|  36.2k|#define				FILE_BEQUAD		26
  ------------------
  |  Branch (894:4): [True: 5.31k, False: 922k]
  ------------------
  895|  38.9k|  	case FILE_LEQUAD:
  ------------------
  |  |  270|  38.9k|#define				FILE_LEQUAD		25
  ------------------
  |  Branch (895:4): [True: 2.76k, False: 924k]
  ------------------
  896|  38.9k|		o = CAST(int32_t, (ms->offset + sizeof(int64_t)));
  ------------------
  |  |  452|  38.9k|#define CAST(T, b)	((T)(b))
  ------------------
  897|  38.9k|		break;
  898|       |
  899|  77.4k|  	case FILE_STRING:
  ------------------
  |  |  250|  77.4k|#define				FILE_STRING		5
  ------------------
  |  Branch (899:4): [True: 77.4k, False: 850k]
  ------------------
  900|  80.6k|  	case FILE_PSTRING:
  ------------------
  |  |  258|  80.6k|#define				FILE_PSTRING		13
  ------------------
  |  Branch (900:4): [True: 3.27k, False: 924k]
  ------------------
  901|  80.8k|  	case FILE_BESTRING16:
  ------------------
  |  |  263|  80.8k|#define				FILE_BESTRING16		18
  ------------------
  |  Branch (901:4): [True: 119, False: 927k]
  ------------------
  902|  81.2k|  	case FILE_LESTRING16:
  ------------------
  |  |  264|  81.2k|#define				FILE_LESTRING16		19
  ------------------
  |  Branch (902:4): [True: 460, False: 927k]
  ------------------
  903|  81.2k|	case FILE_OCTAL:
  ------------------
  |  |  306|  81.2k|#define				FILE_OCTAL		61
  ------------------
  |  Branch (903:2): [True: 0, False: 927k]
  ------------------
  904|  81.2k|		if (m->reln == '=' || m->reln == '!') {
  ------------------
  |  Branch (904:7): [True: 26.8k, False: 54.4k]
  |  Branch (904:25): [True: 766, False: 53.6k]
  ------------------
  905|  27.6k|			o = ms->offset + m->vallen;
  906|  53.6k|		} else {
  907|  53.6k|			union VALUETYPE *p = &ms->ms_value;
  908|       |
  909|  53.6k|			if (*m->value.s == '\0')
  ------------------
  |  Branch (909:8): [True: 42.6k, False: 10.9k]
  ------------------
  910|  42.6k|				p->s[strcspn(p->s, "\r\n")] = '\0';
  911|  53.6k|			o = CAST(uint32_t, (ms->offset + strlen(p->s)));
  ------------------
  |  |  452|  53.6k|#define CAST(T, b)	((T)(b))
  ------------------
  912|  53.6k|			if (m->type == FILE_PSTRING) {
  ------------------
  |  |  258|  53.6k|#define				FILE_PSTRING		13
  ------------------
  |  Branch (912:8): [True: 3.16k, False: 50.4k]
  ------------------
  913|  3.16k|				size_t l = file_pstring_length_size(ms, m);
  914|  3.16k|				if (l == FILE_BADSIZE)
  ------------------
  |  |  175|  3.16k|#define FILE_BADSIZE CAST(size_t, ~0ul)
  |  |  ------------------
  |  |  |  |  452|  3.16k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (914:9): [True: 0, False: 3.16k]
  ------------------
  915|      0|					return -1;
  916|  3.16k|				o += CAST(uint32_t, l);
  ------------------
  |  |  452|  3.16k|#define CAST(T, b)	((T)(b))
  ------------------
  917|  3.16k|			}
  918|  53.6k|		}
  919|  81.2k|		break;
  920|       |
  921|  81.2k|	case FILE_DATE:
  ------------------
  |  |  251|      0|#define				FILE_DATE		6
  ------------------
  |  Branch (921:2): [True: 0, False: 927k]
  ------------------
  922|    291|	case FILE_BEDATE:
  ------------------
  |  |  254|    291|#define				FILE_BEDATE		9
  ------------------
  |  Branch (922:2): [True: 291, False: 927k]
  ------------------
  923|    421|	case FILE_LEDATE:
  ------------------
  |  |  257|    421|#define				FILE_LEDATE		12
  ------------------
  |  Branch (923:2): [True: 130, False: 927k]
  ------------------
  924|    595|	case FILE_MEDATE:
  ------------------
  |  |  266|    595|#define				FILE_MEDATE		21
  ------------------
  |  Branch (924:2): [True: 174, False: 927k]
  ------------------
  925|    595|		o = CAST(int32_t, (ms->offset + sizeof(uint32_t)));
  ------------------
  |  |  452|    595|#define CAST(T, b)	((T)(b))
  ------------------
  926|    595|		break;
  927|       |
  928|      0|	case FILE_LDATE:
  ------------------
  |  |  259|      0|#define				FILE_LDATE		14
  ------------------
  |  Branch (928:2): [True: 0, False: 927k]
  ------------------
  929|    387|	case FILE_BELDATE:
  ------------------
  |  |  260|    387|#define				FILE_BELDATE		15
  ------------------
  |  Branch (929:2): [True: 387, False: 927k]
  ------------------
  930|    479|	case FILE_LELDATE:
  ------------------
  |  |  261|    479|#define				FILE_LELDATE		16
  ------------------
  |  Branch (930:2): [True: 92, False: 927k]
  ------------------
  931|    479|	case FILE_MELDATE:
  ------------------
  |  |  267|    479|#define				FILE_MELDATE		22
  ------------------
  |  Branch (931:2): [True: 0, False: 927k]
  ------------------
  932|    479|		o = CAST(int32_t, (ms->offset + sizeof(uint32_t)));
  ------------------
  |  |  452|    479|#define CAST(T, b)	((T)(b))
  ------------------
  933|    479|		break;
  934|       |
  935|      0|	case FILE_QDATE:
  ------------------
  |  |  272|      0|#define				FILE_QDATE		27
  ------------------
  |  Branch (935:2): [True: 0, False: 927k]
  ------------------
  936|  1.00k|	case FILE_BEQDATE:
  ------------------
  |  |  274|  1.00k|#define				FILE_BEQDATE		29
  ------------------
  |  Branch (936:2): [True: 1.00k, False: 926k]
  ------------------
  937|  1.03k|	case FILE_LEQDATE:
  ------------------
  |  |  273|  1.03k|#define				FILE_LEQDATE		28
  ------------------
  |  Branch (937:2): [True: 37, False: 927k]
  ------------------
  938|  1.03k|		o = CAST(int32_t, (ms->offset + sizeof(uint64_t)));
  ------------------
  |  |  452|  1.03k|#define CAST(T, b)	((T)(b))
  ------------------
  939|  1.03k|		break;
  940|       |
  941|      0|	case FILE_QLDATE:
  ------------------
  |  |  275|      0|#define				FILE_QLDATE		30
  ------------------
  |  Branch (941:2): [True: 0, False: 927k]
  ------------------
  942|    187|	case FILE_BEQLDATE:
  ------------------
  |  |  277|    187|#define				FILE_BEQLDATE		32
  ------------------
  |  Branch (942:2): [True: 187, False: 927k]
  ------------------
  943|    645|	case FILE_LEQLDATE:
  ------------------
  |  |  276|    645|#define				FILE_LEQLDATE		31
  ------------------
  |  Branch (943:2): [True: 458, False: 927k]
  ------------------
  944|    645|		o = CAST(int32_t, (ms->offset + sizeof(uint64_t)));
  ------------------
  |  |  452|    645|#define CAST(T, b)	((T)(b))
  ------------------
  945|    645|		break;
  946|       |
  947|      0|  	case FILE_FLOAT:
  ------------------
  |  |  278|      0|#define				FILE_FLOAT		33
  ------------------
  |  Branch (947:4): [True: 0, False: 927k]
  ------------------
  948|      0|  	case FILE_BEFLOAT:
  ------------------
  |  |  279|      0|#define				FILE_BEFLOAT		34
  ------------------
  |  Branch (948:4): [True: 0, False: 927k]
  ------------------
  949|  1.94k|  	case FILE_LEFLOAT:
  ------------------
  |  |  280|  1.94k|#define				FILE_LEFLOAT		35
  ------------------
  |  Branch (949:4): [True: 1.94k, False: 925k]
  ------------------
  950|  1.94k|		o = CAST(int32_t, (ms->offset + sizeof(float)));
  ------------------
  |  |  452|  1.94k|#define CAST(T, b)	((T)(b))
  ------------------
  951|  1.94k|		break;
  952|       |
  953|      0|  	case FILE_DOUBLE:
  ------------------
  |  |  281|      0|#define				FILE_DOUBLE		36
  ------------------
  |  Branch (953:4): [True: 0, False: 927k]
  ------------------
  954|      0|  	case FILE_BEDOUBLE:
  ------------------
  |  |  282|      0|#define				FILE_BEDOUBLE		37
  ------------------
  |  Branch (954:4): [True: 0, False: 927k]
  ------------------
  955|    446|  	case FILE_LEDOUBLE:
  ------------------
  |  |  283|    446|#define				FILE_LEDOUBLE		38
  ------------------
  |  Branch (955:4): [True: 446, False: 927k]
  ------------------
  956|    446|		o = CAST(int32_t, (ms->offset + sizeof(double)));
  ------------------
  |  |  452|    446|#define CAST(T, b)	((T)(b))
  ------------------
  957|    446|		break;
  958|       |
  959|  1.74k|	case FILE_REGEX:
  ------------------
  |  |  262|  1.74k|#define				FILE_REGEX		17
  ------------------
  |  Branch (959:2): [True: 1.74k, False: 925k]
  ------------------
  960|       |		/* Why is regex and search different? */
  961|  1.74k|		vlen = (m->str_flags & REGEX_OFFSET_START) == 0 ?
  ------------------
  |  |  382|  1.74k|#define str_flags _u._s._flags
  ------------------
              		vlen = (m->str_flags & REGEX_OFFSET_START) == 0 ?
  ------------------
  |  |  400|  1.74k|#define REGEX_OFFSET_START			BIT(4)
  |  |  ------------------
  |  |  |  |  395|  1.74k|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (961:10): [True: 1.65k, False: 92]
  ------------------
  962|  1.65k|		    ms->search.rm_len : 0;
  963|  1.74k|		o = CAST(int32_t, ms->search.offset + vlen - offset);
  ------------------
  |  |  452|  1.74k|#define CAST(T, b)	((T)(b))
  ------------------
  964|  1.74k|		break;
  965|       |
  966|  26.1k|	case FILE_SEARCH:
  ------------------
  |  |  265|  26.1k|#define				FILE_SEARCH		20
  ------------------
  |  Branch (966:2): [True: 26.1k, False: 901k]
  ------------------
  967|  26.1k|		vlen = (m->str_flags & REGEX_OFFSET_START) == 0 ? m->vallen : 0;
  ------------------
  |  |  382|  26.1k|#define str_flags _u._s._flags
  ------------------
              		vlen = (m->str_flags & REGEX_OFFSET_START) == 0 ? m->vallen : 0;
  ------------------
  |  |  400|  26.1k|#define REGEX_OFFSET_START			BIT(4)
  |  |  ------------------
  |  |  |  |  395|  26.1k|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (967:10): [True: 25.9k, False: 134]
  ------------------
  968|  26.1k|		o = CAST(int32_t, ms->search.offset + vlen - offset);
  ------------------
  |  |  452|  26.1k|#define CAST(T, b)	((T)(b))
  ------------------
  969|  26.1k|		break;
  970|       |
  971|  1.49k|	case FILE_CLEAR:
  ------------------
  |  |  292|  1.49k|#define				FILE_CLEAR		47
  ------------------
  |  Branch (971:2): [True: 1.49k, False: 925k]
  ------------------
  972|  8.62k|	case FILE_DEFAULT:
  ------------------
  |  |  248|  8.62k|#define				FILE_DEFAULT		3
  ------------------
  |  Branch (972:2): [True: 7.13k, False: 920k]
  ------------------
  973|  24.5k|	case FILE_INDIRECT:
  ------------------
  |  |  286|  24.5k|#define				FILE_INDIRECT		41
  ------------------
  |  Branch (973:2): [True: 15.8k, False: 911k]
  ------------------
  974|  24.6k|	case FILE_OFFSET:
  ------------------
  |  |  297|  24.6k|#define				FILE_OFFSET		52
  ------------------
  |  Branch (974:2): [True: 163, False: 927k]
  ------------------
  975|  41.3k|	case FILE_USE:
  ------------------
  |  |  291|  41.3k|#define				FILE_USE		46
  ------------------
  |  Branch (975:2): [True: 16.6k, False: 910k]
  ------------------
  976|  41.3k|		o = ms->offset;
  977|  41.3k|		break;
  978|       |
  979|  32.6k|	case FILE_DER:
  ------------------
  |  |  293|  32.6k|#define				FILE_DER		48
  ------------------
  |  Branch (979:2): [True: 32.6k, False: 894k]
  ------------------
  980|  32.6k|		o = der_offs(ms, m, nbytes);
  981|  32.6k|		if (o == -1 || CAST(size_t, o) > nbytes) {
  ------------------
  |  |  452|  32.6k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (981:7): [True: 0, False: 32.6k]
  |  Branch (981:18): [True: 0, False: 32.6k]
  ------------------
  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|  32.6k|		break;
  991|       |
  992|  32.6k|	case FILE_BEGUID:
  ------------------
  |  |  296|     62|#define				FILE_BEGUID		51
  ------------------
  |  Branch (992:2): [True: 62, False: 927k]
  ------------------
  993|     62|	case FILE_LEGUID:
  ------------------
  |  |  295|     62|#define				FILE_LEGUID		50
  ------------------
  |  Branch (993:2): [True: 0, False: 927k]
  ------------------
  994|    243|	case FILE_GUID:
  ------------------
  |  |  294|    243|#define				FILE_GUID		49
  ------------------
  |  Branch (994:2): [True: 181, False: 927k]
  ------------------
  995|    243|		o = CAST(int32_t, (ms->offset + 2 * sizeof(uint64_t)));
  ------------------
  |  |  452|    243|#define CAST(T, b)	((T)(b))
  ------------------
  996|    243|		break;
  997|       |
  998|  54.0k|	default:
  ------------------
  |  Branch (998:2): [True: 54.0k, False: 873k]
  ------------------
  999|  54.0k|		o = 0;
 1000|  54.0k|		break;
 1001|   927k|	}
 1002|       |
 1003|   927k|	if (CAST(size_t, o) > nbytes) {
  ------------------
  |  |  452|   927k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (1003:6): [True: 27.0k, False: 900k]
  ------------------
 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.0k|		return -1;
 1009|  27.0k|	}
 1010|   900k|	*op = o;
 1011|   900k|	return 1;
 1012|   927k|}

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

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|  7.61k|extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
   50|  7.61k|  if (size < 1)
  ------------------
  |  Branch (50:7): [True: 0, False: 7.61k]
  ------------------
   51|      0|    return 0;
   52|  7.61k|  magic_buffer(env->magic, data, size);
   53|  7.61k|  return 0;
   54|  7.61k|}
_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|  }

