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|   125M|{
 1654|   125M|	if (!(m->flag & UNSIGNED)) {
  ------------------
  |  |  229|   125M|#define UNSIGNED	0x08	/* comparison is unsigned */
  ------------------
  |  Branch (1654:6): [True: 118M, False: 7.51M]
  ------------------
 1655|   118M|		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: 117M]
  ------------------
 1662|  1.20M|			v = CAST(signed char,  v);
  ------------------
  |  |  452|  1.20M|#define CAST(T, b)	((T)(b))
  ------------------
 1663|  1.20M|			break;
 1664|  2.26M|		case FILE_SHORT:
  ------------------
  |  |  247|  2.26M|#define				FILE_SHORT		2
  ------------------
  |  Branch (1664:3): [True: 2.26M, False: 116M]
  ------------------
 1665|  7.08M|		case FILE_BESHORT:
  ------------------
  |  |  252|  7.08M|#define				FILE_BESHORT		7
  ------------------
  |  Branch (1665:3): [True: 4.82M, False: 113M]
  ------------------
 1666|  11.1M|		case FILE_LESHORT:
  ------------------
  |  |  255|  11.1M|#define				FILE_LESHORT		10
  ------------------
  |  Branch (1666:3): [True: 4.04M, False: 114M]
  ------------------
 1667|  11.1M|			v = CAST(short, v);
  ------------------
  |  |  452|  11.1M|#define CAST(T, b)	((T)(b))
  ------------------
 1668|  11.1M|			break;
 1669|      0|		case FILE_DATE:
  ------------------
  |  |  251|      0|#define				FILE_DATE		6
  ------------------
  |  Branch (1669:3): [True: 0, False: 118M]
  ------------------
 1670|    508|		case FILE_BEDATE:
  ------------------
  |  |  254|    508|#define				FILE_BEDATE		9
  ------------------
  |  Branch (1670:3): [True: 508, False: 118M]
  ------------------
 1671|    703|		case FILE_LEDATE:
  ------------------
  |  |  257|    703|#define				FILE_LEDATE		12
  ------------------
  |  Branch (1671:3): [True: 195, False: 118M]
  ------------------
 1672|    878|		case FILE_MEDATE:
  ------------------
  |  |  266|    878|#define				FILE_MEDATE		21
  ------------------
  |  Branch (1672:3): [True: 175, False: 118M]
  ------------------
 1673|    878|		case FILE_LDATE:
  ------------------
  |  |  259|    878|#define				FILE_LDATE		14
  ------------------
  |  Branch (1673:3): [True: 0, False: 118M]
  ------------------
 1674|  1.18k|		case FILE_BELDATE:
  ------------------
  |  |  260|  1.18k|#define				FILE_BELDATE		15
  ------------------
  |  Branch (1674:3): [True: 308, False: 118M]
  ------------------
 1675|  1.27k|		case FILE_LELDATE:
  ------------------
  |  |  261|  1.27k|#define				FILE_LELDATE		16
  ------------------
  |  Branch (1675:3): [True: 87, False: 118M]
  ------------------
 1676|  1.27k|		case FILE_MELDATE:
  ------------------
  |  |  267|  1.27k|#define				FILE_MELDATE		22
  ------------------
  |  Branch (1676:3): [True: 0, False: 118M]
  ------------------
 1677|  1.94M|		case FILE_LONG:
  ------------------
  |  |  249|  1.94M|#define				FILE_LONG		4
  ------------------
  |  Branch (1677:3): [True: 1.94M, False: 116M]
  ------------------
 1678|  16.9M|		case FILE_BELONG:
  ------------------
  |  |  253|  16.9M|#define				FILE_BELONG		8
  ------------------
  |  Branch (1678:3): [True: 14.9M, False: 103M]
  ------------------
 1679|  22.7M|		case FILE_LELONG:
  ------------------
  |  |  256|  22.7M|#define				FILE_LELONG		11
  ------------------
  |  Branch (1679:3): [True: 5.86M, False: 112M]
  ------------------
 1680|  22.7M|		case FILE_MELONG:
  ------------------
  |  |  268|  22.7M|#define				FILE_MELONG		23
  ------------------
  |  Branch (1680:3): [True: 82, False: 118M]
  ------------------
 1681|  22.7M|		case FILE_FLOAT:
  ------------------
  |  |  278|  22.7M|#define				FILE_FLOAT		33
  ------------------
  |  Branch (1681:3): [True: 0, False: 118M]
  ------------------
 1682|  22.7M|		case FILE_BEFLOAT:
  ------------------
  |  |  279|  22.7M|#define				FILE_BEFLOAT		34
  ------------------
  |  Branch (1682:3): [True: 0, False: 118M]
  ------------------
 1683|  22.7M|		case FILE_LEFLOAT:
  ------------------
  |  |  280|  22.7M|#define				FILE_LEFLOAT		35
  ------------------
  |  Branch (1683:3): [True: 0, False: 118M]
  ------------------
 1684|  22.7M|		case FILE_MSDOSDATE:
  ------------------
  |  |  300|  22.7M|#define				FILE_MSDOSDATE		55
  ------------------
  |  Branch (1684:3): [True: 0, False: 118M]
  ------------------
 1685|  22.7M|		case FILE_BEMSDOSDATE:
  ------------------
  |  |  302|  22.7M|#define				FILE_BEMSDOSDATE	57
  ------------------
  |  Branch (1685:3): [True: 0, False: 118M]
  ------------------
 1686|  22.7M|		case FILE_LEMSDOSDATE:
  ------------------
  |  |  301|  22.7M|#define				FILE_LEMSDOSDATE	56
  ------------------
  |  Branch (1686:3): [True: 135, False: 118M]
  ------------------
 1687|  22.7M|		case FILE_MSDOSTIME:
  ------------------
  |  |  303|  22.7M|#define				FILE_MSDOSTIME		58
  ------------------
  |  Branch (1687:3): [True: 0, False: 118M]
  ------------------
 1688|  22.7M|		case FILE_BEMSDOSTIME:
  ------------------
  |  |  305|  22.7M|#define				FILE_BEMSDOSTIME	60
  ------------------
  |  Branch (1688:3): [True: 0, False: 118M]
  ------------------
 1689|  22.7M|		case FILE_LEMSDOSTIME:
  ------------------
  |  |  304|  22.7M|#define				FILE_LEMSDOSTIME	59
  ------------------
  |  Branch (1689:3): [True: 135, False: 118M]
  ------------------
 1690|  22.7M|			v = CAST(int32_t, v);
  ------------------
  |  |  452|  22.7M|#define CAST(T, b)	((T)(b))
  ------------------
 1691|  22.7M|			break;
 1692|  83.7k|		case FILE_QUAD:
  ------------------
  |  |  269|  83.7k|#define				FILE_QUAD		24
  ------------------
  |  Branch (1692:3): [True: 83.7k, False: 118M]
  ------------------
 1693|  1.02M|		case FILE_BEQUAD:
  ------------------
  |  |  271|  1.02M|#define				FILE_BEQUAD		26
  ------------------
  |  Branch (1693:3): [True: 943k, False: 117M]
  ------------------
 1694|  1.52M|		case FILE_LEQUAD:
  ------------------
  |  |  270|  1.52M|#define				FILE_LEQUAD		25
  ------------------
  |  Branch (1694:3): [True: 492k, False: 117M]
  ------------------
 1695|  1.52M|		case FILE_QDATE:
  ------------------
  |  |  272|  1.52M|#define				FILE_QDATE		27
  ------------------
  |  Branch (1695:3): [True: 0, False: 118M]
  ------------------
 1696|  1.52M|		case FILE_QLDATE:
  ------------------
  |  |  275|  1.52M|#define				FILE_QLDATE		30
  ------------------
  |  Branch (1696:3): [True: 0, False: 118M]
  ------------------
 1697|  1.52M|		case FILE_QWDATE:
  ------------------
  |  |  287|  1.52M|#define				FILE_QWDATE		42
  ------------------
  |  Branch (1697:3): [True: 115, False: 118M]
  ------------------
 1698|  1.52M|		case FILE_BEQDATE:
  ------------------
  |  |  274|  1.52M|#define				FILE_BEQDATE		29
  ------------------
  |  Branch (1698:3): [True: 1.29k, False: 118M]
  ------------------
 1699|  1.52M|		case FILE_BEQLDATE:
  ------------------
  |  |  277|  1.52M|#define				FILE_BEQLDATE		32
  ------------------
  |  Branch (1699:3): [True: 201, False: 118M]
  ------------------
 1700|  1.52M|		case FILE_BEQWDATE:
  ------------------
  |  |  289|  1.52M|#define				FILE_BEQWDATE		44
  ------------------
  |  Branch (1700:3): [True: 0, False: 118M]
  ------------------
 1701|  1.52M|		case FILE_LEQDATE:
  ------------------
  |  |  273|  1.52M|#define				FILE_LEQDATE		28
  ------------------
  |  Branch (1701:3): [True: 37, False: 118M]
  ------------------
 1702|  1.52M|		case FILE_LEQLDATE:
  ------------------
  |  |  276|  1.52M|#define				FILE_LEQLDATE		31
  ------------------
  |  Branch (1702:3): [True: 446, False: 118M]
  ------------------
 1703|  1.52M|		case FILE_LEQWDATE:
  ------------------
  |  |  288|  1.52M|#define				FILE_LEQWDATE		43
  ------------------
  |  Branch (1703:3): [True: 1.87k, False: 118M]
  ------------------
 1704|  1.52M|		case FILE_DOUBLE:
  ------------------
  |  |  281|  1.52M|#define				FILE_DOUBLE		36
  ------------------
  |  Branch (1704:3): [True: 0, False: 118M]
  ------------------
 1705|  1.52M|		case FILE_BEDOUBLE:
  ------------------
  |  |  282|  1.52M|#define				FILE_BEDOUBLE		37
  ------------------
  |  Branch (1705:3): [True: 0, False: 118M]
  ------------------
 1706|  1.52M|		case FILE_LEDOUBLE:
  ------------------
  |  |  283|  1.52M|#define				FILE_LEDOUBLE		38
  ------------------
  |  Branch (1706:3): [True: 0, False: 118M]
  ------------------
 1707|  1.52M|		case FILE_OFFSET:
  ------------------
  |  |  297|  1.52M|#define				FILE_OFFSET		52
  ------------------
  |  Branch (1707:3): [True: 4.34k, False: 118M]
  ------------------
 1708|  1.52M|		case FILE_BEVARINT:
  ------------------
  |  |  298|  1.52M|#define				FILE_BEVARINT		53
  ------------------
  |  Branch (1708:3): [True: 0, False: 118M]
  ------------------
 1709|  1.52M|		case FILE_LEVARINT:
  ------------------
  |  |  299|  1.52M|#define				FILE_LEVARINT		54
  ------------------
  |  Branch (1709:3): [True: 0, False: 118M]
  ------------------
 1710|  1.52M|			v = CAST(int64_t, v);
  ------------------
  |  |  452|  1.52M|#define CAST(T, b)	((T)(b))
  ------------------
 1711|  1.52M|			break;
 1712|  80.2M|		case FILE_STRING:
  ------------------
  |  |  250|  80.2M|#define				FILE_STRING		5
  ------------------
  |  Branch (1712:3): [True: 80.2M, False: 38.1M]
  ------------------
 1713|  80.3M|		case FILE_PSTRING:
  ------------------
  |  |  258|  80.3M|#define				FILE_PSTRING		13
  ------------------
  |  Branch (1713:3): [True: 35.9k, False: 118M]
  ------------------
 1714|  80.3M|		case FILE_BESTRING16:
  ------------------
  |  |  263|  80.3M|#define				FILE_BESTRING16		18
  ------------------
  |  Branch (1714:3): [True: 85, False: 118M]
  ------------------
 1715|  80.4M|		case FILE_LESTRING16:
  ------------------
  |  |  264|  80.4M|#define				FILE_LESTRING16		19
  ------------------
  |  Branch (1715:3): [True: 82.5k, False: 118M]
  ------------------
 1716|  80.7M|		case FILE_REGEX:
  ------------------
  |  |  262|  80.7M|#define				FILE_REGEX		17
  ------------------
  |  Branch (1716:3): [True: 324k, False: 118M]
  ------------------
 1717|  81.4M|		case FILE_SEARCH:
  ------------------
  |  |  265|  81.4M|#define				FILE_SEARCH		20
  ------------------
  |  Branch (1717:3): [True: 722k, False: 117M]
  ------------------
 1718|  81.4M|		case FILE_DEFAULT:
  ------------------
  |  |  248|  81.4M|#define				FILE_DEFAULT		3
  ------------------
  |  Branch (1718:3): [True: 8.32k, False: 118M]
  ------------------
 1719|  81.4M|		case FILE_INDIRECT:
  ------------------
  |  |  286|  81.4M|#define				FILE_INDIRECT		41
  ------------------
  |  Branch (1719:3): [True: 0, False: 118M]
  ------------------
 1720|  81.4M|		case FILE_NAME:
  ------------------
  |  |  290|  81.4M|#define				FILE_NAME		45
  ------------------
  |  Branch (1720:3): [True: 0, False: 118M]
  ------------------
 1721|  81.4M|		case FILE_USE:
  ------------------
  |  |  291|  81.4M|#define				FILE_USE		46
  ------------------
  |  Branch (1721:3): [True: 0, False: 118M]
  ------------------
 1722|  81.4M|		case FILE_CLEAR:
  ------------------
  |  |  292|  81.4M|#define				FILE_CLEAR		47
  ------------------
  |  Branch (1722:3): [True: 1.44k, False: 118M]
  ------------------
 1723|  81.4M|		case FILE_DER:
  ------------------
  |  |  293|  81.4M|#define				FILE_DER		48
  ------------------
  |  Branch (1723:3): [True: 0, False: 118M]
  ------------------
 1724|  81.7M|		case FILE_GUID:
  ------------------
  |  |  294|  81.7M|#define				FILE_GUID		49
  ------------------
  |  Branch (1724:3): [True: 284k, False: 118M]
  ------------------
 1725|  81.7M|		case FILE_LEGUID:
  ------------------
  |  |  295|  81.7M|#define				FILE_LEGUID		50
  ------------------
  |  Branch (1725:3): [True: 0, False: 118M]
  ------------------
 1726|  81.7M|		case FILE_BEGUID:
  ------------------
  |  |  296|  81.7M|#define				FILE_BEGUID		51
  ------------------
  |  Branch (1726:3): [True: 0, False: 118M]
  ------------------
 1727|  81.7M|		case FILE_OCTAL:
  ------------------
  |  |  306|  81.7M|#define				FILE_OCTAL		61
  ------------------
  |  Branch (1727:3): [True: 0, False: 118M]
  ------------------
 1728|  81.7M|			break;
 1729|      0|		default:
  ------------------
  |  Branch (1729:3): [True: 0, False: 118M]
  ------------------
 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|   118M|		}
 1735|   118M|	}
 1736|   125M|	return v;
 1737|   125M|}
file_pstring_length_size:
 3630|  43.4k|{
 3631|  43.4k|	switch (m->str_flags & PSTRING_LEN) {
  ------------------
  |  |  382|  43.4k|#define str_flags _u._s._flags
  ------------------
              	switch (m->str_flags & PSTRING_LEN) {
  ------------------
  |  |  411|  43.4k|    (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
  |  |  ------------------
  |  |  |  |  403|  43.4k|#define PSTRING_1_BE				BIT(7)
  |  |  |  |  ------------------
  |  |  |  |  |  |  395|  43.4k|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
  |  |  ------------------
  |  |  |  |  406|  43.4k|#define PSTRING_2_LE				BIT(9)
  |  |  |  |  ------------------
  |  |  |  |  |  |  395|  43.4k|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
  |  |  ------------------
  |  |  |  |  405|  43.4k|#define PSTRING_2_BE				BIT(8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  395|  43.4k|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
  |  |  ------------------
  |  |  |  |  408|  43.4k|#define PSTRING_4_LE				BIT(11)
  |  |  |  |  ------------------
  |  |  |  |  |  |  395|  43.4k|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
  |  |  ------------------
  |  |  |  |  407|  43.4k|#define PSTRING_4_BE				BIT(10)
  |  |  |  |  ------------------
  |  |  |  |  |  |  395|  43.4k|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3632|  33.9k|	case PSTRING_1_LE:
  ------------------
  |  |  404|  33.9k|#define PSTRING_1_LE				BIT(7)
  |  |  ------------------
  |  |  |  |  395|  33.9k|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (3632:2): [True: 33.9k, False: 9.49k]
  ------------------
 3633|  33.9k|		return 1;
 3634|    378|	case PSTRING_2_LE:
  ------------------
  |  |  406|    378|#define PSTRING_2_LE				BIT(9)
  |  |  ------------------
  |  |  |  |  395|    378|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (3634:2): [True: 378, False: 43.0k]
  ------------------
 3635|  8.51k|	case PSTRING_2_BE:
  ------------------
  |  |  405|  8.51k|#define PSTRING_2_BE				BIT(8)
  |  |  ------------------
  |  |  |  |  395|  8.51k|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (3635:2): [True: 8.13k, False: 35.3k]
  ------------------
 3636|  8.51k|		return 2;
 3637|    573|	case PSTRING_4_LE:
  ------------------
  |  |  408|    573|#define PSTRING_4_LE				BIT(11)
  |  |  ------------------
  |  |  |  |  395|    573|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (3637:2): [True: 573, False: 42.8k]
  ------------------
 3638|    984|	case PSTRING_4_BE:
  ------------------
  |  |  407|    984|#define PSTRING_4_BE				BIT(10)
  |  |  ------------------
  |  |  |  |  395|    984|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (3638:2): [True: 411, False: 43.0k]
  ------------------
 3639|    984|		return 4;
 3640|      0|	default:
  ------------------
  |  Branch (3640:2): [True: 0, False: 43.4k]
  ------------------
 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|  43.4k|	}
 3646|  43.4k|}
file_pstring_get_length:
 3651|  36.0k|{
 3652|  36.0k|	size_t len = 0;
 3653|  36.0k|	const unsigned char *s = RCAST(const unsigned char *, ss);
  ------------------
  |  |  453|  36.0k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 3654|  36.0k|	unsigned int s3, s2, s1, s0;
 3655|       |
 3656|  36.0k|	switch (m->str_flags & PSTRING_LEN) {
  ------------------
  |  |  382|  36.0k|#define str_flags _u._s._flags
  ------------------
              	switch (m->str_flags & PSTRING_LEN) {
  ------------------
  |  |  411|  36.0k|    (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
  |  |  ------------------
  |  |  |  |  403|  36.0k|#define PSTRING_1_BE				BIT(7)
  |  |  |  |  ------------------
  |  |  |  |  |  |  395|  36.0k|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
  |  |  ------------------
  |  |  |  |  406|  36.0k|#define PSTRING_2_LE				BIT(9)
  |  |  |  |  ------------------
  |  |  |  |  |  |  395|  36.0k|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
  |  |  ------------------
  |  |  |  |  405|  36.0k|#define PSTRING_2_BE				BIT(8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  395|  36.0k|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
  |  |  ------------------
  |  |  |  |  408|  36.0k|#define PSTRING_4_LE				BIT(11)
  |  |  |  |  ------------------
  |  |  |  |  |  |  395|  36.0k|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
  |  |  ------------------
  |  |  |  |  407|  36.0k|#define PSTRING_4_BE				BIT(10)
  |  |  |  |  ------------------
  |  |  |  |  |  |  395|  36.0k|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3657|  33.5k|	case PSTRING_1_LE:
  ------------------
  |  |  404|  33.5k|#define PSTRING_1_LE				BIT(7)
  |  |  ------------------
  |  |  |  |  395|  33.5k|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (3657:2): [True: 33.5k, False: 2.53k]
  ------------------
 3658|  33.5k|		len = *s;
 3659|  33.5k|		break;
 3660|    126|	case PSTRING_2_LE:
  ------------------
  |  |  406|    126|#define PSTRING_2_LE				BIT(9)
  |  |  ------------------
  |  |  |  |  395|    126|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (3660:2): [True: 126, False: 35.9k]
  ------------------
 3661|    126|		s0 = s[0];
 3662|    126|		s1 = s[1];
 3663|    126|		len = (s1 << 8) | s0;
 3664|    126|		break;
 3665|  2.07k|	case PSTRING_2_BE:
  ------------------
  |  |  405|  2.07k|#define PSTRING_2_BE				BIT(8)
  |  |  ------------------
  |  |  |  |  395|  2.07k|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (3665:2): [True: 2.07k, False: 33.9k]
  ------------------
 3666|  2.07k|		s0 = s[0];
 3667|  2.07k|		s1 = s[1];
 3668|  2.07k|		len = (s0 << 8) | s1;
 3669|  2.07k|		break;
 3670|    193|	case PSTRING_4_LE:
  ------------------
  |  |  408|    193|#define PSTRING_4_LE				BIT(11)
  |  |  ------------------
  |  |  |  |  395|    193|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (3670:2): [True: 193, False: 35.8k]
  ------------------
 3671|    193|		s0 = s[0];
 3672|    193|		s1 = s[1];
 3673|    193|		s2 = s[2];
 3674|    193|		s3 = s[3];
 3675|    193|		len = (s3 << 24) | (s2 << 16) | (s1 << 8) | s0;
 3676|    193|		break;
 3677|    137|	case PSTRING_4_BE:
  ------------------
  |  |  407|    137|#define PSTRING_4_BE				BIT(10)
  |  |  ------------------
  |  |  |  |  395|    137|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (3677:2): [True: 137, False: 35.9k]
  ------------------
 3678|    137|		s0 = s[0];
 3679|    137|		s1 = s[1];
 3680|    137|		s2 = s[2];
 3681|    137|		s3 = s[3];
 3682|    137|		len = (s0 << 24) | (s1 << 16) | (s2 << 8) | s3;
 3683|    137|		break;
 3684|      0|	default:
  ------------------
  |  Branch (3684:2): [True: 0, False: 36.0k]
  ------------------
 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.0k|	}
 3690|       |
 3691|  36.0k|	if (m->str_flags & PSTRING_LENGTH_INCLUDES_ITSELF) {
  ------------------
  |  |  382|  36.0k|#define str_flags _u._s._flags
  ------------------
              	if (m->str_flags & PSTRING_LENGTH_INCLUDES_ITSELF) {
  ------------------
  |  |  412|  36.0k|#define PSTRING_LENGTH_INCLUDES_ITSELF		BIT(12)
  |  |  ------------------
  |  |  |  |  395|  36.0k|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (3691:6): [True: 2.05k, False: 34.0k]
  ------------------
 3692|  2.05k|		size_t l = file_pstring_length_size(ms, m);
 3693|  2.05k|		if (l == FILE_BADSIZE)
  ------------------
  |  |  175|  2.05k|#define FILE_BADSIZE CAST(size_t, ~0ul)
  |  |  ------------------
  |  |  |  |  452|  2.05k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (3693:7): [True: 0, False: 2.05k]
  ------------------
 3694|      0|			return l;
 3695|  2.05k|		len -= l;
 3696|  2.05k|	}
 3697|       |
 3698|  36.0k|	return len;
 3699|  36.0k|}
file_magicfind:
 3703|  46.1k|{
 3704|  46.1k|	uint32_t i, j;
 3705|  46.1k|	struct mlist *mlist, *ml;
 3706|       |
 3707|  46.1k|	mlist = ms->mlist[1];
 3708|       |
 3709|  46.1k|	for (ml = mlist->next; ml != mlist; ml = ml->next) {
  ------------------
  |  Branch (3709:25): [True: 46.1k, False: 0]
  ------------------
 3710|  46.1k|		struct magic *ma = ml->magic;
 3711|   128M|		for (i = 0; i < ml->nmagic; i++) {
  ------------------
  |  Branch (3711:15): [True: 128M, False: 0]
  ------------------
 3712|   128M|			if (ma[i].type != FILE_NAME)
  ------------------
  |  |  290|   128M|#define				FILE_NAME		45
  ------------------
  |  Branch (3712:8): [True: 122M, False: 6.28M]
  ------------------
 3713|   122M|				continue;
 3714|  6.28M|			if (strcmp(ma[i].value.s, name) == 0) {
  ------------------
  |  Branch (3714:8): [True: 46.1k, False: 6.24M]
  ------------------
 3715|  46.1k|				v->magic = &ma[i];
 3716|  46.1k|				v->magic_rxcomp = &(ml->magic_rxcomp[i]);
 3717|   966k|				for (j = i + 1; j < ml->nmagic; j++)
  ------------------
  |  Branch (3717:21): [True: 966k, False: 77]
  ------------------
 3718|   966k|				    if (ma[j].cont_level == 0)
  ------------------
  |  Branch (3718:13): [True: 46.0k, False: 920k]
  ------------------
 3719|  46.0k|					    break;
 3720|  46.1k|				v->nmagic = j - i;
 3721|  46.1k|				return 0;
 3722|  46.1k|			}
 3723|  6.28M|		}
 3724|  46.1k|	}
 3725|      0|	return -1;
 3726|  46.1k|}
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)
  ------------------
  |  |  727|      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,
  ------------------
  |  |  371|      0|#define VERSION "5.47"
  ------------------
 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: 5.21k, False: 5.93k]
  |  Branch (88:23): [True: 1.09k, False: 4.12k]
  ------------------
   89|  1.09k|		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.76k, False: 2.38k]
  ------------------
   93|  11.1k|	    &type) == 0)
   94|  8.76k|		rv = 0;
   95|  2.38k|        else
   96|  2.38k|		rv = file_ascmagic_with_encoding(ms, &bb,
   97|  2.38k|		    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.38k|{
  109|  2.38k|	struct buffer bb;
  110|  2.38k|	const unsigned char *buf = CAST(const unsigned char *, b->fbuf);
  ------------------
  |  |  452|  2.38k|#define CAST(T, b)	((T)(b))
  ------------------
  111|  2.38k|	size_t nbytes = b->flen;
  112|  2.38k|	unsigned char *utf8_buf = NULL, *utf8_end;
  113|  2.38k|	size_t mlen, i, len;
  114|  2.38k|	int rv = -1;
  115|  2.38k|	int mime = ms->flags & MAGIC_MIME;
  ------------------
  |  |   44|  2.38k|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   37|  2.38k|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  ------------------
  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   43|  2.38k|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  ------------------
  ------------------
  116|  2.38k|	int need_separator = 0;
  117|       |
  118|  2.38k|	const char *subtype = NULL;
  119|       |
  120|  2.38k|	int has_escapes = 0;
  121|  2.38k|	int has_backspace = 0;
  122|  2.38k|	int seen_cr = 0;
  123|       |
  124|  2.38k|	size_t n_crlf = 0;
  125|  2.38k|	size_t n_lf = 0;
  126|  2.38k|	size_t n_cr = 0;
  127|  2.38k|	size_t n_nel = 0;
  128|  2.38k|	int executable = 0;
  129|       |
  130|  2.38k|	size_t last_line_end = CAST(size_t, -1);
  ------------------
  |  |  452|  2.38k|#define CAST(T, b)	((T)(b))
  ------------------
  131|  2.38k|	size_t has_long_lines = 0;
  132|       |
  133|  2.38k|	nbytes = trim_nuls(buf, nbytes);
  134|       |
  135|       |	/* If we have fewer than 2 bytes, give up. */
  136|  2.38k|	if (nbytes <= 1) {
  ------------------
  |  Branch (136:6): [True: 21, False: 2.36k]
  ------------------
  137|     21|		rv = 0;
  138|     21|		goto done;
  139|     21|	}
  140|       |
  141|  2.36k|	if (ulen > 0 && (ms->flags & MAGIC_NO_CHECK_SOFT) == 0) {
  ------------------
  |  |   56|  2.27k|#define	MAGIC_NO_CHECK_SOFT	0x0004000 /* Don't check magic entries */
  ------------------
  |  Branch (141:6): [True: 2.27k, False: 83]
  |  Branch (141:18): [True: 2.27k, 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.27k|		if (ulen > SIZE_MAX / 6) {
  ------------------
  |  Branch (145:7): [True: 0, False: 2.27k]
  ------------------
  146|      0|			goto done;
  147|      0|		}
  148|  2.27k|		mlen = ulen * 6;
  149|  2.27k|		if ((utf8_buf = CAST(unsigned char *, malloc(mlen))) == NULL) {
  ------------------
  |  |  452|  2.27k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (149:7): [True: 0, False: 2.27k]
  ------------------
  150|      0|			file_oomem(ms, mlen);
  151|      0|			goto done;
  152|      0|		}
  153|  2.27k|		if ((utf8_end = encode_utf8(utf8_buf, mlen, ubuf, ulen))
  ------------------
  |  Branch (153:7): [True: 41, False: 2.23k]
  ------------------
  154|  2.27k|		    == NULL) {
  155|     41|			rv = 0;
  156|     41|			goto done;
  157|     41|		}
  158|  2.23k|		buffer_init(&bb, b->fd, &b->st, utf8_buf,
  159|  2.23k|		    CAST(size_t, utf8_end - utf8_buf));
  ------------------
  |  |  452|  2.23k|#define CAST(T, b)	((T)(b))
  ------------------
  160|       |
  161|  2.23k|		if ((rv = file_softmagic(ms, &bb, NULL, NULL,
  ------------------
  |  Branch (161:7): [True: 2.11k, False: 122]
  ------------------
  162|  2.23k|		    TEXTTEST, text)) == 0)
  ------------------
  |  |  233|  2.23k|#define TEXTTEST	0x40	/* for passing to file_softmagic */
  ------------------
  163|  2.11k|			rv = -1;
  164|    122|		else
  165|    122|			need_separator = 1;
  166|  2.23k|		buffer_fini(&bb);
  167|  2.23k|		if ((ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION))) {
  ------------------
  |  |   45|  2.23k|#define	MAGIC_APPLE		0x0000800 /* Return the Apple creator/type */
  ------------------
              		if ((ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION))) {
  ------------------
  |  |   46|  2.23k|#define	MAGIC_EXTENSION		0x1000000 /* Return a /-separated list of
  ------------------
  |  Branch (167:7): [True: 0, False: 2.23k]
  ------------------
  168|      0|			rv = rv == -1 ? 0 : 1;
  ------------------
  |  Branch (168:9): [True: 0, False: 0]
  ------------------
  169|      0|			goto done;
  170|      0|		}
  171|  2.23k|	}
  172|       |
  173|  2.32k|	if ((ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION))) {
  ------------------
  |  |   45|  2.32k|#define	MAGIC_APPLE		0x0000800 /* Return the Apple creator/type */
  ------------------
              	if ((ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION))) {
  ------------------
  |  |   46|  2.32k|#define	MAGIC_EXTENSION		0x1000000 /* Return a /-separated list of
  ------------------
  |  Branch (173:6): [True: 0, False: 2.32k]
  ------------------
  174|      0|		rv = 0;
  175|      0|		goto done;
  176|      0|	}
  177|       |
  178|       |	/* Now try to discover other details about the file. */
  179|  17.1M|	for (i = 0; i < ulen; i++) {
  ------------------
  |  Branch (179:14): [True: 17.1M, False: 2.32k]
  ------------------
  180|  17.1M|		if (ubuf[i] == '\n') {
  ------------------
  |  Branch (180:7): [True: 980k, False: 16.1M]
  ------------------
  181|   980k|			if (seen_cr)
  ------------------
  |  Branch (181:8): [True: 66.4k, False: 914k]
  ------------------
  182|  66.4k|				n_crlf++;
  183|   914k|			else
  184|   914k|				n_lf++;
  185|   980k|			last_line_end = i;
  186|  16.1M|		} else if (seen_cr)
  ------------------
  |  Branch (186:14): [True: 623k, False: 15.5M]
  ------------------
  187|   623k|			n_cr++;
  188|       |
  189|  17.1M|		seen_cr = (ubuf[i] == '\r');
  190|  17.1M|		if (seen_cr)
  ------------------
  |  Branch (190:7): [True: 689k, False: 16.4M]
  ------------------
  191|   689k|			last_line_end = i;
  192|       |
  193|  17.1M|		if (ubuf[i] == 0x85) { /* X3.64/ECMA-43 "next line" character */
  ------------------
  |  Branch (193:7): [True: 687k, False: 16.4M]
  ------------------
  194|   687k|			n_nel++;
  195|   687k|			last_line_end = i;
  196|   687k|		}
  197|       |
  198|       |		/* If this line is _longer_ than MAXLINELEN, remember it. */
  199|  17.1M|		if (i > last_line_end + MAXLINELEN) {
  ------------------
  |  |   49|  17.1M|#define MAXLINELEN 300	/* longest sane line length */
  ------------------
  |  Branch (199:7): [True: 13.8M, False: 3.35M]
  ------------------
  200|  13.8M|			size_t ll = i - last_line_end;
  201|  13.8M|			if (ll > has_long_lines)
  ------------------
  |  Branch (201:8): [True: 13.7M, False: 3.26k]
  ------------------
  202|  13.7M|				has_long_lines = ll;
  203|  13.8M|		}
  204|       |
  205|  17.1M|		if (ubuf[i] == '\033')
  ------------------
  |  Branch (205:7): [True: 46.4k, False: 17.1M]
  ------------------
  206|  46.4k|			has_escapes = 1;
  207|  17.1M|		if (ubuf[i] == '\b')
  ------------------
  |  Branch (207:7): [True: 241k, False: 16.9M]
  ------------------
  208|   241k|			has_backspace = 1;
  209|  17.1M|	}
  210|       |
  211|  2.32k|	if (strcmp(type, "binary") == 0) {
  ------------------
  |  Branch (211:6): [True: 0, False: 2.32k]
  ------------------
  212|      0|		rv = 0;
  213|      0|		goto done;
  214|      0|	}
  215|  2.32k|	len = file_printedlen(ms);
  216|  2.32k|	if (mime) {
  ------------------
  |  Branch (216:6): [True: 0, False: 2.32k]
  ------------------
  217|      0|		if ((mime & MAGIC_MIME_TYPE) != 0) {
  ------------------
  |  |   37|      0|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  ------------------
  |  Branch (217:7): [True: 0, False: 0]
  ------------------
  218|      0|			if (len) {
  ------------------
  |  Branch (218:8): [True: 0, False: 0]
  ------------------
  219|       |				/*
  220|       |				 * Softmagic printed something, we
  221|       |				 * are either done, or we need a separator
  222|       |				 */
  223|      0|				if ((ms->flags & MAGIC_CONTINUE) == 0) {
  ------------------
  |  |   38|      0|#define	MAGIC_CONTINUE		0x0000020 /* Return all matches */
  ------------------
  |  Branch (223:9): [True: 0, False: 0]
  ------------------
  224|      0|					rv = 1;
  225|      0|					goto done;
  226|      0|				}
  227|      0|				if (need_separator && file_separator(ms) == -1)
  ------------------
  |  Branch (227:9): [True: 0, False: 0]
  |  Branch (227:27): [True: 0, False: 0]
  ------------------
  228|      0|					goto done;
  229|      0|			}
  230|      0|			if (file_printf(ms, "text/plain") == -1)
  ------------------
  |  Branch (230:8): [True: 0, False: 0]
  ------------------
  231|      0|				goto done;
  232|      0|		}
  233|  2.32k|	} else {
  234|  2.32k|		if (len) {
  ------------------
  |  Branch (234:7): [True: 817, False: 1.50k]
  ------------------
  235|    817|			switch (file_replace(ms, " text$", ", ")) {
  236|    779|			case 0:
  ------------------
  |  Branch (236:4): [True: 779, False: 38]
  ------------------
  237|    779|				switch (file_replace(ms, " text executable$",
  238|    779|				    ", ")) {
  239|    716|				case 0:
  ------------------
  |  Branch (239:5): [True: 716, False: 63]
  ------------------
  240|    716|					if (file_printf(ms, ", ") == -1)
  ------------------
  |  Branch (240:10): [True: 0, False: 716]
  ------------------
  241|      0|						goto done;
  242|    716|					break;
  243|    716|				case -1:
  ------------------
  |  Branch (243:5): [True: 0, False: 779]
  ------------------
  244|      0|					goto done;
  245|     63|				default:
  ------------------
  |  Branch (245:5): [True: 63, False: 716]
  ------------------
  246|     63|					executable = 1;
  247|     63|					break;
  248|    779|				}
  249|    779|				break;
  250|    779|			case -1:
  ------------------
  |  Branch (250:4): [True: 0, False: 817]
  ------------------
  251|      0|				goto done;
  252|     38|			default:
  ------------------
  |  Branch (252:4): [True: 38, False: 779]
  ------------------
  253|     38|				break;
  254|    817|			}
  255|    817|		}
  256|       |
  257|  2.32k|		if (file_printf(ms, "%s", code) == -1)
  ------------------
  |  Branch (257:7): [True: 0, False: 2.32k]
  ------------------
  258|      0|			goto done;
  259|       |
  260|  2.32k|		if (subtype) {
  ------------------
  |  Branch (260:7): [True: 0, False: 2.32k]
  ------------------
  261|      0|			if (file_printf(ms, " %s", subtype) == -1)
  ------------------
  |  Branch (261:8): [True: 0, False: 0]
  ------------------
  262|      0|				goto done;
  263|      0|		}
  264|       |
  265|  2.32k|		if (file_printf(ms, " %s", type) == -1)
  ------------------
  |  Branch (265:7): [True: 0, False: 2.32k]
  ------------------
  266|      0|			goto done;
  267|       |
  268|  2.32k|		if (executable)
  ------------------
  |  Branch (268:7): [True: 63, False: 2.25k]
  ------------------
  269|     63|			if (file_printf(ms, " executable") == -1)
  ------------------
  |  Branch (269:8): [True: 0, False: 63]
  ------------------
  270|      0|				goto done;
  271|       |
  272|  2.32k|		if (has_long_lines)
  ------------------
  |  Branch (272:7): [True: 315, False: 2.00k]
  ------------------
  273|    315|			if (file_printf(ms, ", with very long lines (%"
  ------------------
  |  Branch (273:8): [True: 0, False: 315]
  ------------------
  274|    315|			    SIZE_T_FORMAT "u)", has_long_lines) == -1)
  275|      0|				goto done;
  276|       |
  277|       |		/*
  278|       |		 * Only report line terminators if we find one other than LF,
  279|       |		 * or if we find none at all.
  280|       |		 */
  281|  2.32k|		if ((n_crlf == 0 && n_cr == 0 && n_nel == 0 && n_lf == 0) ||
  ------------------
  |  Branch (281:8): [True: 2.29k, False: 26]
  |  Branch (281:23): [True: 2.22k, False: 74]
  |  Branch (281:36): [True: 2.16k, False: 55]
  |  Branch (281:50): [True: 2.02k, False: 137]
  ------------------
  282|  2.18k|		    (n_crlf != 0 || n_cr != 0 || n_nel != 0)) {
  ------------------
  |  Branch (282:8): [True: 26, False: 266]
  |  Branch (282:23): [True: 74, False: 192]
  |  Branch (282:36): [True: 55, False: 137]
  ------------------
  283|  2.18k|			if (file_printf(ms, ", with") == -1)
  ------------------
  |  Branch (283:8): [True: 0, False: 2.18k]
  ------------------
  284|      0|				goto done;
  285|       |
  286|  2.18k|			if (n_crlf == 0 && n_cr == 0 &&
  ------------------
  |  Branch (286:8): [True: 2.15k, False: 26]
  |  Branch (286:23): [True: 2.08k, False: 74]
  ------------------
  287|  2.08k|			    n_nel == 0 && n_lf == 0) {
  ------------------
  |  Branch (287:8): [True: 2.02k, False: 55]
  |  Branch (287:22): [True: 2.02k, False: 0]
  ------------------
  288|  2.02k|				if (file_printf(ms, " no") == -1)
  ------------------
  |  Branch (288:9): [True: 0, False: 2.02k]
  ------------------
  289|      0|					goto done;
  290|  2.02k|			} else {
  291|    155|				if (n_crlf) {
  ------------------
  |  Branch (291:9): [True: 26, False: 129]
  ------------------
  292|     26|					if (file_printf(ms, " CRLF") == -1)
  ------------------
  |  Branch (292:10): [True: 0, False: 26]
  ------------------
  293|      0|						goto done;
  294|     26|					if (n_cr || n_lf || n_nel)
  ------------------
  |  Branch (294:10): [True: 7, False: 19]
  |  Branch (294:18): [True: 4, False: 15]
  |  Branch (294:26): [True: 3, False: 12]
  ------------------
  295|     14|						if (file_printf(ms, ",") == -1)
  ------------------
  |  Branch (295:11): [True: 0, False: 14]
  ------------------
  296|      0|							goto done;
  297|     26|				}
  298|    155|				if (n_cr) {
  ------------------
  |  Branch (298:9): [True: 81, False: 74]
  ------------------
  299|     81|					if (file_printf(ms, " CR") == -1)
  ------------------
  |  Branch (299:10): [True: 0, False: 81]
  ------------------
  300|      0|						goto done;
  301|     81|					if (n_lf || n_nel)
  ------------------
  |  Branch (301:10): [True: 7, False: 74]
  |  Branch (301:18): [True: 4, False: 70]
  ------------------
  302|     11|						if (file_printf(ms, ",") == -1)
  ------------------
  |  Branch (302:11): [True: 0, False: 11]
  ------------------
  303|      0|							goto done;
  304|     81|				}
  305|    155|				if (n_lf) {
  ------------------
  |  Branch (305:9): [True: 17, False: 138]
  ------------------
  306|     17|					if (file_printf(ms, " LF") == -1)
  ------------------
  |  Branch (306:10): [True: 0, False: 17]
  ------------------
  307|      0|						goto done;
  308|     17|					if (n_nel)
  ------------------
  |  Branch (308:10): [True: 6, False: 11]
  ------------------
  309|      6|						if (file_printf(ms, ",") == -1)
  ------------------
  |  Branch (309:11): [True: 0, False: 6]
  ------------------
  310|      0|							goto done;
  311|     17|				}
  312|    155|				if (n_nel)
  ------------------
  |  Branch (312:9): [True: 62, False: 93]
  ------------------
  313|     62|					if (file_printf(ms, " NEL") == -1)
  ------------------
  |  Branch (313:10): [True: 0, False: 62]
  ------------------
  314|      0|						goto done;
  315|    155|			}
  316|       |
  317|  2.18k|			if (file_printf(ms, " line terminators") == -1)
  ------------------
  |  Branch (317:8): [True: 0, False: 2.18k]
  ------------------
  318|      0|				goto done;
  319|  2.18k|		}
  320|       |
  321|  2.32k|		if (has_escapes)
  ------------------
  |  Branch (321:7): [True: 23, False: 2.29k]
  ------------------
  322|     23|			if (file_printf(ms, ", with escape sequences") == -1)
  ------------------
  |  Branch (322:8): [True: 0, False: 23]
  ------------------
  323|      0|				goto done;
  324|  2.32k|		if (has_backspace)
  ------------------
  |  Branch (324:7): [True: 47, False: 2.27k]
  ------------------
  325|     47|			if (file_printf(ms, ", with overstriking") == -1)
  ------------------
  |  Branch (325:8): [True: 0, False: 47]
  ------------------
  326|      0|				goto done;
  327|  2.32k|	}
  328|  2.32k|	rv = 1;
  329|  2.38k|done:
  330|  2.38k|	free(utf8_buf);
  331|       |
  332|  2.38k|	return rv;
  333|  2.32k|}
ascmagic.c:trim_nuls:
   63|  13.5k|{
   64|   265M|	while (nbytes > 1 && buf[nbytes - 1] == '\0')
  ------------------
  |  Branch (64:9): [True: 265M, False: 250]
  |  Branch (64:23): [True: 265M, False: 13.2k]
  ------------------
   65|   265M|		nbytes--;
   66|       |
   67|  13.5k|	return nbytes;
   68|  13.5k|}
ascmagic.c:encode_utf8:
  341|  2.27k|{
  342|  2.27k|	size_t i;
  343|  2.27k|	unsigned char *end = buf + len;
  344|       |
  345|  17.1M|	for (i = 0; i < ulen; i++) {
  ------------------
  |  Branch (345:14): [True: 17.1M, False: 2.23k]
  ------------------
  346|  17.1M|		if (ubuf[i] <= 0x7f) {
  ------------------
  |  Branch (346:7): [True: 11.2M, False: 5.93M]
  ------------------
  347|  11.2M|			if (end - buf < 1)
  ------------------
  |  Branch (347:8): [True: 0, False: 11.2M]
  ------------------
  348|      0|				return NULL;
  349|  11.2M|			*buf++ = CAST(unsigned char, ubuf[i]);
  ------------------
  |  |  452|  11.2M|#define CAST(T, b)	((T)(b))
  ------------------
  350|  11.2M|			continue;
  351|  11.2M|		} 
  352|  5.93M|		if (ubuf[i] <= 0x7ff) {
  ------------------
  |  Branch (352:7): [True: 5.53M, False: 397k]
  ------------------
  353|  5.53M|			if (end - buf < 2)
  ------------------
  |  Branch (353:8): [True: 0, False: 5.53M]
  ------------------
  354|      0|				return NULL;
  355|  5.53M|			*buf++ = CAST(unsigned char, (ubuf[i] >> 6) + 0xc0);
  ------------------
  |  |  452|  5.53M|#define CAST(T, b)	((T)(b))
  ------------------
  356|  5.53M|			goto out1;
  357|  5.53M|		}
  358|   397k|		if (ubuf[i] <= 0xffff) {
  ------------------
  |  Branch (358:7): [True: 221k, False: 176k]
  ------------------
  359|   221k|			if (end - buf < 3)
  ------------------
  |  Branch (359:8): [True: 0, False: 221k]
  ------------------
  360|      0|				return NULL;
  361|   221k|			*buf++ = CAST(unsigned char, (ubuf[i] >> 12) + 0xe0);
  ------------------
  |  |  452|   221k|#define CAST(T, b)	((T)(b))
  ------------------
  362|   221k|			goto out2;
  363|   221k|		}
  364|   176k|		if (ubuf[i] <= 0x1fffff) {
  ------------------
  |  Branch (364:7): [True: 62.7k, False: 113k]
  ------------------
  365|  62.7k|			if (end - buf < 4)
  ------------------
  |  Branch (365:8): [True: 0, False: 62.7k]
  ------------------
  366|      0|				return NULL;
  367|  62.7k|			*buf++ = CAST(unsigned char, (ubuf[i] >> 18) + 0xf0);
  ------------------
  |  |  452|  62.7k|#define CAST(T, b)	((T)(b))
  ------------------
  368|  62.7k|			goto out3;
  369|  62.7k|		}
  370|   113k|		if (ubuf[i] <= 0x3ffffff) {
  ------------------
  |  Branch (370:7): [True: 18.7k, False: 94.7k]
  ------------------
  371|  18.7k|			if (end - buf < 5)
  ------------------
  |  Branch (371:8): [True: 0, False: 18.7k]
  ------------------
  372|      0|				return NULL;
  373|  18.7k|			*buf++ = CAST(unsigned char, (ubuf[i] >> 24) + 0xf8);
  ------------------
  |  |  452|  18.7k|#define CAST(T, b)	((T)(b))
  ------------------
  374|  18.7k|			goto out4;
  375|  18.7k|		} 
  376|  94.7k|		if (ubuf[i] <= 0x7fffffff) {
  ------------------
  |  Branch (376:7): [True: 94.7k, False: 41]
  ------------------
  377|  94.7k|			if (end - buf < 6)
  ------------------
  |  Branch (377:8): [True: 0, False: 94.7k]
  ------------------
  378|      0|				return NULL;
  379|  94.7k|			*buf++ = CAST(unsigned char, (ubuf[i] >> 30) + 0xfc);
  ------------------
  |  |  452|  94.7k|#define CAST(T, b)	((T)(b))
  ------------------
  380|  94.7k|			goto out5;
  381|  94.7k|		} 
  382|       |		/* Invalid character */
  383|     41|		return NULL;
  384|  94.7k|	out5:	*buf++ = CAST(unsigned char, ((ubuf[i] >> 24) & 0x3f) + 0x80);
  ------------------
  |  |  452|  94.7k|#define CAST(T, b)	((T)(b))
  ------------------
  385|   113k|	out4:	*buf++ = CAST(unsigned char, ((ubuf[i] >> 18) & 0x3f) + 0x80);
  ------------------
  |  |  452|   113k|#define CAST(T, b)	((T)(b))
  ------------------
  386|   176k|	out3:	*buf++ = CAST(unsigned char, ((ubuf[i] >> 12) & 0x3f) + 0x80);
  ------------------
  |  |  452|   176k|#define CAST(T, b)	((T)(b))
  ------------------
  387|   397k|	out2:	*buf++ = CAST(unsigned char, ((ubuf[i] >>  6) & 0x3f) + 0x80);
  ------------------
  |  |  452|   397k|#define CAST(T, b)	((T)(b))
  ------------------
  388|  5.93M|	out1:	*buf++ = CAST(unsigned char, ((ubuf[i] >>  0) & 0x3f) + 0x80);
  ------------------
  |  |  452|  5.93M|#define CAST(T, b)	((T)(b))
  ------------------
  389|  5.93M|	}
  390|       |
  391|  2.23k|	return buf;
  392|  2.27k|}

buffer_init:
   42|   139M|{
   43|   139M|	b->fd = fd;
   44|   139M|	if (st)
  ------------------
  |  Branch (44:6): [True: 2.23k, False: 139M]
  ------------------
   45|  2.23k|		memcpy(&b->st, st, sizeof(b->st));
   46|   139M|	else if (b->fd == -1 || fstat(b->fd, &b->st) == -1)
  ------------------
  |  Branch (46:11): [True: 139M, False: 0]
  |  Branch (46:26): [True: 0, False: 0]
  ------------------
   47|   139M|		memset(&b->st, 0, sizeof(b->st));
   48|   139M|	b->fbuf = data;
   49|   139M|	b->flen = len;
   50|   139M|	b->eoff = 0;
   51|       |	b->ebuf = NULL;
   52|   139M|	b->elen = 0;
   53|   139M|}
buffer_fini:
   57|  46.9k|{
   58|  46.9k|	free(b->ebuf);
   59|       |	b->ebuf = NULL;
   60|  46.9k|	b->elen = 0;
   61|  46.9k|}
buffer_fill:
   65|   412k|{
   66|   412k|	struct buffer *b = CCAST(struct buffer *, bb);
  ------------------
  |  |  454|   412k|#define CCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
   67|       |
   68|   412k|	if (b->elen != 0)
  ------------------
  |  Branch (68:6): [True: 0, False: 412k]
  ------------------
   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|   412k|	if (b->fd == -1)
  ------------------
  |  Branch (72:6): [True: 412k, False: 0]
  ------------------
   73|   412k|		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:
  230|  3.49k|{
  231|  3.49k|	size_t i;
  232|       |
  233|  3.49k|	h->h_magic = CDF_TOLE8(h->h_magic);
  ------------------
  |  |   82|  3.49k|    (CAST(uint64_t, NEED_SWAP ? _cdf_tole8(x) : CAST(uint64_t, x)))
  |  |  ------------------
  |  |  |  |  452|  6.98k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 3.49k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  234|  3.49k|	h->h_uuid[0] = CDF_TOLE8(h->h_uuid[0]);
  ------------------
  |  |   82|  3.49k|    (CAST(uint64_t, NEED_SWAP ? _cdf_tole8(x) : CAST(uint64_t, x)))
  |  |  ------------------
  |  |  |  |  452|  6.98k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 3.49k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  235|  3.49k|	h->h_uuid[1] = CDF_TOLE8(h->h_uuid[1]);
  ------------------
  |  |   82|  3.49k|    (CAST(uint64_t, NEED_SWAP ? _cdf_tole8(x) : CAST(uint64_t, x)))
  |  |  ------------------
  |  |  |  |  452|  6.98k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 3.49k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  236|  3.49k|	h->h_revision = CDF_TOLE2(h->h_revision);
  ------------------
  |  |   86|  3.49k|    (CAST(uint16_t, NEED_SWAP ? _cdf_tole2(x) : CAST(uint16_t, x)))
  |  |  ------------------
  |  |  |  |  452|  6.98k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 3.49k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  237|  3.49k|	h->h_version = CDF_TOLE2(h->h_version);
  ------------------
  |  |   86|  3.49k|    (CAST(uint16_t, NEED_SWAP ? _cdf_tole2(x) : CAST(uint16_t, x)))
  |  |  ------------------
  |  |  |  |  452|  6.98k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 3.49k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  238|  3.49k|	h->h_byte_order = CDF_TOLE2(h->h_byte_order);
  ------------------
  |  |   86|  3.49k|    (CAST(uint16_t, NEED_SWAP ? _cdf_tole2(x) : CAST(uint16_t, x)))
  |  |  ------------------
  |  |  |  |  452|  6.98k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 3.49k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  239|  3.49k|	h->h_sec_size_p2 = CDF_TOLE2(h->h_sec_size_p2);
  ------------------
  |  |   86|  3.49k|    (CAST(uint16_t, NEED_SWAP ? _cdf_tole2(x) : CAST(uint16_t, x)))
  |  |  ------------------
  |  |  |  |  452|  6.98k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 3.49k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  240|  3.49k|	h->h_short_sec_size_p2 = CDF_TOLE2(h->h_short_sec_size_p2);
  ------------------
  |  |   86|  3.49k|    (CAST(uint16_t, NEED_SWAP ? _cdf_tole2(x) : CAST(uint16_t, x)))
  |  |  ------------------
  |  |  |  |  452|  6.98k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 3.49k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  241|  3.49k|	h->h_num_sectors_in_sat = CDF_TOLE4(h->h_num_sectors_in_sat);
  ------------------
  |  |   84|  3.49k|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  452|  6.98k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 3.49k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  242|  3.49k|	h->h_secid_first_directory = CDF_TOLE4(h->h_secid_first_directory);
  ------------------
  |  |   84|  3.49k|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  452|  6.98k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 3.49k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  243|  3.49k|	h->h_min_size_standard_stream =
  244|  3.49k|	    CDF_TOLE4(h->h_min_size_standard_stream);
  ------------------
  |  |   84|  3.49k|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  452|  6.98k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 3.49k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  245|  3.49k|	h->h_secid_first_sector_in_short_sat =
  246|  3.49k|	    CDF_TOLE4(CAST(uint32_t, h->h_secid_first_sector_in_short_sat));
  ------------------
  |  |   84|  3.49k|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  452|  6.98k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 3.49k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  247|  3.49k|	h->h_num_sectors_in_short_sat =
  248|  3.49k|	    CDF_TOLE4(h->h_num_sectors_in_short_sat);
  ------------------
  |  |   84|  3.49k|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  452|  6.98k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 3.49k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  249|  3.49k|	h->h_secid_first_sector_in_master_sat =
  250|  3.49k|	    CDF_TOLE4(CAST(uint32_t, h->h_secid_first_sector_in_master_sat));
  ------------------
  |  |   84|  3.49k|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  452|  6.98k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 3.49k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  251|  3.49k|	h->h_num_sectors_in_master_sat =
  252|  3.49k|	    CDF_TOLE4(h->h_num_sectors_in_master_sat);
  ------------------
  |  |   84|  3.49k|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  452|  6.98k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 3.49k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  253|   384k|	for (i = 0; i < __arraycount(h->h_master_sat); i++) {
  ------------------
  |  |  130|   384k|#define __arraycount(a) (sizeof(a) / sizeof(a[0]))
  ------------------
  |  Branch (253:14): [True: 380k, False: 3.49k]
  ------------------
  254|   380k|		h->h_master_sat[i] =
  255|   380k|		    CDF_TOLE4(CAST(uint32_t, h->h_master_sat[i]));
  ------------------
  |  |   84|   380k|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  452|   761k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 380k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  256|   380k|	}
  257|  3.49k|}
cdf_unpack_header:
  261|  3.49k|{
  262|  3.49k|	size_t i;
  263|  3.49k|	size_t len = 0;
  264|       |
  265|  3.49k|	CDF_UNPACK(h->h_magic);
  ------------------
  |  |  206|  3.49k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  266|  3.49k|	CDF_UNPACKA(h->h_uuid);
  ------------------
  |  |  208|  3.49k|    (void)memcpy((a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  267|  3.49k|	CDF_UNPACK(h->h_revision);
  ------------------
  |  |  206|  3.49k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  268|  3.49k|	CDF_UNPACK(h->h_version);
  ------------------
  |  |  206|  3.49k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  269|  3.49k|	CDF_UNPACK(h->h_byte_order);
  ------------------
  |  |  206|  3.49k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  270|  3.49k|	CDF_UNPACK(h->h_sec_size_p2);
  ------------------
  |  |  206|  3.49k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  271|  3.49k|	CDF_UNPACK(h->h_short_sec_size_p2);
  ------------------
  |  |  206|  3.49k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  272|  3.49k|	CDF_UNPACKA(h->h_unused0);
  ------------------
  |  |  208|  3.49k|    (void)memcpy((a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  273|  3.49k|	CDF_UNPACK(h->h_num_sectors_in_sat);
  ------------------
  |  |  206|  3.49k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  274|  3.49k|	CDF_UNPACK(h->h_secid_first_directory);
  ------------------
  |  |  206|  3.49k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  275|  3.49k|	CDF_UNPACKA(h->h_unused1);
  ------------------
  |  |  208|  3.49k|    (void)memcpy((a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  276|  3.49k|	CDF_UNPACK(h->h_min_size_standard_stream);
  ------------------
  |  |  206|  3.49k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  277|  3.49k|	CDF_UNPACK(h->h_secid_first_sector_in_short_sat);
  ------------------
  |  |  206|  3.49k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  278|  3.49k|	CDF_UNPACK(h->h_num_sectors_in_short_sat);
  ------------------
  |  |  206|  3.49k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  279|  3.49k|	CDF_UNPACK(h->h_secid_first_sector_in_master_sat);
  ------------------
  |  |  206|  3.49k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  280|  3.49k|	CDF_UNPACK(h->h_num_sectors_in_master_sat);
  ------------------
  |  |  206|  3.49k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  281|   384k|	for (i = 0; i < __arraycount(h->h_master_sat); i++)
  ------------------
  |  |  130|   384k|#define __arraycount(a) (sizeof(a) / sizeof(a[0]))
  ------------------
  |  Branch (281:14): [True: 380k, False: 3.49k]
  ------------------
  282|   380k|		CDF_UNPACK(h->h_master_sat[i]);
  ------------------
  |  |  206|   380k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  283|  3.49k|}
cdf_swap_class:
  304|    869|{
  305|    869|	d->cl_dword = CDF_TOLE4(d->cl_dword);
  ------------------
  |  |   84|    869|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  452|  1.73k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 869]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  306|    869|	d->cl_word[0] = CDF_TOLE2(d->cl_word[0]);
  ------------------
  |  |   86|    869|    (CAST(uint16_t, NEED_SWAP ? _cdf_tole2(x) : CAST(uint16_t, x)))
  |  |  ------------------
  |  |  |  |  452|  1.73k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 869]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  307|    869|	d->cl_word[1] = CDF_TOLE2(d->cl_word[1]);
  ------------------
  |  |   86|    869|    (CAST(uint16_t, NEED_SWAP ? _cdf_tole2(x) : CAST(uint16_t, x)))
  |  |  ------------------
  |  |  |  |  452|  1.73k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 869]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  308|    869|}
cdf_unpack_dir:
  312|  53.3k|{
  313|  53.3k|	size_t len = 0;
  314|       |
  315|  53.3k|	CDF_UNPACKA(d->d_name);
  ------------------
  |  |  208|  53.3k|    (void)memcpy((a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  316|  53.3k|	CDF_UNPACK(d->d_namelen);
  ------------------
  |  |  206|  53.3k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  317|  53.3k|	CDF_UNPACK(d->d_type);
  ------------------
  |  |  206|  53.3k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  318|  53.3k|	CDF_UNPACK(d->d_color);
  ------------------
  |  |  206|  53.3k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  319|  53.3k|	CDF_UNPACK(d->d_left_child);
  ------------------
  |  |  206|  53.3k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  320|  53.3k|	CDF_UNPACK(d->d_right_child);
  ------------------
  |  |  206|  53.3k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  321|  53.3k|	CDF_UNPACK(d->d_storage);
  ------------------
  |  |  206|  53.3k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  322|  53.3k|	CDF_UNPACKA(d->d_storage_uuid);
  ------------------
  |  |  208|  53.3k|    (void)memcpy((a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  323|  53.3k|	CDF_UNPACK(d->d_flags);
  ------------------
  |  |  206|  53.3k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  324|  53.3k|	CDF_UNPACK(d->d_created);
  ------------------
  |  |  206|  53.3k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  325|  53.3k|	CDF_UNPACK(d->d_modified);
  ------------------
  |  |  206|  53.3k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  326|  53.3k|	CDF_UNPACK(d->d_stream_first_sector);
  ------------------
  |  |  206|  53.3k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  327|  53.3k|	CDF_UNPACK(d->d_size);
  ------------------
  |  |  206|  53.3k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  328|  53.3k|	CDF_UNPACK(d->d_unused0);
  ------------------
  |  |  206|  53.3k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  329|  53.3k|}
cdf_zero_stream:
  333|  4.23k|{
  334|  4.23k|	scn->sst_len = 0;
  335|  4.23k|	scn->sst_dirlen = 0;
  336|  4.23k|	scn->sst_ss = 0;
  337|  4.23k|	free(scn->sst_tab);
  338|       |	scn->sst_tab = NULL;
  339|  4.23k|	return -1;
  340|  4.23k|}
cdf_read_header:
  396|  11.1k|{
  397|  11.1k|	char buf[512];
  398|       |
  399|  11.1k|	(void)memcpy(cdf_bo.s, "\01\02\03\04", 4);
  400|  11.1k|	if (cdf_read(info, CAST(off_t, 0), buf, sizeof(buf)) == -1)
  ------------------
  |  |  452|  11.1k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (400:6): [True: 7.65k, False: 3.49k]
  ------------------
  401|  7.65k|		return -1;
  402|  3.49k|	cdf_unpack_header(h, buf);
  403|  3.49k|	cdf_swap_header(h);
  404|  3.49k|	if (h->h_magic != CDF_MAGIC) {
  ------------------
  |  |   61|  3.49k|#define CDF_MAGIC	0xE11AB1A1E011CFD0LL
  ------------------
  |  Branch (404:6): [True: 1.70k, False: 1.78k]
  ------------------
  405|  1.70k|		DPRINTF(("Bad magic %#" INT64_T_FORMAT "x != %#"
  406|  1.70k|		    INT64_T_FORMAT "x\n",
  407|  1.70k|		    (unsigned long long)h->h_magic,
  408|  1.70k|		    (unsigned long long)CDF_MAGIC));
  409|  1.70k|		goto out;
  410|  1.70k|	}
  411|  1.78k|	if (h->h_sec_size_p2 > 20) {
  ------------------
  |  Branch (411:6): [True: 15, False: 1.76k]
  ------------------
  412|     15|		DPRINTF(("Bad sector size %hu\n", h->h_sec_size_p2));
  413|     15|		goto out;
  414|     15|	}
  415|  1.76k|	if (h->h_short_sec_size_p2 > 20) {
  ------------------
  |  Branch (415:6): [True: 3, False: 1.76k]
  ------------------
  416|      3|		DPRINTF(("Bad short sector size %hu\n",
  417|      3|		    h->h_short_sec_size_p2));
  418|      3|		goto out;
  419|      3|	}
  420|  1.76k|	return 0;
  421|  1.72k|out:
  422|  1.72k|	errno = EFTYPE;
  ------------------
  |  |   59|  1.72k|#define EFTYPE EINVAL
  ------------------
  423|  1.72k|	return -1;
  424|  1.76k|}
cdf_read_sector:
  430|  4.72M|{
  431|  4.72M|	size_t ss = CDF_SEC_SIZE(h);
  ------------------
  |  |   80|  4.72M|#define CDF_SEC_SIZE(h) CAST(size_t, 1 << (h)->h_sec_size_p2)
  |  |  ------------------
  |  |  |  |  452|  4.72M|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  432|  4.72M|	size_t pos;
  433|       |
  434|  4.72M|	if (SIZE_T_MAX / ss < CAST(size_t, id))
  ------------------
  |  |   63|  4.72M|#define SIZE_T_MAX CAST(size_t, ~0ULL)
  |  |  ------------------
  |  |  |  |  452|  4.72M|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
              	if (SIZE_T_MAX / ss < CAST(size_t, id))
  ------------------
  |  |  452|  4.72M|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (434:6): [True: 0, False: 4.72M]
  ------------------
  435|      0|		return -1;
  436|       |
  437|  4.72M|	pos = CDF_SEC_POS(h, id);
  ------------------
  |  |   81|  4.72M|#define CDF_SEC_POS(h, secid) (CDF_SEC_SIZE(h) + (secid) * CDF_SEC_SIZE(h))
  |  |  ------------------
  |  |  |  |   80|  4.72M|#define CDF_SEC_SIZE(h) CAST(size_t, 1 << (h)->h_sec_size_p2)
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|  4.72M|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define CDF_SEC_POS(h, secid) (CDF_SEC_SIZE(h) + (secid) * CDF_SEC_SIZE(h))
  |  |  ------------------
  |  |  |  |   80|  4.72M|#define CDF_SEC_SIZE(h) CAST(size_t, 1 << (h)->h_sec_size_p2)
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|  4.72M|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  438|  4.72M|	assert(ss == len);
  ------------------
  |  Branch (438:2): [True: 0, False: 4.72M]
  |  Branch (438:2): [True: 4.72M, False: 0]
  ------------------
  439|  4.72M|	return cdf_read(info, CAST(off_t, pos), RCAST(char *, buf) + offs, len);
  ------------------
  |  |  452|  4.72M|#define CAST(T, b)	((T)(b))
  ------------------
              	return cdf_read(info, CAST(off_t, pos), RCAST(char *, buf) + offs, len);
  ------------------
  |  |  453|  4.72M|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
  440|  4.72M|}
cdf_read_short_sector:
  445|    415|{
  446|    415|	size_t ss = CDF_SHORT_SEC_SIZE(h);
  ------------------
  |  |   82|    415|#define CDF_SHORT_SEC_SIZE(h)	CAST(size_t, 1 << (h)->h_short_sec_size_p2)
  |  |  ------------------
  |  |  |  |  452|    415|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  447|    415|	size_t pos;
  448|       |
  449|    415|	if (SIZE_T_MAX / ss < CAST(size_t, id))
  ------------------
  |  |   63|    415|#define SIZE_T_MAX CAST(size_t, ~0ULL)
  |  |  ------------------
  |  |  |  |  452|    415|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
              	if (SIZE_T_MAX / ss < CAST(size_t, id))
  ------------------
  |  |  452|    415|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (449:6): [True: 0, False: 415]
  ------------------
  450|      0|		return -1;
  451|       |
  452|    415|	pos = CDF_SHORT_SEC_POS(h, id);
  ------------------
  |  |   83|    415|#define CDF_SHORT_SEC_POS(h, secid) ((secid) * CDF_SHORT_SEC_SIZE(h))
  |  |  ------------------
  |  |  |  |   82|    415|#define CDF_SHORT_SEC_SIZE(h)	CAST(size_t, 1 << (h)->h_short_sec_size_p2)
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|    415|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  453|    415|	assert(ss == len);
  ------------------
  |  Branch (453:2): [True: 0, False: 415]
  |  Branch (453:2): [True: 415, False: 0]
  ------------------
  454|    415|	if (pos + len > CDF_SEC_SIZE(h) * sst->sst_len) {
  ------------------
  |  |   80|    415|#define CDF_SEC_SIZE(h) CAST(size_t, 1 << (h)->h_sec_size_p2)
  |  |  ------------------
  |  |  |  |  452|    415|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (454:6): [True: 28, False: 387]
  ------------------
  455|     28|		DPRINTF(("Out of bounds read %" SIZE_T_FORMAT "u > %"
  456|     28|		    SIZE_T_FORMAT "u\n",
  457|     28|		    pos + len, CDF_SEC_SIZE(h) * sst->sst_len));
  458|     28|		goto out;
  459|     28|	}
  460|    387|	(void)memcpy(RCAST(char *, buf) + offs,
  ------------------
  |  |  453|    387|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
  461|    387|	    RCAST(const char *, sst->sst_tab) + pos, len);
  ------------------
  |  |  453|    387|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
  462|    387|	return len;
  463|     28|out:
  464|     28|	errno = EFTYPE;
  ------------------
  |  |   59|     28|#define EFTYPE EINVAL
  ------------------
  465|     28|	return -1;
  466|    415|}
cdf_read_sat:
  473|  1.76k|{
  474|  1.76k|	size_t i, j, k;
  475|  1.76k|	size_t ss = CDF_SEC_SIZE(h);
  ------------------
  |  |   80|  1.76k|#define CDF_SEC_SIZE(h) CAST(size_t, 1 << (h)->h_sec_size_p2)
  |  |  ------------------
  |  |  |  |  452|  1.76k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  476|  1.76k|	cdf_secid_t *msa, mid, sec;
  477|  1.76k|	size_t nsatpersec = (ss / sizeof(mid)) - 1;
  478|       |
  479|   122k|	for (i = 0; i < __arraycount(h->h_master_sat); i++)
  ------------------
  |  |  130|   122k|#define __arraycount(a) (sizeof(a) / sizeof(a[0]))
  ------------------
  |  Branch (479:14): [True: 121k, False: 927]
  ------------------
  480|   121k|		if (h->h_master_sat[i] == CDF_SECID_FREE)
  ------------------
  |  |   54|   121k|#define CDF_SECID_FREE					-1
  ------------------
  |  Branch (480:7): [True: 837, False: 120k]
  ------------------
  481|    837|			break;
  482|       |
  483|  1.76k|#define CDF_SEC_LIMIT (UINT32_MAX / (64 * ss))
  484|  1.76k|	if ((nsatpersec > 0 &&
  ------------------
  |  Branch (484:7): [True: 1.65k, False: 112]
  ------------------
  485|  1.65k|	    h->h_num_sectors_in_master_sat > CDF_SEC_LIMIT / nsatpersec) ||
  ------------------
  |  |  483|  1.65k|#define CDF_SEC_LIMIT (UINT32_MAX / (64 * ss))
  ------------------
  |  Branch (485:6): [True: 30, False: 1.62k]
  ------------------
  486|  1.73k|	    i > CDF_SEC_LIMIT) {
  ------------------
  |  |  483|  1.73k|#define CDF_SEC_LIMIT (UINT32_MAX / (64 * ss))
  ------------------
  |  Branch (486:6): [True: 1, False: 1.73k]
  ------------------
  487|     31|		DPRINTF(("Number of sectors in master SAT too big %u %"
  488|     31|		    SIZE_T_FORMAT "u\n", h->h_num_sectors_in_master_sat, i));
  489|     31|		errno = EFTYPE;
  ------------------
  |  |   59|     31|#define EFTYPE EINVAL
  ------------------
  490|     31|		return -1;
  491|     31|	}
  492|       |
  493|  1.73k|	sat->sat_len = h->h_num_sectors_in_master_sat * nsatpersec + i;
  494|  1.73k|	DPRINTF(("sat_len = %" SIZE_T_FORMAT "u ss = %" SIZE_T_FORMAT "u\n",
  495|  1.73k|	    sat->sat_len, ss));
  496|  1.73k|	if ((sat->sat_tab = CAST(cdf_secid_t *, CDF_CALLOC(sat->sat_len, ss)))
  ------------------
  |  |  452|  1.73k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (496:6): [True: 0, False: 1.73k]
  ------------------
  497|  1.73k|	    == NULL)
  498|      0|		return -1;
  499|       |
  500|  23.2k|	for (i = 0; i < __arraycount(h->h_master_sat); i++) {
  ------------------
  |  |  130|  23.2k|#define __arraycount(a) (sizeof(a) / sizeof(a[0]))
  ------------------
  |  Branch (500:14): [True: 23.0k, False: 163]
  ------------------
  501|  23.0k|		if (h->h_master_sat[i] < 0)
  ------------------
  |  Branch (501:7): [True: 1.52k, False: 21.5k]
  ------------------
  502|  1.52k|			break;
  503|  21.5k|		if (cdf_read_sector(info, sat->sat_tab, ss * i, ss, h,
  ------------------
  |  Branch (503:7): [True: 47, False: 21.5k]
  ------------------
  504|  21.5k|		    h->h_master_sat[i]) != CAST(ssize_t, ss)) {
  ------------------
  |  |  452|  21.5k|#define CAST(T, b)	((T)(b))
  ------------------
  505|     47|			DPRINTF(("Reading sector %d", h->h_master_sat[i]));
  506|     47|			goto out1;
  507|     47|		}
  508|  21.5k|	}
  509|       |
  510|  1.68k|	if ((msa = CAST(cdf_secid_t *, CDF_CALLOC(1, ss))) == NULL)
  ------------------
  |  |  452|  1.68k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (510:6): [True: 0, False: 1.68k]
  ------------------
  511|      0|		goto out1;
  512|       |
  513|  1.68k|	mid = h->h_secid_first_sector_in_master_sat;
  514|   253k|	for (j = 0; j < h->h_num_sectors_in_master_sat; j++) {
  ------------------
  |  Branch (514:14): [True: 252k, False: 800]
  ------------------
  515|   252k|		if (mid < 0)
  ------------------
  |  Branch (515:7): [True: 615, False: 251k]
  ------------------
  516|    615|			goto out;
  517|   251k|		if (j >= CDF_LOOP_LIMIT) {
  ------------------
  |  |   50|   251k|#define CDF_LOOP_LIMIT					10000
  ------------------
  |  Branch (517:7): [True: 13, False: 251k]
  ------------------
  518|     13|			DPRINTF(("Reading master sector loop limit"));
  519|     13|			goto out3;
  520|     13|		}
  521|   251k|		if (cdf_read_sector(info, msa, 0, ss, h, mid) !=
  ------------------
  |  Branch (521:7): [True: 44, False: 251k]
  ------------------
  522|   251k|		    CAST(ssize_t, ss)) {
  ------------------
  |  |  452|   251k|#define CAST(T, b)	((T)(b))
  ------------------
  523|     44|			DPRINTF(("Reading master sector %d", mid));
  524|     44|			goto out2;
  525|     44|		}
  526|  4.69M|		for (k = 0; k < nsatpersec; k++, i++) {
  ------------------
  |  Branch (526:15): [True: 4.44M, False: 251k]
  ------------------
  527|  4.44M|			sec = CDF_TOLE4(CAST(uint32_t, msa[k]));
  ------------------
  |  |   84|  4.44M|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  452|  8.88M|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 4.44M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  528|  4.44M|			if (sec < 0)
  ------------------
  |  Branch (528:8): [True: 172, False: 4.44M]
  ------------------
  529|    172|				goto out;
  530|  4.44M|			if (i >= sat->sat_len) {
  ------------------
  |  Branch (530:8): [True: 0, False: 4.44M]
  ------------------
  531|      0|			    DPRINTF(("Out of bounds reading MSA %"
  532|      0|				SIZE_T_FORMAT "u >= %" SIZE_T_FORMAT "u",
  533|      0|				i, sat->sat_len));
  534|      0|			    goto out3;
  535|      0|			}
  536|  4.44M|			if (cdf_read_sector(info, sat->sat_tab, ss * i, ss, h,
  ------------------
  |  Branch (536:8): [True: 42, False: 4.44M]
  ------------------
  537|  4.44M|			    sec) != CAST(ssize_t, ss)) {
  ------------------
  |  |  452|  4.44M|#define CAST(T, b)	((T)(b))
  ------------------
  538|     42|				DPRINTF(("Reading sector %d",
  539|     42|				    CDF_TOLE4(msa[k])));
  540|     42|				goto out2;
  541|     42|			}
  542|  4.44M|		}
  543|   251k|		mid = CDF_TOLE4(CAST(uint32_t, msa[nsatpersec]));
  ------------------
  |  |   84|   251k|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  452|   502k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 251k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  544|   251k|	}
  545|  1.58k|out:
  546|  1.58k|	sat->sat_len = i;
  547|  1.58k|	free(msa);
  548|  1.58k|	return 0;
  549|     13|out3:
  550|     13|	errno = EFTYPE;
  ------------------
  |  |   59|     13|#define EFTYPE EINVAL
  ------------------
  551|     99|out2:
  552|     99|	free(msa);
  553|    146|out1:
  554|    146|	free(sat->sat_tab);
  555|    146|	return -1;
  556|     99|}
cdf_count_chain:
  560|  4.57k|{
  561|  4.57k|	size_t i, j;
  562|  4.57k|	cdf_secid_t maxsector = CAST(cdf_secid_t, (sat->sat_len * size)
  ------------------
  |  |  452|  4.57k|#define CAST(T, b)	((T)(b))
  ------------------
  563|  4.57k|	    / sizeof(maxsector));
  564|       |
  565|  4.57k|	DPRINTF(("Chain:"));
  566|  4.57k|	if (sid == CDF_SECID_END_OF_CHAIN) {
  ------------------
  |  |   55|  4.57k|#define CDF_SECID_END_OF_CHAIN				-2
  ------------------
  |  Branch (566:6): [True: 62, False: 4.51k]
  ------------------
  567|       |		/* 0-length chain. */
  568|     62|		DPRINTF((" empty\n"));
  569|     62|		return 0;
  570|     62|	}
  571|       |
  572|   307k|	for (j = i = 0; sid >= 0; i++, j++) {
  ------------------
  |  Branch (572:18): [True: 303k, False: 4.16k]
  ------------------
  573|   303k|		DPRINTF((" %d", sid));
  574|   303k|		if (j >= CDF_LOOP_LIMIT) {
  ------------------
  |  |   50|   303k|#define CDF_LOOP_LIMIT					10000
  ------------------
  |  Branch (574:7): [True: 29, False: 303k]
  ------------------
  575|     29|			DPRINTF(("Counting chain loop limit"));
  576|     29|			goto out;
  577|     29|		}
  578|   303k|		if (sid >= maxsector) {
  ------------------
  |  Branch (578:7): [True: 322, False: 303k]
  ------------------
  579|    322|			DPRINTF(("Sector %d >= %d\n", sid, maxsector));
  580|    322|			goto out;
  581|    322|		}
  582|   303k|		sid = CDF_TOLE4(CAST(uint32_t, sat->sat_tab[sid]));
  ------------------
  |  |   84|   303k|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  452|   606k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 303k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  583|   303k|	}
  584|  4.16k|	if (i == 0) {
  ------------------
  |  Branch (584:6): [True: 212, False: 3.95k]
  ------------------
  585|    212|		DPRINTF((" none, sid: %d\n", sid));
  586|    212|		goto out;
  587|       |
  588|    212|	}
  589|  3.95k|	DPRINTF(("\n"));
  590|  3.95k|	return i;
  591|    563|out:
  592|    563|	errno = EFTYPE;
  ------------------
  |  |   59|    563|#define EFTYPE EINVAL
  ------------------
  593|    563|	return CAST(size_t, -1);
  ------------------
  |  |  452|    563|#define CAST(T, b)	((T)(b))
  ------------------
  594|  4.16k|}
cdf_read_long_sector_chain:
  599|  1.30k|{
  600|  1.30k|	size_t ss = CDF_SEC_SIZE(h), i, j;
  ------------------
  |  |   80|  1.30k|#define CDF_SEC_SIZE(h) CAST(size_t, 1 << (h)->h_sec_size_p2)
  |  |  ------------------
  |  |  |  |  452|  1.30k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  601|  1.30k|	ssize_t nr;
  602|  1.30k|	scn->sst_tab = NULL;
  603|  1.30k|	scn->sst_len = cdf_count_chain(sat, sid, ss);
  604|  1.30k|	scn->sst_dirlen = MAX(h->h_min_size_standard_stream, len);
  ------------------
  |  Branch (604:20): [True: 388, False: 912]
  ------------------
  605|  1.30k|	scn->sst_ss = ss;
  606|       |
  607|  1.30k|	if (sid == CDF_SECID_END_OF_CHAIN || len == 0)
  ------------------
  |  |   55|  2.60k|#define CDF_SECID_END_OF_CHAIN				-2
  ------------------
  |  Branch (607:6): [True: 4, False: 1.29k]
  |  Branch (607:39): [True: 77, False: 1.21k]
  ------------------
  608|     81|		return cdf_zero_stream(scn);
  609|       |
  610|  1.21k|	if (scn->sst_len == CAST(size_t, -1))
  ------------------
  |  |  452|  1.21k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (610:6): [True: 110, False: 1.10k]
  ------------------
  611|    110|		goto out;
  612|       |
  613|  1.10k|	scn->sst_tab = CDF_CALLOC(scn->sst_len, ss);
  ------------------
  |  |   96|  1.10k|#define CDF_CALLOC(n, u) cdf_calloc(__FILE__, __LINE__, (n), (u))
  ------------------
  614|  1.10k|	if (scn->sst_tab == NULL)
  ------------------
  |  Branch (614:6): [True: 0, False: 1.10k]
  ------------------
  615|      0|		return cdf_zero_stream(scn);
  616|       |
  617|  5.02k|	for (j = i = 0; sid >= 0; i++, j++) {
  ------------------
  |  Branch (617:18): [True: 3.94k, False: 1.08k]
  ------------------
  618|  3.94k|		if (j >= CDF_LOOP_LIMIT) {
  ------------------
  |  |   50|  3.94k|#define CDF_LOOP_LIMIT					10000
  ------------------
  |  Branch (618:7): [True: 0, False: 3.94k]
  ------------------
  619|      0|			DPRINTF(("Read long sector chain loop limit"));
  620|      0|			goto out;
  621|      0|		}
  622|  3.94k|		if (i >= scn->sst_len) {
  ------------------
  |  Branch (622:7): [True: 0, False: 3.94k]
  ------------------
  623|      0|			DPRINTF(("Out of bounds reading long sector chain "
  624|      0|			    "%" SIZE_T_FORMAT "u > %" SIZE_T_FORMAT "u\n", i,
  625|      0|			    scn->sst_len));
  626|      0|			goto out;
  627|      0|		}
  628|  3.94k|		if ((nr = cdf_read_sector(info, scn->sst_tab, i * ss, ss, h,
  ------------------
  |  Branch (628:7): [True: 24, False: 3.91k]
  ------------------
  629|  3.94k|		    sid)) != CAST(ssize_t, ss)) {
  ------------------
  |  |  452|  3.94k|#define CAST(T, b)	((T)(b))
  ------------------
  630|     24|			if (i == scn->sst_len - 1 && nr > 0) {
  ------------------
  |  Branch (630:8): [True: 9, False: 15]
  |  Branch (630:33): [True: 0, False: 9]
  ------------------
  631|       |				/* Last sector might be truncated */
  632|      0|				return 0;
  633|      0|			}
  634|     24|			DPRINTF(("Reading long sector chain %d", sid));
  635|     24|			goto out;
  636|     24|		}
  637|  3.91k|		sid = CDF_TOLE4(CAST(uint32_t, sat->sat_tab[sid]));
  ------------------
  |  |   84|  3.91k|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  452|  7.83k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 3.91k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  638|  3.91k|	}
  639|  1.08k|	return 0;
  640|    134|out:
  641|    134|	errno = EFTYPE;
  ------------------
  |  |   59|    134|#define EFTYPE EINVAL
  ------------------
  642|    134|	return cdf_zero_stream(scn);
  643|  1.10k|}
cdf_read_short_sector_chain:
  649|    324|{
  650|    324|	size_t ss = CDF_SHORT_SEC_SIZE(h), i, j;
  ------------------
  |  |   82|    324|#define CDF_SHORT_SEC_SIZE(h)	CAST(size_t, 1 << (h)->h_short_sec_size_p2)
  |  |  ------------------
  |  |  |  |  452|    324|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  651|    324|	scn->sst_tab = NULL;
  652|    324|	scn->sst_len = cdf_count_chain(ssat, sid, CDF_SEC_SIZE(h));
  ------------------
  |  |   80|    324|#define CDF_SEC_SIZE(h) CAST(size_t, 1 << (h)->h_sec_size_p2)
  |  |  ------------------
  |  |  |  |  452|    324|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  653|    324|	scn->sst_dirlen = len;
  654|    324|	scn->sst_ss = ss;
  655|       |
  656|    324|	if (scn->sst_len == CAST(size_t, -1))
  ------------------
  |  |  452|    324|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (656:6): [True: 102, False: 222]
  ------------------
  657|    102|		goto out;
  658|       |
  659|    222|	scn->sst_tab = CDF_CALLOC(scn->sst_len, ss);
  ------------------
  |  |   96|    222|#define CDF_CALLOC(n, u) cdf_calloc(__FILE__, __LINE__, (n), (u))
  ------------------
  660|    222|	if (scn->sst_tab == NULL)
  ------------------
  |  Branch (660:6): [True: 0, False: 222]
  ------------------
  661|      0|		return cdf_zero_stream(scn);
  662|       |
  663|    609|	for (j = i = 0; sid >= 0; i++, j++) {
  ------------------
  |  Branch (663:18): [True: 415, False: 194]
  ------------------
  664|    415|		if (j >= CDF_LOOP_LIMIT) {
  ------------------
  |  |   50|    415|#define CDF_LOOP_LIMIT					10000
  ------------------
  |  Branch (664:7): [True: 0, False: 415]
  ------------------
  665|      0|			DPRINTF(("Read short sector chain loop limit"));
  666|      0|			goto out;
  667|      0|		}
  668|    415|		if (i >= scn->sst_len) {
  ------------------
  |  Branch (668:7): [True: 0, False: 415]
  ------------------
  669|      0|			DPRINTF(("Out of bounds reading short sector chain "
  670|      0|			    "%" SIZE_T_FORMAT "u > %" SIZE_T_FORMAT "u\n",
  671|      0|			    i, scn->sst_len));
  672|      0|			goto out;
  673|      0|		}
  674|    415|		if (cdf_read_short_sector(sst, scn->sst_tab, i * ss, ss, h,
  ------------------
  |  Branch (674:7): [True: 28, False: 387]
  ------------------
  675|    415|		    sid) != CAST(ssize_t, ss)) {
  ------------------
  |  |  452|    415|#define CAST(T, b)	((T)(b))
  ------------------
  676|     28|			DPRINTF(("Reading short sector chain %d", sid));
  677|     28|			goto out;
  678|     28|		}
  679|    387|		sid = CDF_TOLE4(CAST(uint32_t, ssat->sat_tab[sid]));
  ------------------
  |  |   84|    387|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  452|    774|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 387]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  680|    387|	}
  681|    194|	return 0;
  682|    130|out:
  683|    130|	errno = EFTYPE;
  ------------------
  |  |   59|    130|#define EFTYPE EINVAL
  ------------------
  684|    130|	return cdf_zero_stream(scn);
  685|    222|}
cdf_read_sector_chain:
  691|  1.14k|{
  692|       |
  693|  1.14k|	if (len < h->h_min_size_standard_stream && sst->sst_tab != NULL)
  ------------------
  |  Branch (693:6): [True: 504, False: 636]
  |  Branch (693:45): [True: 324, False: 180]
  ------------------
  694|    324|		return cdf_read_short_sector_chain(h, ssat, sst, sid, len,
  695|    324|		    scn);
  696|    816|	else
  697|    816|		return cdf_read_long_sector_chain(info, h, sat, sid, len, scn);
  698|  1.14k|}
cdf_read_dir:
  703|  1.36k|{
  704|  1.36k|	size_t i, j;
  705|  1.36k|	size_t ss = CDF_SEC_SIZE(h), ns, nd;
  ------------------
  |  |   80|  1.36k|#define CDF_SEC_SIZE(h) CAST(size_t, 1 << (h)->h_sec_size_p2)
  |  |  ------------------
  |  |  |  |  452|  1.36k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  706|  1.36k|	char *buf;
  707|  1.36k|	cdf_secid_t sid = h->h_secid_first_directory;
  708|       |
  709|  1.36k|	ns = cdf_count_chain(sat, sid, ss);
  710|  1.36k|	if (ns == CAST(size_t, -1))
  ------------------
  |  |  452|  1.36k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (710:6): [True: 85, False: 1.27k]
  ------------------
  711|     85|		return -1;
  712|       |
  713|  1.27k|	nd = ss / CDF_DIRECTORY_SIZE;
  ------------------
  |  |  117|  1.27k|#define CDF_DIRECTORY_SIZE	128
  ------------------
  714|       |
  715|  1.27k|	dir->dir_len = ns * nd;
  716|  1.27k|	dir->dir_tab = CAST(cdf_directory_t *,
  ------------------
  |  |  452|  1.27k|#define CAST(T, b)	((T)(b))
  ------------------
  717|  1.27k|	    CDF_CALLOC(dir->dir_len, sizeof(dir->dir_tab[0])));
  718|  1.27k|	if (dir->dir_tab == NULL)
  ------------------
  |  Branch (718:6): [True: 0, False: 1.27k]
  ------------------
  719|      0|		return -1;
  720|       |
  721|  1.27k|	if ((buf = CAST(char *, CDF_MALLOC(ss))) == NULL) {
  ------------------
  |  |  452|  1.27k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (721:6): [True: 0, False: 1.27k]
  ------------------
  722|      0|		free(dir->dir_tab);
  723|      0|		return -1;
  724|      0|	}
  725|       |
  726|  6.10k|	for (j = i = 0; i < ns; i++, j++) {
  ------------------
  |  Branch (726:18): [True: 4.83k, False: 1.27k]
  ------------------
  727|  4.83k|		if (j >= CDF_LOOP_LIMIT) {
  ------------------
  |  |   50|  4.83k|#define CDF_LOOP_LIMIT					10000
  ------------------
  |  Branch (727:7): [True: 0, False: 4.83k]
  ------------------
  728|      0|			DPRINTF(("Read dir loop limit"));
  729|      0|			goto out;
  730|      0|		}
  731|  4.83k|		if (cdf_read_sector(info, buf, 0, ss, h, sid) !=
  ------------------
  |  Branch (731:7): [True: 9, False: 4.82k]
  ------------------
  732|  4.83k|		    CAST(ssize_t, ss)) {
  ------------------
  |  |  452|  4.83k|#define CAST(T, b)	((T)(b))
  ------------------
  733|      9|			DPRINTF(("Reading directory sector %d", sid));
  734|      9|			goto out;
  735|      9|		}
  736|  58.1k|		for (j = 0; j < nd; j++) {
  ------------------
  |  Branch (736:15): [True: 53.3k, False: 4.82k]
  ------------------
  737|  53.3k|			cdf_unpack_dir(&dir->dir_tab[i * nd + j],
  738|  53.3k|			    &buf[j * CDF_DIRECTORY_SIZE]);
  ------------------
  |  |  117|  53.3k|#define CDF_DIRECTORY_SIZE	128
  ------------------
  739|  53.3k|		}
  740|  4.82k|		sid = CDF_TOLE4(CAST(uint32_t, sat->sat_tab[sid]));
  ------------------
  |  |   84|  4.82k|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  452|  9.64k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 4.82k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  741|  4.82k|	}
  742|  1.27k|	if (NEED_SWAP)
  ------------------
  |  |   79|  1.27k|#define NEED_SWAP	(cdf_bo.u == CAST(uint32_t, 0x01020304))
  |  |  ------------------
  |  |  |  |  452|  1.27k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  |  Branch (79:19): [True: 0, False: 1.27k]
  |  |  ------------------
  ------------------
  743|      0|		for (i = 0; i < dir->dir_len; i++)
  ------------------
  |  Branch (743:15): [True: 0, False: 0]
  ------------------
  744|      0|			cdf_swap_dir(&dir->dir_tab[i]);
  745|  1.27k|	free(buf);
  746|  1.27k|	return 0;
  747|      9|out:
  748|      9|	free(dir->dir_tab);
  749|      9|	free(buf);
  750|      9|	errno = EFTYPE;
  ------------------
  |  |   59|      9|#define EFTYPE EINVAL
  ------------------
  751|      9|	return -1;
  752|  1.27k|}
cdf_read_ssat:
  758|  1.58k|{
  759|  1.58k|	size_t i, j;
  760|  1.58k|	size_t ss = CDF_SEC_SIZE(h);
  ------------------
  |  |   80|  1.58k|#define CDF_SEC_SIZE(h) CAST(size_t, 1 << (h)->h_sec_size_p2)
  |  |  ------------------
  |  |  |  |  452|  1.58k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  761|  1.58k|	cdf_secid_t sid = h->h_secid_first_sector_in_short_sat;
  762|       |
  763|  1.58k|	ssat->sat_tab = NULL;
  764|  1.58k|	ssat->sat_len = cdf_count_chain(sat, sid, ss);
  765|  1.58k|	if (ssat->sat_len == CAST(size_t, -1))
  ------------------
  |  |  452|  1.58k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (765:6): [True: 210, False: 1.37k]
  ------------------
  766|    210|		goto out;
  767|       |
  768|  1.37k|	ssat->sat_tab = CAST(cdf_secid_t *, CDF_CALLOC(ssat->sat_len, ss));
  ------------------
  |  |  452|  1.37k|#define CAST(T, b)	((T)(b))
  ------------------
  769|  1.37k|	if (ssat->sat_tab == NULL)
  ------------------
  |  Branch (769:6): [True: 0, False: 1.37k]
  ------------------
  770|      0|		goto out1;
  771|       |
  772|  5.22k|	for (j = i = 0; sid >= 0; i++, j++) {
  ------------------
  |  Branch (772:18): [True: 3.86k, False: 1.36k]
  ------------------
  773|  3.86k|		if (j >= CDF_LOOP_LIMIT) {
  ------------------
  |  |   50|  3.86k|#define CDF_LOOP_LIMIT					10000
  ------------------
  |  Branch (773:7): [True: 0, False: 3.86k]
  ------------------
  774|      0|			DPRINTF(("Read short sat sector loop limit"));
  775|      0|			goto out;
  776|      0|		}
  777|  3.86k|		if (i >= ssat->sat_len) {
  ------------------
  |  Branch (777:7): [True: 0, False: 3.86k]
  ------------------
  778|      0|			DPRINTF(("Out of bounds reading short sector chain "
  779|      0|			    "%" SIZE_T_FORMAT "u > %" SIZE_T_FORMAT "u\n", i,
  780|      0|			    ssat->sat_len));
  781|      0|			goto out;
  782|      0|		}
  783|  3.86k|		if (cdf_read_sector(info, ssat->sat_tab, i * ss, ss, h, sid) !=
  ------------------
  |  Branch (783:7): [True: 13, False: 3.84k]
  ------------------
  784|  3.86k|		    CAST(ssize_t, ss)) {
  ------------------
  |  |  452|  3.86k|#define CAST(T, b)	((T)(b))
  ------------------
  785|     13|			DPRINTF(("Reading short sat sector %d", sid));
  786|     13|			goto out1;
  787|     13|		}
  788|  3.84k|		sid = CDF_TOLE4(CAST(uint32_t, sat->sat_tab[sid]));
  ------------------
  |  |   84|  3.84k|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  452|  7.69k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 3.84k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  789|  3.84k|	}
  790|  1.36k|	return 0;
  791|    210|out:
  792|    210|	errno = EFTYPE;
  ------------------
  |  |   59|    210|#define EFTYPE EINVAL
  ------------------
  793|    223|out1:
  794|    223|	free(ssat->sat_tab);
  795|    223|	return -1;
  796|    210|}
cdf_read_short_stream:
  802|  1.27k|{
  803|  1.27k|	size_t i;
  804|  1.27k|	const cdf_directory_t *d;
  805|       |
  806|  1.27k|	*root = NULL;
  807|  11.6k|	for (i = 0; i < dir->dir_len; i++)
  ------------------
  |  Branch (807:14): [True: 11.0k, False: 661]
  ------------------
  808|  11.0k|		if (dir->dir_tab[i].d_type == CDF_DIR_TYPE_ROOT_STORAGE)
  ------------------
  |  |  101|  11.0k|#define CDF_DIR_TYPE_ROOT_STORAGE	5
  ------------------
  |  Branch (808:7): [True: 609, False: 10.4k]
  ------------------
  809|    609|			break;
  810|       |
  811|       |	/* If the it is not there, just fake it; some docs don't have it */
  812|  1.27k|	if (i == dir->dir_len) {
  ------------------
  |  Branch (812:6): [True: 661, False: 609]
  ------------------
  813|    661|		DPRINTF(("Cannot find root storage dir\n"));
  814|    661|		goto out;
  815|    661|	}
  816|    609|	d = &dir->dir_tab[i];
  817|    609|	*root = d;
  818|       |
  819|       |	/* If the it is not there, just fake it; some docs don't have it */
  820|    609|	if (d->d_stream_first_sector < 0) {
  ------------------
  |  Branch (820:6): [True: 125, False: 484]
  ------------------
  821|    125|		DPRINTF(("No first secror in dir\n"));
  822|    125|		goto out;
  823|    125|	}
  824|       |
  825|    484|	return cdf_read_long_sector_chain(info, h, sat,
  826|    484|	    d->d_stream_first_sector, d->d_size, scn);
  827|    786|out:
  828|       |	scn->sst_tab = NULL;
  829|    786|	(void)cdf_zero_stream(scn);
  830|    786|	return 0;
  831|    609|}
cdf_namecmp:
  835|  16.8k|{
  836|  41.9k|	for (; l--; d++, s++)
  ------------------
  |  Branch (836:9): [True: 40.8k, False: 1.15k]
  ------------------
  837|  40.8k|		if (*d != CDF_TOLE2(*s))
  ------------------
  |  |   86|  40.8k|    (CAST(uint16_t, NEED_SWAP ? _cdf_tole2(x) : CAST(uint16_t, x)))
  |  |  ------------------
  |  |  |  |  452|  81.6k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 40.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (837:7): [True: 15.6k, False: 25.1k]
  ------------------
  838|  15.6k|			return CAST(unsigned char, *d) - CDF_TOLE2(*s);
  ------------------
  |  |  452|  15.6k|#define CAST(T, b)	((T)(b))
  ------------------
              			return CAST(unsigned char, *d) - CDF_TOLE2(*s);
  ------------------
  |  |   86|  15.6k|    (CAST(uint16_t, NEED_SWAP ? _cdf_tole2(x) : CAST(uint16_t, x)))
  |  |  ------------------
  |  |  |  |  452|  31.3k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 15.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  839|  1.15k|	return 0;
  840|  16.8k|}
cdf_read_doc_summary_info:
  846|    989|{
  847|    989|	return cdf_read_user_stream(info, h, sat, ssat, sst, dir,
  848|    989|	    "\05DocumentSummaryInformation", scn);
  849|    989|}
cdf_read_summary_info:
  855|  1.15k|{
  856|  1.15k|	return cdf_read_user_stream(info, h, sat, ssat, sst, dir,
  857|  1.15k|	    "\05SummaryInformation", scn);
  858|  1.15k|}
cdf_read_user_stream:
  864|  3.29k|{
  865|  3.29k|	const cdf_directory_t *d;
  866|  3.29k|	int i = cdf_find_stream(dir, name, CDF_DIR_TYPE_USER_STREAM);
  ------------------
  |  |   98|  3.29k|#define CDF_DIR_TYPE_USER_STREAM	2
  ------------------
  867|       |
  868|  3.29k|	if (i <= 0) {
  ------------------
  |  Branch (868:6): [True: 2.15k, False: 1.14k]
  ------------------
  869|  2.15k|		memset(scn, 0, sizeof(*scn));
  870|  2.15k|		return -1;
  871|  2.15k|	}
  872|       |
  873|  1.14k|	d = &dir->dir_tab[i - 1];
  874|  1.14k|	return cdf_read_sector_chain(info, h, sat, ssat, sst,
  875|  1.14k|	    d->d_stream_first_sector, d->d_size, scn);
  876|  3.29k|}
cdf_find_stream:
  880|  3.29k|{
  881|  3.29k|	size_t i, name_len = strlen(name) + 1;
  882|       |
  883|   111k|	for (i = 1; i <= dir->dir_len; i++)
  ------------------
  |  Branch (883:14): [True: 109k, False: 2.15k]
  ------------------
  884|   109k|		if (dir->dir_tab[i-1].d_type == type &&
  ------------------
  |  Branch (884:7): [True: 4.48k, False: 105k]
  ------------------
  885|  4.48k|		    cdf_namecmp(name, dir->dir_tab[i-1].d_name, name_len)
  ------------------
  |  Branch (885:7): [True: 1.14k, False: 3.34k]
  ------------------
  886|  4.48k|		    == 0)
  887|  1.14k|			break;
  888|  3.29k|	if (i <= dir->dir_len)
  ------------------
  |  Branch (888:6): [True: 1.14k, False: 2.15k]
  ------------------
  889|  1.14k|		return CAST(int, i);
  ------------------
  |  |  452|  1.14k|#define CAST(T, b)	((T)(b))
  ------------------
  890|       |
  891|  2.15k|	DPRINTF(("Cannot find type %d `%s'\n", type, name));
  892|  2.15k|	errno = ESRCH;
  893|  2.15k|	return 0;
  894|  3.29k|}
cdf_read_property_info:
  993|    869|{
  994|    869|	const cdf_section_header_t *shp;
  995|    869|	cdf_section_header_t sh;
  996|    869|	const uint8_t *p, *q, *e;
  997|    869|	size_t i, o4, nelements, j, slen, left;
  998|    869|	cdf_property_info_t *inp;
  999|       |
 1000|    869|	if (offs > UINT32_MAX / 4) {
  ------------------
  |  Branch (1000:6): [True: 22, False: 847]
  ------------------
 1001|     22|		errno = EFTYPE;
  ------------------
  |  |   59|     22|#define EFTYPE EINVAL
  ------------------
 1002|     22|		goto out;
 1003|     22|	}
 1004|    847|	shp = CAST(const cdf_section_header_t *,
  ------------------
  |  |  452|    847|#define CAST(T, b)	((T)(b))
  ------------------
 1005|    847|	    cdf_offset(sst->sst_tab, offs));
 1006|    847|	if (cdf_check_stream_offset(sst, h, shp, sizeof(*shp), __LINE__) == -1)
  ------------------
  |  Branch (1006:6): [True: 59, False: 788]
  ------------------
 1007|     59|		goto out;
 1008|    788|	sh.sh_len = CDF_TOLE4(shp->sh_len);
  ------------------
  |  |   84|    788|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  452|  1.57k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 788]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1009|    788|	if (sh.sh_len > CDF_SHLEN_LIMIT) {
  ------------------
  |  |  896|    788|#define CDF_SHLEN_LIMIT (UINT32_MAX / 64)
  ------------------
  |  Branch (1009:6): [True: 8, False: 780]
  ------------------
 1010|      8|		errno = EFTYPE;
  ------------------
  |  |   59|      8|#define EFTYPE EINVAL
  ------------------
 1011|      8|		goto out;
 1012|      8|	}
 1013|       |
 1014|    780|	if (cdf_check_stream_offset(sst, h, shp, sh.sh_len, __LINE__) == -1)
  ------------------
  |  Branch (1014:6): [True: 49, False: 731]
  ------------------
 1015|     49|		goto out;
 1016|       |
 1017|    731|	sh.sh_properties = CDF_TOLE4(shp->sh_properties);
  ------------------
  |  |   84|    731|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  452|  1.46k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 731]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1018|    731|	DPRINTF(("section len: %u properties %u\n", sh.sh_len,
 1019|    731|	    sh.sh_properties));
 1020|    731|	if (sh.sh_properties > CDF_PROP_LIMIT)
  ------------------
  |  |  897|    731|#define CDF_PROP_LIMIT (UINT32_MAX / (64 * sizeof(cdf_property_info_t)))
  ------------------
  |  Branch (1020:6): [True: 21, False: 710]
  ------------------
 1021|     21|		goto out;
 1022|    710|	inp = cdf_grow_info(info, maxcount, sh.sh_properties);
 1023|    710|	if (inp == NULL)
  ------------------
  |  Branch (1023:6): [True: 0, False: 710]
  ------------------
 1024|      0|		goto out;
 1025|    710|	inp += *count;
 1026|    710|	*count += sh.sh_properties;
 1027|    710|	p = CAST(const uint8_t *, cdf_offset(sst->sst_tab, offs + sizeof(sh)));
  ------------------
  |  |  452|    710|#define CAST(T, b)	((T)(b))
  ------------------
 1028|    710|	e = CAST(const uint8_t *, cdf_offset(shp, sh.sh_len));
  ------------------
  |  |  452|    710|#define CAST(T, b)	((T)(b))
  ------------------
 1029|    710|	if (p >= e || cdf_check_stream_offset(sst, h, e, 0, __LINE__) == -1)
  ------------------
  |  Branch (1029:6): [True: 11, False: 699]
  |  Branch (1029:16): [True: 0, False: 699]
  ------------------
 1030|     11|		goto out;
 1031|       |
 1032|  7.06k|	for (i = 0; i < sh.sh_properties; i++) {
  ------------------
  |  Branch (1032:14): [True: 6.71k, False: 356]
  ------------------
 1033|  6.71k|		if ((q = cdf_get_property_info_pos(sst, h, p, e, i)) == NULL)
  ------------------
  |  Branch (1033:7): [True: 236, False: 6.47k]
  ------------------
 1034|    236|			goto out;
 1035|  6.47k|		inp[i].pi_id = CDF_GETUINT32(p, i << 1);
  ------------------
  |  |   92|  6.47k|#define CDF_GETUINT32(x, y)	cdf_getuint32(x, y)
  ------------------
 1036|  6.47k|		left = CAST(size_t, e - q);
  ------------------
  |  |  452|  6.47k|#define CAST(T, b)	((T)(b))
  ------------------
 1037|  6.47k|		if (left < sizeof(uint32_t)) {
  ------------------
  |  Branch (1037:7): [True: 3, False: 6.47k]
  ------------------
 1038|      3|			DPRINTF(("short info (no type)_\n"));
 1039|      3|			goto out;
 1040|      3|		}
 1041|  6.47k|		inp[i].pi_type = CDF_GETUINT32(q, 0);
  ------------------
  |  |   92|  6.47k|#define CDF_GETUINT32(x, y)	cdf_getuint32(x, y)
  ------------------
 1042|  6.47k|		DPRINTF(("%" SIZE_T_FORMAT "u) id=%#x type=%#x offs=%#tx,%#x\n",
 1043|  6.47k|		    i, inp[i].pi_id, inp[i].pi_type, q - p, offs));
 1044|  6.47k|		if (inp[i].pi_type & CDF_VECTOR) {
  ------------------
  |  |  237|  6.47k|#define CDF_VECTOR		0x00001000
  ------------------
  |  Branch (1044:7): [True: 1.33k, False: 5.13k]
  ------------------
 1045|  1.33k|			if (left < sizeof(uint32_t) * 2) {
  ------------------
  |  Branch (1045:8): [True: 3, False: 1.33k]
  ------------------
 1046|      3|				DPRINTF(("missing CDF_VECTOR length\n"));
 1047|      3|				goto out;
 1048|      3|			}
 1049|  1.33k|			nelements = CDF_GETUINT32(q, 1);
  ------------------
  |  |   92|  1.33k|#define CDF_GETUINT32(x, y)	cdf_getuint32(x, y)
  ------------------
 1050|  1.33k|			if (nelements > CDF_ELEMENT_LIMIT || nelements == 0) {
  ------------------
  |  |   51|  2.66k|#define CDF_ELEMENT_LIMIT				100000
  ------------------
  |  Branch (1050:8): [True: 33, False: 1.30k]
  |  Branch (1050:41): [True: 3, False: 1.29k]
  ------------------
 1051|     36|				DPRINTF(("CDF_VECTOR with nelements == %"
 1052|     36|				    SIZE_T_FORMAT "u\n", nelements));
 1053|     36|				goto out;
 1054|     36|			}
 1055|  1.29k|			slen = 2;
 1056|  5.13k|		} else {
 1057|  5.13k|			nelements = 1;
 1058|  5.13k|			slen = 1;
 1059|  5.13k|		}
 1060|  6.43k|		o4 = slen * sizeof(uint32_t);
 1061|  6.43k|		if (inp[i].pi_type & (CDF_ARRAY|CDF_BYREF|CDF_RESERVED))
  ------------------
  |  |  238|  6.43k|#define CDF_ARRAY		0x00002000
  ------------------
              		if (inp[i].pi_type & (CDF_ARRAY|CDF_BYREF|CDF_RESERVED))
  ------------------
  |  |  239|  6.43k|#define CDF_BYREF		0x00004000
  ------------------
              		if (inp[i].pi_type & (CDF_ARRAY|CDF_BYREF|CDF_RESERVED))
  ------------------
  |  |  240|  6.43k|#define CDF_RESERVED		0x00008000
  ------------------
  |  Branch (1061:7): [True: 1.68k, False: 4.74k]
  ------------------
 1062|  1.68k|			goto unknown;
 1063|  4.74k|		switch (inp[i].pi_type & CDF_TYPEMASK) {
  ------------------
  |  |  243|  4.74k|#define CDF_TYPEMASK		0x00000fff
  ------------------
 1064|    294|		case CDF_NULL:
  ------------------
  |  |  198|    294|#define CDF_NULL		0x00000001
  ------------------
  |  Branch (1064:3): [True: 294, False: 4.45k]
  ------------------
 1065|  1.17k|		case CDF_EMPTY:
  ------------------
  |  |  197|  1.17k|#define CDF_EMPTY		0x00000000
  ------------------
  |  Branch (1065:3): [True: 880, False: 3.86k]
  ------------------
 1066|  1.17k|			break;
 1067|    412|		case CDF_SIGNED16:
  ------------------
  |  |  199|    412|#define CDF_SIGNED16		0x00000002
  ------------------
  |  Branch (1067:3): [True: 412, False: 4.33k]
  ------------------
 1068|    412|			if (!cdf_copy_info(&inp[i], &q[o4], e, sizeof(int16_t)))
  ------------------
  |  Branch (1068:8): [True: 116, False: 296]
  ------------------
 1069|    116|				goto unknown;
 1070|    296|			break;
 1071|    296|		case CDF_SIGNED32:
  ------------------
  |  |  200|    281|#define CDF_SIGNED32		0x00000003
  ------------------
  |  Branch (1071:3): [True: 281, False: 4.46k]
  ------------------
 1072|    360|		case CDF_BOOL:
  ------------------
  |  |  208|    360|#define CDF_BOOL		0x0000000b
  ------------------
  |  Branch (1072:3): [True: 79, False: 4.66k]
  ------------------
 1073|    513|		case CDF_UNSIGNED32:
  ------------------
  |  |  215|    513|#define CDF_UNSIGNED32		0x00000013
  ------------------
  |  Branch (1073:3): [True: 153, False: 4.59k]
  ------------------
 1074|  1.00k|		case CDF_FLOAT:
  ------------------
  |  |  201|  1.00k|#define CDF_FLOAT		0x00000004
  ------------------
  |  Branch (1074:3): [True: 489, False: 4.25k]
  ------------------
 1075|  1.00k|			if (!cdf_copy_info(&inp[i], &q[o4], e, sizeof(int32_t)))
  ------------------
  |  Branch (1075:8): [True: 199, False: 803]
  ------------------
 1076|    199|				goto unknown;
 1077|    803|			break;
 1078|    803|		case CDF_SIGNED64:
  ------------------
  |  |  216|     79|#define CDF_SIGNED64		0x00000014
  ------------------
  |  Branch (1078:3): [True: 79, False: 4.66k]
  ------------------
 1079|    149|		case CDF_UNSIGNED64:
  ------------------
  |  |  217|    149|#define CDF_UNSIGNED64		0x00000015
  ------------------
  |  Branch (1079:3): [True: 70, False: 4.67k]
  ------------------
 1080|    333|		case CDF_DOUBLE:
  ------------------
  |  |  202|    333|#define CDF_DOUBLE		0x00000005
  ------------------
  |  Branch (1080:3): [True: 184, False: 4.56k]
  ------------------
 1081|    906|		case CDF_FILETIME:
  ------------------
  |  |  228|    906|#define CDF_FILETIME		0x00000040
  ------------------
  |  Branch (1081:3): [True: 573, False: 4.17k]
  ------------------
 1082|    906|			if (!cdf_copy_info(&inp[i], &q[o4], e, sizeof(int64_t)))
  ------------------
  |  Branch (1082:8): [True: 263, False: 643]
  ------------------
 1083|    263|				goto unknown;
 1084|    643|			break;
 1085|    643|		case CDF_LENGTH32_STRING:
  ------------------
  |  |  226|    335|#define CDF_LENGTH32_STRING	0x0000001e
  ------------------
  |  Branch (1085:3): [True: 335, False: 4.41k]
  ------------------
 1086|    491|		case CDF_LENGTH32_WSTRING:
  ------------------
  |  |  227|    491|#define CDF_LENGTH32_WSTRING	0x0000001f
  ------------------
  |  Branch (1086:3): [True: 156, False: 4.59k]
  ------------------
 1087|    491|			if (nelements > 1) {
  ------------------
  |  Branch (1087:8): [True: 92, False: 399]
  ------------------
 1088|     92|				size_t nelem = inp - *info;
 1089|     92|				inp = cdf_grow_info(info, maxcount, nelements);
 1090|     92|				if (inp == NULL)
  ------------------
  |  Branch (1090:9): [True: 4, False: 88]
  ------------------
 1091|      4|					goto out;
 1092|     88|				inp += nelem;
 1093|     88|			}
 1094|   319k|			for (j = 0; j < nelements && i < sh.sh_properties;
  ------------------
  |  Branch (1094:16): [True: 319k, False: 422]
  |  Branch (1094:33): [True: 319k, False: 4]
  ------------------
 1095|   319k|			    j++, i++)
 1096|   319k|			{
 1097|   319k|				uint32_t l;
 1098|       |
 1099|   319k|				if (o4 + sizeof(uint32_t) > left)
  ------------------
  |  Branch (1099:9): [True: 9, False: 319k]
  ------------------
 1100|      9|					goto out;
 1101|       |
 1102|   319k|				l = CDF_GETUINT32(q, slen);
  ------------------
  |  |   92|   319k|#define CDF_GETUINT32(x, y)	cdf_getuint32(x, y)
  ------------------
 1103|   319k|				o4 += sizeof(uint32_t);
 1104|   319k|				if (o4 + l > left)
  ------------------
  |  Branch (1104:9): [True: 52, False: 319k]
  ------------------
 1105|     52|					goto out;
 1106|       |
 1107|   319k|				inp[i].pi_str.s_len = l;
  ------------------
  |  |  191|   319k|#define pi_str	pi_val._pi_str
  ------------------
 1108|   319k|				inp[i].pi_str.s_buf = CAST(const char *,
  ------------------
  |  |  191|   319k|#define pi_str	pi_val._pi_str
  ------------------
              				inp[i].pi_str.s_buf = CAST(const char *,
  ------------------
  |  |  452|   319k|#define CAST(T, b)	((T)(b))
  ------------------
 1109|   319k|				    CAST(const void *, &q[o4]));
 1110|       |
 1111|   319k|				DPRINTF(("o=%" SIZE_T_FORMAT "u l=%d(%"
 1112|   319k|				    SIZE_T_FORMAT "u), t=%" SIZE_T_FORMAT
 1113|   319k|				    "u s=%.*s\n", o4, l,
 1114|   319k|				    CDF_ROUND(l, sizeof(l)),
 1115|   319k|				    left, (int)l, inp[i].pi_str.s_buf));
 1116|       |
 1117|   319k|				if (l & 1)
  ------------------
  |  Branch (1117:9): [True: 210, False: 319k]
  ------------------
 1118|    210|					l++;
 1119|       |
 1120|   319k|				slen += l >> 1;
 1121|   319k|				o4 = slen * sizeof(uint32_t);
 1122|   319k|			}
 1123|    426|			i--;
 1124|    426|			break;
 1125|    154|		case CDF_CLIPBOARD:
  ------------------
  |  |  235|    154|#define CDF_CLIPBOARD		0x00000047
  ------------------
  |  Branch (1125:3): [True: 154, False: 4.59k]
  ------------------
 1126|    154|			if (inp[i].pi_type & CDF_VECTOR)
  ------------------
  |  |  237|    154|#define CDF_VECTOR		0x00001000
  ------------------
  |  Branch (1126:8): [True: 36, False: 118]
  ------------------
 1127|     36|				goto unknown;
 1128|    118|			break;
 1129|    607|		default:
  ------------------
  |  Branch (1129:3): [True: 607, False: 4.13k]
  ------------------
 1130|  2.90k|		unknown:
 1131|  2.90k|			memset(&inp[i].pi_val, 0, sizeof(inp[i].pi_val));
 1132|  2.90k|			DPRINTF(("Don't know how to deal with %#x\n",
 1133|  2.90k|			    inp[i].pi_type));
 1134|  2.90k|			break;
 1135|  4.74k|		}
 1136|  4.74k|	}
 1137|    356|	return 0;
 1138|    513|out:
 1139|    513|	free(*info);
 1140|    513|	*info = NULL;
 1141|    513|	*count = 0;
 1142|    513|	*maxcount = 0;
 1143|    513|	errno = EFTYPE;
  ------------------
  |  |   59|    513|#define EFTYPE EINVAL
  ------------------
 1144|    513|	return -1;
 1145|    699|}
cdf_unpack_summary_info:
 1150|    882|{
 1151|    882|	size_t maxcount;
 1152|    882|	const cdf_summary_info_header_t *si =
 1153|    882|	    CAST(const cdf_summary_info_header_t *, sst->sst_tab);
  ------------------
  |  |  452|    882|#define CAST(T, b)	((T)(b))
  ------------------
 1154|    882|	const cdf_section_declaration_t *sd =
 1155|    882|	    CAST(const cdf_section_declaration_t *, RCAST(const void *,
  ------------------
  |  |  452|    882|#define CAST(T, b)	((T)(b))
  ------------------
 1156|    882|	    RCAST(const char *, sst->sst_tab)
 1157|    882|	    + CDF_SECTION_DECLARATION_OFFSET));
 1158|       |
 1159|    882|	if (cdf_check_stream_offset(sst, h, si, sizeof(*si), __LINE__) == -1 ||
  ------------------
  |  Branch (1159:6): [True: 8, False: 874]
  ------------------
 1160|    874|	    cdf_check_stream_offset(sst, h, sd, sizeof(*sd), __LINE__) == -1)
  ------------------
  |  Branch (1160:6): [True: 5, False: 869]
  ------------------
 1161|     13|		return -1;
 1162|    869|	ssi->si_byte_order = CDF_TOLE2(si->si_byte_order);
  ------------------
  |  |   86|    869|    (CAST(uint16_t, NEED_SWAP ? _cdf_tole2(x) : CAST(uint16_t, x)))
  |  |  ------------------
  |  |  |  |  452|  1.73k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 869]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1163|    869|	ssi->si_os_version = CDF_TOLE2(si->si_os_version);
  ------------------
  |  |   86|    869|    (CAST(uint16_t, NEED_SWAP ? _cdf_tole2(x) : CAST(uint16_t, x)))
  |  |  ------------------
  |  |  |  |  452|  1.73k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 869]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1164|    869|	ssi->si_os = CDF_TOLE2(si->si_os);
  ------------------
  |  |   86|    869|    (CAST(uint16_t, NEED_SWAP ? _cdf_tole2(x) : CAST(uint16_t, x)))
  |  |  ------------------
  |  |  |  |  452|  1.73k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 869]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1165|    869|	ssi->si_class = si->si_class;
 1166|    869|	cdf_swap_class(&ssi->si_class);
 1167|    869|	ssi->si_count = CDF_TOLE4(si->si_count);
  ------------------
  |  |   84|    869|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  452|  1.73k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 869]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1168|    869|	*count = 0;
 1169|    869|	maxcount = 0;
 1170|    869|	*info = NULL;
 1171|    869|	if (cdf_read_property_info(sst, h, CDF_TOLE4(sd->sd_offset), info,
  ------------------
  |  |   84|    869|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  452|  1.73k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 869]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1171:6): [True: 513, False: 356]
  ------------------
 1172|    869|	    count, &maxcount) == -1)
 1173|    513|		return -1;
 1174|    356|	return 0;
 1175|    869|}
cdf_print_property_name:
 1294|  1.32k|{
 1295|  1.32k|	size_t i;
 1296|       |
 1297|  23.7k|	for (i = 0; i < __arraycount(vn); i++)
  ------------------
  |  |  130|  23.7k|#define __arraycount(a) (sizeof(a) / sizeof(a[0]))
  ------------------
  |  Branch (1297:14): [True: 22.7k, False: 998]
  ------------------
 1298|  22.7k|		if (vn[i].v == p)
  ------------------
  |  Branch (1298:7): [True: 323, False: 22.4k]
  ------------------
 1299|    323|			return snprintf(buf, bufsiz, "%s", vn[i].n);
 1300|    998|	return snprintf(buf, bufsiz, "%#x", p);
 1301|  1.32k|}
cdf_print_elapsed_time:
 1305|    242|{
 1306|    242|	int len = 0;
 1307|    242|	int days, hours, mins, secs;
 1308|       |
 1309|    242|	ts /= CDF_TIME_PREC;
  ------------------
  |  |   90|    242|#define CDF_TIME_PREC	10000000
  ------------------
 1310|    242|	secs = CAST(int, ts % 60);
  ------------------
  |  |  452|    242|#define CAST(T, b)	((T)(b))
  ------------------
 1311|    242|	ts /= 60;
 1312|    242|	mins = CAST(int, ts % 60);
  ------------------
  |  |  452|    242|#define CAST(T, b)	((T)(b))
  ------------------
 1313|    242|	ts /= 60;
 1314|    242|	hours = CAST(int, ts % 24);
  ------------------
  |  |  452|    242|#define CAST(T, b)	((T)(b))
  ------------------
 1315|    242|	ts /= 24;
 1316|    242|	days = CAST(int, ts);
  ------------------
  |  |  452|    242|#define CAST(T, b)	((T)(b))
  ------------------
 1317|       |
 1318|    242|	if (days) {
  ------------------
  |  Branch (1318:6): [True: 137, False: 105]
  ------------------
 1319|    137|		len += snprintf(buf + len, bufsiz - len, "%dd+", days);
 1320|    137|		if (CAST(size_t, len) >= bufsiz)
  ------------------
  |  |  452|    137|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (1320:7): [True: 0, False: 137]
  ------------------
 1321|      0|			return len;
 1322|    137|	}
 1323|       |
 1324|    242|	if (days || hours) {
  ------------------
  |  Branch (1324:6): [True: 137, False: 105]
  |  Branch (1324:14): [True: 48, False: 57]
  ------------------
 1325|    185|		len += snprintf(buf + len, bufsiz - len, "%.2d:", hours);
 1326|    185|		if (CAST(size_t, len) >= bufsiz)
  ------------------
  |  |  452|    185|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (1326:7): [True: 0, False: 185]
  ------------------
 1327|      0|			return len;
 1328|    185|	}
 1329|       |
 1330|    242|	len += snprintf(buf + len, bufsiz - len, "%.2d:", mins);
 1331|    242|	if (CAST(size_t, len) >= bufsiz)
  ------------------
  |  |  452|    242|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (1331:6): [True: 0, False: 242]
  ------------------
 1332|      0|		return len;
 1333|       |
 1334|    242|	len += snprintf(buf + len, bufsiz - len, "%.2d", secs);
 1335|    242|	return len;
 1336|    242|}
cdf.c:cdf_read:
  371|  4.73M|{
  372|  4.73M|	size_t siz = CAST(size_t, off + len);
  ------------------
  |  |  452|  4.73M|#define CAST(T, b)	((T)(b))
  ------------------
  373|       |
  374|  4.73M|	if (CAST(off_t, off + len) != CAST(off_t, siz))
  ------------------
  |  |  452|  4.73M|#define CAST(T, b)	((T)(b))
  ------------------
              	if (CAST(off_t, off + len) != CAST(off_t, siz))
  ------------------
  |  |  452|  4.73M|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (374:6): [True: 0, False: 4.73M]
  ------------------
  375|      0|		goto out;
  376|       |
  377|  4.73M|	if (info->i_buf != NULL && info->i_len >= siz) {
  ------------------
  |  Branch (377:6): [True: 4.73M, False: 0]
  |  Branch (377:29): [True: 4.73M, False: 7.83k]
  ------------------
  378|  4.73M|		(void)memcpy(buf, &info->i_buf[off], len);
  379|  4.73M|		return CAST(ssize_t, len);
  ------------------
  |  |  452|  4.73M|#define CAST(T, b)	((T)(b))
  ------------------
  380|  4.73M|	}
  381|       |
  382|  7.83k|	if (info->i_fd == -1)
  ------------------
  |  Branch (382:6): [True: 7.83k, False: 0]
  ------------------
  383|  7.83k|		goto out;
  384|       |
  385|      0|	if (pread(info->i_fd, buf, len, off) != CAST(ssize_t, len))
  ------------------
  |  |  452|      0|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (385:6): [True: 0, False: 0]
  ------------------
  386|      0|		return -1;
  387|       |
  388|      0|	return CAST(ssize_t, len);
  ------------------
  |  |  452|      0|#define CAST(T, b)	((T)(b))
  ------------------
  389|  7.83k|out:
  390|  7.83k|	errno = EINVAL;
  391|  7.83k|	return -1;
  392|      0|}
cdf.c:cdf_calloc:
  125|  7.40k|{
  126|  7.40k|	DPRINTF(("%s,%" SIZE_T_FORMAT "u: %s %" SIZE_T_FORMAT "u %"
  127|  7.40k|	    SIZE_T_FORMAT "u\n", file, line, __func__, n, u));
  128|  7.40k|	if (n == 0)
  ------------------
  |  Branch (128:6): [True: 100, False: 7.30k]
  ------------------
  129|    100|	    n++;
  130|  7.40k|	return calloc(n, u);
  131|  7.40k|}
cdf.c:cdf_malloc:
  103|  1.27k|{
  104|  1.27k|	DPRINTF(("%s,%" SIZE_T_FORMAT "u: %s %" SIZE_T_FORMAT "u\n",
  105|  1.27k|	    file, line, __func__, n));
  106|  1.27k|	if (n == 0)
  ------------------
  |  Branch (106:6): [True: 0, False: 1.27k]
  ------------------
  107|      0|	    n++;
  108|  1.27k|	return malloc(n);
  109|  1.27k|}
cdf.c:cdf_offset:
  901|  8.74k|{
  902|  8.74k|	return CAST(const void *, CAST(const uint8_t *, p) + l);
  ------------------
  |  |  452|  8.74k|#define CAST(T, b)	((T)(b))
  ------------------
  903|  8.74k|}
cdf.c:cdf_check_stream_offset:
  354|  10.7k|{
  355|  10.7k|	const char *b = RCAST(const char *, sst->sst_tab);
  ------------------
  |  |  453|  10.7k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
  356|  10.7k|	const char *e = RCAST(const char *, p) + tail;
  ------------------
  |  |  453|  10.7k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
  357|  10.7k|	size_t ss = cdf_check_stream(sst, h);
  358|  10.7k|	/*LINTED*/(void)&line;
  359|  10.7k|	if (e >= b && CAST(size_t, e - b) <= ss * sst->sst_len)
  ------------------
  |  |  452|  10.7k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (359:6): [True: 10.7k, False: 0]
  |  Branch (359:16): [True: 10.6k, False: 133]
  ------------------
  360|  10.6k|		return 0;
  361|    133|	DPRINTF(("%d: offset begin %p < end %p || %" SIZE_T_FORMAT "u"
  362|    133|	    " > %" SIZE_T_FORMAT "u [%" SIZE_T_FORMAT "u %"
  363|    133|	    SIZE_T_FORMAT "u]\n", line, b, e, (size_t)(e - b),
  364|    133|	    ss * sst->sst_len, ss, sst->sst_len));
  365|    133|	errno = EFTYPE;
  ------------------
  |  |   59|    133|#define EFTYPE EINVAL
  ------------------
  366|    133|	return -1;
  367|  10.7k|}
cdf.c:cdf_grow_info:
  938|    802|{
  939|    802|	cdf_property_info_t *inp;
  940|    802|	size_t newcount = *maxcount + incr;
  941|       |
  942|    802|	if (newcount > CDF_PROP_LIMIT) {
  ------------------
  |  |  897|    802|#define CDF_PROP_LIMIT (UINT32_MAX / (64 * sizeof(cdf_property_info_t)))
  ------------------
  |  Branch (942:6): [True: 4, False: 798]
  ------------------
  943|      4|		DPRINTF(("exceeded property limit %" SIZE_T_FORMAT "u > %"
  944|      4|		    SIZE_T_FORMAT "u\n", newcount, CDF_PROP_LIMIT));
  945|      4|		goto out;
  946|      4|	}
  947|    798|	inp = CAST(cdf_property_info_t *,
  ------------------
  |  |  452|    798|#define CAST(T, b)	((T)(b))
  ------------------
  948|    798|	    CDF_REALLOC(*info, newcount * sizeof(*inp)));
  949|    798|	if (inp == NULL)
  ------------------
  |  Branch (949:6): [True: 0, False: 798]
  ------------------
  950|      0|		goto out;
  951|       |
  952|    798|	*info = inp;
  953|    798|	*maxcount = newcount;
  954|    798|	return inp;
  955|      4|out:
  956|      4|	free(*info);
  957|      4|	*maxcount = 0;
  958|      4|	*info = NULL;
  959|       |	return NULL;
  960|    798|}
cdf.c:cdf_realloc:
  115|    798|{
  116|    798|	DPRINTF(("%s,%" SIZE_T_FORMAT "u: %s %" SIZE_T_FORMAT "u\n",
  117|    798|	    file, line, __func__, n));
  118|    798|	return realloc(p, n);
  119|    798|}
cdf.c:cdf_get_property_info_pos:
  908|  6.71k|{
  909|  6.71k|	size_t tail = (i << 1) + 1;
  910|  6.71k|	size_t ofs;
  911|       |
  912|  6.71k|	if (p >= e) {
  ------------------
  |  Branch (912:6): [True: 0, False: 6.71k]
  ------------------
  913|      0|		DPRINTF(("Past end %p < %p\n", e, p));
  914|      0|		return NULL;
  915|      0|	}
  916|       |
  917|  6.71k|	if (cdf_check_stream_offset(sst, h, p, (tail + 1) * sizeof(uint32_t),
  ------------------
  |  Branch (917:6): [True: 12, False: 6.69k]
  ------------------
  918|  6.71k|	    __LINE__) == -1)
  919|     12|		return NULL;
  920|       |
  921|  6.69k|	ofs = CDF_GETUINT32(p, tail);
  ------------------
  |  |   92|  6.69k|#define CDF_GETUINT32(x, y)	cdf_getuint32(x, y)
  ------------------
  922|  6.69k|	if (ofs < 2 * sizeof(uint32_t)) {
  ------------------
  |  Branch (922:6): [True: 22, False: 6.67k]
  ------------------
  923|     22|		DPRINTF(("Offset too small %zu\n", ofs));
  924|     22|		return NULL;
  925|     22|	}
  926|       |
  927|  6.67k|	ofs -= 2 * sizeof(uint32_t);
  928|  6.67k|	if (ofs > CAST(size_t, e - p)) {
  ------------------
  |  |  452|  6.67k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (928:6): [True: 202, False: 6.47k]
  ------------------
  929|    202|		DPRINTF(("Offset too big %zu %td\n", ofs, e - p));
  930|    202|		return NULL;
  931|    202|	}
  932|       |
  933|  6.47k|	return CAST(const uint8_t *, cdf_offset(CAST(const void *, p), ofs));
  ------------------
  |  |  452|  6.47k|#define CAST(T, b)	((T)(b))
  ------------------
  934|  6.67k|}
cdf.c:cdf_getuint32:
  199|   340k|{
  200|   340k|	uint32_t rv;
  201|   340k|	(void)memcpy(&rv, p + offs * sizeof(uint32_t), sizeof(rv));
  202|   340k|	return CDF_TOLE4(rv);
  ------------------
  |  |   84|   340k|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  452|   680k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 340k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  203|   340k|}
cdf.c:cdf_copy_info:
  965|  2.32k|{
  966|  2.32k|	if (inp->pi_type & CDF_VECTOR)
  ------------------
  |  |  237|  2.32k|#define CDF_VECTOR		0x00001000
  ------------------
  |  Branch (966:6): [True: 363, False: 1.95k]
  ------------------
  967|    363|		return 0;
  968|       |
  969|  1.95k|	if (CAST(size_t, CAST(const char *, e) - CAST(const char *, p)) < len)
  ------------------
  |  |  452|  1.95k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (969:6): [True: 215, False: 1.74k]
  ------------------
  970|    215|		return 0;
  971|       |
  972|  1.74k|	(void)memcpy(&inp->pi_val, p, len);
  973|       |
  974|  1.74k|	switch (len) {
  975|    296|	case 2:
  ------------------
  |  Branch (975:2): [True: 296, False: 1.44k]
  ------------------
  976|    296|		inp->pi_u16 = CDF_TOLE2(inp->pi_u16);
  ------------------
  |  |  186|    296|#define pi_u16	pi_val._pi_u16
  ------------------
              		inp->pi_u16 = CDF_TOLE2(inp->pi_u16);
  ------------------
  |  |   86|    296|    (CAST(uint16_t, NEED_SWAP ? _cdf_tole2(x) : CAST(uint16_t, x)))
  |  |  ------------------
  |  |  |  |  452|    592|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 296]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  977|    296|		break;
  978|    803|	case 4:
  ------------------
  |  Branch (978:2): [True: 803, False: 939]
  ------------------
  979|    803|		inp->pi_u32 = CDF_TOLE4(inp->pi_u32);
  ------------------
  |  |  184|    803|#define pi_u32	pi_val._pi_u32
  ------------------
              		inp->pi_u32 = CDF_TOLE4(inp->pi_u32);
  ------------------
  |  |   84|    803|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  452|  1.60k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 803]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  980|    803|		break;
  981|    643|	case 8:
  ------------------
  |  Branch (981:2): [True: 643, False: 1.09k]
  ------------------
  982|    643|		inp->pi_u64 = CDF_TOLE8(inp->pi_u64);
  ------------------
  |  |  182|    643|#define pi_u64	pi_val._pi_u64
  ------------------
              		inp->pi_u64 = CDF_TOLE8(inp->pi_u64);
  ------------------
  |  |   82|    643|    (CAST(uint64_t, NEED_SWAP ? _cdf_tole8(x) : CAST(uint64_t, x)))
  |  |  ------------------
  |  |  |  |  452|  1.28k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 0, False: 643]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  983|    643|		break;
  984|      0|	default:
  ------------------
  |  Branch (984:2): [True: 0, False: 1.74k]
  ------------------
  985|      0|		abort();
  986|  1.74k|	}
  987|  1.74k|	return 1;
  988|  1.74k|}
cdf.c:cdf_check_stream:
  344|  10.7k|{
  345|  10.7k|	size_t ss = sst->sst_dirlen < h->h_min_size_standard_stream ?
  ------------------
  |  Branch (345:14): [True: 842, False: 9.95k]
  ------------------
  346|  10.7k|	    CDF_SHORT_SEC_SIZE(h) : CDF_SEC_SIZE(h);
  ------------------
  |  |   82|    842|#define CDF_SHORT_SEC_SIZE(h)	CAST(size_t, 1 << (h)->h_short_sec_size_p2)
  |  |  ------------------
  |  |  |  |  452|    842|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
              	    CDF_SHORT_SEC_SIZE(h) : CDF_SEC_SIZE(h);
  ------------------
  |  |   80|  9.95k|#define CDF_SEC_SIZE(h) CAST(size_t, 1 << (h)->h_sec_size_p2)
  |  |  ------------------
  |  |  |  |  452|  9.95k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  347|  10.7k|	assert(ss == sst->sst_ss);
  ------------------
  |  Branch (347:2): [True: 0, False: 10.7k]
  |  Branch (347:2): [True: 10.7k, False: 0]
  ------------------
  348|  10.7k|	return sst->sst_ss;
  349|  10.7k|}

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

file_zmagic:
  284|  14.4k|{
  285|  14.4k|	unsigned char *newbuf = NULL;
  286|  14.4k|	size_t i, nsz;
  287|  14.4k|	char *rbuf;
  288|  14.4k|	file_pushbuf_t *pb;
  289|  14.4k|	int urv, prv, rv = 0;
  290|  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 */
  |  |  ------------------
  ------------------
  291|  14.4k|	int fd = b->fd;
  292|  14.4k|	const unsigned char *buf = CAST(const unsigned char *, b->fbuf);
  ------------------
  |  |  452|  14.4k|#define CAST(T, b)	((T)(b))
  ------------------
  293|  14.4k|	size_t nbytes = b->flen;
  294|  14.4k|	int sa_saved = 0;
  295|  14.4k|	struct sigaction sig_act;
  296|       |
  297|  14.4k|	if ((ms->flags & MAGIC_COMPRESS) == 0)
  ------------------
  |  |   35|  14.4k|#define	MAGIC_COMPRESS		0x0000004 /* Check inside compressed files */
  ------------------
  |  Branch (297:6): [True: 6.90k, False: 7.56k]
  ------------------
  298|  6.90k|		return 0;
  299|       |
  300|   121k|	for (i = 0; i < ncompr; i++) {
  ------------------
  |  Branch (300:14): [True: 113k, False: 7.56k]
  ------------------
  301|   113k|		int zm;
  302|   113k|		if (nbytes < CAST(size_t, abs(compr[i].maglen)))
  ------------------
  |  |  452|   113k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (302:7): [True: 7.31k, False: 106k]
  ------------------
  303|  7.31k|			continue;
  304|   106k|		if (compr[i].maglen < 0) {
  ------------------
  |  Branch (304:7): [True: 12.2k, False: 93.9k]
  ------------------
  305|  12.2k|			zm = (*compr[i].u.func)(buf);
  306|  93.9k|		} else {
  307|  93.9k|			zm = memcmp(buf, compr[i].u.magic,
  308|  93.9k|			    CAST(size_t, compr[i].maglen)) == 0;
  ------------------
  |  |  452|  93.9k|#define CAST(T, b)	((T)(b))
  ------------------
  309|  93.9k|		}
  310|       |
  311|   106k|		if (!zm)
  ------------------
  |  Branch (311:7): [True: 102k, False: 3.94k]
  ------------------
  312|   102k|			continue;
  313|       |
  314|       |		/* Prevent SIGPIPE death if child dies unexpectedly */
  315|  3.94k|		if (!sa_saved) {
  ------------------
  |  Branch (315:7): [True: 3.32k, False: 625]
  ------------------
  316|       |			//We can use sig_act for both new and old, but
  317|  3.32k|			struct sigaction new_act;
  318|  3.32k|			memset(&new_act, 0, sizeof(new_act));
  319|  3.32k|			new_act.sa_handler = SIG_IGN;
  320|  3.32k|			sa_saved = sigaction(SIGPIPE, &new_act, &sig_act) != -1;
  321|  3.32k|		}
  322|       |
  323|  3.94k|		nsz = nbytes;
  324|  3.94k|		free(newbuf);
  325|  3.94k|		urv = uncompressbuf(fd, ms->bytes_max, i, 
  326|  3.94k|		    (ms->flags & MAGIC_NO_COMPRESS_FORK), buf, &newbuf, &nsz);
  ------------------
  |  |   50|  3.94k|#define MAGIC_NO_COMPRESS_FORK	0x4000000 /* Don't allow decompression that
  ------------------
  327|  3.94k|		DPRINTF("uncompressbuf = %d, %s, %" SIZE_T_FORMAT "u\n", urv,
  328|  3.94k|		    (char *)newbuf, nsz);
  329|  3.94k|		switch (urv) {
  330|  3.20k|		case OKDATA:
  ------------------
  |  |  224|  3.20k|#define OKDATA 	0
  ------------------
  |  Branch (330:3): [True: 3.20k, False: 743]
  ------------------
  331|  3.94k|		case ERRDATA:
  ------------------
  |  |  226|  3.94k|#define ERRDATA	2
  ------------------
  |  Branch (331:3): [True: 743, False: 3.20k]
  ------------------
  332|  3.94k|			ms->flags &= ~MAGIC_COMPRESS;
  ------------------
  |  |   35|  3.94k|#define	MAGIC_COMPRESS		0x0000004 /* Check inside compressed files */
  ------------------
  333|  3.94k|			if (urv == ERRDATA)
  ------------------
  |  |  226|  3.94k|#define ERRDATA	2
  ------------------
  |  Branch (333:8): [True: 743, False: 3.20k]
  ------------------
  334|    743|				prv = format_decompression_error(ms, i, newbuf);
  335|  3.20k|			else
  336|  3.20k|				prv = file_buffer(ms, -1, NULL, name, newbuf,
  337|  3.20k|				    nsz);
  338|  3.94k|			if (prv == -1)
  ------------------
  |  Branch (338:8): [True: 0, False: 3.94k]
  ------------------
  339|      0|				goto error;
  340|  3.94k|			rv = 1;
  341|  3.94k|			if ((ms->flags & MAGIC_COMPRESS_TRANSP) != 0)
  ------------------
  |  |   48|  3.94k|#define MAGIC_COMPRESS_TRANSP	0x2000000 /* Check inside compressed files
  ------------------
  |  Branch (341:8): [True: 0, False: 3.94k]
  ------------------
  342|      0|				goto out;
  343|  3.94k|			if (mime != MAGIC_MIME && mime != 0)
  ------------------
  |  |   44|  7.89k|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   37|  3.94k|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  ------------------
  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   43|  3.94k|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  ------------------
  ------------------
  |  Branch (343:8): [True: 3.94k, False: 0]
  |  Branch (343:30): [True: 0, False: 3.94k]
  ------------------
  344|      0|				goto out;
  345|  3.94k|			if ((file_printf(ms,
  ------------------
  |  Branch (345:8): [True: 0, False: 3.94k]
  ------------------
  346|  3.94k|			    mime ? " compressed-encoding=" : " (")) == -1)
  ------------------
  |  Branch (346:8): [True: 0, False: 3.94k]
  ------------------
  347|      0|				goto error;
  348|  3.94k|			if ((pb = file_push_buffer(ms)) == NULL)
  ------------------
  |  Branch (348:8): [True: 215, False: 3.73k]
  ------------------
  349|    215|				goto error;
  350|       |			/*
  351|       |			 * XXX: If file_buffer fails here, we overwrite
  352|       |			 * the compressed text. FIXME.
  353|       |			 */
  354|  3.73k|			if (file_buffer(ms, -1, NULL, NULL, buf, nbytes) == -1)
  ------------------
  |  Branch (354:8): [True: 0, False: 3.73k]
  ------------------
  355|      0|			{
  356|      0|				if (file_pop_buffer(ms, pb) != NULL)
  ------------------
  |  Branch (356:9): [True: 0, False: 0]
  ------------------
  357|      0|					abort();
  358|      0|				goto error;
  359|      0|			}
  360|  3.73k|			if ((rbuf = file_pop_buffer(ms, pb)) != NULL) {
  ------------------
  |  Branch (360:8): [True: 3.70k, False: 25]
  ------------------
  361|  3.70k|				if (file_printf(ms, "%s", rbuf) == -1) {
  ------------------
  |  Branch (361:9): [True: 5, False: 3.70k]
  ------------------
  362|      5|					free(rbuf);
  363|      5|					goto error;
  364|      5|				}
  365|  3.70k|				free(rbuf);
  366|  3.70k|			}
  367|  3.72k|			if (!mime && file_printf(ms, ")") == -1)
  ------------------
  |  Branch (367:8): [True: 3.72k, False: 0]
  |  Branch (367:17): [True: 0, False: 3.72k]
  ------------------
  368|      0|				goto error;
  369|       |			/*FALLTHROUGH*/
  370|  3.72k|		case NODATA:
  ------------------
  |  |  225|  3.72k|#define NODATA	1
  ------------------
  |  Branch (370:3): [True: 0, False: 3.94k]
  ------------------
  371|  3.72k|			break;
  372|      0|		default:
  ------------------
  |  Branch (372:3): [True: 0, False: 3.94k]
  ------------------
  373|      0|			abort();
  374|       |			/*NOTREACHED*/
  375|    220|		error:
  376|    220|			rv = -1;
  377|    220|			break;
  378|  3.94k|		}
  379|  3.94k|	}
  380|  7.56k|out:
  381|  7.56k|	DPRINTF("rv = %d\n", rv);
  382|       |
  383|  7.56k|	if (sa_saved && sig_act.sa_handler != SIG_IGN)
  ------------------
  |  Branch (383:6): [True: 3.32k, False: 4.24k]
  |  Branch (383:18): [True: 3.32k, False: 0]
  ------------------
  384|  3.32k|		(void)sigaction(SIGPIPE, &sig_act, NULL);
  385|       |
  386|  7.56k|	free(newbuf);
  387|  7.56k|	ms->flags |= MAGIC_COMPRESS;
  ------------------
  |  |   35|  7.56k|#define	MAGIC_COMPRESS		0x0000004 /* Check inside compressed files */
  ------------------
  388|  7.56k|	DPRINTF("Zmagic returns %d\n", rv);
  389|  7.56k|	return rv;
  390|  7.56k|}
sread:
  422|  7.56k|{
  423|  7.56k|	ssize_t rv;
  424|  7.56k|#if defined(FIONREAD) && !defined(__MINGW32__)
  425|  7.56k|	int t = 0;
  426|  7.56k|#endif
  427|  7.56k|	size_t rn = n;
  428|       |
  429|  7.56k|	if (fd == STDIN_FILENO)
  ------------------
  |  Branch (429:6): [True: 0, False: 7.56k]
  ------------------
  430|      0|		goto nocheck;
  431|       |
  432|  7.56k|#if defined(FIONREAD) && !defined(__MINGW32__)
  433|  7.56k|	if (canbepipe && (ioctl(fd, FIONREAD, &t) == -1 || t == 0)) {
  ------------------
  |  Branch (433:6): [True: 0, False: 7.56k]
  |  Branch (433:20): [True: 0, False: 0]
  |  Branch (433:53): [True: 0, False: 0]
  ------------------
  434|      0|#ifdef FD_ZERO
  435|      0|		ssize_t cnt;
  436|      0|		for (cnt = 0;; cnt++) {
  437|      0|			fd_set check;
  438|      0|			struct timeval tout = {0, 100 * 1000};
  439|      0|			int selrv;
  440|       |
  441|      0|			FD_ZERO(&check);
  ------------------
  |  Branch (441:4): [Folded, False: 0]
  ------------------
  442|      0|			FD_SET(fd, &check);
  443|       |
  444|       |			/*
  445|       |			 * Avoid soft deadlock: do not read if there
  446|       |			 * is nothing to read from sockets and pipes.
  447|       |			 */
  448|      0|			selrv = select(fd + 1, &check, NULL, NULL, &tout);
  449|      0|			if (selrv == -1) {
  ------------------
  |  Branch (449:8): [True: 0, False: 0]
  ------------------
  450|      0|				if (errno == EINTR || errno == EAGAIN)
  ------------------
  |  Branch (450:9): [True: 0, False: 0]
  |  Branch (450:27): [True: 0, False: 0]
  ------------------
  451|      0|					continue;
  452|      0|			} else if (selrv == 0 && cnt >= 5) {
  ------------------
  |  Branch (452:15): [True: 0, False: 0]
  |  Branch (452:29): [True: 0, False: 0]
  ------------------
  453|      0|				return 0;
  454|      0|			} else
  455|      0|				break;
  456|      0|		}
  457|      0|#endif
  458|      0|		(void)ioctl(fd, FIONREAD, &t);
  459|      0|	}
  460|       |
  461|  7.56k|	if (t > 0 && CAST(size_t, t) < n) {
  ------------------
  |  |  452|      0|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (461:6): [True: 0, False: 7.56k]
  |  Branch (461:15): [True: 0, False: 0]
  ------------------
  462|      0|		n = t;
  463|      0|		rn = n;
  464|      0|	}
  465|  7.56k|#endif
  466|       |
  467|  7.56k|nocheck:
  468|  7.56k|	do
  469|   348k|		switch ((rv = read(fd, buf, n))) {
  470|      2|		case -1:
  ------------------
  |  Branch (470:3): [True: 2, False: 348k]
  ------------------
  471|      2|			if (errno == EINTR)
  ------------------
  |  Branch (471:8): [True: 2, False: 0]
  ------------------
  472|      2|				continue;
  473|      0|			return -1;
  474|  7.40k|		case 0:
  ------------------
  |  Branch (474:3): [True: 7.40k, False: 341k]
  ------------------
  475|  7.40k|			return rn - n;
  476|   341k|		default:
  ------------------
  |  Branch (476:3): [True: 341k, False: 7.40k]
  ------------------
  477|   341k|			n -= rv;
  478|   341k|			buf = CAST(char *, CCAST(void *, buf)) + rv;
  ------------------
  |  |  452|   341k|#define CAST(T, b)	((T)(b))
  ------------------
  479|   341k|			break;
  480|   348k|		}
  481|   341k|	while (n > 0);
  ------------------
  |  Branch (481:9): [True: 341k, False: 165]
  ------------------
  482|    165|	return rn;
  483|  7.56k|}
compress.c:lzmacmp:
  145|  4.67k|{
  146|  4.67k|	if (buf[0] != 0x5d || buf[1] || buf[2])
  ------------------
  |  Branch (146:6): [True: 4.63k, False: 36]
  |  Branch (146:24): [True: 16, False: 20]
  |  Branch (146:34): [True: 5, False: 15]
  ------------------
  147|  4.65k|		return 0;
  148|     15|	if (buf[12] && buf[12] != 0xff)
  ------------------
  |  Branch (148:6): [True: 12, False: 3]
  |  Branch (148:17): [True: 11, False: 1]
  ------------------
  149|     11|		return 0;
  150|      4|	return 1;
  151|     15|}
compress.c:zlibcmp:
  127|  7.56k|{
  128|  7.56k|	unsigned short x = 1;
  129|  7.56k|	unsigned char *s = CAST(unsigned char *, CAST(void *, &x));
  ------------------
  |  |  452|  7.56k|#define CAST(T, b)	((T)(b))
  ------------------
  130|       |
  131|  7.56k|	if ((buf[0] & 0xf) != 8 || (buf[0] & 0x80) != 0)
  ------------------
  |  Branch (131:6): [True: 7.46k, False: 102]
  |  Branch (131:29): [True: 26, False: 76]
  ------------------
  132|  7.49k|		return 0;
  133|     76|	if (s[0] != 1)	/* endianness test */
  ------------------
  |  Branch (133:6): [True: 0, False: 76]
  ------------------
  134|      0|		x = buf[0] | (buf[1] << 8);
  135|     76|	else
  136|     76|		x = buf[1] | (buf[0] << 8);
  137|     76|	if (x % 31)
  ------------------
  |  Branch (137:6): [True: 55, False: 21]
  ------------------
  138|     55|		return 0;
  139|     21|	return 1;
  140|     76|}
compress.c:format_decompression_error:
  267|    743|{
  268|    743|	unsigned char *p;
  269|    743|	int mime = ms->flags & MAGIC_MIME;
  ------------------
  |  |   44|    743|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   37|    743|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  ------------------
  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   43|    743|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  ------------------
  ------------------
  270|       |
  271|    743|	if (!mime)
  ------------------
  |  Branch (271:6): [True: 743, False: 0]
  ------------------
  272|    743|		return file_printf(ms, "ERROR:[%s: %s]", methodname(i), buf);
  273|       |
  274|      0|	for (p = buf; *p; p++)
  ------------------
  |  Branch (274:16): [True: 0, False: 0]
  ------------------
  275|      0|		if (!isalnum(*p))
  ------------------
  |  Branch (275:7): [True: 0, False: 0]
  ------------------
  276|      0|			*p = '-';
  277|       |
  278|      0|	return file_printf(ms, "application/x-decompression-error-%s-%s",
  279|      0|	    methodname(i), buf);
  280|    743|}
compress.c:methodname:
 1054|    743|{
 1055|    743|	switch (method) {
 1056|      0|#ifdef BUILTIN_DECOMPRESS
 1057|     26|	case METH_FROZEN:
  ------------------
  |  |  193|     26|#define METH_FROZEN	2
  ------------------
  |  Branch (1057:2): [True: 26, False: 717]
  ------------------
 1058|     47|	case METH_ZLIB:
  ------------------
  |  |  200|     47|#define METH_ZLIB	14
  ------------------
  |  Branch (1058:2): [True: 21, False: 722]
  ------------------
 1059|     47|		return "zlib";
 1060|      0|#endif
 1061|      0|#ifdef BUILTIN_BZLIB
 1062|      8|	case METH_BZIP:
  ------------------
  |  |  194|      8|#define METH_BZIP	7
  ------------------
  |  Branch (1062:2): [True: 8, False: 735]
  ------------------
 1063|      8|		return "bzlib";
 1064|      0|#endif
 1065|      0|#ifdef BUILTIN_XZLIB
 1066|      2|	case METH_XZ:
  ------------------
  |  |  195|      2|#define METH_XZ		9
  ------------------
  |  Branch (1066:2): [True: 2, False: 741]
  ------------------
 1067|      6|	case METH_LZMA:
  ------------------
  |  |  199|      6|#define METH_LZMA	13
  ------------------
  |  Branch (1067:2): [True: 4, False: 739]
  ------------------
 1068|      6|		return "xzlib";
 1069|      0|#endif
 1070|      0|#ifdef BUILTIN_ZSTDLIB
 1071|      5|	case METH_ZSTD:
  ------------------
  |  |  198|      5|#define METH_ZSTD	12
  ------------------
  |  Branch (1071:2): [True: 5, False: 738]
  ------------------
 1072|      5|		return "zstd";
 1073|      0|#endif
 1074|       |#ifdef BUILTIN_LZLIB
 1075|       |	case METH_LZIP:
 1076|       |		return "lzlib";
 1077|       |#endif
 1078|       |#ifdef BUILTIN_LRZIP
 1079|       |	case METH_LRZIP:
 1080|       |		return "lrzip";
 1081|       |#endif
 1082|    677|	default:
  ------------------
  |  Branch (1082:2): [True: 677, False: 66]
  ------------------
 1083|    677|		return compr[method].argv[0];
 1084|    743|	}
 1085|    743|}
compress.c:uncompressbuf:
 1127|  3.94k|{
 1128|  3.94k|	int fdp[3][2];
 1129|  3.94k|	int status, rv, w;
 1130|  3.94k|	pid_t pid;
 1131|  3.94k|	pid_t writepid = -1;
 1132|  3.94k|	size_t i;
 1133|  3.94k|	ssize_t r, re;
 1134|  3.94k|	char *const *args;
 1135|  3.94k|#ifdef HAVE_POSIX_SPAWNP
 1136|  3.94k|	posix_spawn_file_actions_t fa;
 1137|  3.94k|#endif
 1138|  3.94k|	int (*decompress)(const unsigned char *, unsigned char **,
 1139|  3.94k|	    size_t, size_t *, int) = getdecompressor(method);
 1140|       |
 1141|  3.94k|	*newch = CAST(unsigned char *, malloc(bytes_max + 1));
  ------------------
  |  |  452|  3.94k|#define CAST(T, b)	((T)(b))
  ------------------
 1142|  3.94k|	if (*newch == NULL)
  ------------------
  |  Branch (1142:6): [True: 0, False: 3.94k]
  ------------------
 1143|      0|		return makeerror(newch, n, "No buffer, %s", strerror(errno));
 1144|       |
 1145|  3.94k|	if (decompress) {
  ------------------
  |  Branch (1145:6): [True: 66, False: 3.87k]
  ------------------
 1146|     66|		if (nofork) {
  ------------------
  |  Branch (1146:7): [True: 66, False: 0]
  ------------------
 1147|     66|			return makeerror(newch, n,
 1148|     66|			    "Fork is required to uncompress, but disabled");
 1149|     66|		}
 1150|      0|		return (*decompress)(old, newch, bytes_max, n, 1);
 1151|     66|	}
 1152|       |
 1153|  3.87k|	(void)fflush(stdout);
 1154|  3.87k|	(void)fflush(stderr);
 1155|       |
 1156|  15.5k|	for (i = 0; i < __arraycount(fdp); i++)
  ------------------
  |  |  130|  15.5k|#define __arraycount(a) (sizeof(a) / sizeof(a[0]))
  ------------------
  |  Branch (1156:14): [True: 11.6k, False: 3.87k]
  ------------------
 1157|  11.6k|		fdp[i][0] = fdp[i][1] = -1;
 1158|       |
 1159|       |	/*
 1160|       |	 * There are multithreaded users who run magic_file()
 1161|       |	 * from dozens of threads. If two parallel magic_file() calls
 1162|       |	 * analyze two large compressed files, both will spawn
 1163|       |	 * an uncompressing child here, which writes out uncompressed data.
 1164|       |	 * We read some portion, then close the pipe, then waitpid() the child.
 1165|       |	 * If uncompressed data is larger, child should get EPIPE and exit.
 1166|       |	 * However, with *parallel* calls OTHER child may unintentionally
 1167|       |	 * inherit pipe fds, thus keeping pipe open and making writes in
 1168|       |	 * our child block instead of failing with EPIPE!
 1169|       |	 * (For the bug to occur, two threads must mutually inherit their pipes,
 1170|       |	 * and both must have large outputs. Thus it happens not that often).
 1171|       |	 * To avoid this, be sure to create pipes with O_CLOEXEC.
 1172|       |	 */
 1173|  3.87k|	if ((fd == -1 && file_pipe_closexec(fdp[STDIN_FILENO]) == -1) ||
  ------------------
  |  Branch (1173:7): [True: 3.87k, False: 0]
  |  Branch (1173:19): [True: 0, False: 3.87k]
  ------------------
 1174|  3.87k|	    file_pipe_closexec(fdp[STDOUT_FILENO]) == -1 ||
  ------------------
  |  Branch (1174:6): [True: 0, False: 3.87k]
  ------------------
 1175|  3.87k|	    file_pipe_closexec(fdp[STDERR_FILENO]) == -1) {
  ------------------
  |  Branch (1175:6): [True: 0, False: 3.87k]
  ------------------
 1176|      0|		closep(fdp[STDIN_FILENO]);
 1177|      0|		closep(fdp[STDOUT_FILENO]);
 1178|      0|		return makeerror(newch, n, "Cannot create pipe, %s",
 1179|      0|		    strerror(errno));
 1180|      0|	}
 1181|       |
 1182|  3.87k|	args = RCAST(char *const *, RCAST(intptr_t, compr[method].argv));
  ------------------
  |  |  453|  3.87k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 1183|  3.87k|#ifdef HAVE_POSIX_SPAWNP
 1184|  3.87k|	posix_spawn_file_actions_init(&fa);
 1185|       |
 1186|  3.87k|	handledesc(&fa, fd, fdp);
 1187|       |
 1188|  3.87k|	DPRINTF("Executing %s\n", compr[method].argv[0]);
 1189|  3.87k|	status = posix_spawnp(&pid, compr[method].argv[0], &fa, NULL,
 1190|  3.87k|	    args, NULL);
 1191|       |
 1192|  3.87k|	posix_spawn_file_actions_destroy(&fa);
 1193|       |
 1194|  3.87k|	if (status != 0) {
  ------------------
  |  Branch (1194:6): [True: 13, False: 3.86k]
  ------------------
 1195|     13|		return makeerror(newch, n, "Cannot posix_spawn `%s', %s",
 1196|     13|		    compr[method].argv[0], strerror(status));
 1197|     13|	}
 1198|       |#else
 1199|       |	/* For processes with large mapped virtual sizes, vfork
 1200|       |	 * may be _much_ faster (10-100 times) than fork.
 1201|       |	 */
 1202|       |	pid = vfork();
 1203|       |	if (pid == -1) {
 1204|       |		return makeerror(newch, n, "Cannot vfork, %s",
 1205|       |		    strerror(errno));
 1206|       |	}
 1207|       |	if (pid == 0) {
 1208|       |		/* child */
 1209|       |		/* Note: we are after vfork, do not modify memory
 1210|       |		 * in a way which confuses parent. In particular,
 1211|       |		 * do not modify fdp[i][j].
 1212|       |		 */
 1213|       |		handledesc(NULL, fd, fdp);
 1214|       |		DPRINTF("Executing %s\n", compr[method].argv[0]);
 1215|       |
 1216|       |		(void)execvp(compr[method].argv[0], args);
 1217|       |		dprintf(STDERR_FILENO, "exec `%s' failed, %s",
 1218|       |		    compr[method].argv[0], strerror(errno));
 1219|       |		_exit(EXIT_FAILURE); /* _exit(), not exit(), because of vfork */
 1220|       |	}
 1221|       |#endif
 1222|       |	/* parent */
 1223|       |	/* Close write sides of child stdout/err pipes */
 1224|  11.5k|	for (i = 1; i < __arraycount(fdp); i++)
  ------------------
  |  |  130|  11.5k|#define __arraycount(a) (sizeof(a) / sizeof(a[0]))
  ------------------
  |  Branch (1224:14): [True: 7.73k, False: 3.86k]
  ------------------
 1225|  7.73k|		closefd(fdp[i], 1);
 1226|       |	/* Write the buffer data to child stdin, if we don't have fd */
 1227|  3.86k|	if (fd == -1) {
  ------------------
  |  Branch (1227:6): [True: 3.86k, False: 0]
  ------------------
 1228|  3.86k|		closefd(fdp[STDIN_FILENO], 0);
 1229|  3.86k|		writepid = writechild(fdp[STDIN_FILENO][1], old, *n);
 1230|  3.86k|		if (writepid == (pid_t)-1) {
  ------------------
  |  Branch (1230:7): [True: 0, False: 3.86k]
  ------------------
 1231|      0|			rv = makeerror(newch, n, "Write to child failed, %s",
 1232|      0|			    strerror(errno));
 1233|      0|			DPRINTF("Write to child failed\n");
 1234|      0|			goto err;
 1235|      0|		}
 1236|  3.86k|		closefd(fdp[STDIN_FILENO], 1);
 1237|  3.86k|	}
 1238|       |
 1239|  3.86k|	rv = OKDATA;
  ------------------
  |  |  224|  3.86k|#define OKDATA 	0
  ------------------
 1240|  3.86k|	r = sread(fdp[STDOUT_FILENO][0], *newch, bytes_max, 0);
 1241|  3.86k|	DPRINTF("read got %zd\n", r);
 1242|  3.86k|	if (r < 0) {
  ------------------
  |  Branch (1242:6): [True: 0, False: 3.86k]
  ------------------
 1243|      0|		rv = ERRDATA;
  ------------------
  |  |  226|      0|#define ERRDATA	2
  ------------------
 1244|      0|		DPRINTF("Read stdout failed %d (%s)\n", fdp[STDOUT_FILENO][0],
 1245|      0|		        strerror(errno));
 1246|      0|		goto err;
 1247|      0|	} 
 1248|  3.86k|	if (CAST(size_t, r) == bytes_max) {
  ------------------
  |  |  452|  3.86k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (1248:6): [True: 165, False: 3.70k]
  ------------------
 1249|       |		/*
 1250|       |		 * close fd so that the child exits with sigpipe and ignore
 1251|       |		 * errors, otherwise we risk the child blocking and never
 1252|       |		 * exiting.
 1253|       |		 */
 1254|    165|		DPRINTF("Closing stdout for bytes_max\n");
 1255|    165|		closefd(fdp[STDOUT_FILENO], 0);
 1256|    165|		goto ok;
 1257|    165|	}
 1258|  3.70k|	if ((re = sread(fdp[STDERR_FILENO][0], *newch, bytes_max, 0)) > 0) {
  ------------------
  |  Branch (1258:6): [True: 664, False: 3.03k]
  ------------------
 1259|    664|		DPRINTF("Got stuff from stderr %s\n", *newch);
 1260|    664|		rv = ERRDATA;
  ------------------
  |  |  226|    664|#define ERRDATA	2
  ------------------
 1261|    664|		r = filter_error(*newch, r);
 1262|    664|		goto ok;
 1263|    664|	}
 1264|  3.03k|	if  (re == 0)
  ------------------
  |  Branch (1264:7): [True: 3.03k, False: 0]
  ------------------
 1265|  3.03k|		goto ok;
 1266|      0|	rv = makeerror(newch, n, "Read stderr failed, %s",
 1267|      0|	    strerror(errno));
 1268|      0|	goto err;
 1269|  3.86k|ok:
 1270|  3.86k|	*n = r;
 1271|       |	/* NUL terminate, as every buffer is handled here. */
 1272|  3.86k|	(*newch)[*n] = '\0';
 1273|  3.86k|err:
 1274|  3.86k|	closefd(fdp[STDIN_FILENO], 1);
 1275|  3.86k|	closefd(fdp[STDOUT_FILENO], 0);
 1276|  3.86k|	closefd(fdp[STDERR_FILENO], 0);
 1277|       |
 1278|  3.86k|	w = waitpid(pid, &status, 0);
 1279|  7.73k|wait_err:
 1280|  7.73k|	if (w == -1) {
  ------------------
  |  Branch (1280:6): [True: 0, False: 7.73k]
  ------------------
 1281|      0|		rv = makeerror(newch, n, "Wait failed, %s", strerror(errno));
 1282|      0|		DPRINTF("Child wait return %#x\n", status);
 1283|  7.73k|	} else if (!WIFEXITED(status)) {
  ------------------
  |  Branch (1283:13): [True: 0, False: 7.73k]
  ------------------
 1284|      0|		DPRINTF("Child not exited (%#x)\n", status);
 1285|  7.73k|	} else if (WEXITSTATUS(status) != 0) {
  ------------------
  |  Branch (1285:13): [True: 4.69k, False: 3.03k]
  ------------------
 1286|  4.69k|		DPRINTF("Child exited (%#x)\n", WEXITSTATUS(status));
 1287|  4.69k|	}
 1288|  7.73k|	if (writepid > 0) {
  ------------------
  |  Branch (1288:6): [True: 3.86k, False: 3.86k]
  ------------------
 1289|       |		/* _After_ we know decompressor has exited, our input writer
 1290|       |		 * definitely will exit now (at worst, writing fails in it,
 1291|       |		 * since output fd is closed now on the reading size).
 1292|       |		 */
 1293|  3.86k|		w = waitpid(writepid, &status, 0);
 1294|  3.86k|		writepid = -1;
 1295|  3.86k|		goto wait_err;
 1296|  3.86k|	}
 1297|       |
 1298|  3.86k|	closefd(fdp[STDIN_FILENO], 0); //why? it is already closed here!
 1299|  3.86k|	DPRINTF("Returning %p n=%" SIZE_T_FORMAT "u rv=%d\n", *newch, *n, rv);
 1300|       |
 1301|  3.86k|	return rv;
 1302|  7.73k|}
compress.c:getdecompressor:
 1090|  3.94k|{
 1091|  3.94k|	switch (method) {
 1092|      0|#ifdef BUILTIN_DECOMPRESS
 1093|     26|	case METH_FROZEN:
  ------------------
  |  |  193|     26|#define METH_FROZEN	2
  ------------------
  |  Branch (1093:2): [True: 26, False: 3.91k]
  ------------------
 1094|     26|		return uncompressgzipped;
 1095|     21|	case METH_ZLIB:
  ------------------
  |  |  200|     21|#define METH_ZLIB	14
  ------------------
  |  Branch (1095:2): [True: 21, False: 3.92k]
  ------------------
 1096|     21|		return uncompresszlib;
 1097|      0|#endif
 1098|      0|#ifdef BUILTIN_BZLIB
 1099|      8|	case METH_BZIP:
  ------------------
  |  |  194|      8|#define METH_BZIP	7
  ------------------
  |  Branch (1099:2): [True: 8, False: 3.93k]
  ------------------
 1100|      8|		return uncompressbzlib;
 1101|      0|#endif
 1102|      0|#ifdef BUILTIN_XZLIB
 1103|      2|	case METH_XZ:
  ------------------
  |  |  195|      2|#define METH_XZ		9
  ------------------
  |  Branch (1103:2): [True: 2, False: 3.94k]
  ------------------
 1104|      6|	case METH_LZMA:
  ------------------
  |  |  199|      6|#define METH_LZMA	13
  ------------------
  |  Branch (1104:2): [True: 4, False: 3.94k]
  ------------------
 1105|      6|		return uncompressxzlib;
 1106|      0|#endif
 1107|      0|#ifdef BUILTIN_ZSTDLIB
 1108|      5|	case METH_ZSTD:
  ------------------
  |  |  198|      5|#define METH_ZSTD	12
  ------------------
  |  Branch (1108:2): [True: 5, False: 3.94k]
  ------------------
 1109|      5|		return uncompresszstd;
 1110|      0|#endif
 1111|       |#ifdef BUILTIN_LZLIB
 1112|       |	case METH_LZIP:
 1113|       |		return uncompresslzlib;
 1114|       |#endif
 1115|       |#ifdef BUILTIN_LRZIP
 1116|       |	case METH_LRZIP:
 1117|       |		return uncompresslrzip;
 1118|       |#endif
 1119|  3.87k|	default:
  ------------------
  |  Branch (1119:2): [True: 3.87k, False: 66]
  ------------------
 1120|       |		return NULL;
 1121|  3.94k|	}
 1122|  3.94k|}
compress.c:makeerror:
  903|     79|{
  904|     79|	char *msg;
  905|     79|	va_list ap;
  906|     79|	int rv;
  907|       |
  908|     79|	DPRINTF("Makeerror %s\n", fmt);
  909|     79|	free(*buf);
  910|     79|	va_start(ap, fmt);
  911|     79|	rv = vasprintf(&msg, fmt, ap);
  912|     79|	va_end(ap);
  913|     79|	if (rv < 0) {
  ------------------
  |  Branch (913:6): [True: 0, False: 79]
  ------------------
  914|      0|		DPRINTF("Makeerror failed");
  915|      0|		*buf = NULL;
  916|      0|		*len = 0;
  917|      0|		return NODATA;
  ------------------
  |  |  225|      0|#define NODATA	1
  ------------------
  918|      0|	}
  919|     79|	*buf = RCAST(unsigned char *, msg);
  ------------------
  |  |  453|     79|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
  920|     79|	*len = strlen(msg);
  921|     79|	return ERRDATA;
  ------------------
  |  |  226|     79|#define ERRDATA	2
  ------------------
  922|     79|}
compress.c:handledesc:
  972|  3.87k|{
  973|  3.87k|	if (fd != -1) {
  ------------------
  |  Branch (973:6): [True: 0, False: 3.87k]
  ------------------
  974|      0|		(void) lseek(fd, CAST(off_t, 0), SEEK_SET);
  ------------------
  |  |  452|      0|#define CAST(T, b)	((T)(b))
  ------------------
  975|      0|		movedesc(v, STDIN_FILENO, fd);
  976|  3.87k|	} else {
  977|  3.87k|		movedesc(v, STDIN_FILENO, fdp[STDIN_FILENO][0]);
  978|  3.87k|		if (fdp[STDIN_FILENO][1] > 2)
  ------------------
  |  Branch (978:7): [True: 3.87k, False: 0]
  ------------------
  979|  3.87k|		    closedesc(v, fdp[STDIN_FILENO][1]);
  980|  3.87k|	}
  981|       |
  982|  3.87k|	file_clear_closexec(STDIN_FILENO);
  983|       |
  984|       |///FIXME: if one of the fdp[i][j] is 0 or 1, this can bomb spectacularly
  985|  3.87k|	movedesc(v, STDOUT_FILENO, fdp[STDOUT_FILENO][1]);
  986|  3.87k|	if (fdp[STDOUT_FILENO][0] > 2)
  ------------------
  |  Branch (986:6): [True: 3.87k, False: 0]
  ------------------
  987|  3.87k|		closedesc(v, fdp[STDOUT_FILENO][0]);
  988|       |
  989|  3.87k|	file_clear_closexec(STDOUT_FILENO);
  990|       |
  991|  3.87k|	movedesc(v, STDERR_FILENO, fdp[STDERR_FILENO][1]);
  992|  3.87k|	if (fdp[STDERR_FILENO][0] > 2)
  ------------------
  |  Branch (992:6): [True: 3.87k, False: 0]
  ------------------
  993|  3.87k|		closedesc(v, fdp[STDERR_FILENO][0]);
  994|       |
  995|       |	file_clear_closexec(STDERR_FILENO);
  996|  3.87k|}
compress.c:movedesc:
  943|  11.6k|{
  944|  11.6k|	if (fd == i)
  ------------------
  |  Branch (944:6): [True: 0, False: 11.6k]
  ------------------
  945|      0|		return; /* "no dup was necessary" */
  946|  11.6k|#ifdef HAVE_POSIX_SPAWNP
  947|  11.6k|	posix_spawn_file_actions_t *fa = RCAST(posix_spawn_file_actions_t *, v);
  ------------------
  |  |  453|  11.6k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
  948|  11.6k|	posix_spawn_file_actions_adddup2(fa, fd, i);
  949|  11.6k|	posix_spawn_file_actions_addclose(fa, fd);
  950|       |#else
  951|       |	if (dup2(fd, i) == -1) {
  952|       |		DPRINTF("dup(%d, %d) failed (%s)\n", fd, i, strerror(errno));
  953|       |		exit(EXIT_FAILURE);
  954|       |	}
  955|       |	close(v ? fd : fd);
  956|       |#endif
  957|  11.6k|}
compress.c:closedesc:
  961|  11.6k|{
  962|  11.6k|#ifdef HAVE_POSIX_SPAWNP
  963|  11.6k|	posix_spawn_file_actions_t *fa = RCAST(posix_spawn_file_actions_t *, v);
  ------------------
  |  |  453|  11.6k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
  964|  11.6k|	posix_spawn_file_actions_addclose(fa, fd);
  965|       |#else
  966|       |	close(v ? fd : fd);
  967|       |#endif
  968|  11.6k|}
compress.c:closefd:
  926|  31.0k|{
  927|  31.0k|	if (fd[i] == -1)
  ------------------
  |  Branch (927:6): [True: 7.89k, False: 23.1k]
  ------------------
  928|  7.89k|		return;
  929|  23.1k|	(void) close(fd[i]);
  930|  23.1k|	fd[i] = -1;
  931|  23.1k|}
compress.c:writechild:
 1000|  3.86k|{
 1001|  3.86k|	pid_t pid;
 1002|       |
 1003|       |	/*
 1004|       |	 * fork again, to avoid blocking because both
 1005|       |	 * pipes filled
 1006|       |	 */
 1007|  3.86k|	pid = fork();
 1008|  3.86k|	if (pid == -1) {
  ------------------
  |  Branch (1008:6): [True: 0, False: 3.86k]
  ------------------
 1009|      0|		DPRINTF("Fork failed (%s)\n", strerror(errno));
 1010|      0|		return -1;
 1011|      0|	}
 1012|  3.86k|	if (pid == 0) {
  ------------------
  |  Branch (1012:6): [True: 0, False: 3.86k]
  ------------------
 1013|       |		/* child */
 1014|      0|		if (swrite(fd, old, n) != CAST(ssize_t, n)) {
  ------------------
  |  |  452|      0|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (1014:7): [True: 0, False: 0]
  ------------------
 1015|      0|			DPRINTF("Write failed (%s)\n", strerror(errno));
 1016|      0|			exit(EXIT_FAILURE);
 1017|      0|		}
 1018|      0|		exit(EXIT_SUCCESS);
 1019|      0|	}
 1020|       |	/* parent */
 1021|  3.86k|	return pid;
 1022|  3.86k|}
compress.c:filter_error:
 1026|    664|{
 1027|    664|	char *p;
 1028|    664|	char *buf;
 1029|       |
 1030|    664|	ubuf[n] = '\0';
 1031|    664|	buf = RCAST(char *, ubuf);
  ------------------
  |  |  453|    664|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 1032|    664|	while (isspace(CAST(unsigned char, *buf)))
  ------------------
  |  Branch (1032:9): [True: 219, False: 664]
  ------------------
 1033|    219|		buf++;
 1034|    664|	DPRINTF("Filter error[[[%s]]]\n", buf);
 1035|    664|	if ((p = strchr(CAST(char *, buf), '\n')) != NULL)
  ------------------
  |  |  452|    664|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (1035:6): [True: 30, False: 634]
  ------------------
 1036|     30|		*p = '\0';
 1037|    664|	if ((p = strchr(CAST(char *, buf), ';')) != NULL)
  ------------------
  |  |  452|    664|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (1037:6): [True: 0, False: 664]
  ------------------
 1038|      0|		*p = '\0';
 1039|    664|	if ((p = strrchr(CAST(char *, buf), ':')) != NULL) {
  ------------------
  |  |  452|    664|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (1039:6): [True: 61, False: 603]
  ------------------
 1040|     61|		++p;
 1041|     61|		while (isspace(CAST(unsigned char, *p)))
  ------------------
  |  Branch (1041:10): [True: 45, False: 61]
  ------------------
 1042|     45|			p++;
 1043|     61|		n = strlen(p);
 1044|     61|		memmove(ubuf, p, CAST(size_t, n + 1));
  ------------------
  |  |  452|     61|#define CAST(T, b)	((T)(b))
  ------------------
 1045|     61|	}
 1046|    664|	DPRINTF("Filter error after[[[%s]]]\n", (char *)ubuf);
 1047|    664|	if (islower(*ubuf))
  ------------------
  |  Branch (1047:6): [True: 39, False: 625]
  ------------------
 1048|     39|		*ubuf = toupper(*ubuf);
  ------------------
  |  Branch (1048:11): [True: 0, False: 0]
  |  Branch (1048:11): [True: 0, False: 0]
  |  Branch (1048:11): [Folded, False: 39]
  ------------------
 1049|    664|	return n;
 1050|    664|}

der_offs:
  265|  29.3k|{
  266|  29.3k|	const uint8_t *b = RCAST(const uint8_t *, ms->search.s);
  ------------------
  |  |  453|  29.3k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
  267|  29.3k|	size_t offs = 0, len = ms->search.s_len ? ms->search.s_len : nbytes;
  ------------------
  |  Branch (267:25): [True: 29.3k, False: 0]
  ------------------
  268|       |
  269|  29.3k|	if (gettag(b, &offs, len) == DER_BAD) {
  ------------------
  |  |   62|  29.3k|#define DER_BAD	CAST(uint32_t, -1)
  |  |  ------------------
  |  |  |  |  452|  29.3k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (269:6): [True: 0, False: 29.3k]
  ------------------
  270|      0|		DPRINTF(("%s: bad tag 1\n", __func__));
  271|      0|		return -1;
  272|      0|	}
  273|  29.3k|	DPRINTF(("%s1: %u %" SIZE_T_FORMAT "u %d\n", __func__, ms->offset,
  274|  29.3k|	    offs, m->offset));
  275|       |
  276|  29.3k|	uint32_t tlen = getlength(b, &offs, len);
  277|  29.3k|	if (tlen == DER_BAD) {
  ------------------
  |  |   62|  29.3k|#define DER_BAD	CAST(uint32_t, -1)
  |  |  ------------------
  |  |  |  |  452|  29.3k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (277:6): [True: 0, False: 29.3k]
  ------------------
  278|      0|		DPRINTF(("%s: bad tag 2\n", __func__));
  279|      0|		return -1;
  280|      0|	}
  281|  29.3k|	DPRINTF(("%s2: %u %" SIZE_T_FORMAT "u %u\n", __func__, ms->offset,
  282|  29.3k|	    offs, tlen));
  283|       |
  284|  29.3k|	offs += ms->offset + m->offset;
  285|  29.3k|	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|  29.3k|	if (m->cont_level != 0) {
  ------------------
  |  Branch (292:6): [True: 4.72k, False: 24.5k]
  ------------------
  293|  4.72k|		if (offs + tlen > nbytes)
  ------------------
  |  Branch (293:7): [True: 0, False: 4.72k]
  ------------------
  294|      0|			return -1;
  295|  4.72k|		ms->c.li[m->cont_level - 1].off = CAST(int, offs + tlen);
  ------------------
  |  |  452|  4.72k|#define CAST(T, b)	((T)(b))
  ------------------
  296|  4.72k|		DPRINTF(("cont_level[%u] = %d\n", m->cont_level - 1,
  297|  4.72k|		    ms->c.li[m->cont_level - 1].off));
  298|  4.72k|	}
  299|  29.3k|	return CAST(int32_t, offs);
  ------------------
  |  |  452|  29.3k|#define CAST(T, b)	((T)(b))
  ------------------
  300|  29.3k|}
der_cmp:
  304|   514k|{
  305|   514k|	const uint8_t *b = RCAST(const uint8_t *, ms->search.s);
  ------------------
  |  |  453|   514k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
  306|   514k|	const char *s = m->value.s;
  307|   514k|	size_t offs = 0, len = ms->search.s_len;
  308|   514k|	uint32_t tag, tlen;
  309|   514k|	char buf[128];
  310|       |
  311|   514k|	DPRINTF(("%s: compare %zu bytes\n", __func__, len));
  312|       |
  313|   514k|	tag = gettag(b, &offs, len);
  314|   514k|	if (tag == DER_BAD) {
  ------------------
  |  |   62|   514k|#define DER_BAD	CAST(uint32_t, -1)
  |  |  ------------------
  |  |  |  |  452|   514k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (314:6): [True: 4.26k, False: 509k]
  ------------------
  315|  4.26k|		DPRINTF(("%s: bad tag 1\n", __func__));
  316|  4.26k|		return -1;
  317|  4.26k|	}
  318|       |
  319|   509k|	DPRINTF(("%s1: %d %" SIZE_T_FORMAT "u %d\n", __func__, ms->offset,
  320|   509k|	    offs, m->offset));
  321|       |
  322|   509k|	tlen = getlength(b, &offs, len);
  323|   509k|	if (tlen == DER_BAD) {
  ------------------
  |  |   62|   509k|#define DER_BAD	CAST(uint32_t, -1)
  |  |  ------------------
  |  |  |  |  452|   509k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (323:6): [True: 186k, False: 323k]
  ------------------
  324|   186k|		DPRINTF(("%s: bad tag 2\n", __func__));
  325|   186k|		return -1;
  326|   186k|	}
  327|       |
  328|   323k|	der_tag(buf, sizeof(buf), tag);
  329|   323k|	if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|   323k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (329:6): [True: 0, False: 323k]
  ------------------
  330|      0|		fprintf(stderr, "%s: tag %p got=%s exp=%s\n", __func__, b,
  331|      0|		    buf, s);
  332|   323k|	size_t slen = strlen(buf);
  333|       |
  334|   323k|	if (strncmp(buf, s, slen) != 0) {
  ------------------
  |  Branch (334:6): [True: 291k, False: 31.8k]
  ------------------
  335|   291k|		DPRINTF(("%s: no string match %s != %s\n", __func__, buf, s));
  336|   291k|		return 0;
  337|   291k|	}
  338|       |
  339|  31.8k|	s += slen;
  340|       |
  341|  33.1k|again:
  342|  33.1k|	switch (*s) {
  343|  28.5k|	case '\0':
  ------------------
  |  Branch (343:2): [True: 28.5k, False: 4.63k]
  ------------------
  344|  28.5k|		DPRINTF(("%s: EOF match\n", __func__));
  345|  28.5k|		return 1;
  346|  1.56k|	case '=':
  ------------------
  |  Branch (346:2): [True: 1.56k, False: 31.5k]
  ------------------
  347|  1.56k|		s++;
  348|  1.56k|		goto val;
  349|  3.06k|	default:
  ------------------
  |  Branch (349:2): [True: 3.06k, False: 30.0k]
  ------------------
  350|  3.06k|		if (!isdigit(CAST(unsigned char, *s))) {
  ------------------
  |  Branch (350:7): [True: 0, False: 3.06k]
  ------------------
  351|      0|			DPRINTF(("%s: no digit %c\n", __func__, *s));
  352|      0|			return 0;
  353|      0|		}
  354|       |
  355|  3.06k|		slen = 0;
  356|  3.06k|		do
  357|  4.23k|			slen = slen * 10 + *s - '0';
  358|  3.06k|		while (isdigit(CAST(unsigned char, *++s)));
  ------------------
  |  Branch (358:10): [True: 1.16k, False: 3.06k]
  ------------------
  359|  3.06k|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  3.06k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (359:7): [True: 0, False: 3.06k]
  ------------------
  360|      0|			fprintf(stderr, "%s: len %" SIZE_T_FORMAT "u %u\n",
  361|      0|			    __func__, slen, tlen);
  362|  3.06k|		if (tlen != slen) {
  ------------------
  |  Branch (362:7): [True: 1.79k, False: 1.26k]
  ------------------
  363|  1.79k|			DPRINTF(("%s: len %u != %zu\n", __func__, tlen, slen));
  364|  1.79k|			return 0;
  365|  1.79k|		}
  366|  1.26k|		goto again;
  367|  33.1k|	}
  368|  1.56k|val:
  369|  1.56k|	DPRINTF(("%s: before data %" SIZE_T_FORMAT "u %u\n", __func__, offs,
  370|  1.56k|	    tlen));
  371|  1.56k|	der_data(buf, sizeof(buf), tag, b + offs, tlen);
  372|  1.56k|	if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  1.56k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (372:6): [True: 0, False: 1.56k]
  ------------------
  373|      0|		fprintf(stderr, "%s: data %s %s\n", __func__, buf, s);
  374|  1.56k|	if (strcmp(buf, s) != 0 && strcmp("x", s) != 0) {
  ------------------
  |  Branch (374:6): [True: 1.15k, False: 406]
  |  Branch (374:29): [True: 754, False: 404]
  ------------------
  375|    754|		DPRINTF(("%s: no string match %s != %s\n", __func__, buf, s));
  376|    754|		return 0;
  377|    754|	}
  378|    810|	strlcpy(ms->ms_value.s, buf, sizeof(ms->ms_value.s));
  379|    810|	DPRINTF(("%s: complete match\n", __func__));
  380|    810|	return 1;
  381|  1.56k|}
der.c:gettag:
  150|   543k|{
  151|   543k|	uint32_t tag;
  152|       |
  153|   543k|	if (*p >= l)
  ------------------
  |  Branch (153:6): [True: 1.12k, False: 542k]
  ------------------
  154|  1.12k|		return DER_BAD;
  ------------------
  |  |   62|  1.12k|#define DER_BAD	CAST(uint32_t, -1)
  |  |  ------------------
  |  |  |  |  452|  1.12k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  155|       |
  156|   542k|	tag = c[(*p)++] & 0x1f;
  157|       |
  158|   542k|	if (tag != 0x1f)
  ------------------
  |  Branch (158:6): [True: 474k, False: 68.1k]
  ------------------
  159|   474k|		return tag;
  160|       |
  161|  68.1k|	if (*p >= l)
  ------------------
  |  Branch (161:6): [True: 377, False: 67.7k]
  ------------------
  162|    377|		return DER_BAD;
  ------------------
  |  |   62|    377|#define DER_BAD	CAST(uint32_t, -1)
  |  |  ------------------
  |  |  |  |  452|    377|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  163|       |
  164|  1.31G|	while (c[*p] >= 0x80) {
  ------------------
  |  Branch (164:9): [True: 1.31G, False: 65.3k]
  ------------------
  165|  1.31G|		tag = tag * 128 + c[(*p)++] - 0x80;
  166|  1.31G|		if (*p >= l)
  ------------------
  |  Branch (166:7): [True: 2.44k, False: 1.31G]
  ------------------
  167|  2.44k|			return DER_BAD;
  ------------------
  |  |   62|  2.44k|#define DER_BAD	CAST(uint32_t, -1)
  |  |  ------------------
  |  |  |  |  452|  2.44k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  168|  1.31G|	}
  169|  65.3k|	return tag;
  170|  67.7k|}
der.c:getlength:
  183|   539k|{
  184|   539k|	uint8_t digits, i;
  185|   539k|	size_t len;
  186|   539k|	int is_onebyte_result;
  187|       |
  188|   539k|	if (*p >= l) {
  ------------------
  |  Branch (188:6): [True: 2.47k, False: 536k]
  ------------------
  189|  2.47k|		DPRINTF(("%s:[1] %zu >= %zu\n", __func__, *p, l));
  190|  2.47k|		return DER_BAD;
  ------------------
  |  |   62|  2.47k|#define DER_BAD	CAST(uint32_t, -1)
  |  |  ------------------
  |  |  |  |  452|  2.47k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  191|  2.47k|	}
  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|   536k|	is_onebyte_result = (c[*p] & 0x80) == 0;
  199|   536k|	digits = c[(*p)++] & 0x7f;
  200|   536k|	if (*p + digits >= l) {
  ------------------
  |  Branch (200:6): [True: 120k, False: 416k]
  ------------------
  201|   120k|		DPRINTF(("%s:[2] %zu + %u >= %zu\n", __func__, *p, digits, l));
  202|   120k|		return DER_BAD;
  ------------------
  |  |   62|   120k|#define DER_BAD	CAST(uint32_t, -1)
  |  |  ------------------
  |  |  |  |  452|   120k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  203|   120k|	}
  204|       |
  205|   416k|	if (is_onebyte_result)
  ------------------
  |  Branch (205:6): [True: 311k, False: 105k]
  ------------------
  206|   311k|		return digits;
  207|       |
  208|       |	/*
  209|       |	 * Decode len. We've already verified that we're allowed to read
  210|       |	 * `digits` bytes.
  211|       |	 */
  212|   105k|	len = 0;
  213|  9.80M|	for (i = 0; i < digits; i++)
  ------------------
  |  Branch (213:14): [True: 9.70M, False: 105k]
  ------------------
  214|  9.70M|		len = (len << 8) | c[(*p)++];
  215|       |
  216|   105k|	if (len > UINT32_MAX - *p || *p + len > l) {
  ------------------
  |  Branch (216:6): [True: 57.2k, False: 47.9k]
  |  Branch (216:31): [True: 6.49k, False: 41.4k]
  ------------------
  217|  63.7k|		DPRINTF(("%s:[3] bad len %zu + %zu >= %zu\n",
  218|  63.7k|		    __func__, *p, len, l));
  219|  63.7k|		return DER_BAD;
  ------------------
  |  |   62|  63.7k|#define DER_BAD	CAST(uint32_t, -1)
  |  |  ------------------
  |  |  |  |  452|  63.7k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  220|  63.7k|	}
  221|  41.4k|	return CAST(uint32_t, len);
  ------------------
  |  |  452|  41.4k|#define CAST(T, b)	((T)(b))
  ------------------
  222|   105k|}
der.c:der_tag:
  226|   323k|{
  227|   323k|	if (tag < DER_TAG_LAST)
  ------------------
  |  |  115|   323k|#define	DER_TAG_LAST			0x25
  ------------------
  |  Branch (227:6): [True: 281k, False: 42.4k]
  ------------------
  228|   281k|		strlcpy(buf, der__tag[tag], len);
  229|  42.4k|	else
  230|  42.4k|		snprintf(buf, len, "%#x", tag);
  231|   323k|	return buf;
  232|   323k|}
der.c:der_data:
  237|  1.56k|{
  238|  1.56k|	uint32_t i;
  239|  1.56k|	const uint8_t *d = CAST(const uint8_t *, q);
  ------------------
  |  |  452|  1.56k|#define CAST(T, b)	((T)(b))
  ------------------
  240|  1.56k|	switch (tag) {
  241|    210|	case DER_TAG_PRINTABLE_STRING:
  ------------------
  |  |   97|    210|#define	DER_TAG_PRINTABLE_STRING	0x13
  ------------------
  |  Branch (241:2): [True: 210, False: 1.35k]
  ------------------
  242|    295|	case DER_TAG_UTF8_STRING:
  ------------------
  |  |   90|    295|#define	DER_TAG_UTF8_STRING		0x0c
  ------------------
  |  Branch (242:2): [True: 85, False: 1.47k]
  ------------------
  243|    295|	case DER_TAG_IA5_STRING:
  ------------------
  |  |  100|    295|#define	DER_TAG_IA5_STRING		0x16
  ------------------
  |  Branch (243:2): [True: 0, False: 1.56k]
  ------------------
  244|    295|		return snprintf(buf, blen, "%.*s", len, RCAST(const char *, q));
  ------------------
  |  |  453|    295|#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.56k]
  ------------------
  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.26k|	default:
  ------------------
  |  Branch (251:2): [True: 1.26k, False: 295]
  ------------------
  252|  1.26k|		break;
  253|  1.56k|	}
  254|       |
  255|  5.60k|	for (i = 0; i < len; i++) {
  ------------------
  |  Branch (255:14): [True: 4.33k, False: 1.26k]
  ------------------
  256|  4.33k|		uint32_t z = i << 1;
  257|  4.33k|		if (z < blen - 2)
  ------------------
  |  Branch (257:7): [True: 4.09k, False: 244]
  ------------------
  258|  4.09k|			snprintf(buf + z, blen - z, "%.2x", d[i]);
  259|  4.33k|	}
  260|  1.26k|	return len * 2;
  261|  1.56k|}

file_encoding:
   78|  25.6k|{
   79|  25.6k|	const unsigned char *buf = CAST(const unsigned char *, b->fbuf);
  ------------------
  |  |  452|  25.6k|#define CAST(T, b)	((T)(b))
  ------------------
   80|  25.6k|	size_t nbytes = b->flen;
   81|  25.6k|	size_t mlen;
   82|  25.6k|	int rv = 1, ucs_type;
   83|  25.6k|	file_unichar_t *udefbuf;
   84|  25.6k|	size_t udeflen;
   85|       |
   86|  25.6k|	if (ubuf == NULL)
  ------------------
  |  Branch (86:6): [True: 14.4k, False: 11.1k]
  ------------------
   87|  14.4k|		ubuf = &udefbuf;
   88|  25.6k|	if (ulen == NULL)
  ------------------
  |  Branch (88:6): [True: 14.4k, False: 11.1k]
  ------------------
   89|  14.4k|		ulen = &udeflen;
   90|       |
   91|  25.6k|	*type = "text";
   92|  25.6k|	*ulen = 0;
   93|  25.6k|	*code = "unknown";
   94|  25.6k|	*code_mime = "binary";
   95|       |
   96|  25.6k|	if (nbytes > ms->encoding_max)
  ------------------
  |  Branch (96:6): [True: 1.92k, False: 23.6k]
  ------------------
   97|  1.92k|		nbytes = ms->encoding_max;
   98|       |
   99|  25.6k|	mlen = (nbytes + 1) * sizeof((*ubuf)[0]);
  100|  25.6k|	*ubuf = CAST(file_unichar_t *, calloc(CAST(size_t, 1), mlen));
  ------------------
  |  |  452|  25.6k|#define CAST(T, b)	((T)(b))
  ------------------
  101|  25.6k|	if (*ubuf == NULL) {
  ------------------
  |  Branch (101:6): [True: 0, False: 25.6k]
  ------------------
  102|      0|		file_oomem(ms, mlen);
  103|      0|		goto done;
  104|      0|	}
  105|  25.6k|	if (looks_ascii(buf, nbytes, *ubuf, ulen)) {
  ------------------
  |  Branch (105:6): [True: 1.81k, False: 23.8k]
  ------------------
  106|  1.81k|		if (looks_utf7(buf, nbytes, *ubuf, ulen) > 0) {
  ------------------
  |  Branch (106:7): [True: 14, False: 1.79k]
  ------------------
  107|     14|			DPRINTF(("utf-7 %" SIZE_T_FORMAT "u\n", *ulen));
  108|     14|			*code = "Unicode text, UTF-7";
  109|     14|			*code_mime = "utf-7";
  110|  1.79k|		} else {
  111|  1.79k|			DPRINTF(("ascii %" SIZE_T_FORMAT "u\n", *ulen));
  112|  1.79k|			*code = "ASCII";
  113|  1.79k|			*code_mime = "us-ascii";
  114|  1.79k|		}
  115|  23.8k|	} else if (looks_utf8_with_BOM(buf, nbytes, *ubuf, ulen) > 0) {
  ------------------
  |  Branch (115:13): [True: 7, False: 23.7k]
  ------------------
  116|      7|		DPRINTF(("utf8/bom %" SIZE_T_FORMAT "u\n", *ulen));
  117|      7|		*code = "Unicode text, UTF-8 (with BOM)";
  118|      7|		*code_mime = "utf-8";
  119|  23.7k|	} else if (file_looks_utf8(buf, nbytes, *ubuf, ulen) > 1) {
  ------------------
  |  Branch (119:13): [True: 202, False: 23.5k]
  ------------------
  120|    202|		DPRINTF(("utf8 %" SIZE_T_FORMAT "u\n", *ulen));
  121|    202|		*code = "Unicode text, UTF-8";
  122|    202|		*code_mime = "utf-8";
  123|  23.5k|	} else if ((ucs_type = looks_ucs32(buf, nbytes, *ubuf, ulen)) != 0) {
  ------------------
  |  Branch (123:13): [True: 442, False: 23.1k]
  ------------------
  124|    442|		if (ucs_type == 1) {
  ------------------
  |  Branch (124:7): [True: 183, False: 259]
  ------------------
  125|    183|			*code = "Unicode text, UTF-32, little-endian";
  126|    183|			*code_mime = "utf-32le";
  127|    259|		} else {
  128|    259|			*code = "Unicode text, UTF-32, big-endian";
  129|    259|			*code_mime = "utf-32be";
  130|    259|		}
  131|    442|		DPRINTF(("ucs32 %" SIZE_T_FORMAT "u\n", *ulen));
  132|  23.1k|	} else if ((ucs_type = looks_ucs16(buf, nbytes, *ubuf, ulen)) != 0) {
  ------------------
  |  Branch (132:13): [True: 361, False: 22.7k]
  ------------------
  133|    361|		if (ucs_type == 1) {
  ------------------
  |  Branch (133:7): [True: 211, False: 150]
  ------------------
  134|    211|			*code = "Unicode text, UTF-16, little-endian";
  135|    211|			*code_mime = "utf-16le";
  136|    211|		} else {
  137|    150|			*code = "Unicode text, UTF-16, big-endian";
  138|    150|			*code_mime = "utf-16be";
  139|    150|		}
  140|    361|		DPRINTF(("ucs16 %" SIZE_T_FORMAT "u\n", *ulen));
  141|  22.7k|	} else if (looks_latin1(buf, nbytes, *ubuf, ulen)) {
  ------------------
  |  Branch (141:13): [True: 1.01k, False: 21.7k]
  ------------------
  142|  1.01k|		DPRINTF(("latin1 %" SIZE_T_FORMAT "u\n", *ulen));
  143|  1.01k|		*code = "ISO-8859";
  144|  1.01k|		*code_mime = "iso-8859-1";
  145|  21.7k|	} else if (looks_extended(buf, nbytes, *ubuf, ulen)) {
  ------------------
  |  Branch (145:13): [True: 519, False: 21.2k]
  ------------------
  146|    519|		DPRINTF(("extended %" SIZE_T_FORMAT "u\n", *ulen));
  147|    519|		*code = "Non-ISO extended-ASCII";
  148|    519|		*code_mime = "unknown-8bit";
  149|  21.2k|	} else {
  150|  21.2k|		unsigned char *nbuf;
  151|       |
  152|  21.2k|		mlen = (nbytes + 1) * sizeof(nbuf[0]);
  153|  21.2k|		if ((nbuf = CAST(unsigned char *, malloc(mlen))) == NULL) {
  ------------------
  |  |  452|  21.2k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (153:7): [True: 0, False: 21.2k]
  ------------------
  154|      0|			file_oomem(ms, mlen);
  155|      0|			goto done;
  156|      0|		}
  157|  21.2k|		from_ebcdic(buf, nbytes, nbuf);
  158|       |
  159|  21.2k|		if (looks_ascii(nbuf, nbytes, *ubuf, ulen)) {
  ------------------
  |  Branch (159:7): [True: 127, False: 21.1k]
  ------------------
  160|    127|			DPRINTF(("ebcdic %" SIZE_T_FORMAT "u\n", *ulen));
  161|    127|			*code = "EBCDIC";
  162|    127|			*code_mime = "ebcdic";
  163|  21.1k|		} else if (looks_latin1(nbuf, nbytes, *ubuf, ulen)) {
  ------------------
  |  Branch (163:14): [True: 79, False: 21.0k]
  ------------------
  164|     79|			DPRINTF(("ebcdic/international %" SIZE_T_FORMAT "u\n",
  165|     79|			    *ulen));
  166|     79|			*code = "International EBCDIC";
  167|     79|			*code_mime = "ebcdic";
  168|  21.0k|		} else { /* Doesn't look like text at all */
  169|  21.0k|			DPRINTF(("binary\n"));
  170|  21.0k|			rv = 0;
  171|  21.0k|			*type = "binary";
  172|  21.0k|		}
  173|  21.2k|		free(nbuf);
  174|  21.2k|	}
  175|       |
  176|  25.6k| done:
  177|  25.6k|	if (ubuf == &udefbuf)
  ------------------
  |  Branch (177:6): [True: 14.4k, False: 11.1k]
  ------------------
  178|  14.4k|		free(udefbuf);
  179|       |
  180|  25.6k|	return rv;
  181|  25.6k|}
file_looks_utf8:
  356|  23.8k|{
  357|  23.8k|	size_t i;
  358|  23.8k|	int n;
  359|  23.8k|	file_unichar_t c;
  360|  23.8k|	int gotone = 0, ctrl = 0;
  361|       |
  362|  23.8k|	if (ubuf)
  ------------------
  |  Branch (362:6): [True: 23.8k, False: 0]
  ------------------
  363|  23.8k|		*ulen = 0;
  364|       |
  365|  22.6M|	for (i = 0; i < nbytes; i++) {
  ------------------
  |  Branch (365:14): [True: 22.6M, False: 1.79k]
  ------------------
  366|  22.6M|		if ((buf[i] & 0x80) == 0) {	   /* 0xxxxxxx is plain ASCII */
  ------------------
  |  Branch (366:7): [True: 22.3M, False: 231k]
  ------------------
  367|       |			/*
  368|       |			 * Even if the whole file is valid UTF-8 sequences,
  369|       |			 * still reject it if it uses weird control characters.
  370|       |			 */
  371|       |
  372|  22.3M|			if (text_chars[buf[i]] != T)
  ------------------
  |  |  236|  22.3M|#define T 1   /* character appears in plain ASCII text */
  ------------------
  |  Branch (372:8): [True: 19.5M, False: 2.88M]
  ------------------
  373|  19.5M|				ctrl = 1;
  374|       |
  375|  22.3M|			if (ubuf)
  ------------------
  |  Branch (375:8): [True: 22.3M, False: 0]
  ------------------
  376|  22.3M|				ubuf[(*ulen)++] = buf[i];
  377|  22.3M|		} else if ((buf[i] & 0x40) == 0) { /* 10xxxxxx never 1st byte */
  ------------------
  |  Branch (377:14): [True: 12.9k, False: 218k]
  ------------------
  378|  12.9k|			return -1;
  379|   218k|		} else {			   /* 11xxxxxx begins UTF-8 */
  380|   218k|			int following;
  381|   218k|			uint8_t x = first[buf[i]];
  382|   218k|			const struct accept_range *ar =
  383|   218k|			    &accept_ranges[(unsigned int)x >> 4];
  384|   218k|			if (x == XX)
  ------------------
  |  |  304|   218k|#define	XX 0xF1 // invalid: size 1
  ------------------
  |  Branch (384:8): [True: 3.42k, False: 215k]
  ------------------
  385|  3.42k|				return -1;
  386|       |
  387|   215k|			if ((buf[i] & 0x20) == 0) {		/* 110xxxxx */
  ------------------
  |  Branch (387:8): [True: 183k, False: 32.2k]
  ------------------
  388|   183k|				c = buf[i] & 0x1f;
  389|   183k|				following = 1;
  390|   183k|			} else if ((buf[i] & 0x10) == 0) {	/* 1110xxxx */
  ------------------
  |  Branch (390:15): [True: 19.5k, False: 12.6k]
  ------------------
  391|  19.5k|				c = buf[i] & 0x0f;
  392|  19.5k|				following = 2;
  393|  19.5k|			} else if ((buf[i] & 0x08) == 0) {	/* 11110xxx */
  ------------------
  |  Branch (393:15): [True: 12.6k, False: 0]
  ------------------
  394|  12.6k|				c = buf[i] & 0x07;
  395|  12.6k|				following = 3;
  396|  12.6k|			} else if ((buf[i] & 0x04) == 0) {	/* 111110xx */
  ------------------
  |  Branch (396:15): [True: 0, False: 0]
  ------------------
  397|      0|				c = buf[i] & 0x03;
  398|      0|				following = 4;
  399|      0|			} else if ((buf[i] & 0x02) == 0) {	/* 1111110x */
  ------------------
  |  Branch (399:15): [True: 0, False: 0]
  ------------------
  400|      0|				c = buf[i] & 0x01;
  401|      0|				following = 5;
  402|      0|			} else
  403|      0|				return -1;
  404|       |
  405|   468k|			for (n = 0; n < following; n++) {
  ------------------
  |  Branch (405:16): [True: 259k, False: 209k]
  ------------------
  406|   259k|				i++;
  407|   259k|				if (i >= nbytes)
  ------------------
  |  Branch (407:9): [True: 208, False: 258k]
  ------------------
  408|    208|					goto done;
  409|       |
  410|   258k|				if (n == 0 &&
  ------------------
  |  Branch (410:9): [True: 215k, False: 43.7k]
  ------------------
  411|   215k|				     (buf[i] < ar->lo || buf[i] > ar->hi))
  ------------------
  |  Branch (411:11): [True: 1.05k, False: 214k]
  |  Branch (411:30): [True: 4.27k, False: 209k]
  ------------------
  412|  5.32k|					return -1;
  413|       |
  414|   253k|				if ((buf[i] & 0x80) == 0 || (buf[i] & 0x40))
  ------------------
  |  Branch (414:9): [True: 79, False: 253k]
  |  Branch (414:33): [True: 79, False: 253k]
  ------------------
  415|    158|					return -1;
  416|       |
  417|   253k|				c = (c << 6) + (buf[i] & 0x3f);
  418|   253k|			}
  419|       |
  420|   209k|			if (ubuf)
  ------------------
  |  Branch (420:8): [True: 209k, False: 0]
  ------------------
  421|   209k|				ubuf[(*ulen)++] = c;
  422|   209k|			gotone = 1;
  423|   209k|		}
  424|  22.6M|	}
  425|  2.00k|done:
  426|  2.00k|	return ctrl ? 0 : (gotone ? 2 : 1);
  ------------------
  |  Branch (426:9): [True: 1.71k, False: 291]
  |  Branch (426:21): [True: 202, False: 89]
  ------------------
  427|  23.8k|}
encoding.c:looks_ascii:
  269|  46.8k|    size_t *ulen) \
  270|  46.8k|{ \
  271|  46.8k|	size_t i; \
  272|  46.8k|\
  273|  46.8k|	*ulen = 0; \
  274|  46.8k|\
  275|  18.9M|	for (i = 0; i < nbytes; i++) { \
  ------------------
  |  Branch (275:14): [True: 18.9M, False: 1.93k]
  ------------------
  276|  18.9M|		int t = text_chars[buf[i]]; \
  277|  18.9M|\
  278|  18.9M|		if (COND) \
  ------------------
  |  Branch (278:7): [True: 44.9k, False: 18.8M]
  ------------------
  279|  18.9M|			return 0; \
  280|  18.9M|\
  281|  18.9M|		ubuf[(*ulen)++] = buf[i]; \
  282|  18.8M|	} \
  283|  46.8k|	return 1; \
  284|  46.8k|}
encoding.c:looks_latin1:
  269|  43.9k|    size_t *ulen) \
  270|  43.9k|{ \
  271|  43.9k|	size_t i; \
  272|  43.9k|\
  273|  43.9k|	*ulen = 0; \
  274|  43.9k|\
  275|  10.4M|	for (i = 0; i < nbytes; i++) { \
  ------------------
  |  Branch (275:14): [True: 10.4M, False: 1.09k]
  ------------------
  276|  10.4M|		int t = text_chars[buf[i]]; \
  277|  10.4M|\
  278|  28.4M|		if (COND) \
  ------------------
  |  Branch (278:7): [True: 7.59M, False: 2.81M]
  |  Branch (278:7): [True: 42.8k, False: 7.55M]
  ------------------
  279|  10.4M|			return 0; \
  280|  10.4M|\
  281|  10.4M|		ubuf[(*ulen)++] = buf[i]; \
  282|  10.3M|	} \
  283|  43.9k|	return 1; \
  284|  43.9k|}
encoding.c:looks_extended:
  269|  21.7k|    size_t *ulen) \
  270|  21.7k|{ \
  271|  21.7k|	size_t i; \
  272|  21.7k|\
  273|  21.7k|	*ulen = 0; \
  274|  21.7k|\
  275|  5.01M|	for (i = 0; i < nbytes; i++) { \
  ------------------
  |  Branch (275:14): [True: 5.01M, False: 519]
  ------------------
  276|  5.01M|		int t = text_chars[buf[i]]; \
  277|  5.01M|\
  278|  18.3M|		if (COND) \
  ------------------
  |  Branch (278:7): [True: 2.27M, False: 2.74M]
  |  Branch (278:7): [True: 1.06M, False: 1.21M]
  |  Branch (278:7): [True: 21.2k, False: 1.04M]
  ------------------
  279|  5.01M|			return 0; \
  280|  5.01M|\
  281|  5.01M|		ubuf[(*ulen)++] = buf[i]; \
  282|  4.99M|	} \
  283|  21.7k|	return 1; \
  284|  21.7k|}
encoding.c:looks_utf8_with_BOM:
  437|  23.8k|{
  438|  23.8k|	if (nbytes > 3 && buf[0] == 0xef && buf[1] == 0xbb && buf[2] == 0xbf)
  ------------------
  |  Branch (438:6): [True: 22.4k, False: 1.32k]
  |  Branch (438:20): [True: 158, False: 22.3k]
  |  Branch (438:38): [True: 110, False: 48]
  |  Branch (438:56): [True: 83, False: 27]
  ------------------
  439|     83|		return file_looks_utf8(buf + 3, nbytes - 3, ubuf, ulen);
  440|  23.7k|	else
  441|  23.7k|		return -1;
  442|  23.8k|}
encoding.c:looks_utf7:
  447|  1.81k|{
  448|  1.81k|	if (nbytes > 4 && buf[0] == '+' && buf[1] == '/' && buf[2] == 'v')
  ------------------
  |  Branch (448:6): [True: 1.06k, False: 746]
  |  Branch (448:20): [True: 54, False: 1.01k]
  |  Branch (448:37): [True: 34, False: 20]
  |  Branch (448:54): [True: 17, False: 17]
  ------------------
  449|     17|		switch (buf[3]) {
  450|      3|		case '8':
  ------------------
  |  Branch (450:3): [True: 3, False: 14]
  ------------------
  451|      6|		case '9':
  ------------------
  |  Branch (451:3): [True: 3, False: 14]
  ------------------
  452|      9|		case '+':
  ------------------
  |  Branch (452:3): [True: 3, False: 14]
  ------------------
  453|     14|		case '/':
  ------------------
  |  Branch (453:3): [True: 5, False: 12]
  ------------------
  454|     14|			if (ubuf)
  ------------------
  |  Branch (454:8): [True: 14, False: 0]
  ------------------
  455|     14|				*ulen = 0;
  456|     14|			return 1;
  457|      3|		default:
  ------------------
  |  Branch (457:3): [True: 3, False: 14]
  ------------------
  458|      3|			return -1;
  459|     17|		}
  460|  1.79k|	else
  461|  1.79k|		return -1;
  462|  1.81k|}
encoding.c:looks_ucs16:
  471|  23.1k|{
  472|  23.1k|	int bigend;
  473|  23.1k|	uint32_t hi;
  474|  23.1k|	size_t i;
  475|       |
  476|  23.1k|	if (nbytes < 2)
  ------------------
  |  Branch (476:6): [True: 88, False: 23.0k]
  ------------------
  477|     88|		return 0;
  478|       |
  479|  23.0k|	if (bf[0] == 0xff && bf[1] == 0xfe)
  ------------------
  |  Branch (479:6): [True: 1.28k, False: 21.7k]
  |  Branch (479:23): [True: 333, False: 951]
  ------------------
  480|    333|		bigend = 0;
  481|  22.7k|	else if (bf[0] == 0xfe && bf[1] == 0xff)
  ------------------
  |  Branch (481:11): [True: 293, False: 22.4k]
  |  Branch (481:28): [True: 224, False: 69]
  ------------------
  482|    224|		bigend = 1;
  483|  22.5k|	else
  484|  22.5k|		return 0;
  485|       |
  486|    557|	*ulen = 0;
  487|    557|	hi = 0;
  488|       |
  489|   470k|	for (i = 2; i + 1 < nbytes; i += 2) {
  ------------------
  |  Branch (489:14): [True: 470k, False: 361]
  ------------------
  490|   470k|		uint32_t uc;
  491|       |
  492|   470k|		if (bigend)
  ------------------
  |  Branch (492:7): [True: 299k, False: 171k]
  ------------------
  493|   299k|			uc = CAST(uint32_t,
  ------------------
  |  |  452|   299k|#define CAST(T, b)	((T)(b))
  ------------------
  494|   470k|			    bf[i + 1] | (CAST(file_unichar_t, bf[i]) << 8));
  495|   171k|		else
  496|   171k|			uc = CAST(uint32_t,
  ------------------
  |  |  452|   171k|#define CAST(T, b)	((T)(b))
  ------------------
  497|   470k|			    bf[i] | (CAST(file_unichar_t, bf[i + 1]) << 8));
  498|       |
  499|   470k|		uc &= 0xffff;
  500|       |
  501|   470k|		switch (uc) {
  502|      2|		case 0xfffe:
  ------------------
  |  Branch (502:3): [True: 2, False: 470k]
  ------------------
  503|     24|		case 0xffff:
  ------------------
  |  Branch (503:3): [True: 22, False: 470k]
  ------------------
  504|     24|			return 0;
  505|   470k|		default:
  ------------------
  |  Branch (505:3): [True: 470k, False: 24]
  ------------------
  506|   470k|			if (UCS16_NOCHAR(uc))
  ------------------
  |  |  464|   470k|#define UCS16_NOCHAR(c) ((c) >= 0xfdd0 && (c) <= 0xfdef)
  |  |  ------------------
  |  |  |  Branch (464:26): [True: 82.7k, False: 387k]
  |  |  |  Branch (464:43): [True: 12, False: 82.7k]
  |  |  ------------------
  ------------------
  507|     12|				return 0;
  508|   470k|			break;
  509|   470k|		}
  510|   470k|		if (hi) {
  ------------------
  |  Branch (510:7): [True: 48.2k, False: 422k]
  ------------------
  511|  48.2k|			if (!UCS16_LOSURR(uc))
  ------------------
  |  |  466|  48.2k|#define UCS16_LOSURR(c) ((c) >= 0xdc00 && (c) <= 0xdfff)
  |  |  ------------------
  |  |  |  Branch (466:26): [True: 48.2k, False: 35]
  |  |  |  Branch (466:43): [True: 48.2k, False: 13]
  |  |  ------------------
  ------------------
  512|     48|				return 0;
  513|  48.2k|			uc = 0x10000 + 0x400 * (hi - 1) + (uc - 0xdc00);
  514|  48.2k|			hi = 0;
  515|  48.2k|		}
  516|   470k|		if (uc < 128 && text_chars[CAST(size_t, uc)] != T)
  ------------------
  |  |  452|  41.5k|#define CAST(T, b)	((T)(b))
  ------------------
              		if (uc < 128 && text_chars[CAST(size_t, uc)] != T)
  ------------------
  |  |  236|  41.5k|#define T 1   /* character appears in plain ASCII text */
  ------------------
  |  Branch (516:7): [True: 41.5k, False: 428k]
  |  Branch (516:19): [True: 76, False: 41.5k]
  ------------------
  517|     76|			return 0;
  518|   470k|		ubf[(*ulen)++] = uc;
  519|   470k|		if (UCS16_HISURR(uc))
  ------------------
  |  |  465|   470k|#define UCS16_HISURR(c) ((c) >= 0xd800 && (c) <= 0xdbff)
  |  |  ------------------
  |  |  |  Branch (465:26): [True: 179k, False: 290k]
  |  |  |  Branch (465:43): [True: 48.3k, False: 131k]
  |  |  ------------------
  ------------------
  520|  48.3k|			hi = uc - 0xd800 + 1;
  521|   470k|		if (UCS16_LOSURR(uc))
  ------------------
  |  |  466|   470k|#define UCS16_LOSURR(c) ((c) >= 0xdc00 && (c) <= 0xdfff)
  |  |  ------------------
  |  |  |  Branch (466:26): [True: 131k, False: 339k]
  |  |  |  Branch (466:43): [True: 36, False: 131k]
  |  |  ------------------
  ------------------
  522|     36|			return 0;
  523|   470k|	}
  524|       |
  525|    361|	return 1 + bigend;
  526|    557|}
encoding.c:looks_ucs32:
  531|  23.5k|{
  532|  23.5k|	int bigend;
  533|  23.5k|	size_t i;
  534|       |
  535|  23.5k|	if (nbytes < 4)
  ------------------
  |  Branch (535:6): [True: 1.23k, False: 22.3k]
  ------------------
  536|  1.23k|		return 0;
  537|       |
  538|  22.3k|	if (bf[0] == 0xff && bf[1] == 0xfe && bf[2] == 0 && bf[3] == 0)
  ------------------
  |  Branch (538:6): [True: 1.37k, False: 20.9k]
  |  Branch (538:23): [True: 491, False: 885]
  |  Branch (538:40): [True: 239, False: 252]
  |  Branch (538:54): [True: 203, False: 36]
  ------------------
  539|    203|		bigend = 0;
  540|  22.1k|	else if (bf[0] == 0 && bf[1] == 0 && bf[2] == 0xfe && bf[3] == 0xff)
  ------------------
  |  Branch (540:11): [True: 1.16k, False: 20.9k]
  |  Branch (540:25): [True: 758, False: 407]
  |  Branch (540:39): [True: 301, False: 457]
  |  Branch (540:56): [True: 266, False: 35]
  ------------------
  541|    266|		bigend = 1;
  542|  21.8k|	else
  543|  21.8k|		return 0;
  544|       |
  545|    469|	*ulen = 0;
  546|       |
  547|   449k|	for (i = 4; i + 3 < nbytes; i += 4) {
  ------------------
  |  Branch (547:14): [True: 449k, False: 442]
  ------------------
  548|       |		/* XXX fix to properly handle chars > 65536 */
  549|       |
  550|   449k|		if (bigend)
  ------------------
  |  Branch (550:7): [True: 67.8k, False: 381k]
  ------------------
  551|  67.8k|			ubf[(*ulen)++] = CAST(file_unichar_t, bf[i + 3])
  ------------------
  |  |  452|  67.8k|#define CAST(T, b)	((T)(b))
  ------------------
  552|  67.8k|			    | (CAST(file_unichar_t, bf[i + 2]) << 8)
  ------------------
  |  |  452|  67.8k|#define CAST(T, b)	((T)(b))
  ------------------
  553|  67.8k|			    | (CAST(file_unichar_t, bf[i + 1]) << 16)
  ------------------
  |  |  452|  67.8k|#define CAST(T, b)	((T)(b))
  ------------------
  554|  67.8k|			    | (CAST(file_unichar_t, bf[i]) << 24);
  ------------------
  |  |  452|  67.8k|#define CAST(T, b)	((T)(b))
  ------------------
  555|   381k|		else
  556|   381k|			ubf[(*ulen)++] = CAST(file_unichar_t, bf[i + 0])
  ------------------
  |  |  452|   381k|#define CAST(T, b)	((T)(b))
  ------------------
  557|   381k|			    | (CAST(file_unichar_t, bf[i + 1]) << 8) 
  ------------------
  |  |  452|   381k|#define CAST(T, b)	((T)(b))
  ------------------
  558|   381k|			    | (CAST(file_unichar_t, bf[i + 2]) << 16)
  ------------------
  |  |  452|   381k|#define CAST(T, b)	((T)(b))
  ------------------
  559|   381k|			    | (CAST(file_unichar_t, bf[i + 3]) << 24);
  ------------------
  |  |  452|   381k|#define CAST(T, b)	((T)(b))
  ------------------
  560|       |
  561|   449k|		if (ubf[*ulen - 1] == 0xfffe)
  ------------------
  |  Branch (561:7): [True: 7, False: 449k]
  ------------------
  562|      7|			return 0;
  563|   449k|		if (ubf[*ulen - 1] < 128 &&
  ------------------
  |  Branch (563:7): [True: 5.20k, False: 444k]
  ------------------
  564|  5.20k|		    text_chars[CAST(size_t, ubf[*ulen - 1])] != T)
  ------------------
  |  |  452|  5.20k|#define CAST(T, b)	((T)(b))
  ------------------
              		    text_chars[CAST(size_t, ubf[*ulen - 1])] != T)
  ------------------
  |  |  236|  5.20k|#define T 1   /* character appears in plain ASCII text */
  ------------------
  |  Branch (564:7): [True: 20, False: 5.18k]
  ------------------
  565|     20|			return 0;
  566|   449k|	}
  567|       |
  568|    442|	return 1 + bigend;
  569|    469|}
encoding.c:from_ebcdic:
  656|  21.2k|{
  657|  21.2k|	size_t i;
  658|       |
  659|   145M|	for (i = 0; i < nbytes; i++) {
  ------------------
  |  Branch (659:14): [True: 145M, False: 21.2k]
  ------------------
  660|   145M|		out[i] = ebcdic_to_ascii[buf[i]];
  661|   145M|	}
  662|  21.2k|}

fmtcheck:
  236|  50.5k|{
  237|  50.5k|	const char	*f1p, *f2p;
  238|  50.5k|	EFT		f1t, f2t;
  239|       |
  240|  50.5k|	if (!f1) return f2;
  ------------------
  |  Branch (240:6): [True: 0, False: 50.5k]
  ------------------
  241|       |
  242|  50.5k|	f1p = f1;
  243|  50.5k|	f1t = FMTCHECK_START;
  244|  50.5k|	f2p = f2;
  245|  50.5k|	f2t = FMTCHECK_START;
  246|   101k|	while ((f1t = get_next_format(&f1p, f1t)) != FMTCHECK_DONE) {
  ------------------
  |  Branch (246:9): [True: 50.5k, False: 50.5k]
  ------------------
  247|  50.5k|		if (f1t == FMTCHECK_UNKNOWN)
  ------------------
  |  Branch (247:7): [True: 0, False: 50.5k]
  ------------------
  248|      0|			return f2;
  249|  50.5k|		f2t = get_next_format(&f2p, f2t);
  250|  50.5k|		if (f1t != f2t)
  ------------------
  |  Branch (250:7): [True: 0, False: 50.5k]
  ------------------
  251|      0|			return f2;
  252|  50.5k|	}
  253|  50.5k|	return f1;
  254|  50.5k|}
fmtcheck.c:get_next_format:
  190|   151k|{
  191|   151k|	int		infmt;
  192|   151k|	const char	*f;
  193|       |
  194|   151k|	if (eft == FMTCHECK_WIDTH) {
  ------------------
  |  Branch (194:6): [True: 0, False: 151k]
  ------------------
  195|      0|		(*pf)++;
  196|      0|		return get_next_format_from_width(pf);
  197|   151k|	} else if (eft == FMTCHECK_PRECISION) {
  ------------------
  |  Branch (197:13): [True: 0, False: 151k]
  ------------------
  198|      0|		(*pf)++;
  199|      0|		return get_next_format_from_precision(pf);
  200|      0|	}
  201|       |
  202|   151k|	f = *pf;
  203|   151k|	infmt = 0;
  204|   252k|	while (!infmt) {
  ------------------
  |  Branch (204:9): [True: 151k, False: 101k]
  ------------------
  205|   151k|		f = strchr(f, '%');
  206|   151k|		if (f == NULL)
  ------------------
  |  Branch (206:7): [True: 50.5k, False: 101k]
  ------------------
  207|  50.5k|			RETURN(pf,f,FMTCHECK_DONE);
  ------------------
  |  |   60|  50.5k|#define RETURN(pf,f,r) do { \
  |  |   61|  50.5k|			*(pf) = (f); \
  |  |   62|  50.5k|			return r; \
  |  |   63|  50.5k|		       } /*NOTREACHED*/ /*CONSTCOND*/ while (0)
  |  |  ------------------
  |  |  |  Branch (63:48): [Folded, False: 0]
  |  |  ------------------
  ------------------
  208|   101k|		f++;
  209|   101k|		if (!*f)
  ------------------
  |  Branch (209:7): [True: 0, False: 101k]
  ------------------
  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|   101k|		if (*f != '%')
  ------------------
  |  Branch (211:7): [True: 101k, False: 0]
  ------------------
  212|   101k|			infmt = 1;
  213|      0|		else
  214|      0|			f++;
  215|   101k|	}
  216|       |
  217|       |	/* Eat any of the flags */
  218|   109k|	while (*f && (strchr("#0- +", *f)))
  ------------------
  |  Branch (218:9): [True: 109k, False: 0]
  |  Branch (218:15): [True: 7.94k, False: 101k]
  ------------------
  219|  7.94k|		f++;
  220|       |
  221|   101k|	if (*f == '*') {
  ------------------
  |  Branch (221:6): [True: 0, False: 101k]
  ------------------
  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|   101k|	while (isdigit((unsigned char)*f)) f++;
  ------------------
  |  Branch (225:9): [True: 3.91k, False: 101k]
  ------------------
  226|   101k|	if (!*f) {
  ------------------
  |  Branch (226:6): [True: 0, False: 101k]
  ------------------
  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|   101k|	RETURN(pf,f,get_next_format_from_width(pf));
  ------------------
  |  |   60|   101k|#define RETURN(pf,f,r) do { \
  |  |   61|   101k|			*(pf) = (f); \
  |  |   62|   101k|			return r; \
  |  |   63|   101k|		       } /*NOTREACHED*/ /*CONSTCOND*/ while (0)
  |  |  ------------------
  |  |  |  Branch (63:48): [Folded, False: 0]
  |  |  ------------------
  ------------------
  231|       |	/*NOTREACHED*/
  232|   101k|}
fmtcheck.c:get_next_format_from_width:
  171|   101k|{
  172|   101k|	const char	*f;
  173|       |
  174|   101k|	f = *pf;
  175|   101k|	if (*f == '.') {
  ------------------
  |  Branch (175:6): [True: 3.93k, False: 97.2k]
  ------------------
  176|  3.93k|		f++;
  177|  3.93k|		if (*f == '*') {
  ------------------
  |  Branch (177:7): [True: 0, False: 3.93k]
  ------------------
  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.02k|		while (isdigit((unsigned char)*f)) f++;
  ------------------
  |  Branch (181:10): [True: 5.02k, False: 3.93k]
  ------------------
  182|  3.93k|		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: 3.93k]
  ------------------
  183|  3.93k|	}
  184|   101k|	RETURN(pf,f,get_next_format_from_precision(pf));
  ------------------
  |  |   60|   101k|#define RETURN(pf,f,r) do { \
  |  |   61|   101k|			*(pf) = (f); \
  |  |   62|   101k|			return r; \
  |  |   63|   101k|		       } /*NOTREACHED*/ /*CONSTCOND*/ while (0)
  |  |  ------------------
  |  |  |  Branch (63:48): [Folded, False: 0]
  |  |  ------------------
  ------------------
  185|       |	/*NOTREACHED*/
  186|   101k|}
fmtcheck.c:get_next_format_from_precision:
   67|   101k|{
   68|   101k|	int		sh, lg, quad, longdouble;
   69|   101k|	const char	*f;
   70|       |
   71|   101k|	sh = lg = quad = longdouble = 0;
   72|       |
   73|   101k|	f = *pf;
   74|   101k|	switch (*f) {
   75|      0|	case 'h':
  ------------------
  |  Branch (75:2): [True: 0, False: 101k]
  ------------------
   76|      0|		f++;
   77|      0|		sh = 1;
   78|      0|		break;
   79|  5.29k|	case 'l':
  ------------------
  |  Branch (79:2): [True: 5.29k, False: 95.8k]
  ------------------
   80|  5.29k|		f++;
   81|  5.29k|		if (!*f) RETURN(pf,f,FMTCHECK_UNKNOWN);
  ------------------
  |  |   60|      0|#define RETURN(pf,f,r) do { \
  |  |   61|      0|			*(pf) = (f); \
  |  |   62|      0|			return r; \
  |  |   63|      0|		       } /*NOTREACHED*/ /*CONSTCOND*/ while (0)
  |  |  ------------------
  |  |  |  Branch (63:48): [Folded, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (81:7): [True: 0, False: 5.29k]
  ------------------
   82|  5.29k|		if (*f == 'l') {
  ------------------
  |  Branch (82:7): [True: 5.29k, False: 0]
  ------------------
   83|  5.29k|			f++;
   84|  5.29k|			quad = 1;
   85|  5.29k|		} else {
   86|      0|			lg = 1;
   87|      0|		}
   88|  5.29k|		break;
   89|      0|	case 'q':
  ------------------
  |  Branch (89:2): [True: 0, False: 101k]
  ------------------
   90|      0|		f++;
   91|      0|		quad = 1;
   92|      0|		break;
   93|      0|	case 'L':
  ------------------
  |  Branch (93:2): [True: 0, False: 101k]
  ------------------
   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|  95.8k|	default:
  ------------------
  |  Branch (114:2): [True: 95.8k, False: 5.29k]
  ------------------
  115|  95.8k|		break;
  116|   101k|	}
  117|   101k|	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: 101k]
  ------------------
  118|   101k|	if (strchr("diouxX", *f)) {
  ------------------
  |  Branch (118:6): [True: 66.2k, False: 34.9k]
  ------------------
  119|  66.2k|		if (longdouble)
  ------------------
  |  Branch (119:7): [True: 0, False: 66.2k]
  ------------------
  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.2k|		if (lg)
  ------------------
  |  Branch (121:7): [True: 0, False: 66.2k]
  ------------------
  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.2k|		if (quad)
  ------------------
  |  Branch (123:7): [True: 5.29k, False: 60.9k]
  ------------------
  124|  5.29k|			RETURN(pf,f,FMTCHECK_QUAD);
  ------------------
  |  |   60|  5.29k|#define RETURN(pf,f,r) do { \
  |  |   61|  5.29k|			*(pf) = (f); \
  |  |   62|  5.29k|			return r; \
  |  |   63|  5.29k|		       } /*NOTREACHED*/ /*CONSTCOND*/ while (0)
  |  |  ------------------
  |  |  |  Branch (63:48): [Folded, False: 0]
  |  |  ------------------
  ------------------
  125|  60.9k|		RETURN(pf,f,FMTCHECK_INT);
  ------------------
  |  |   60|  60.9k|#define RETURN(pf,f,r) do { \
  |  |   61|  60.9k|			*(pf) = (f); \
  |  |   62|  60.9k|			return r; \
  |  |   63|  60.9k|		       } /*NOTREACHED*/ /*CONSTCOND*/ while (0)
  |  |  ------------------
  |  |  |  Branch (63:48): [Folded, False: 0]
  |  |  ------------------
  ------------------
  126|  60.9k|	}
  127|  34.9k|	if (*f == 'n') {
  ------------------
  |  Branch (127:6): [True: 0, False: 34.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|  34.9k|	if (strchr("DOU", *f)) {
  ------------------
  |  Branch (138:6): [True: 0, False: 34.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|  34.9k|	if (strchr("eEfg", *f)) {
  ------------------
  |  Branch (143:6): [True: 3.03k, False: 31.8k]
  ------------------
  144|  3.03k|		if (longdouble)
  ------------------
  |  Branch (144:7): [True: 0, False: 3.03k]
  ------------------
  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.03k|		if (sh + lg + quad)
  ------------------
  |  Branch (146:7): [True: 0, False: 3.03k]
  ------------------
  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.03k|		RETURN(pf,f,FMTCHECK_DOUBLE);
  ------------------
  |  |   60|  3.03k|#define RETURN(pf,f,r) do { \
  |  |   61|  3.03k|			*(pf) = (f); \
  |  |   62|  3.03k|			return r; \
  |  |   63|  3.03k|		       } /*NOTREACHED*/ /*CONSTCOND*/ while (0)
  |  |  ------------------
  |  |  |  Branch (63:48): [Folded, False: 0]
  |  |  ------------------
  ------------------
  149|  3.03k|	}
  150|  31.8k|	if (*f == 'c') {
  ------------------
  |  Branch (150:6): [True: 486, False: 31.3k]
  ------------------
  151|    486|		if (sh + lg + quad + longdouble)
  ------------------
  |  Branch (151:7): [True: 0, False: 486]
  ------------------
  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|    486|		RETURN(pf,f,FMTCHECK_INT);
  ------------------
  |  |   60|    486|#define RETURN(pf,f,r) do { \
  |  |   61|    486|			*(pf) = (f); \
  |  |   62|    486|			return r; \
  |  |   63|    486|		       } /*NOTREACHED*/ /*CONSTCOND*/ while (0)
  |  |  ------------------
  |  |  |  Branch (63:48): [Folded, False: 0]
  |  |  ------------------
  ------------------
  154|    486|	}
  155|  31.3k|	if (*f == 's') {
  ------------------
  |  Branch (155:6): [True: 31.3k, False: 0]
  ------------------
  156|  31.3k|		if (sh + lg + quad + longdouble)
  ------------------
  |  Branch (156:7): [True: 0, False: 31.3k]
  ------------------
  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|  31.3k|		RETURN(pf,f,FMTCHECK_STRING);
  ------------------
  |  |   60|  31.3k|#define RETURN(pf,f,r) do { \
  |  |   61|  31.3k|			*(pf) = (f); \
  |  |   62|  31.3k|			return r; \
  |  |   63|  31.3k|		       } /*NOTREACHED*/ /*CONSTCOND*/ while (0)
  |  |  ------------------
  |  |  |  Branch (63:48): [Folded, False: 0]
  |  |  ------------------
  ------------------
  159|  31.3k|	}
  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_checkfmt:
   96|   272k|{
   97|   272k|	const char *p;
   98|  1.98M|	for (p = fmt; *p; p++) {
  ------------------
  |  Branch (98:16): [True: 1.71M, False: 272k]
  ------------------
   99|  1.71M|		if (*p != '%')
  ------------------
  |  Branch (99:7): [True: 1.57M, False: 138k]
  ------------------
  100|  1.57M|			continue;
  101|   138k|		if (*++p == '%')
  ------------------
  |  Branch (101:7): [True: 0, False: 138k]
  ------------------
  102|      0|			continue;
  103|   138k|		if (*p == '\0') {
  ------------------
  |  Branch (103:7): [True: 0, False: 138k]
  ------------------
  104|      0|			if (msg)
  ------------------
  |  Branch (104:8): [True: 0, False: 0]
  ------------------
  105|      0|				snprintf(msg, mlen, "incomplete %% format");
  106|      0|			return -1;
  107|      0|		}
  108|       |		// Skip uninteresting.
  109|   148k|		while (*p != '\0' && strchr("#0.'+- ", *p) != NULL)
  ------------------
  |  Branch (109:10): [True: 148k, False: 0]
  |  Branch (109:24): [True: 10.2k, False: 138k]
  ------------------
  110|  10.2k|			p++;
  111|   138k|		if (*p == '*') {
  ------------------
  |  Branch (111:7): [True: 0, False: 138k]
  ------------------
  112|      0|			if (msg)
  ------------------
  |  Branch (112:8): [True: 0, False: 0]
  ------------------
  113|      0|				snprintf(msg, mlen, "* not allowed in format");
  114|      0|			return -1;
  115|      0|		}
  116|       |
  117|   138k|		if (!file_checkfield(msg, mlen, "width", &p))
  ------------------
  |  Branch (117:7): [True: 0, False: 138k]
  ------------------
  118|      0|			return -1;
  119|       |
  120|   138k|		if (*p == '.') {
  ------------------
  |  Branch (120:7): [True: 1.52k, False: 137k]
  ------------------
  121|  1.52k|			p++;
  122|  1.52k|			if (!file_checkfield(msg, mlen, "precision", &p))
  ------------------
  |  Branch (122:8): [True: 0, False: 1.52k]
  ------------------
  123|      0|				return -1;
  124|  1.52k|		}
  125|       |
  126|   138k|		if (!isalpha((unsigned char)*p)) {
  ------------------
  |  Branch (126:7): [True: 0, False: 138k]
  ------------------
  127|      0|			if (msg)
  ------------------
  |  Branch (127:8): [True: 0, False: 0]
  ------------------
  128|      0|				snprintf(msg, mlen, "bad format char: %c", *p);
  129|      0|			return -1;
  130|      0|		}
  131|   138k|	}
  132|   272k|	return 0;
  133|   272k|}
file_vprintf:
  140|   273k|{
  141|   273k|	int len;
  142|   273k|	char *buf, *newstr;
  143|   273k|	char tbuf[1024];
  144|       |
  145|   273k|	if (ms->event_flags & EVENT_HAD_ERR)
  ------------------
  |  |  487|   273k|#define 		EVENT_HAD_ERR		0x01
  ------------------
  |  Branch (145:6): [True: 1.17k, False: 272k]
  ------------------
  146|  1.17k|		return 0;
  147|       |
  148|   272k|	if (file_checkfmt(tbuf, sizeof(tbuf), fmt)) {
  ------------------
  |  Branch (148:6): [True: 0, False: 272k]
  ------------------
  149|      0|		file_clearbuf(ms);
  150|      0|		file_error(ms, 0, "Bad magic format `%s' (%s)", fmt, tbuf);
  151|      0|		return -1;
  152|      0|	}
  153|       |
  154|   272k|	len = vasprintf(&buf, fmt, ap);
  155|   272k|	if (len < 0 || (size_t)len > 1024 || len + ms->o.blen > 1024 * 1024) {
  ------------------
  |  Branch (155:6): [True: 0, False: 272k]
  |  Branch (155:17): [True: 106, False: 272k]
  |  Branch (155:39): [True: 0, False: 272k]
  ------------------
  156|    106|		size_t blen = ms->o.blen;
  157|    106|		free(buf);
  158|    106|		file_clearbuf(ms);
  159|    106|		file_error(ms, 0, "Output buffer space exceeded %d+%"
  160|    106|		    SIZE_T_FORMAT "u", len, blen);
  161|    106|		return -1;
  162|    106|	}
  163|       |
  164|   272k|	if (ms->o.buf != NULL) {
  ------------------
  |  Branch (164:6): [True: 238k, False: 34.4k]
  ------------------
  165|   238k|		len = asprintf(&newstr, "%s%s", ms->o.buf, buf);
  166|   238k|		free(buf);
  167|   238k|		if (len < 0)
  ------------------
  |  Branch (167:7): [True: 0, False: 238k]
  ------------------
  168|      0|			goto out;
  169|   238k|		free(ms->o.buf);
  170|   238k|		buf = newstr;
  171|   238k|	}
  172|   272k|	ms->o.buf = buf;
  173|   272k|	ms->o.blen = len;
  174|   272k|	return 0;
  175|      0|out:
  176|      0|	file_clearbuf(ms);
  177|       |	file_error(ms, errno, "vasprintf failed");
  178|      0|	return -1;
  179|   272k|}
file_printf:
  183|   273k|{
  184|   273k|	int rv;
  185|   273k|	va_list ap;
  186|       |
  187|   273k|	va_start(ap, fmt);
  188|   273k|	rv = file_vprintf(ms, fmt, ap);
  189|       |	va_end(ap);
  190|   273k|	return rv;
  191|   273k|}
file_error:
  221|    271|{
  222|    271|	va_list va;
  223|    271|	va_start(va, f);
  224|    271|	file_error_core(ms, error, f, va, 0);
  225|       |	va_end(va);
  226|    271|}
file_magerror:
  234|     44|{
  235|     44|	va_list va;
  236|     44|	va_start(va, f);
  237|     44|	file_error_core(ms, 0, f, va, ms->line);
  238|       |	va_end(va);
  239|     44|}
file_separator:
  265|  29.0k|{
  266|  29.0k|	return file_printf(ms, FILE_SEPARATOR);
  ------------------
  |  |  261|  29.0k|#define FILE_SEPARATOR "\n- "
  ------------------
  267|  29.0k|}
file_default:
  300|  8.86k|{
  301|  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 (301:6): [True: 0, False: 8.86k]
  ------------------
  302|      0|		if ((ms->flags & MAGIC_MIME_TYPE) &&
  ------------------
  |  |   37|      0|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  ------------------
  |  Branch (302:7): [True: 0, False: 0]
  ------------------
  303|      0|		    file_printf(ms, "application/%s",
  ------------------
  |  Branch (303:7): [True: 0, False: 0]
  ------------------
  304|      0|			nb ? "octet-stream" : "x-empty") == -1)
  ------------------
  |  Branch (304:4): [True: 0, False: 0]
  ------------------
  305|      0|			return -1;
  306|      0|		return 1;
  307|      0|	}
  308|  8.86k|	if (ms->flags & MAGIC_APPLE) {
  ------------------
  |  |   45|  8.86k|#define	MAGIC_APPLE		0x0000800 /* Return the Apple creator/type */
  ------------------
  |  Branch (308:6): [True: 0, False: 8.86k]
  ------------------
  309|       |		// This is not a typo: Type: UNKN Creator: UNKN
  310|      0|		if (file_printf(ms, "UNKNUNKN") == -1)
  ------------------
  |  Branch (310:7): [True: 0, False: 0]
  ------------------
  311|      0|			return -1;
  312|      0|		return 1;
  313|      0|	}
  314|  8.86k|	if (ms->flags & MAGIC_EXTENSION) {
  ------------------
  |  |   46|  8.86k|#define	MAGIC_EXTENSION		0x1000000 /* Return a /-separated list of
  ------------------
  |  Branch (314:6): [True: 0, False: 8.86k]
  ------------------
  315|      0|		if (file_printf(ms, "???") == -1)
  ------------------
  |  Branch (315:7): [True: 0, False: 0]
  ------------------
  316|      0|			return -1;
  317|      0|		return 1;
  318|      0|	}
  319|  8.86k|	return 0;
  320|  8.86k|}
file_buffer:
  333|  14.5k|{
  334|  14.5k|	int m = 0, rv = 0, looks_text = 0;
  335|  14.5k|	const char *code = NULL;
  336|  14.5k|	const char *code_mime = "binary";
  337|  14.5k|	const char *def = "data";
  338|  14.5k|	const char *ftype = NULL;
  339|  14.5k|	char *rbuf = NULL;
  340|  14.5k|	struct buffer b;
  341|       |
  342|  14.5k|	buffer_init(&b, fd, st, buf, nb);
  343|  14.5k|	ms->mode = b.st.st_mode;
  344|       |
  345|  14.5k|	if (nb == 0) {
  ------------------
  |  Branch (345:6): [True: 20, False: 14.4k]
  ------------------
  346|     20|		def = "empty";
  347|     20|		goto simple;
  348|  14.4k|	} else if (nb == 1) {
  ------------------
  |  Branch (348:13): [True: 14, False: 14.4k]
  ------------------
  349|     14|		def = "very short file (no magic)";
  350|     14|		goto simple;
  351|     14|	}
  352|       |
  353|  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 (353:6): [True: 14.4k, False: 0]
  ------------------
  354|  14.4k|		looks_text = file_encoding(ms, &b, NULL, 0,
  355|  14.4k|		    &code, &code_mime, &ftype);
  356|  14.4k|	}
  357|       |
  358|       |#ifdef __EMX__
  359|       |	if ((ms->flags & MAGIC_NO_CHECK_APPTYPE) == 0 && inname) {
  360|       |		m = file_os2_apptype(ms, inname, &b);
  361|       |		if ((ms->flags & MAGIC_DEBUG) != 0)
  362|       |			(void)fprintf(stderr, "[try os2_apptype %d]\n", m);
  363|       |		switch (m) {
  364|       |		case -1:
  365|       |			return -1;
  366|       |		case 0:
  367|       |			break;
  368|       |		default:
  369|       |			return 1;
  370|       |		}
  371|       |	}
  372|       |#endif
  373|  14.4k|#if HAVE_FORK
  374|       |	/* try compression stuff */
  375|  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 (375:6): [True: 14.4k, False: 0]
  ------------------
  376|  14.4k|		m = file_zmagic(ms, &b, inname);
  377|  14.4k|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  14.4k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (377:7): [True: 0, False: 14.4k]
  ------------------
  378|      0|			(void)fprintf(stderr, "[try zmagic %d]\n", m);
  379|  14.4k|		if (m) {
  ------------------
  |  Branch (379:7): [True: 3.32k, False: 11.1k]
  ------------------
  380|  3.32k|			goto done_encoding;
  381|  3.32k|		}
  382|  14.4k|	}
  383|  11.1k|#endif
  384|       |	/* Check if we have a tar file */
  385|  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 (385:6): [True: 11.1k, False: 0]
  ------------------
  386|  11.1k|		m = file_is_tar(ms, &b);
  387|  11.1k|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  11.1k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (387:7): [True: 0, False: 11.1k]
  ------------------
  388|      0|			(void)fprintf(stderr, "[try tar %d]\n", m);
  389|  11.1k|		if (m) {
  ------------------
  |  Branch (389:7): [True: 35, False: 11.1k]
  ------------------
  390|     35|			if (checkdone(ms, &rv))
  ------------------
  |  Branch (390:8): [True: 0, False: 35]
  ------------------
  391|      0|				goto done;
  392|     35|		}
  393|  11.1k|	}
  394|       |
  395|       |	/* Check if we have a JSON file */
  396|  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 (396:6): [True: 11.1k, False: 0]
  ------------------
  397|  11.1k|		m = file_is_json(ms, &b);
  398|  11.1k|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  11.1k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (398:7): [True: 0, False: 11.1k]
  ------------------
  399|      0|			(void)fprintf(stderr, "[try json %d]\n", m);
  400|  11.1k|		if (m) {
  ------------------
  |  Branch (400:7): [True: 35, False: 11.1k]
  ------------------
  401|     35|			if (checkdone(ms, &rv))
  ------------------
  |  Branch (401:8): [True: 0, False: 35]
  ------------------
  402|      0|				goto done;
  403|     35|		}
  404|  11.1k|	}
  405|       |
  406|       |	/* Check if we have a CSV file */
  407|  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 (407:6): [True: 11.1k, False: 0]
  ------------------
  408|  11.1k|		m = file_is_csv(ms, &b, looks_text, code);
  409|  11.1k|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  11.1k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (409:7): [True: 0, False: 11.1k]
  ------------------
  410|      0|			(void)fprintf(stderr, "[try csv %d]\n", m);
  411|  11.1k|		if (m) {
  ------------------
  |  Branch (411:7): [True: 4, False: 11.1k]
  ------------------
  412|      4|			if (checkdone(ms, &rv))
  ------------------
  |  Branch (412:8): [True: 0, False: 4]
  ------------------
  413|      0|				goto done;
  414|      4|		}
  415|  11.1k|	}
  416|       |
  417|       |	/* Check if we have a SIMH tape file */
  418|  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 (418:6): [True: 11.1k, False: 0]
  ------------------
  419|  11.1k|		m = file_is_simh(ms, &b);
  420|  11.1k|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  11.1k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (420:7): [True: 0, False: 11.1k]
  ------------------
  421|      0|			(void)fprintf(stderr, "[try simh %d]\n", m);
  422|  11.1k|		if (m) {
  ------------------
  |  Branch (422:7): [True: 32, False: 11.1k]
  ------------------
  423|     32|			if (checkdone(ms, &rv))
  ------------------
  |  Branch (423:8): [True: 0, False: 32]
  ------------------
  424|      0|				goto done;
  425|     32|		}
  426|  11.1k|	}
  427|       |
  428|       |	/* Check if we have a CDF file */
  429|  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 (429:6): [True: 11.1k, False: 0]
  ------------------
  430|  11.1k|		m = file_trycdf(ms, &b);
  431|  11.1k|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  11.1k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (431:7): [True: 0, False: 11.1k]
  ------------------
  432|      0|			(void)fprintf(stderr, "[try cdf %d]\n", m);
  433|  11.1k|		if (m) {
  ------------------
  |  Branch (433:7): [True: 1.76k, False: 9.38k]
  ------------------
  434|  1.76k|			if (checkdone(ms, &rv))
  ------------------
  |  Branch (434:8): [True: 0, False: 1.76k]
  ------------------
  435|      0|				goto done;
  436|  1.76k|		}
  437|  11.1k|	}
  438|  11.1k|#ifdef BUILTIN_ELF
  439|  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 (439:6): [True: 11.1k, False: 0]
  |  Branch (439:47): [True: 9.48k, False: 1.66k]
  |  Branch (439:57): [True: 0, False: 9.48k]
  ------------------
  440|      0|		file_pushbuf_t *pb;
  441|       |		/*
  442|       |		 * We matched something in the file, so this
  443|       |		 * *might* be an ELF file, and the file is at
  444|       |		 * least 5 bytes long, so if it's an ELF file
  445|       |		 * it has at least one byte past the ELF magic
  446|       |		 * number - try extracting information from the
  447|       |		 * ELF headers that cannot easily be  extracted
  448|       |		 * with rules in the magic file. We we don't
  449|       |		 * print the information yet.
  450|       |		 */
  451|      0|		if ((pb = file_push_buffer(ms)) == NULL)
  ------------------
  |  Branch (451:7): [True: 0, False: 0]
  ------------------
  452|      0|			return -1;
  453|       |
  454|      0|		rv = file_tryelf(ms, &b);
  455|      0|		rbuf = file_pop_buffer(ms, pb);
  456|      0|		if (rv == -1) {
  ------------------
  |  Branch (456:7): [True: 0, False: 0]
  ------------------
  457|      0|			free(rbuf);
  458|      0|			rbuf = NULL;
  459|      0|		}
  460|      0|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|      0|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (460:7): [True: 0, False: 0]
  ------------------
  461|      0|			(void)fprintf(stderr, "[try elf %d]\n", m);
  462|      0|	}
  463|  11.1k|#endif
  464|       |
  465|       |	/* try soft magic tests */
  466|  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 (466:6): [True: 11.1k, False: 0]
  ------------------
  467|  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
  ------------------
  468|  11.1k|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  11.1k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (468:7): [True: 0, False: 11.1k]
  ------------------
  469|      0|			(void)fprintf(stderr, "[try softmagic %d]\n", m);
  470|  11.1k|		if (m == 1 && rbuf) {
  ------------------
  |  Branch (470:7): [True: 7.76k, False: 3.37k]
  |  Branch (470:17): [True: 0, False: 7.76k]
  ------------------
  471|      0|			if (file_printf(ms, "%s", rbuf) == -1)
  ------------------
  |  Branch (471:8): [True: 0, False: 0]
  ------------------
  472|      0|				goto done;
  473|      0|		}
  474|  11.1k|		if (m) {
  ------------------
  |  Branch (474:7): [True: 8.03k, False: 3.10k]
  ------------------
  475|  8.03k|			if (checkdone(ms, &rv))
  ------------------
  |  Branch (475:8): [True: 0, False: 8.03k]
  ------------------
  476|      0|				goto done;
  477|  8.03k|		}
  478|  11.1k|	}
  479|       |
  480|       |	/* try text properties */
  481|  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 (481:6): [True: 11.1k, False: 0]
  ------------------
  482|       |
  483|  11.1k|		m = file_ascmagic(ms, &b, looks_text);
  484|  11.1k|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  11.1k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (484:7): [True: 0, False: 11.1k]
  ------------------
  485|      0|			(void)fprintf(stderr, "[try ascmagic %d]\n", m);
  486|  11.1k|		if (m) {
  ------------------
  |  Branch (486:7): [True: 2.32k, False: 8.82k]
  ------------------
  487|  2.32k|			goto done;
  488|  2.32k|		}
  489|  11.1k|	}
  490|       |
  491|  8.86k|simple:
  492|       |	/* give up */
  493|  8.86k|	if (m == 0) {
  ------------------
  |  Branch (493:6): [True: 8.86k, False: 0]
  ------------------
  494|  8.86k|		m = 1;
  495|  8.86k|		rv = file_default(ms, nb);
  496|  8.86k|		if (rv == 0)
  ------------------
  |  Branch (496:7): [True: 8.86k, False: 0]
  ------------------
  497|  8.86k|			if (file_printf(ms, "%s", def) == -1)
  ------------------
  |  Branch (497:8): [True: 0, False: 8.86k]
  ------------------
  498|      0|				rv = -1;
  499|  8.86k|	}
  500|  11.1k| done:
  501|  11.1k|	trim_separator(ms);
  502|  11.1k|	if ((ms->flags & MAGIC_MIME_ENCODING) != 0) {
  ------------------
  |  |   43|  11.1k|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  ------------------
  |  Branch (502:6): [True: 0, False: 11.1k]
  ------------------
  503|      0|		if (ms->flags & MAGIC_MIME_TYPE)
  ------------------
  |  |   37|      0|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  ------------------
  |  Branch (503:7): [True: 0, False: 0]
  ------------------
  504|      0|			if (file_printf(ms, "; charset=") == -1)
  ------------------
  |  Branch (504:8): [True: 0, False: 0]
  ------------------
  505|      0|				rv = -1;
  506|      0|		if (file_printf(ms, "%s", code_mime) == -1)
  ------------------
  |  Branch (506:7): [True: 0, False: 0]
  ------------------
  507|      0|			rv = -1;
  508|      0|	}
  509|  11.1k|#if HAVE_FORK
  510|  14.5k| done_encoding:
  511|  14.5k|#endif
  512|  14.5k|	free(rbuf);
  513|  14.5k|	buffer_fini(&b);
  514|  14.5k|	if (rv)
  ------------------
  |  Branch (514:6): [True: 0, False: 14.5k]
  ------------------
  515|      0|		return rv;
  516|       |
  517|  14.5k|	return m;
  518|  14.5k|}
file_reset:
  523|  7.57k|{
  524|  7.57k|	if (checkloaded && ms->mlist[0] == NULL) {
  ------------------
  |  Branch (524:6): [True: 7.57k, False: 2]
  |  Branch (524:21): [True: 0, False: 7.57k]
  ------------------
  525|      0|		file_error(ms, 0, "no magic files loaded");
  526|      0|		return -1;
  527|      0|	}
  528|  7.57k|	file_clearbuf(ms);
  529|  7.57k|	if (ms->o.pbuf) {
  ------------------
  |  Branch (529:6): [True: 7.25k, False: 313]
  ------------------
  530|  7.25k|		free(ms->o.pbuf);
  531|  7.25k|		ms->o.pbuf = NULL;
  532|  7.25k|	}
  533|  7.57k|	ms->event_flags &= ~EVENT_HAD_ERR;
  ------------------
  |  |  487|  7.57k|#define 		EVENT_HAD_ERR		0x01
  ------------------
  534|  7.57k|	ms->error = -1;
  535|  7.57k|	return 0;
  536|  7.57k|}
file_getbuffer:
  548|  7.35k|{
  549|  7.35k|	char *pbuf, *op, *np;
  550|  7.35k|	size_t psize, len;
  551|       |
  552|  7.35k|	if (ms->event_flags & EVENT_HAD_ERR)
  ------------------
  |  |  487|  7.35k|#define 		EVENT_HAD_ERR		0x01
  ------------------
  |  Branch (552:6): [True: 98, False: 7.25k]
  ------------------
  553|     98|		return NULL;
  554|       |
  555|  7.25k|	if (ms->flags & MAGIC_RAW)
  ------------------
  |  |   41|  7.25k|#define	MAGIC_RAW		0x0000100 /* Don't convert unprintable chars */
  ------------------
  |  Branch (555:6): [True: 0, False: 7.25k]
  ------------------
  556|      0|		return ms->o.buf;
  557|       |
  558|  7.25k|	if (ms->o.buf == NULL)
  ------------------
  |  Branch (558:6): [True: 0, False: 7.25k]
  ------------------
  559|      0|		return NULL;
  560|       |
  561|       |	/* * 4 is for octal representation, + 1 is for NUL */
  562|  7.25k|	len = strlen(ms->o.buf);
  563|  7.25k|	if (len > (SIZE_MAX - 1) / 4) {
  ------------------
  |  Branch (563:6): [True: 0, False: 7.25k]
  ------------------
  564|      0|		file_oomem(ms, len);
  565|      0|		return NULL;
  566|      0|	}
  567|  7.25k|	psize = len * 4 + 1;
  568|  7.25k|	if ((pbuf = CAST(char *, realloc(ms->o.pbuf, psize))) == NULL) {
  ------------------
  |  |  452|  7.25k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (568:6): [True: 0, False: 7.25k]
  ------------------
  569|      0|		file_oomem(ms, psize);
  570|      0|		return NULL;
  571|      0|	}
  572|  7.25k|	ms->o.pbuf = pbuf;
  573|       |
  574|  7.25k|#if defined(HAVE_WCHAR_H) && defined(HAVE_MBRTOWC) && defined(HAVE_WCWIDTH)
  575|  7.25k|	{
  576|  7.25k|		mbstate_t state;
  577|  7.25k|		wchar_t nextchar;
  578|  7.25k|		int mb_conv = 1;
  579|  7.25k|		size_t bytesconsumed;
  580|  7.25k|		char *eop;
  581|  7.25k|		(void)memset(&state, 0, sizeof(mbstate_t));
  582|       |
  583|  7.25k|		np = ms->o.pbuf;
  584|  7.25k|		op = ms->o.buf;
  585|  7.25k|		eop = op + len;
  586|       |
  587|  2.25M|		while (op < eop) {
  ------------------
  |  Branch (587:10): [True: 2.24M, False: 7.21k]
  ------------------
  588|  2.24M|			bytesconsumed = mbrtowc(&nextchar, op,
  589|  2.24M|			    CAST(size_t, eop - op), &state);
  ------------------
  |  |  452|  2.24M|#define CAST(T, b)	((T)(b))
  ------------------
  590|  2.24M|			if (bytesconsumed == CAST(size_t, -1) ||
  ------------------
  |  |  452|  4.48M|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (590:8): [True: 40, False: 2.24M]
  ------------------
  591|  2.24M|			    bytesconsumed == CAST(size_t, -2)) {
  ------------------
  |  |  452|  2.24M|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (591:8): [True: 0, False: 2.24M]
  ------------------
  592|     40|				mb_conv = 0;
  593|     40|				break;
  594|     40|			}
  595|       |
  596|  2.24M|			if (iswprint(nextchar)) {
  ------------------
  |  Branch (596:8): [True: 2.22M, False: 21.0k]
  ------------------
  597|  2.22M|				(void)memcpy(np, op, bytesconsumed);
  598|  2.22M|				op += bytesconsumed;
  599|  2.22M|				np += bytesconsumed;
  600|  2.22M|			} else {
  601|  42.0k|				while (bytesconsumed-- > 0)
  ------------------
  |  Branch (601:12): [True: 21.0k, False: 21.0k]
  ------------------
  602|  21.0k|					OCTALIFY(np, op);
  ------------------
  |  |  540|  21.0k|	(void)(*(n)++ = '\\', \
  |  |  541|  21.0k|	*(n)++ = ((CAST(uint32_t, *(o)) >> 6) & 3) + '0', \
  |  |  ------------------
  |  |  |  |  452|  21.0k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  542|  21.0k|	*(n)++ = ((CAST(uint32_t, *(o)) >> 3) & 7) + '0', \
  |  |  ------------------
  |  |  |  |  452|  21.0k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  543|  21.0k|	*(n)++ = ((CAST(uint32_t, *(o)) >> 0) & 7) + '0', \
  |  |  ------------------
  |  |  |  |  452|  21.0k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  544|  21.0k|	(o)++)
  ------------------
  603|  21.0k|			}
  604|  2.24M|		}
  605|  7.25k|		*np = '\0';
  606|       |
  607|       |		/* Parsing succeeded as a multi-byte sequence */
  608|  7.25k|		if (mb_conv != 0)
  ------------------
  |  Branch (608:7): [True: 7.21k, False: 40]
  ------------------
  609|  7.21k|			return ms->o.pbuf;
  610|  7.25k|	}
  611|     40|#endif
  612|       |
  613|  18.9k|	for (np = ms->o.pbuf, op = ms->o.buf; *op;) {
  ------------------
  |  Branch (613:40): [True: 18.9k, False: 40]
  ------------------
  614|  18.9k|		if (isprint(CAST(unsigned char, *op))) {
  ------------------
  |  Branch (614:7): [True: 18.4k, False: 455]
  ------------------
  615|  18.4k|			*np++ = *op++;
  616|  18.4k|		} else {
  617|    455|			OCTALIFY(np, op);
  ------------------
  |  |  540|    455|	(void)(*(n)++ = '\\', \
  |  |  541|    455|	*(n)++ = ((CAST(uint32_t, *(o)) >> 6) & 3) + '0', \
  |  |  ------------------
  |  |  |  |  452|    455|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  542|    455|	*(n)++ = ((CAST(uint32_t, *(o)) >> 3) & 7) + '0', \
  |  |  ------------------
  |  |  |  |  452|    455|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  543|    455|	*(n)++ = ((CAST(uint32_t, *(o)) >> 0) & 7) + '0', \
  |  |  ------------------
  |  |  |  |  452|    455|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  544|    455|	(o)++)
  ------------------
  618|    455|		}
  619|  18.9k|	}
  620|     40|	*np = '\0';
  621|     40|	return ms->o.pbuf;
  622|  7.25k|}
file_check_mem:
  626|   940k|{
  627|   940k|	size_t len;
  628|       |
  629|   940k|	if (level >= ms->c.len) {
  ------------------
  |  Branch (629:6): [True: 1, False: 940k]
  ------------------
  630|      1|		len = (ms->c.len = 20 + level) * sizeof(*ms->c.li);
  631|      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]
  |  |  ------------------
  ------------------
  632|      1|		    malloc(len) :
  633|      1|		    realloc(ms->c.li, len));
  634|      1|		if (ms->c.li == NULL) {
  ------------------
  |  Branch (634:7): [True: 0, False: 1]
  ------------------
  635|      0|			file_oomem(ms, len);
  636|      0|			return -1;
  637|      0|		}
  638|      1|	}
  639|   940k|	ms->c.li[level].got_match = 0;
  640|   940k|#ifdef ENABLE_CONDITIONALS
  641|   940k|	ms->c.li[level].last_match = 0;
  642|   940k|	ms->c.li[level].last_cond = COND_NONE;
  ------------------
  |  |  360|   940k|#define				COND_NONE	0
  ------------------
  643|   940k|#endif /* ENABLE_CONDITIONALS */
  644|   940k|	return 0;
  645|   940k|}
file_printedlen:
  649|  2.32k|{
  650|  2.32k|	return ms->o.blen;
  651|  2.32k|}
file_replace:
  655|  1.59k|{
  656|  1.59k|	file_regex_t rx;
  657|  1.59k|	int rc, rv = -1;
  658|       |
  659|  1.59k|	rc = file_regcomp(ms, &rx, pat, REG_EXTENDED);
  660|  1.59k|	if (rc == 0) {
  ------------------
  |  Branch (660:6): [True: 1.59k, False: 0]
  ------------------
  661|  1.59k|		regmatch_t rm;
  662|  1.59k|		int nm = 0;
  663|  1.69k|		while (file_regexec(ms, &rx, ms->o.buf, 1, &rm, 0) == 0) {
  ------------------
  |  Branch (663:10): [True: 101, False: 1.59k]
  ------------------
  664|    101|			ms->o.buf[rm.rm_so] = '\0';
  665|    101|			if (file_printf(ms, "%s%s", rep,
  ------------------
  |  Branch (665:8): [True: 0, False: 101]
  ------------------
  666|    101|			    rm.rm_eo != 0 ? ms->o.buf + rm.rm_eo : "") == -1)
  ------------------
  |  Branch (666:8): [True: 101, False: 0]
  ------------------
  667|      0|				goto out;
  668|    101|			nm++;
  669|    101|		}
  670|  1.59k|		rv = nm;
  671|  1.59k|	}
  672|  1.59k|out:
  673|  1.59k|	file_regfree(&rx);
  674|  1.59k|	return rv;
  675|  1.59k|}
file_regcomp:
  734|  36.6k|{
  735|  36.6k|	if (check_regex(ms, pat) == -1)
  ------------------
  |  Branch (735:6): [True: 0, False: 36.6k]
  ------------------
  736|      0|		return -1;
  737|       |
  738|  36.6k|#ifdef USE_C_LOCALE
  739|  36.6k|	locale_t old = uselocale(ms->c_lc_ctype);
  740|  36.6k|	assert(old != NULL);
  ------------------
  |  Branch (740:2): [True: 0, False: 36.6k]
  |  Branch (740:2): [True: 36.6k, False: 0]
  ------------------
  741|       |#else
  742|       |	char old[1024];
  743|       |	strlcpy(old, setlocale(LC_CTYPE, NULL), sizeof(old));
  744|       |	(void)setlocale(LC_CTYPE, "C");
  745|       |#endif
  746|  36.6k|	int rc;
  747|  36.6k|	rc = regcomp(rx, pat, flags);
  748|       |
  749|  36.6k|#ifdef USE_C_LOCALE
  750|  36.6k|	uselocale(old);
  751|       |#else
  752|       |	(void)setlocale(LC_CTYPE, old);
  753|       |#endif
  754|  36.6k|	if (rc > 0 && (ms->flags & MAGIC_CHECK)) {
  ------------------
  |  |   39|      0|#define	MAGIC_CHECK		0x0000040 /* Print warnings to stderr */
  ------------------
  |  Branch (754:6): [True: 0, False: 36.6k]
  |  Branch (754:16): [True: 0, False: 0]
  ------------------
  755|      0|		char errmsg[512], buf[512];
  756|       |
  757|      0|		(void)regerror(rc, rx, errmsg, sizeof(errmsg));
  758|      0|		file_magerror(ms, "regex error %d for `%s', (%s)", rc, 
  759|      0|		    file_printable(ms, buf, sizeof(buf), pat, strlen(pat)),
  760|      0|		    errmsg);
  761|      0|	}
  762|  36.6k|	return rc;
  763|  36.6k|}
file_regexec:
  769|   360k|{
  770|   360k|#ifdef USE_C_LOCALE
  771|   360k|	locale_t old = uselocale(ms->c_lc_ctype);
  772|   360k|	assert(old != NULL);
  ------------------
  |  Branch (772:2): [True: 0, False: 360k]
  |  Branch (772:2): [True: 360k, False: 0]
  ------------------
  773|       |#else
  774|       |	char old[1024];
  775|       |	strlcpy(old, setlocale(LC_CTYPE, NULL), sizeof(old));
  776|       |	(void)setlocale(LC_CTYPE, "C");
  777|       |#endif
  778|   360k|	int rc;
  779|       |	/* XXX: force initialization because glibc does not always do this */
  780|   360k|	if (nmatch != 0)
  ------------------
  |  Branch (780:6): [True: 325k, False: 34.8k]
  ------------------
  781|   325k|		memset(pmatch, 0, nmatch * sizeof(*pmatch));
  782|   360k|	rc = regexec(rx, str, nmatch, pmatch, eflags);
  783|   360k|#ifdef USE_C_LOCALE
  784|   360k|	uselocale(old);
  785|       |#else
  786|       |	(void)setlocale(LC_CTYPE, old);
  787|       |#endif
  788|   360k|	return rc;
  789|   360k|}
file_regfree:
  793|  36.4k|{
  794|  36.4k|	regfree(rx);
  795|  36.4k|}
file_push_buffer:
  799|  34.1k|{
  800|  34.1k|	file_pushbuf_t *pb;
  801|       |
  802|  34.1k|	if (ms->event_flags & EVENT_HAD_ERR)
  ------------------
  |  |  487|  34.1k|#define 		EVENT_HAD_ERR		0x01
  ------------------
  |  Branch (802:6): [True: 226, False: 33.9k]
  ------------------
  803|    226|		return NULL;
  804|       |
  805|  33.9k|	if ((pb = (CAST(file_pushbuf_t *, malloc(sizeof(*pb))))) == NULL)
  ------------------
  |  |  452|  33.9k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (805:6): [True: 0, False: 33.9k]
  ------------------
  806|      0|		return NULL;
  807|       |
  808|  33.9k|	pb->buf = ms->o.buf;
  809|  33.9k|	pb->blen = ms->o.blen;
  810|  33.9k|	pb->offset = ms->offset;
  811|       |
  812|  33.9k|	ms->o.buf = NULL;
  813|  33.9k|	ms->o.blen = 0;
  814|  33.9k|	ms->offset = 0;
  815|       |
  816|  33.9k|	return pb;
  817|  33.9k|}
file_pop_buffer:
  821|  33.9k|{
  822|  33.9k|	char *rbuf;
  823|       |
  824|  33.9k|	if (ms->event_flags & EVENT_HAD_ERR) {
  ------------------
  |  |  487|  33.9k|#define 		EVENT_HAD_ERR		0x01
  ------------------
  |  Branch (824:6): [True: 7.41k, False: 26.5k]
  ------------------
  825|  7.41k|		free(pb->buf);
  826|  7.41k|		free(pb);
  827|  7.41k|		return NULL;
  828|  7.41k|	}
  829|       |
  830|  26.5k|	rbuf = ms->o.buf;
  831|       |
  832|  26.5k|	ms->o.buf = pb->buf;
  833|  26.5k|	ms->o.blen = pb->blen;
  834|  26.5k|	ms->offset = pb->offset;
  835|       |
  836|  26.5k|	free(pb);
  837|  26.5k|	return rbuf;
  838|  33.9k|}
file_printable:
  846|  23.2k|{
  847|  23.2k|	char *ptr, *eptr = buf + bufsiz - 1;
  848|  23.2k|	const unsigned char *s = RCAST(const unsigned char *, str);
  ------------------
  |  |  453|  23.2k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
  849|  23.2k|	const unsigned char *es = s + slen;
  850|       |
  851|   521k|	for (ptr = buf;  ptr < eptr && s < es && *s; s++) {
  ------------------
  |  Branch (851:19): [True: 521k, False: 100]
  |  Branch (851:33): [True: 520k, False: 703]
  |  Branch (851:43): [True: 498k, False: 22.2k]
  ------------------
  852|   498k|		if ((ms->flags & MAGIC_RAW) != 0 || isprint(*s)) {
  ------------------
  |  |   41|   498k|#define	MAGIC_RAW		0x0000100 /* Don't convert unprintable chars */
  ------------------
  |  Branch (852:7): [True: 0, False: 498k]
  |  Branch (852:39): [True: 147k, False: 350k]
  ------------------
  853|   147k|			*ptr++ = *s;
  854|   147k|			continue;
  855|   147k|		}
  856|   350k|		if (ptr >= eptr - 3)
  ------------------
  |  Branch (856:7): [True: 176, False: 350k]
  ------------------
  857|    176|			break;
  858|   350k|		*ptr++ = '\\';
  859|   350k|		*ptr++ = ((CAST(unsigned int, *s) >> 6) & 7) + '0';
  ------------------
  |  |  452|   350k|#define CAST(T, b)	((T)(b))
  ------------------
  860|   350k|		*ptr++ = ((CAST(unsigned int, *s) >> 3) & 7) + '0';
  ------------------
  |  |  452|   350k|#define CAST(T, b)	((T)(b))
  ------------------
  861|   350k|		*ptr++ = ((CAST(unsigned int, *s) >> 0) & 7) + '0';
  ------------------
  |  |  452|   350k|#define CAST(T, b)	((T)(b))
  ------------------
  862|   350k|	}
  863|  23.2k|	*ptr = '\0';
  864|  23.2k|	return buf;
  865|  23.2k|}
file_print_leguid:
  958|    177|{
  959|    177|	const struct guid *g = CAST(const struct guid *,
  ------------------
  |  |  452|    177|#define CAST(T, b)	((T)(b))
  ------------------
  960|    177|	    CAST(const void *, guid));
  961|    177|	return file_print_guid(str, len, g);
  962|    177|}
file_pipe_closexec:
  978|  11.6k|{
  979|       |#ifdef __MINGW32__
  980|       |	return 0;
  981|       |#elif defined(HAVE_PIPE2)
  982|  11.6k|	return pipe2(fds, O_CLOEXEC);
  983|       |#else
  984|       |	if (pipe(fds) == -1)
  985|       |		return -1;
  986|       |# ifdef F_SETFD
  987|       |	(void)fcntl(fds[0], F_SETFD, FD_CLOEXEC);
  988|       |	(void)fcntl(fds[1], F_SETFD, FD_CLOEXEC);
  989|       |# endif
  990|       |	return 0;
  991|       |#endif
  992|  11.6k|}
file_clear_closexec:
  995|  11.6k|file_clear_closexec(int fd) {
  996|  11.6k|#ifdef F_SETFD
  997|  11.6k|	return fcntl(fd, F_SETFD, 0);
  998|       |#else
  999|       |	return 0;
 1000|       |#endif
 1001|  11.6k|}
file_strtrim:
 1005|    589|{
 1006|    589|	char *last;
 1007|       |
 1008|    589|	while (isspace(CAST(unsigned char, *str)))
  ------------------
  |  Branch (1008:9): [True: 496, False: 589]
  ------------------
 1009|    496|		str++;
 1010|    589|	last = str;
 1011|  6.23k|	while (*last)
  ------------------
  |  Branch (1011:9): [True: 5.64k, False: 589]
  ------------------
 1012|  5.64k|		last++;
 1013|    589|	if (last == str)
  ------------------
  |  Branch (1013:6): [True: 128, False: 461]
  ------------------
 1014|    128|		return str;
 1015|    461|	--last;
 1016|    461|	while (isspace(CAST(unsigned char, *last)))
  ------------------
  |  Branch (1016:9): [True: 532, False: 461]
  ------------------
 1017|    532|		last--;
 1018|    461|	*++last = '\0';
 1019|    461|	return str;
 1020|    589|}
funcs.c:file_checkfield:
   77|   140k|{
   78|   140k|	const char *p = *pp;
   79|   140k|	int fw = 0;
   80|       |
   81|   148k|	while (*p && isdigit((unsigned char)*p))
  ------------------
  |  Branch (81:9): [True: 148k, False: 0]
  |  Branch (81:15): [True: 8.80k, False: 140k]
  ------------------
   82|  8.80k|		fw = fw * 10 + (*p++ - '0');
   83|       |
   84|   140k|	*pp = p;
   85|       |
   86|   140k|	if (fw < 1024)
  ------------------
  |  Branch (86:6): [True: 140k, False: 0]
  ------------------
   87|   140k|		return 1;
   88|      0|	if (msg)
  ------------------
  |  Branch (88:6): [True: 0, False: 0]
  ------------------
   89|      0|		snprintf(msg, mlen, "field %s too large: %d", what, fw);
   90|       |
   91|      0|	return 0;
   92|   140k|}
funcs.c:file_clearbuf:
   69|  7.71k|{
   70|  7.71k|	free(ms->o.buf);
   71|       |	ms->o.buf = NULL;
   72|  7.71k|	ms->o.blen = 0;
   73|  7.71k|}
funcs.c:file_error_core:
  201|    315|{
  202|       |	/* Only the first error is ok */
  203|    315|	if (ms->event_flags & EVENT_HAD_ERR)
  ------------------
  |  |  487|    315|#define 		EVENT_HAD_ERR		0x01
  ------------------
  |  Branch (203:6): [True: 4, False: 311]
  ------------------
  204|      4|		return;
  205|    311|	if (lineno != 0) {
  ------------------
  |  Branch (205:6): [True: 40, False: 271]
  ------------------
  206|     40|		file_clearbuf(ms);
  207|     40|		(void)file_printf(ms, "line %" SIZE_T_FORMAT "u:", lineno);
  208|     40|	}
  209|    311|	if (ms->o.buf && *ms->o.buf)
  ------------------
  |  Branch (209:6): [True: 42, False: 269]
  |  Branch (209:19): [True: 42, False: 0]
  ------------------
  210|     42|		(void)file_printf(ms, " ");
  211|    311|	(void)file_vprintf(ms, f, va);
  212|    311|	if (error > 0)
  ------------------
  |  Branch (212:6): [True: 0, False: 311]
  ------------------
  213|      0|		(void)file_printf(ms, " (%s)", strerror(error));
  214|    311|	ms->event_flags |= EVENT_HAD_ERR;
  ------------------
  |  |  487|    311|#define 		EVENT_HAD_ERR		0x01
  ------------------
  215|    311|	ms->error = error;
  216|    311|}
funcs.c:checkdone:
  290|  9.90k|{
  291|  9.90k|	if ((ms->flags & MAGIC_CONTINUE) == 0)
  ------------------
  |  |   38|  9.90k|#define	MAGIC_CONTINUE		0x0000020 /* Return all matches */
  ------------------
  |  Branch (291:6): [True: 0, False: 9.90k]
  ------------------
  292|      0|		return 1;
  293|  9.90k|	if (file_separator(ms) == -1)
  ------------------
  |  Branch (293:6): [True: 0, False: 9.90k]
  ------------------
  294|      0|		*rv = -1;
  295|  9.90k|	return 0;
  296|  9.90k|}
funcs.c:trim_separator:
  271|  11.1k|{
  272|  11.1k|	size_t l;
  273|       |
  274|  11.1k|	if (ms->o.buf == NULL)
  ------------------
  |  Branch (274:6): [True: 0, False: 11.1k]
  ------------------
  275|      0|		return;
  276|       |
  277|  11.1k|	l = strlen(ms->o.buf);
  278|  11.1k|	if (l < sizeof(FILE_SEPARATOR))
  ------------------
  |  |  261|  11.1k|#define FILE_SEPARATOR "\n- "
  ------------------
  |  Branch (278:6): [True: 0, False: 11.1k]
  ------------------
  279|      0|		return;
  280|       |
  281|  11.1k|	l -= sizeof(FILE_SEPARATOR) - 1;
  ------------------
  |  |  261|  11.1k|#define FILE_SEPARATOR "\n- "
  ------------------
  282|  11.1k|	if (strcmp(ms->o.buf + l, FILE_SEPARATOR) != 0)
  ------------------
  |  |  261|  11.1k|#define FILE_SEPARATOR "\n- "
  ------------------
  |  Branch (282:6): [True: 11.1k, False: 0]
  ------------------
  283|  11.1k|		return;
  284|       |
  285|      0|	ms->o.buf[l] = '\0';
  286|      0|}
funcs.c:check_regex:
  679|  36.6k|{
  680|  36.6k|	char sbuf[512];
  681|  36.6k|	unsigned char oc = '\0';
  682|  36.6k|	const char *p;
  683|  36.6k|	unsigned long l;
  684|  36.6k|	static const char wild[] = "?*+{";
  685|       |
  686|   442k|	for (p = pat; *p; p++) {
  ------------------
  |  Branch (686:16): [True: 406k, False: 36.6k]
  ------------------
  687|   406k|		unsigned char c = *p;
  688|       |		// Avoid repetition of wild characters
  689|   406k|		if (strchr(wild, oc) != NULL && strchr(wild, c) != NULL) {
  ------------------
  |  Branch (689:7): [True: 71.7k, False: 334k]
  |  Branch (689:35): [True: 0, False: 71.7k]
  ------------------
  690|      0|			size_t len = strlen(pat);
  691|      0|			file_magwarn(ms,
  692|      0|			    "repetition-operator operand `%c%c' "
  693|      0|			    "invalid in regex `%s'", oc, c,
  694|      0|			    file_printable(ms, sbuf, sizeof(sbuf), pat, len));
  695|      0|			return -1;
  696|      0|		}
  697|   406k|		if (c == '{') {
  ------------------
  |  Branch (697:7): [True: 69, False: 406k]
  ------------------
  698|     69|			char *ep, *eep;
  699|       |
  700|     69|			if (oc == '}') {
  ------------------
  |  Branch (700:8): [True: 0, False: 69]
  ------------------
  701|      0|				file_magwarn(ms, "cascading repetition "
  702|      0|				    "operators in regex `%s'", pat);
  703|      0|				return -1;
  704|      0|			}
  705|     69|			errno = 0;
  706|     69|			l = strtoul(p + 1, &ep, 10);
  707|     69|			if (ep != p + 1 && l > 1000)
  ------------------
  |  Branch (707:8): [True: 45, False: 24]
  |  Branch (707:23): [True: 0, False: 45]
  ------------------
  708|      0|				goto bounds;
  709|     69|			if (*ep == ',') {
  ------------------
  |  Branch (709:8): [True: 27, False: 42]
  ------------------
  710|     27|				l = strtoul(ep + 1, &eep, 10);
  711|     27|				if (eep != ep + 1 && l > 1000)
  ------------------
  |  Branch (711:9): [True: 27, False: 0]
  |  Branch (711:26): [True: 0, False: 27]
  ------------------
  712|      0|					goto bounds;
  713|     27|			}
  714|     69|		}
  715|   406k|		oc = c;
  716|   406k|		if (isprint(c) || isspace(c) || c == '\b'
  ------------------
  |  Branch (716:7): [True: 405k, False: 154]
  |  Branch (716:21): [True: 150, False: 4]
  |  Branch (716:35): [True: 3, False: 1]
  ------------------
  717|      1|		    || c == 0x8a) // XXX: apple magic fixme
  ------------------
  |  Branch (717:10): [True: 1, False: 0]
  ------------------
  718|   406k|			continue;
  719|      0|		size_t len = strlen(pat);
  720|      0|		file_magwarn(ms,
  721|      0|		    "non-ascii characters in regex \\%#o `%s'",
  722|      0|		    c, file_printable(ms, sbuf, sizeof(sbuf), pat, len));
  723|      0|		return -1;
  724|   406k|	}
  725|  36.6k|	return 0;
  726|      0|bounds:
  727|      0|	file_magwarn(ms, "bounds too large %ld in regex `%s'", l, pat);
  728|      0|	return -1;
  729|  36.6k|}
funcs.c:file_print_guid:
  940|    177|{
  941|    177|#ifndef WIN32
  942|    177|	return snprintf(str, len, "%.8X-%.4hX-%.4hX-%.2hhX%.2hhX-"
  943|    177|	    "%.2hhX%.2hhX%.2hhX%.2hhX%.2hhX%.2hhX",
  944|    177|	    g->data1, g->data2, g->data3, g->data4[0], g->data4[1],
  945|    177|	    g->data4[2], g->data4[3], g->data4[4], g->data4[5],
  946|    177|	    g->data4[6], g->data4[7]);
  947|       |#else
  948|       |	return snprintf(str, len, "%.8X-%.4hX-%.4hX-%.2hX%.2hX-"
  949|       |	    "%.2hX%.2hX%.2hX%.2hX%.2hX%.2hX",
  950|       |	    g->data1, g->data2, g->data3, g->data4[0], g->data4[1],
  951|       |	    g->data4[2], g->data4[3], g->data4[4], g->data4[5],
  952|       |	    g->data4[6], g->data4[7]);
  953|       |#endif
  954|    177|}

file_is_csv:
  136|  11.1k|{
  137|  11.1k|	const unsigned char *uc = CAST(const unsigned char *, b->fbuf);
  ------------------
  |  |  452|  11.1k|#define CAST(T, b)	((T)(b))
  ------------------
  138|  11.1k|	const unsigned char *ue = uc + b->flen;
  139|  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 */
  |  |  ------------------
  ------------------
  140|       |
  141|  11.1k|	if (!looks_text)
  ------------------
  |  Branch (141:6): [True: 9.00k, False: 2.14k]
  ------------------
  142|  9.00k|		return 0;
  143|       |
  144|  2.14k|	if ((ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION)) != 0)
  ------------------
  |  |   45|  2.14k|#define	MAGIC_APPLE		0x0000800 /* Return the Apple creator/type */
  ------------------
              	if ((ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION)) != 0)
  ------------------
  |  |   46|  2.14k|#define	MAGIC_EXTENSION		0x1000000 /* Return a /-separated list of
  ------------------
  |  Branch (144:6): [True: 0, False: 2.14k]
  ------------------
  145|      0|		return 0;
  146|       |
  147|  2.14k|	if (!csv_parse(uc, ue))
  ------------------
  |  Branch (147:6): [True: 2.13k, False: 4]
  ------------------
  148|  2.13k|		return 0;
  149|       |
  150|      4|	if (mime == MAGIC_MIME_ENCODING)
  ------------------
  |  |   43|      4|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  ------------------
  |  Branch (150:6): [True: 0, False: 4]
  ------------------
  151|      0|		return 1;
  152|       |
  153|      4|	if (mime) {
  ------------------
  |  Branch (153:6): [True: 0, False: 4]
  ------------------
  154|      0|		if (file_printf(ms, "text/csv") == -1)
  ------------------
  |  Branch (154:7): [True: 0, False: 0]
  ------------------
  155|      0|			return -1;
  156|      0|		return 1;
  157|      0|	}
  158|       |
  159|      4|	if (file_printf(ms, "CSV %s%stext", code ? code : "",
  ------------------
  |  Branch (159:6): [True: 0, False: 4]
  |  Branch (159:38): [True: 4, False: 0]
  ------------------
  160|      4|	    code ? " " : "") == -1)
  ------------------
  |  Branch (160:6): [True: 4, False: 0]
  ------------------
  161|      0|		return -1;
  162|       |
  163|      4|	return 1;
  164|      4|}
is_csv.c:csv_parse:
   94|  2.14k|{
   95|  2.14k|	size_t nf = 0, tf = 0, nl = 0;
   96|       |
   97|   429M|	while (uc < ue) {
  ------------------
  |  Branch (97:9): [True: 429M, False: 1.99k]
  ------------------
   98|   429M|		switch (*uc++) {
   99|  9.69M|		case '"':
  ------------------
  |  Branch (99:3): [True: 9.69M, False: 420M]
  ------------------
  100|       |			// Eat until the matching quote
  101|  9.69M|			uc = eatquote(uc, ue);
  102|  9.69M|			break;
  103|  38.8M|		case ',':
  ------------------
  |  Branch (103:3): [True: 38.8M, False: 391M]
  ------------------
  104|  38.8M|			nf++;
  105|  38.8M|			break;
  106|    360|		case '\n':
  ------------------
  |  Branch (106:3): [True: 360, False: 429M]
  ------------------
  107|    360|			DPRINTF("%zu %zu %zu\n", nl, nf, tf);
  108|    360|			nl++;
  109|    360|#if CSV_LINES
  110|    360|			if (nl == CSV_LINES)
  ------------------
  |  |   62|    360|#define CSV_LINES 10
  ------------------
  |  Branch (110:8): [True: 13, False: 347]
  ------------------
  111|     13|				return tf > 1 && tf == nf;
  ------------------
  |  Branch (111:12): [True: 9, False: 4]
  |  Branch (111:22): [True: 1, False: 8]
  ------------------
  112|    347|#endif
  113|    347|			if (tf == 0) {
  ------------------
  |  Branch (113:8): [True: 178, False: 169]
  ------------------
  114|       |				// First time and no fields, give up
  115|    178|				if (nf == 0) 
  ------------------
  |  Branch (115:9): [True: 97, False: 81]
  ------------------
  116|     97|					return 0;
  117|       |				// First time, set the number of fields
  118|     81|				tf = nf;
  119|    169|			} else if (tf != nf) {
  ------------------
  |  Branch (119:15): [True: 37, False: 132]
  ------------------
  120|       |				// Field number mismatch, we are done.
  121|     37|				return 0;
  122|     37|			}
  123|    213|			nf = 0;
  124|    213|			break;
  125|   381M|		default:
  ------------------
  |  Branch (125:3): [True: 381M, False: 48.5M]
  ------------------
  126|   381M|			break;
  127|   429M|		}
  128|   429M|	}
  129|  1.99k|	return tf > 1 && nl >= 2;
  ------------------
  |  Branch (129:9): [True: 19, False: 1.97k]
  |  Branch (129:19): [True: 3, False: 16]
  ------------------
  130|  2.14k|}
is_csv.c:eatquote:
   69|  9.69M|{
   70|  9.69M|	int quote = 0;
   71|       |
   72|   147M|	while (uc < ue) {
  ------------------
  |  Branch (72:9): [True: 147M, False: 208]
  ------------------
   73|   147M|		unsigned char c = *uc++;
   74|   147M|		if (c != '"') {
  ------------------
  |  Branch (74:7): [True: 130M, False: 17.0M]
  ------------------
   75|       |			// We already got one, done.
   76|   130M|			if (quote) {
  ------------------
  |  Branch (76:8): [True: 9.69M, False: 121M]
  ------------------
   77|  9.69M|				return --uc;
   78|  9.69M|			}
   79|   121M|			continue;
   80|   130M|		}
   81|  17.0M|		if (quote) {
  ------------------
  |  Branch (81:7): [True: 3.68M, False: 13.3M]
  ------------------
   82|       |			// quote-quote escapes
   83|  3.68M|			quote = 0;
   84|  3.68M|			continue;
   85|  3.68M|		}
   86|       |		// first quote
   87|  13.3M|		quote = 1;
   88|  13.3M|	}
   89|    208|	return ue;
   90|  9.69M|}

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: 35]
  ------------------
  437|  11.1k|		return 0;
  438|       |
  439|     35|	if (mime == MAGIC_MIME_ENCODING)
  ------------------
  |  |   43|     35|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  ------------------
  |  Branch (439:6): [True: 0, False: 35]
  ------------------
  440|      0|		return 1;
  441|     35|	if (mime) {
  ------------------
  |  Branch (441:6): [True: 0, False: 35]
  ------------------
  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|     35|	if (file_printf(ms, "%sJSON text data",
  ------------------
  |  Branch (447:6): [True: 0, False: 35]
  ------------------
  448|     35|	    jt == 1 ? "" : "New Line Delimited ") == -1)
  ------------------
  |  Branch (448:6): [True: 22, False: 13]
  ------------------
  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|     35|	return 1;
  462|     35|}
is_json.c:json_parse:
  348|  6.65M|{
  349|  6.65M|	const unsigned char *uc, *ouc;
  350|  6.65M|	int rv = 0;
  351|  6.65M|	int t;
  352|       |
  353|  6.65M|	ouc = uc = json_skip_space(*ucp, ue);
  354|  6.65M|	if (uc == ue)
  ------------------
  |  Branch (354:6): [True: 77, False: 6.65M]
  ------------------
  355|     77|		goto out;
  356|       |
  357|       |	// Avoid recursion
  358|  6.65M|	if (lvl > 500) {
  ------------------
  |  Branch (358:6): [True: 7, False: 6.65M]
  ------------------
  359|      7|		DPRINTF("Too many levels", uc, *ucp);
  ------------------
  |  |   52|      7|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 7]
  |  |  ------------------
  ------------------
  360|      7|		return 0;
  361|      7|	}
  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|  6.65M|	DPRINTF("Parse general: ", uc, *ucp);
  ------------------
  |  |   52|  6.65M|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 6.65M]
  |  |  ------------------
  ------------------
  369|  6.65M|	switch (*uc++) {
  370|  1.41M|	case '"':
  ------------------
  |  Branch (370:2): [True: 1.41M, False: 5.23M]
  ------------------
  371|  1.41M|		rv = json_parse_string(&uc, ue, lvl + 1);
  372|  1.41M|		t = JSON_STRING;
  ------------------
  |  |   60|  1.41M|#define JSON_STRING	4
  ------------------
  373|  1.41M|		break;
  374|   393k|	case '[':
  ------------------
  |  Branch (374:2): [True: 393k, False: 6.25M]
  ------------------
  375|   393k|		rv = json_parse_array(&uc, ue, st, lvl + 1);
  376|   393k|		t = JSON_ARRAY;
  ------------------
  |  |   56|   393k|#define JSON_ARRAY	0
  ------------------
  377|   393k|		break;
  378|  53.8k|	case '{': /* '}' */
  ------------------
  |  Branch (378:2): [True: 53.8k, False: 6.59M]
  ------------------
  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|    407|	case 't':
  ------------------
  |  Branch (382:2): [True: 407, False: 6.65M]
  ------------------
  383|    407|		rv = json_parse_const(&uc, ue, "true", sizeof("true"), lvl + 1);
  384|    407|		t = JSON_CONSTANT;
  ------------------
  |  |   57|    407|#define JSON_CONSTANT	1
  ------------------
  385|    407|		break;
  386|    292|	case 'f':
  ------------------
  |  Branch (386:2): [True: 292, False: 6.65M]
  ------------------
  387|    292|		rv = json_parse_const(&uc, ue, "false", sizeof("false"),
  388|    292|		    lvl + 1);
  389|    292|		t = JSON_CONSTANT;
  ------------------
  |  |   57|    292|#define JSON_CONSTANT	1
  ------------------
  390|    292|		break;
  391|  1.70M|	case 'n':
  ------------------
  |  Branch (391:2): [True: 1.70M, False: 4.95M]
  ------------------
  392|  1.70M|		rv = json_parse_const(&uc, ue, "null", sizeof("null"), lvl + 1);
  393|  1.70M|		t = JSON_CONSTANT;
  ------------------
  |  |   57|  1.70M|#define JSON_CONSTANT	1
  ------------------
  394|  1.70M|		break;
  395|  3.09M|	default:
  ------------------
  |  Branch (395:2): [True: 3.09M, False: 3.55M]
  ------------------
  396|  3.09M|		--uc;
  397|  3.09M|		rv = json_parse_number(&uc, ue, lvl + 1);
  398|  3.09M|		t = JSON_NUMBER;
  ------------------
  |  |   58|  3.09M|#define JSON_NUMBER	2
  ------------------
  399|  3.09M|		break;
  400|  6.65M|	}
  401|  6.65M|	if (rv)
  ------------------
  |  Branch (401:6): [True: 6.63M, False: 15.4k]
  ------------------
  402|  6.63M|		st[t]++;
  403|  6.65M|	uc = json_skip_space(uc, ue);
  404|  6.65M|out:
  405|  6.65M|	DPRINTF("End general: ", uc, *ucp);
  ------------------
  |  |   52|  6.65M|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 6.65M]
  |  |  ------------------
  ------------------
  406|  6.65M|	*ucp = uc;
  407|  6.65M|	if (lvl == 0) {
  ------------------
  |  Branch (407:6): [True: 11.1k, False: 6.63M]
  ------------------
  408|  11.1k|		if (!rv)
  ------------------
  |  Branch (408:7): [True: 10.7k, False: 391]
  ------------------
  409|  10.7k|			return 0;
  410|    391|		if (uc == ue)
  ------------------
  |  Branch (410:7): [True: 93, False: 298]
  ------------------
  411|     93|			return (st[JSON_ARRAYN] || st[JSON_OBJECT]) ? 1 : 0;
  ------------------
  |  |   61|     93|#define JSON_ARRAYN	5
  ------------------
              			return (st[JSON_ARRAYN] || st[JSON_OBJECT]) ? 1 : 0;
  ------------------
  |  |   59|     81|#define JSON_OBJECT	3
  ------------------
  |  Branch (411:12): [True: 12, False: 81]
  |  Branch (411:31): [True: 10, False: 71]
  ------------------
  412|    298|		if (*ouc == *uc && json_parse(&uc, ue, st, 1))
  ------------------
  |  Branch (412:7): [True: 60, False: 238]
  |  Branch (412:22): [True: 45, False: 15]
  ------------------
  413|     45|			return (st[JSON_ARRAYN] || st[JSON_OBJECT]) ? 2 : 0;
  ------------------
  |  |   61|     45|#define JSON_ARRAYN	5
  ------------------
              			return (st[JSON_ARRAYN] || st[JSON_OBJECT]) ? 2 : 0;
  ------------------
  |  |   59|     36|#define JSON_OBJECT	3
  ------------------
  |  Branch (413:12): [True: 9, False: 36]
  |  Branch (413:31): [True: 4, False: 32]
  ------------------
  414|    253|		else
  415|    253|			return 0;
  416|    298|	}
  417|  6.63M|	return rv;
  418|  6.65M|}
is_json.c:json_skip_space:
  119|  20.4M|{
  120|  31.0M|	while (uc < ue && json_isspace(*uc))
  ------------------
  |  Branch (120:9): [True: 31.0M, False: 2.96k]
  |  Branch (120:20): [True: 10.6M, False: 20.4M]
  ------------------
  121|  10.6M|		uc++;
  122|  20.4M|	return uc;
  123|  20.4M|}
is_json.c:json_isspace:
   79|  31.0M|{
   80|  31.0M|	switch (uc) {
   81|   218k|	case ' ':
  ------------------
  |  Branch (81:2): [True: 218k, False: 30.8M]
  ------------------
   82|  1.31M|	case '\n':
  ------------------
  |  Branch (82:2): [True: 1.09M, False: 30.0M]
  ------------------
   83|  9.66M|	case '\r':
  ------------------
  |  Branch (83:2): [True: 8.35M, False: 22.7M]
  ------------------
   84|  10.6M|	case '\t':
  ------------------
  |  Branch (84:2): [True: 991k, False: 30.1M]
  ------------------
   85|  10.6M|		return 1;
   86|  20.4M|	default:
  ------------------
  |  Branch (86:2): [True: 20.4M, False: 10.6M]
  ------------------
   87|  20.4M|		return 0;
   88|  31.0M|	}
   89|  31.0M|}
is_json.c:json_parse_string:
  129|  1.47M|{
  130|  1.47M|	const unsigned char *uc = *ucp;
  131|  1.47M|	size_t i;
  132|       |
  133|  1.47M|	DPRINTF("Parse string: ", uc, *ucp);
  ------------------
  |  |   52|  1.47M|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 1.47M]
  |  |  ------------------
  ------------------
  134|  74.2M|	while (uc < ue) {
  ------------------
  |  Branch (134:9): [True: 74.2M, False: 110]
  ------------------
  135|  74.2M|		switch (*uc++) {
  136|      8|		case '\0':
  ------------------
  |  Branch (136:3): [True: 8, False: 74.2M]
  ------------------
  137|      8|			goto out;
  138|  41.9M|		case '\\':
  ------------------
  |  Branch (138:3): [True: 41.9M, False: 32.3M]
  ------------------
  139|  41.9M|			if (uc == ue)
  ------------------
  |  Branch (139:8): [True: 20, False: 41.9M]
  ------------------
  140|     20|				goto out;
  141|  41.9M|			switch (*uc++) {
  142|      0|			case '\0':
  ------------------
  |  Branch (142:4): [True: 0, False: 41.9M]
  ------------------
  143|      0|				goto out;
  144|  3.55M|			case '"':
  ------------------
  |  Branch (144:4): [True: 3.55M, False: 38.3M]
  ------------------
  145|  9.44M|			case '\\':
  ------------------
  |  Branch (145:4): [True: 5.89M, False: 36.0M]
  ------------------
  146|  17.7M|			case '/':
  ------------------
  |  Branch (146:4): [True: 8.32M, False: 33.6M]
  ------------------
  147|  20.4M|			case 'b':
  ------------------
  |  Branch (147:4): [True: 2.67M, False: 39.2M]
  ------------------
  148|  25.0M|			case 'f':
  ------------------
  |  Branch (148:4): [True: 4.63M, False: 37.2M]
  ------------------
  149|  28.4M|			case 'n':
  ------------------
  |  Branch (149:4): [True: 3.35M, False: 38.5M]
  ------------------
  150|  31.5M|			case 'r':
  ------------------
  |  Branch (150:4): [True: 3.14M, False: 38.7M]
  ------------------
  151|  41.7M|			case 't':
  ------------------
  |  Branch (151:4): [True: 10.1M, False: 31.7M]
  ------------------
  152|  41.7M|				continue;
  153|   180k|			case 'u':
  ------------------
  |  Branch (153:4): [True: 180k, False: 41.7M]
  ------------------
  154|   180k|				if (ue - uc < 4) {
  ------------------
  |  Branch (154:9): [True: 11, False: 180k]
  ------------------
  155|     11|					uc = ue;
  156|     11|					goto out;
  157|     11|				}
  158|   904k|				for (i = 0; i < 4; i++)
  ------------------
  |  Branch (158:17): [True: 723k, False: 180k]
  ------------------
  159|   723k|					if (!json_isxdigit(*uc++))
  ------------------
  |  Branch (159:10): [True: 27, False: 723k]
  ------------------
  160|     27|						goto out;
  161|   180k|				continue;
  162|   180k|			default:
  ------------------
  |  Branch (162:4): [True: 7, False: 41.9M]
  ------------------
  163|      7|				goto out;
  164|  41.9M|			}
  165|  1.47M|		case '"':
  ------------------
  |  Branch (165:3): [True: 1.47M, False: 72.7M]
  ------------------
  166|  1.47M|			DPRINTF("Good string: ", uc, *ucp);
  ------------------
  |  |   52|  1.47M|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 1.47M]
  |  |  ------------------
  ------------------
  167|  1.47M|			*ucp = uc;
  168|  1.47M|			return 1;
  169|  30.8M|		default:
  ------------------
  |  Branch (169:3): [True: 30.8M, False: 43.3M]
  ------------------
  170|  30.8M|			continue;
  171|  74.2M|		}
  172|  74.2M|	}
  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.47M|}
is_json.c:json_isxdigit:
  105|   723k|{
  106|   723k|	if (json_isdigit(uc))
  ------------------
  |  Branch (106:6): [True: 369k, False: 354k]
  ------------------
  107|   369k|		return 1;
  108|   354k|	switch (uc) {
  109|   284k|	case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
  ------------------
  |  Branch (109:2): [True: 1.49k, False: 352k]
  |  Branch (109:12): [True: 116k, False: 238k]
  |  Branch (109:22): [True: 109k, False: 245k]
  |  Branch (109:32): [True: 831, False: 353k]
  |  Branch (109:42): [True: 56.0k, False: 298k]
  |  Branch (109:52): [True: 153, False: 354k]
  ------------------
  110|   354k|	case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
  ------------------
  |  Branch (110:2): [True: 3.23k, False: 351k]
  |  Branch (110:12): [True: 42, False: 354k]
  |  Branch (110:22): [True: 27, False: 354k]
  |  Branch (110:32): [True: 10.8k, False: 343k]
  |  Branch (110:42): [True: 7.28k, False: 347k]
  |  Branch (110:52): [True: 48.6k, False: 305k]
  ------------------
  111|   354k|		return 1;
  112|     27|	default:
  ------------------
  |  Branch (112:2): [True: 27, False: 354k]
  ------------------
  113|     27|		return 0;
  114|   354k|	}
  115|   354k|}
is_json.c:json_isdigit:
   93|  44.1M|{
   94|  44.1M|	switch (uc) {
   95|  32.4M|	case '0': case '1': case '2': case '3': case '4':
  ------------------
  |  Branch (95:2): [True: 27.3M, False: 16.8M]
  |  Branch (95:12): [True: 1.88M, False: 42.2M]
  |  Branch (95:22): [True: 2.32M, False: 41.7M]
  |  Branch (95:32): [True: 305k, False: 43.8M]
  |  Branch (95:42): [True: 605k, False: 43.5M]
  ------------------
   96|  34.9M|	case '5': case '6': case '7': case '8': case '9':
  ------------------
  |  Branch (96:2): [True: 453k, False: 43.6M]
  |  Branch (96:12): [True: 1.84M, False: 42.2M]
  |  Branch (96:22): [True: 4.15k, False: 44.1M]
  |  Branch (96:32): [True: 252k, False: 43.8M]
  |  Branch (96:42): [True: 22, False: 44.1M]
  ------------------
   97|  34.9M|		return 1;
   98|  9.13M|	default:
  ------------------
  |  Branch (98:2): [True: 9.13M, False: 34.9M]
  ------------------
   99|  9.13M|		return 0;
  100|  44.1M|	}
  101|  44.1M|}
is_json.c:json_parse_array:
  182|   393k|{
  183|   393k|	const unsigned char *uc = *ucp;
  184|       |
  185|   393k|	DPRINTF("Parse array: ", uc, *ucp);
  ------------------
  |  |   52|   393k|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 393k]
  |  |  ------------------
  ------------------
  186|  6.96M|	while (uc < ue) {
  ------------------
  |  Branch (186:9): [True: 6.96M, False: 33]
  ------------------
  187|  6.96M|		uc = json_skip_space(uc, ue);
  188|  6.96M|		if (uc == ue)
  ------------------
  |  Branch (188:7): [True: 15, False: 6.96M]
  ------------------
  189|     15|			goto out;
  190|  6.96M|		if (*uc == ']')
  ------------------
  |  Branch (190:7): [True: 388k, False: 6.57M]
  ------------------
  191|   388k|			goto done;
  192|  6.57M|		if (!json_parse(&uc, ue, st, lvl + 1))
  ------------------
  |  Branch (192:7): [True: 4.34k, False: 6.57M]
  ------------------
  193|  4.34k|			goto out;
  194|  6.57M|		if (uc == ue)
  ------------------
  |  Branch (194:7): [True: 47, False: 6.57M]
  ------------------
  195|     47|			goto out;
  196|  6.57M|		switch (*uc) {
  197|  6.57M|		case ',':
  ------------------
  |  Branch (197:3): [True: 6.57M, False: 679]
  ------------------
  198|  6.57M|			uc++;
  199|  6.57M|			continue;
  200|    662|		case ']':
  ------------------
  |  Branch (200:3): [True: 662, False: 6.57M]
  ------------------
  201|   388k|		done:
  202|   388k|			st[JSON_ARRAYN]++;
  ------------------
  |  |   61|   388k|#define JSON_ARRAYN	5
  ------------------
  203|   388k|			DPRINTF("Good array: ", uc, *ucp);
  ------------------
  |  |   52|   388k|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 388k]
  |  |  ------------------
  ------------------
  204|   388k|			*ucp = uc + 1;
  205|   388k|			return 1;
  206|     17|		default:
  ------------------
  |  Branch (206:3): [True: 17, False: 6.57M]
  ------------------
  207|     17|			goto out;
  208|  6.57M|		}
  209|  6.57M|	}
  210|  4.45k|out:
  211|  4.45k|	DPRINTF("Bad array: ", uc,  *ucp);
  ------------------
  |  |   52|  4.45k|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 4.45k]
  |  |  ------------------
  ------------------
  212|  4.45k|	*ucp = uc;
  213|  4.45k|	return 0;
  214|   393k|}
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|   113k|	while (uc < ue) {
  ------------------
  |  Branch (222:9): [True: 113k, False: 9]
  ------------------
  223|   113k|		uc = json_skip_space(uc, ue);
  224|   113k|		if (uc == ue)
  ------------------
  |  Branch (224:7): [True: 12, False: 113k]
  ------------------
  225|     12|			goto out;
  226|   113k|		if (*uc == '}') {
  ------------------
  |  Branch (226:7): [True: 53.1k, False: 60.3k]
  ------------------
  227|  53.1k|			uc++;
  228|  53.1k|			goto done;
  229|  53.1k|		}
  230|  60.3k|		if (*uc++ != '"') {
  ------------------
  |  Branch (230:7): [True: 31, False: 60.2k]
  ------------------
  231|     31|			DPRINTF("not string", uc, *ucp);
  ------------------
  |  |   52|     31|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 31]
  |  |  ------------------
  ------------------
  232|     31|			goto out;
  233|     31|		}
  234|  60.2k|		DPRINTF("next field", uc, *ucp);
  ------------------
  |  |   52|  60.2k|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 60.2k]
  |  |  ------------------
  ------------------
  235|  60.2k|		if (!json_parse_string(&uc, ue, lvl)) {
  ------------------
  |  Branch (235:7): [True: 6, False: 60.2k]
  ------------------
  236|      6|			DPRINTF("not string", uc, *ucp);
  ------------------
  |  |   52|      6|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 6]
  |  |  ------------------
  ------------------
  237|      6|			goto out;
  238|      6|		}
  239|  60.2k|		uc = json_skip_space(uc, ue);
  240|  60.2k|		if (uc == ue)
  ------------------
  |  Branch (240:7): [True: 9, False: 60.2k]
  ------------------
  241|      9|			goto out;
  242|  60.2k|		if (*uc++ != ':') {
  ------------------
  |  Branch (242:7): [True: 23, False: 60.2k]
  ------------------
  243|     23|			DPRINTF("not colon", uc, *ucp);
  ------------------
  |  |   52|     23|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 23]
  |  |  ------------------
  ------------------
  244|     23|			goto out;
  245|     23|		}
  246|  60.2k|		if (!json_parse(&uc, ue, st, lvl + 1)) {
  ------------------
  |  Branch (246:7): [True: 385, False: 59.8k]
  ------------------
  247|    385|			DPRINTF("not json", uc, *ucp);
  ------------------
  |  |   52|    385|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 385]
  |  |  ------------------
  ------------------
  248|    385|			goto out;
  249|    385|		}
  250|  59.8k|		if (uc == ue)
  ------------------
  |  Branch (250:7): [True: 3, False: 59.8k]
  ------------------
  251|      3|			goto out;
  252|  59.8k|		switch (*uc++) {
  253|  59.6k|		case ',':
  ------------------
  |  Branch (253:3): [True: 59.6k, False: 204]
  ------------------
  254|  59.6k|			continue;
  255|    199|		case '}': /* { */
  ------------------
  |  Branch (255:3): [True: 199, False: 59.6k]
  ------------------
  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: 59.8k]
  ------------------
  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|  59.8k|		}
  265|  59.8k|	}
  266|    483|out:
  267|    483|	DPRINTF("Bad object: ", uc, *ucp);
  ------------------
  |  |   52|    483|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 483]
  |  |  ------------------
  ------------------
  268|    483|	*ucp = uc;
  269|    483|	return 0;
  270|  53.8k|}
is_json.c:json_parse_const:
  328|  1.70M|{
  329|  1.70M|	const unsigned char *uc = *ucp;
  330|       |
  331|  1.70M|	DPRINTF("Parse const: ", uc, *ucp);
  ------------------
  |  |   52|  1.70M|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 1.70M]
  |  |  ------------------
  ------------------
  332|  1.70M|	*ucp += --len - 1;
  333|  1.70M|	if (*ucp > ue)
  ------------------
  |  Branch (333:6): [True: 57, False: 1.70M]
  ------------------
  334|     57|		*ucp = ue;
  335|  6.80M|	for (; uc < ue && --len;) {
  ------------------
  |  Branch (335:9): [True: 6.80M, False: 50]
  |  Branch (335:20): [True: 5.10M, False: 1.70M]
  ------------------
  336|  5.10M|		if (*uc++ != *++str) {
  ------------------
  |  Branch (336:7): [True: 56, False: 5.10M]
  ------------------
  337|     56|			DPRINTF("Bad const: ", uc, *ucp);
  ------------------
  |  |   52|     56|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 56]
  |  |  ------------------
  ------------------
  338|     56|			return 0;
  339|     56|		}
  340|  5.10M|	}
  341|  1.70M|	DPRINTF("Good const: ", uc, *ucp);
  ------------------
  |  |   52|  1.70M|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 1.70M]
  |  |  ------------------
  ------------------
  342|  1.70M|	return 1;
  343|  1.70M|}
is_json.c:json_parse_number:
  276|  3.09M|{
  277|  3.09M|	const unsigned char *uc = *ucp;
  278|  3.09M|	int got = 0;
  279|       |
  280|  3.09M|	DPRINTF("Parse number: ", uc, *ucp);
  ------------------
  |  |   52|  3.09M|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 3.09M]
  |  |  ------------------
  ------------------
  281|  3.09M|	if (uc == ue)
  ------------------
  |  Branch (281:6): [True: 0, False: 3.09M]
  ------------------
  282|      0|		return 0;
  283|  3.09M|	if (*uc == '-')
  ------------------
  |  Branch (283:6): [True: 408k, False: 2.68M]
  ------------------
  284|   408k|		uc++;
  285|       |
  286|  21.0M|	for (; uc < ue; uc++) {
  ------------------
  |  Branch (286:9): [True: 21.0M, False: 44]
  ------------------
  287|  21.0M|		if (!json_isdigit(*uc))
  ------------------
  |  Branch (287:7): [True: 3.09M, False: 17.9M]
  ------------------
  288|  3.09M|			break;
  289|  17.9M|		got = 1;
  290|  17.9M|	}
  291|  3.09M|	if (uc == ue)
  ------------------
  |  Branch (291:6): [True: 44, False: 3.09M]
  ------------------
  292|     44|		goto out;
  293|  3.09M|	if (*uc == '.')
  ------------------
  |  Branch (293:6): [True: 430k, False: 2.66M]
  ------------------
  294|   430k|		uc++;
  295|  14.3M|	for (; uc < ue; uc++) {
  ------------------
  |  Branch (295:9): [True: 14.3M, False: 23]
  ------------------
  296|  14.3M|		if (!json_isdigit(*uc))
  ------------------
  |  Branch (296:7): [True: 3.09M, False: 11.2M]
  ------------------
  297|  3.09M|			break;
  298|  11.2M|		got = 1;
  299|  11.2M|	}
  300|  3.09M|	if (uc == ue)
  ------------------
  |  Branch (300:6): [True: 23, False: 3.09M]
  ------------------
  301|     23|		goto out;
  302|  3.09M|	if (got && (*uc == 'e' || *uc == 'E')) {
  ------------------
  |  Branch (302:6): [True: 3.08M, False: 10.1k]
  |  Branch (302:14): [True: 1.04M, False: 2.03M]
  |  Branch (302:28): [True: 1.55M, False: 483k]
  ------------------
  303|  2.59M|		uc++;
  304|  2.59M|		got = 0;
  305|  2.59M|		if (uc == ue)
  ------------------
  |  Branch (305:7): [True: 10, False: 2.59M]
  ------------------
  306|     10|			goto out;
  307|  2.59M|		if (*uc == '+' || *uc == '-')
  ------------------
  |  Branch (307:7): [True: 63.8k, False: 2.53M]
  |  Branch (307:21): [True: 1.20M, False: 1.32M]
  ------------------
  308|  1.27M|			uc++;
  309|  8.03M|		for (; uc < ue; uc++) {
  ------------------
  |  Branch (309:10): [True: 8.03M, False: 28]
  ------------------
  310|  8.03M|			if (!json_isdigit(*uc))
  ------------------
  |  Branch (310:8): [True: 2.59M, False: 5.43M]
  ------------------
  311|  2.59M|				break;
  312|  5.43M|			got = 1;
  313|  5.43M|		}
  314|  2.59M|	}
  315|  3.09M|out:
  316|  3.09M|	if (!got)
  ------------------
  |  Branch (316:6): [True: 10.2k, False: 3.08M]
  ------------------
  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|  3.08M|	else
  319|  3.08M|		DPRINTF("Good number: ", uc, *ucp);
  ------------------
  |  |   52|  3.08M|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 3.08M]
  |  |  ------------------
  ------------------
  320|  3.09M|	*ucp = uc;
  321|  3.09M|	return got;
  322|  3.09M|}

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: 32]
  ------------------
  167|  11.1k|		return 0;
  168|       |
  169|     32|	if (mime == MAGIC_MIME_ENCODING)
  ------------------
  |  |   43|     32|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  ------------------
  |  Branch (169:6): [True: 0, False: 32]
  ------------------
  170|      0|		return 1;
  171|       |
  172|     32|	if (mime) {
  ------------------
  |  Branch (172:6): [True: 0, False: 32]
  ------------------
  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|     32|	if (file_printf(ms, "SIMH tape data") == -1)
  ------------------
  |  Branch (178:6): [True: 0, False: 32]
  ------------------
  179|      0|		return -1;
  180|       |
  181|     32|	return 1;
  182|     32|}
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.07M|	while (ue - uc >= CAST(ptrdiff_t, sizeof(nbytes))) {
  ------------------
  |  |  452|  1.07M|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (122:9): [True: 1.07M, False: 786]
  ------------------
  123|  1.07M|		nbytes = getlen(&uc, &err);
  124|  1.07M|		if (err)
  ------------------
  |  Branch (124:7): [True: 6.46k, False: 1.06M]
  ------------------
  125|  6.46k|			return 0;
  126|  1.06M|		if ((nt > 0 || nr > 0) && nbytes == 0xFFFFFFFF)
  ------------------
  |  Branch (126:8): [True: 3.47k, False: 1.06M]
  |  Branch (126:18): [True: 1.05M, False: 3.95k]
  |  Branch (126:29): [True: 3, False: 1.06M]
  ------------------
  127|       |			/* EOM after at least one record or tapemark */
  128|      3|			break;
  129|  1.06M|		if (nbytes == 0) {
  ------------------
  |  Branch (129:7): [True: 1.51k, False: 1.06M]
  ------------------
  130|  1.51k|			nt++;	/* count tapemarks */
  131|  1.51k|#if SIMH_TAPEMARKS
  132|  1.51k|			if (nt == SIMH_TAPEMARKS)
  ------------------
  |  |   65|  1.51k|#define SIMH_TAPEMARKS 10
  ------------------
  |  Branch (132:8): [True: 135, False: 1.38k]
  ------------------
  133|    135|				break;
  134|  1.38k|#endif
  135|  1.38k|			continue;
  136|  1.51k|		}
  137|       |		/* handle a data record */
  138|  1.06M|		uc += nbytes;
  139|  1.06M|		if (ue - uc < CAST(ptrdiff_t, sizeof(nbytes)))
  ------------------
  |  |  452|  1.06M|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (139:7): [True: 3.35k, False: 1.06M]
  ------------------
  140|  3.35k|			break;
  141|  1.06M|		cbytes = getlen(&uc, &err);
  142|  1.06M|		if (err)
  ------------------
  |  Branch (142:7): [True: 138, False: 1.06M]
  ------------------
  143|    138|			return 0;
  144|  1.06M|		if (nbytes != cbytes)
  ------------------
  |  Branch (144:7): [True: 272, False: 1.06M]
  ------------------
  145|    272|			return 0;
  146|  1.06M|		nr++;
  147|  1.06M|	}
  148|  4.27k|	if (nt * sizeof(uint32_t) == CAST(size_t, uc - orig_uc))
  ------------------
  |  |  452|  4.27k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (148:6): [True: 910, False: 3.36k]
  ------------------
  149|    910|		return 0;	/* All examined data was tapemarks (0) */
  150|  3.36k|	if (nr == 0)		/* No records */
  ------------------
  |  Branch (150:6): [True: 3.33k, False: 32]
  ------------------
  151|  3.33k|		return 0;
  152|     32|	return 1;
  153|  3.36k|}
is_simh.c:getlen:
   95|  2.13M|{
   96|  2.13M|	uint32_t n;
   97|  2.13M|	memcpy(&n, *uc, sizeof(n));
   98|  2.13M|	*err = 0;
   99|  2.13M|	*uc += sizeof(n);
  100|  2.13M|	if (NEED_SWAP)
  ------------------
  |  |   75|  2.13M|#define NEED_SWAP	(simh_bo.u == CAST(uint32_t, 0x01020304))
  |  |  ------------------
  |  |  |  |  452|  2.13M|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  |  Branch (75:19): [True: 0, False: 2.13M]
  |  |  ------------------
  ------------------
  101|      0|		n = swap4(n);
  102|  2.13M|	if (n == 0xffffffff)	/* check for End of Medium */
  ------------------
  |  Branch (102:6): [True: 66, False: 2.13M]
  ------------------
  103|     66|		return n;
  104|       |	/* Check bits 25 to 28 are not used */
  105|  2.13M|	*err = ((n & 0x00ffffff) != (n & 0x0fffffff));
  106|  2.13M|	n &= 0x00ffffff;	/* keep only the record len */
  107|  2.13M|	if (n & 1)
  ------------------
  |  Branch (107:6): [True: 2.11M, False: 16.1k]
  ------------------
  108|  2.11M|		n++;
  109|  2.13M|	return n;
  110|  2.13M|}

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: 35]
  |  Branch (78:17): [True: 0, False: 35]
  ------------------
   79|  11.1k|		return 0;
   80|       |
   81|     35|	if (mime == MAGIC_MIME_ENCODING)
  ------------------
  |  |   43|     35|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  ------------------
  |  Branch (81:6): [True: 0, False: 35]
  ------------------
   82|      0|		return 1;
   83|       |
   84|     35|	if (file_printf(ms, "%s", mime ? "application/x-tar" :
  ------------------
  |  Branch (84:6): [True: 0, False: 35]
  |  Branch (84:28): [True: 0, False: 35]
  ------------------
   85|     35|	    tartype[tar - 1]) == -1)
   86|      0|		return -1;
   87|       |
   88|     35|	return 1;
   89|     35|}
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.65k, False: 3.49k]
  ------------------
  111|  7.65k|		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.49k|	nulp = CAST(const char *,
  ------------------
  |  |  452|  3.49k|#define CAST(T, b)	((T)(b))
  ------------------
  117|  3.49k|	    memchr(header->header.name, 0, sizeof(header->header.name)));
  118|  3.49k|	if (nulp != NULL && nulp >= header->header.name + sizeof(gpkg_match) &&
  ------------------
  |  Branch (118:6): [True: 3.06k, False: 422]
  |  Branch (118:22): [True: 2.21k, False: 858]
  ------------------
  119|  2.21k|	    memcmp(nulp - sizeof(gpkg_match) + 1, gpkg_match,
  ------------------
  |  Branch (119:6): [True: 30, False: 2.18k]
  ------------------
  120|  2.21k|	    sizeof(gpkg_match)) == 0)
  121|     30|	    return 0;
  122|       |
  123|  3.46k|	recsum = from_oct(header->header.chksum, sizeof(header->header.chksum));
  124|       |
  125|  3.46k|	sum = 0;
  126|  3.46k|	p = header->charptr;
  127|  3.46k|	ep = header->charptr + sizeof(*header);
  128|  1.77M|	while (p < ep)
  ------------------
  |  Branch (128:9): [True: 1.77M, False: 3.46k]
  ------------------
  129|  1.77M|		sum += *p++;
  130|       |
  131|       |	/* Adjust checksum to count the "chksum" field as blanks. */
  132|  31.1k|	for (i = 0; i < sizeof(header->header.chksum); i++)
  ------------------
  |  Branch (132:14): [True: 27.6k, False: 3.46k]
  ------------------
  133|  27.6k|		sum -= header->header.chksum[i];
  134|  3.46k|	sum += ' ' * sizeof(header->header.chksum);
  135|       |
  136|  3.46k|	if (sum != recsum)
  ------------------
  |  Branch (136:6): [True: 3.42k, False: 35]
  ------------------
  137|  3.42k|		return 0;	/* Not a tar archive */
  138|       |
  139|     35|	if (strncmp(header->header.magic, GNUTMAGIC,
  ------------------
  |  |   73|     35|#define	GNUTMAGIC	"ustar  "	/* 7 chars and a null */
  ------------------
  |  Branch (139:6): [True: 3, False: 32]
  ------------------
  140|     35|	    sizeof(header->header.magic)) == 0)
  141|      3|		return 3;		/* GNU Unix Standard tar archive */
  142|       |
  143|     32|	if (strncmp(header->header.magic, TMAGIC,
  ------------------
  |  |   72|     32|#define	TMAGIC		"ustar"		/* 5 chars and a null */
  ------------------
  |  Branch (143:6): [True: 3, False: 29]
  ------------------
  144|     32|	    sizeof(header->header.magic)) == 0)
  145|      3|		return 2;		/* Unix Standard tar archive */
  146|       |
  147|     29|	return 1;			/* Old fashioned tar archive */
  148|     32|}
is_tar.c:from_oct:
  158|  3.46k|{
  159|  3.46k|	int	value;
  160|       |
  161|  3.46k|	if (digs == 0)
  ------------------
  |  Branch (161:6): [True: 0, False: 3.46k]
  ------------------
  162|      0|		return -1;
  163|       |
  164|  3.46k|	while (isspace(CAST(unsigned char, *where))) {	/* Skip spaces */
  ------------------
  |  Branch (164:9): [True: 638, False: 3.40k]
  ------------------
  165|    638|		where++;
  166|    638|		if (digs-- == 0)
  ------------------
  |  Branch (166:7): [True: 54, False: 584]
  ------------------
  167|     54|			return -1;		/* All blank field */
  168|    638|	}
  169|  3.40k|	value = 0;
  170|  3.98k|	while (digs > 0 && isodigit(*where)) {	/* Scan til non-octal */
  ------------------
  |  |   51|  3.94k|#define	isodigit(c)	( ((c) >= '0') && ((c) <= '7') )
  |  |  ------------------
  |  |  |  Branch (51:23): [True: 1.02k, False: 2.91k]
  |  |  |  Branch (51:39): [True: 577, False: 446]
  |  |  ------------------
  ------------------
  |  Branch (170:9): [True: 3.94k, False: 42]
  ------------------
  171|    577|		value = (value << 3) | (*where++ - '0');
  172|    577|		digs--;
  173|    577|	}
  174|       |
  175|  3.40k|	if (digs > 0 && *where && !isspace(CAST(unsigned char, *where)))
  ------------------
  |  Branch (175:6): [True: 3.36k, False: 42]
  |  Branch (175:18): [True: 1.77k, False: 1.58k]
  |  Branch (175:28): [True: 1.76k, False: 8]
  ------------------
  176|  1.76k|		return -1;			/* Ended on non-(space/NUL) */
  177|       |
  178|  1.63k|	return value;
  179|  3.40k|}

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.57k|{
  554|  7.57k|	if (ms == NULL)
  ------------------
  |  Branch (554:6): [True: 0, False: 7.57k]
  ------------------
  555|      0|		return NULL;
  556|  7.57k|	if (file_reset(ms, 1) == -1)
  ------------------
  |  Branch (556:6): [True: 0, False: 7.57k]
  ------------------
  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.57k|	if (file_buffer(ms, -1, NULL, NULL, buf, nb) == -1) {
  ------------------
  |  Branch (562:6): [True: 213, False: 7.35k]
  ------------------
  563|    213|		return NULL;
  564|    213|	}
  565|  7.35k|	return file_getbuffer(ms);
  566|  7.57k|}
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.53k|{
  312|  4.53k|	char *pp;
  313|  4.53k|	time_t t;
  314|  4.53k|	struct tm *tm, tmz;
  315|       |
  316|  4.53k|	if (flags & FILE_T_WINDOWS) {
  ------------------
  |  |  541|  4.53k|#define FILE_T_WINDOWS	2
  ------------------
  |  Branch (316:6): [True: 1.58k, False: 2.94k]
  ------------------
  317|  1.58k|		struct timespec ts;
  318|  1.58k|		cdf_timestamp_to_timespec(&ts, CAST(cdf_timestamp_t, v));
  ------------------
  |  |  452|  1.58k|#define CAST(T, b)	((T)(b))
  ------------------
  319|  1.58k|		t = ts.tv_sec;
  320|  2.94k|	} else {
  321|       |		// XXX: perhaps detect and print something if overflow
  322|       |		// on 32 bit time_t?
  323|  2.94k|		t = CAST(time_t, v);
  ------------------
  |  |  452|  2.94k|#define CAST(T, b)	((T)(b))
  ------------------
  324|  2.94k|	}
  325|       |
  326|  4.53k|	if (t > MAX_CTIME)
  ------------------
  |  |  173|  4.53k|    CAST(time_t, sizeof(time_t) > 4 ? 0x3afff487cfULL : 0x7fffffffULL)
  |  |  ------------------
  |  |  |  |  452|  9.07k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:25): [True: 4.53k, Folded]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (326:6): [True: 1.24k, False: 3.29k]
  ------------------
  327|  1.24k|		goto out;
  328|       |
  329|  3.29k|	if (flags & FILE_T_LOCAL) {
  ------------------
  |  |  540|  3.29k|#define FILE_T_LOCAL	1
  ------------------
  |  Branch (329:6): [True: 585, False: 2.71k]
  ------------------
  330|    585|		tzset();
  331|    585|		tm = localtime_r(&t, &tmz);
  332|  2.71k|	} else {
  333|  2.71k|		tm = gmtime_r(&t, &tmz);
  334|  2.71k|	}
  335|  3.29k|	if (tm == NULL)
  ------------------
  |  Branch (335:6): [True: 424, False: 2.87k]
  ------------------
  336|    424|		goto out;
  337|  2.87k|	pp = asctime_r(tm, buf);
  338|       |
  339|  2.87k|	if (pp == NULL)
  ------------------
  |  Branch (339:6): [True: 339, False: 2.53k]
  ------------------
  340|    339|		goto out;
  341|  2.53k|	pp[strcspn(pp, "\n")] = '\0';
  342|  2.53k|	return pp;
  343|  2.00k|out:
  344|  2.00k|	strlcpy(buf, "*Invalid datetime*", bsize);
  345|  2.00k|	return buf;
  346|  2.87k|}
file_fmtdate:
  354|    135|{
  355|    135|	struct tm tm;
  356|       |
  357|    135|	memset(&tm, 0, sizeof(tm));
  358|    135|	tm.tm_mday = v & 0x1f;
  359|    135|	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|    135|	if (tm.tm_mon < 0 || tm.tm_mon > 11)
  ------------------
  |  Branch (362:6): [True: 43, False: 92]
  |  Branch (362:23): [True: 40, False: 52]
  ------------------
  363|     83|		tm.tm_mon = 0;
  364|    135|	tm.tm_year = (v >> 9) + 80;
  365|       |
  366|    135|	if (strftime(buf, bsize, "%b %d %Y", &tm) == 0)
  ------------------
  |  Branch (366:6): [True: 0, False: 135]
  ------------------
  367|      0|		goto out;
  368|       |
  369|    135|	return buf;
  370|      0|out:
  371|      0|	strlcpy(buf, "*Invalid date*", bsize);
  372|      0|	return buf;
  373|    135|}
file_fmttime:
  377|    135|{
  378|    135|	struct tm tm;
  379|       |
  380|    135|	memset(&tm, 0, sizeof(tm));
  381|    135|	tm.tm_sec = (v & 0x1f) * 2;
  382|    135|	tm.tm_min = ((v >> 5) & 0x3f);
  383|    135|	tm.tm_hour = (v >> 11);
  384|       |
  385|    135|	if (strftime(buf, bsize, "%T", &tm) == 0)
  ------------------
  |  Branch (385:6): [True: 0, False: 135]
  ------------------
  386|      0|		goto out;
  387|       |
  388|    135|	return buf;
  389|      0|out:
  390|      0|	strlcpy(buf, "*Invalid time*", bsize);
  391|      0|	return buf;
  392|       |
  393|    135|}

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.38k, False: 1.76k]
  ------------------
  582|  9.38k|		return 0;
  583|       |#ifdef CDF_DEBUG
  584|       |	cdf_dump_header(&h);
  585|       |#endif
  586|       |
  587|  1.76k|	if ((i = cdf_read_sat(&info, &h, &sat)) == -1) {
  ------------------
  |  Branch (587:6): [True: 177, False: 1.58k]
  ------------------
  588|    177|		expn = "Can't read SAT";
  589|    177|		goto out0;
  590|    177|	}
  591|       |#ifdef CDF_DEBUG
  592|       |	cdf_dump_sat("SAT", &sat, CDF_SEC_SIZE(&h));
  593|       |#endif
  594|       |
  595|  1.58k|	if ((i = cdf_read_ssat(&info, &h, &sat, &ssat)) == -1) {
  ------------------
  |  Branch (595:6): [True: 223, False: 1.36k]
  ------------------
  596|    223|		expn = "Can't read SSAT";
  597|    223|		goto out1;
  598|    223|	}
  599|       |#ifdef CDF_DEBUG
  600|       |	cdf_dump_sat("SSAT", &ssat, CDF_SHORT_SEC_SIZE(&h));
  601|       |#endif
  602|       |
  603|  1.36k|	if ((i = cdf_read_dir(&info, &h, &sat, &dir)) == -1) {
  ------------------
  |  Branch (603:6): [True: 94, False: 1.27k]
  ------------------
  604|     94|		expn = "Can't read directory";
  605|     94|		goto out2;
  606|     94|	}
  607|       |
  608|  1.27k|	if ((i = cdf_read_short_stream(&info, &h, &sat, &dir, &sst,
  ------------------
  |  Branch (608:6): [True: 117, False: 1.15k]
  ------------------
  609|  1.27k|	    &root_storage)) == -1) {
  610|    117|		expn = "Cannot read short stream";
  611|    117|		goto out3;
  612|    117|	}
  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: 30, False: 1.12k]
  ------------------
  629|  1.15k|	    "FileHeader", &scn) != -1) {
  630|     30|#define HWP5_SIGNATURE "HWP Document File"
  631|     30|		if (scn.sst_len * scn.sst_ss >= sizeof(HWP5_SIGNATURE) - 1
  ------------------
  |  |  630|     30|#define HWP5_SIGNATURE "HWP Document File"
  ------------------
  |  Branch (631:7): [True: 25, False: 5]
  ------------------
  632|     25|		    && memcmp(scn.sst_tab, HWP5_SIGNATURE,
  ------------------
  |  |  630|     25|#define HWP5_SIGNATURE "HWP Document File"
  ------------------
  |  Branch (632:10): [True: 1, False: 24]
  ------------------
  633|     25|		    sizeof(HWP5_SIGNATURE) - 1) == 0) {
  ------------------
  |  |  630|     25|#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|     29|		} else {
  645|     29|		    cdf_zero_stream(&scn);
  646|     29|		}
  647|     30|	}
  648|       |
  649|  1.15k|	if ((i = cdf_read_summary_info(&info, &h, &sat, &ssat, &sst, &dir,
  ------------------
  |  Branch (649:6): [True: 387, False: 765]
  ------------------
  650|  1.15k|	    &scn)) == -1) {
  651|    387|		if (errno != ESRCH) {
  ------------------
  |  Branch (651:7): [True: 72, False: 315]
  ------------------
  652|     72|			expn = "Cannot read summary info";
  653|     72|		}
  654|    765|	} else {
  655|    765|		i = cdf_check_summary_info(ms, &info, &h,
  656|    765|		    &sat, &ssat, &sst, &dir, &scn, root_storage, &expn);
  657|    765|		cdf_zero_stream(&scn);
  658|    765|	}
  659|  1.15k|	if (i <= 0) {
  ------------------
  |  Branch (659:6): [True: 989, False: 163]
  ------------------
  660|    989|		if ((i = cdf_read_doc_summary_info(&info, &h, &sat, &ssat,
  ------------------
  |  Branch (660:7): [True: 872, False: 117]
  ------------------
  661|    989|		    &sst, &dir, &scn)) == -1) {
  662|    872|			if (errno != ESRCH) {
  ------------------
  |  Branch (662:8): [True: 40, False: 832]
  ------------------
  663|     40|				expn = "Cannot read summary info";
  664|     40|			}
  665|    872|		} else {
  666|    117|			i = cdf_check_summary_info(ms, &info, &h, &sat, &ssat,
  667|    117|			    &sst, &dir, &scn, root_storage, &expn);
  668|    117|		}
  669|    989|	}
  670|  1.15k|	if (i <= 0) {
  ------------------
  |  Branch (670:6): [True: 987, False: 165]
  ------------------
  671|    987|		i = cdf_file_dir_info(ms, &dir);
  672|    987|		if (i < 0)
  ------------------
  |  Branch (672:7): [True: 973, False: 14]
  ------------------
  673|    973|			expn = "Cannot read section info";
  674|    987|	}
  675|  1.15k|out5:
  676|  1.15k|	cdf_zero_stream(&scn);
  677|  1.15k|	cdf_zero_stream(&sst);
  678|  1.27k|out3:
  679|  1.27k|	free(dir.dir_tab);
  680|  1.36k|out2:
  681|  1.36k|	free(ssat.sat_tab);
  682|  1.58k|out1:
  683|  1.58k|	free(sat.sat_tab);
  684|  1.76k|out0:
  685|       |	/* If we handled it already, return */
  686|  1.76k|	if (i != -1)
  ------------------
  |  Branch (686:6): [True: 180, False: 1.58k]
  ------------------
  687|    180|		return i;
  688|       |	/* Provide a default handler */
  689|  1.58k|	if (NOTMIME(ms)) {
  ------------------
  |  |   42|  1.58k|#define NOTMIME(ms) (((ms)->flags & MAGIC_MIME) == 0)
  |  |  ------------------
  |  |  |  |   44|  1.58k|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|  1.58k|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  |  |  ------------------
  |  |  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|  1.58k|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (42:21): [True: 1.58k, False: 0]
  |  |  ------------------
  ------------------
  690|  1.58k|		if (file_printf(ms,
  ------------------
  |  Branch (690:7): [True: 0, False: 1.58k]
  ------------------
  691|  1.58k|		    "Composite Document File V2 Document") == -1)
  692|      0|			return -1;
  693|  1.58k|		if (*expn)
  ------------------
  |  Branch (693:7): [True: 1.58k, False: 0]
  ------------------
  694|  1.58k|			if (file_printf(ms, ", %s", expn) == -1)
  ------------------
  |  Branch (694:8): [True: 0, False: 1.58k]
  ------------------
  695|      0|				return -1;
  696|  1.58k|	} 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.58k|	return 1;
  702|  1.58k|}
readcdf.c:cdf_check_summary_info:
  396|    882|{
  397|    882|	int i;
  398|    882|	const char *str = NULL;
  399|    882|	cdf_directory_t *d;
  400|    882|	char name[__arraycount(d->d_name)];
  401|    882|	size_t j, k;
  402|       |
  403|       |#ifdef CDF_DEBUG
  404|       |	cdf_dump_summary_info(h, scn);
  405|       |#endif
  406|    882|	if ((i = cdf_file_summary_info(ms, h, scn, root_storage)) < 0) {
  ------------------
  |  Branch (406:6): [True: 717, False: 165]
  ------------------
  407|    717|	    *expn = "Can't expand summary_info";
  408|    717|	    return i;
  409|    717|	}
  410|    165|	if (i == 1)
  ------------------
  |  Branch (410:6): [True: 165, False: 0]
  ------------------
  411|    165|		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|    882|{
  305|    882|	cdf_summary_info_header_t si;
  306|    882|	cdf_property_info_t *info;
  307|    882|	size_t count;
  308|    882|	int m;
  309|       |
  310|    882|	if (cdf_unpack_summary_info(sst, h, &si, &info, &count) == -1)
  ------------------
  |  Branch (310:6): [True: 526, False: 356]
  ------------------
  311|    526|		return -1;
  312|       |
  313|    356|	if (NOTMIME(ms)) {
  ------------------
  |  |   42|    356|#define NOTMIME(ms) (((ms)->flags & MAGIC_MIME) == 0)
  |  |  ------------------
  |  |  |  |   44|    356|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|    356|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  |  |  ------------------
  |  |  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|    356|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (42:21): [True: 356, False: 0]
  |  |  ------------------
  ------------------
  314|    356|		const char *str;
  315|       |
  316|    356|		if (file_printf(ms, "Composite Document File V2 Document")
  ------------------
  |  Branch (316:7): [True: 0, False: 356]
  ------------------
  317|    356|		    == -1)
  318|      0|			return -1;
  319|       |
  320|    356|		if (file_printf(ms, ", %s Endian",
  ------------------
  |  Branch (320:7): [True: 0, False: 356]
  ------------------
  321|    356|		    si.si_byte_order == 0xfffe ?  "Little" : "Big") == -1)
  ------------------
  |  Branch (321:7): [True: 5, False: 351]
  ------------------
  322|      0|			return -2;
  323|    356|		switch (si.si_os) {
  324|      8|		case 2:
  ------------------
  |  Branch (324:3): [True: 8, False: 348]
  ------------------
  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|     17|		case 1:
  ------------------
  |  Branch (330:3): [True: 17, False: 339]
  ------------------
  331|     17|			if (file_printf(ms, ", Os: MacOS, Version %d.%d",
  ------------------
  |  Branch (331:8): [True: 0, False: 17]
  ------------------
  332|     17|			    CAST(uint32_t, si.si_os_version) >> 8,
  ------------------
  |  |  452|     17|#define CAST(T, b)	((T)(b))
  ------------------
  333|     17|			    si.si_os_version & 0xff) == -1)
  334|      0|				return -2;
  335|     17|			break;
  336|    331|		default:
  ------------------
  |  Branch (336:3): [True: 331, False: 25]
  ------------------
  337|    331|			if (file_printf(ms, ", Os %d, Version: %d.%d", si.si_os,
  ------------------
  |  Branch (337:8): [True: 0, False: 331]
  ------------------
  338|    331|			    si.si_os_version & 0xff,
  339|    331|			    CAST(uint32_t, si.si_os_version) >> 8) == -1)
  ------------------
  |  |  452|    331|#define CAST(T, b)	((T)(b))
  ------------------
  340|      0|				return -2;
  341|    331|			break;
  342|    356|		}
  343|    356|		if (root_storage) {
  ------------------
  |  Branch (343:7): [True: 121, False: 235]
  ------------------
  344|    121|			str = cdf_clsid_to_mime(root_storage->d_storage_uuid,
  345|    121|			    clsid2desc);
  346|    121|			if (str) {
  ------------------
  |  Branch (346:8): [True: 0, False: 121]
  ------------------
  347|      0|				if (file_printf(ms, ", %s", str) == -1)
  ------------------
  |  Branch (347:9): [True: 0, False: 0]
  ------------------
  348|      0|					return -2;
  349|      0|			}
  350|    121|		}
  351|    356|	}
  352|       |
  353|    356|	m = cdf_file_property_info(ms, info, count, root_storage);
  354|    356|	free(info);
  355|       |
  356|    356|	return m == -1 ? -2 : m;
  ------------------
  |  Branch (356:9): [True: 191, False: 165]
  ------------------
  357|    356|}
readcdf.c:cdf_clsid_to_mime:
   97|    121|{
   98|    121|	size_t i;
   99|    242|	for (i = 0; cv[i].mime != NULL; i++) {
  ------------------
  |  Branch (99:14): [True: 121, False: 121]
  ------------------
  100|    121|		if (clsid[0] == cv[i].clsid[0] && clsid[1] == cv[i].clsid[1])
  ------------------
  |  Branch (100:7): [True: 45, False: 76]
  |  Branch (100:37): [True: 0, False: 45]
  ------------------
  101|      0|			return cv[i].mime;
  102|    121|	}
  103|       |#ifdef CDF_DEBUG
  104|       |	fprintf(stderr, "unknown mime %" PRIx64 ", %" PRIx64 "\n", clsid[0],
  105|       |	    clsid[1]);
  106|       |#endif
  107|    121|	return NULL;
  108|    121|}
readcdf.c:cdf_file_property_info:
  150|    356|{
  151|    356|	size_t i;
  152|    356|	cdf_timestamp_t tp;
  153|    356|	struct timespec ts;
  154|    356|	char buf[64];
  155|    356|	const char *str = NULL;
  156|    356|	const char *s, *e;
  157|    356|	int len;
  158|       |
  159|    356|	if (!NOTMIME(ms) && root_storage)
  ------------------
  |  |   42|    712|#define NOTMIME(ms) (((ms)->flags & MAGIC_MIME) == 0)
  |  |  ------------------
  |  |  |  |   44|    356|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|    356|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  |  |  ------------------
  |  |  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|    356|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (159:6): [True: 0, False: 356]
  |  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.48k|	for (i = 0; i < count; i++) {
  ------------------
  |  Branch (163:14): [True: 1.32k, False: 165]
  ------------------
  164|  1.32k|		cdf_print_property_name(buf, sizeof(buf), info[i].pi_id);
  165|  1.32k|		switch (info[i].pi_type) {
  166|     69|		case CDF_NULL:
  ------------------
  |  |  198|     69|#define CDF_NULL		0x00000001
  ------------------
  |  Branch (166:3): [True: 69, False: 1.25k]
  ------------------
  167|     69|			break;
  168|     55|		case CDF_SIGNED16:
  ------------------
  |  |  199|     55|#define CDF_SIGNED16		0x00000002
  ------------------
  |  Branch (168:3): [True: 55, False: 1.26k]
  ------------------
  169|     55|			if (NOTMIME(ms) && file_printf(ms, ", %s: %hd", buf,
  ------------------
  |  |   42|    110|#define NOTMIME(ms) (((ms)->flags & MAGIC_MIME) == 0)
  |  |  ------------------
  |  |  |  |   44|     55|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|     55|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  |  |  ------------------
  |  |  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|     55|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (42:21): [True: 55, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (169:23): [True: 0, False: 55]
  ------------------
  170|     55|			    info[i].pi_s16) == -1)
  ------------------
  |  |  187|     55|#define pi_s16	pi_val._pi_s16
  ------------------
  171|      0|				return -1;
  172|     55|			break;
  173|     71|		case CDF_SIGNED32:
  ------------------
  |  |  200|     71|#define CDF_SIGNED32		0x00000003
  ------------------
  |  Branch (173:3): [True: 71, False: 1.25k]
  ------------------
  174|     71|			if (NOTMIME(ms) && file_printf(ms, ", %s: %d", buf,
  ------------------
  |  |   42|    142|#define NOTMIME(ms) (((ms)->flags & MAGIC_MIME) == 0)
  |  |  ------------------
  |  |  |  |   44|     71|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|     71|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  |  |  ------------------
  |  |  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|     71|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (42:21): [True: 71, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (174:23): [True: 0, False: 71]
  ------------------
  175|     71|			    info[i].pi_s32) == -1)
  ------------------
  |  |  185|     71|#define pi_s32	pi_val._pi_s32
  ------------------
  176|      0|				return -1;
  177|     71|			break;
  178|     71|		case CDF_UNSIGNED32:
  ------------------
  |  |  215|     61|#define CDF_UNSIGNED32		0x00000013
  ------------------
  |  Branch (178:3): [True: 61, False: 1.26k]
  ------------------
  179|     61|			if (NOTMIME(ms) && file_printf(ms, ", %s: %u", buf,
  ------------------
  |  |   42|    122|#define NOTMIME(ms) (((ms)->flags & MAGIC_MIME) == 0)
  |  |  ------------------
  |  |  |  |   44|     61|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|     61|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  |  |  ------------------
  |  |  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|     61|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (42:21): [True: 61, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (179:23): [True: 0, False: 61]
  ------------------
  180|     61|			    info[i].pi_u32) == -1)
  ------------------
  |  |  184|     61|#define pi_u32	pi_val._pi_u32
  ------------------
  181|      0|				return -1;
  182|     61|			break;
  183|     79|		case CDF_FLOAT:
  ------------------
  |  |  201|     79|#define CDF_FLOAT		0x00000004
  ------------------
  |  Branch (183:3): [True: 79, False: 1.24k]
  ------------------
  184|     79|			if (NOTMIME(ms) && file_printf(ms, ", %s: %g", buf,
  ------------------
  |  |   42|    158|#define NOTMIME(ms) (((ms)->flags & MAGIC_MIME) == 0)
  |  |  ------------------
  |  |  |  |   44|     79|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|     79|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  |  |  ------------------
  |  |  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|     79|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (42:21): [True: 79, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (184:23): [True: 0, False: 79]
  ------------------
  185|     79|			    info[i].pi_f) == -1)
  ------------------
  |  |  188|     79|#define pi_f	pi_val._pi_f
  ------------------
  186|      0|				return -1;
  187|     79|			break;
  188|     79|		case CDF_DOUBLE:
  ------------------
  |  |  202|     67|#define CDF_DOUBLE		0x00000005
  ------------------
  |  Branch (188:3): [True: 67, False: 1.25k]
  ------------------
  189|     67|			if (NOTMIME(ms) && file_printf(ms, ", %s: %g", buf,
  ------------------
  |  |   42|    134|#define NOTMIME(ms) (((ms)->flags & MAGIC_MIME) == 0)
  |  |  ------------------
  |  |  |  |   44|     67|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|     67|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  |  |  ------------------
  |  |  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|     67|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (42:21): [True: 67, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (189:23): [True: 0, False: 67]
  ------------------
  190|     67|			    info[i].pi_d) == -1)
  ------------------
  |  |  189|     67|#define pi_d	pi_val._pi_d
  ------------------
  191|      0|				return -1;
  192|     67|			break;
  193|    170|		case CDF_LENGTH32_STRING:
  ------------------
  |  |  226|    170|#define CDF_LENGTH32_STRING	0x0000001e
  ------------------
  |  Branch (193:3): [True: 170, False: 1.15k]
  ------------------
  194|    233|		case CDF_LENGTH32_WSTRING:
  ------------------
  |  |  227|    233|#define CDF_LENGTH32_WSTRING	0x0000001f
  ------------------
  |  Branch (194:3): [True: 63, False: 1.25k]
  ------------------
  195|    233|			len = info[i].pi_str.s_len;
  ------------------
  |  |  191|    233|#define pi_str	pi_val._pi_str
  ------------------
  196|    233|			if (len > 1) {
  ------------------
  |  Branch (196:8): [True: 197, False: 36]
  ------------------
  197|    197|				char vbuf[1024];
  198|    197|				size_t j, k = 1;
  199|       |
  200|    197|				if (info[i].pi_type == CDF_LENGTH32_WSTRING)
  ------------------
  |  |  227|    197|#define CDF_LENGTH32_WSTRING	0x0000001f
  ------------------
  |  Branch (200:9): [True: 55, False: 142]
  ------------------
  201|     55|				    k++;
  202|    197|				s = info[i].pi_str.s_buf;
  ------------------
  |  |  191|    197|#define pi_str	pi_val._pi_str
  ------------------
  203|    197|				e = info[i].pi_str.s_buf + len;
  ------------------
  |  |  191|    197|#define pi_str	pi_val._pi_str
  ------------------
  204|  44.5k|				for (j = 0; s < e && j < sizeof(vbuf)
  ------------------
  |  Branch (204:17): [True: 44.5k, False: 42]
  |  Branch (204:26): [True: 44.4k, False: 12]
  ------------------
  205|  44.4k|				    && len--; s += k) {
  ------------------
  |  Branch (205:12): [True: 44.4k, False: 0]
  ------------------
  206|  44.4k|					if (*s == '\0')
  ------------------
  |  Branch (206:10): [True: 143, False: 44.3k]
  ------------------
  207|    143|						break;
  208|  44.3k|					if (isprint(CAST(unsigned char, *s)))
  ------------------
  |  Branch (208:10): [True: 39.7k, False: 4.58k]
  ------------------
  209|  39.7k|						vbuf[j++] = *s;
  210|  44.3k|				}
  211|    197|				if (j == sizeof(vbuf))
  ------------------
  |  Branch (211:9): [True: 12, False: 185]
  ------------------
  212|     12|					--j;
  213|    197|				vbuf[j] = '\0';
  214|    197|				if (NOTMIME(ms)) {
  ------------------
  |  |   42|    197|#define NOTMIME(ms) (((ms)->flags & MAGIC_MIME) == 0)
  |  |  ------------------
  |  |  |  |   44|    197|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|    197|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  |  |  ------------------
  |  |  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|    197|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (42:21): [True: 197, False: 0]
  |  |  ------------------
  ------------------
  215|    197|					if (vbuf[0]) {
  ------------------
  |  Branch (215:10): [True: 139, False: 58]
  ------------------
  216|    139|						if (file_printf(ms, ", %s: %s",
  ------------------
  |  Branch (216:11): [True: 9, False: 130]
  ------------------
  217|    139|						    buf, vbuf) == -1)
  218|      9|							return -1;
  219|    139|					}
  220|    197|				} 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|    197|			}
  230|    224|			break;
  231|    462|		case CDF_FILETIME:
  ------------------
  |  |  228|    462|#define CDF_FILETIME		0x00000040
  ------------------
  |  Branch (231:3): [True: 462, False: 859]
  ------------------
  232|    462|			tp = info[i].pi_tp;
  ------------------
  |  |  190|    462|#define pi_tp	pi_val._pi_tp
  ------------------
  233|    462|			if (tp != 0) {
  ------------------
  |  Branch (233:8): [True: 428, False: 34]
  ------------------
  234|    428|				char tbuf[64];
  235|    428|				if (tp < 1000000000000000LL) {
  ------------------
  |  Branch (235:9): [True: 242, False: 186]
  ------------------
  236|    242|					cdf_print_elapsed_time(tbuf,
  237|    242|					    sizeof(tbuf), tp);
  238|    242|					if (NOTMIME(ms) && file_printf(ms,
  ------------------
  |  |   42|    484|#define NOTMIME(ms) (((ms)->flags & MAGIC_MIME) == 0)
  |  |  ------------------
  |  |  |  |   44|    242|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|    242|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  |  |  ------------------
  |  |  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|    242|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (42:21): [True: 242, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (238:25): [True: 0, False: 242]
  ------------------
  239|    242|					    ", %s: %s", buf, tbuf) == -1)
  240|      0|						return -1;
  241|    242|				} else {
  242|    186|					char *c, *ec;
  243|    186|					cdf_timestamp_to_timespec(&ts, tp);
  244|    186|					c = cdf_ctime(&ts.tv_sec, tbuf);
  245|    186|					if (c != NULL &&
  ------------------
  |  Branch (245:10): [True: 186, False: 0]
  ------------------
  246|    186|					    (ec = strchr(c, '\n')) != NULL)
  ------------------
  |  Branch (246:10): [True: 186, False: 0]
  ------------------
  247|    186|						*ec = '\0';
  248|       |
  249|    186|					if (NOTMIME(ms) && file_printf(ms,
  ------------------
  |  |   42|    372|#define NOTMIME(ms) (((ms)->flags & MAGIC_MIME) == 0)
  |  |  ------------------
  |  |  |  |   44|    186|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|    186|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  |  |  ------------------
  |  |  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|    186|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (42:21): [True: 186, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (249:25): [True: 0, False: 186]
  ------------------
  250|    186|					    ", %s: %s", buf, c) == -1)
  251|      0|						return -1;
  252|    186|				}
  253|    428|			}
  254|    462|			break;
  255|    462|		case CDF_CLIPBOARD:
  ------------------
  |  |  235|     42|#define CDF_CLIPBOARD		0x00000047
  ------------------
  |  Branch (255:3): [True: 42, False: 1.27k]
  ------------------
  256|     42|			break;
  257|    182|		default:
  ------------------
  |  Branch (257:3): [True: 182, False: 1.13k]
  ------------------
  258|    182|			return -1;
  259|  1.32k|		}
  260|  1.32k|	}
  261|    165|	if (ms->flags & MAGIC_MIME_TYPE) {
  ------------------
  |  |   37|    165|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  ------------------
  |  Branch (261:6): [True: 0, False: 165]
  ------------------
  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|    165|	return 1;
  268|    165|}
readcdf.c:cdf_file_dir_info:
  518|    987|{
  519|    987|	size_t sd, i, j;
  520|    987|	uint16_t *dir_name;
  521|    987|	int dir_type;
  522|    987|	const char* section_name;
  523|       |
  524|  38.9k|	for (i = 0; i < dir->dir_len; i++) {
  ------------------
  |  Branch (524:14): [True: 37.9k, False: 973]
  ------------------
  525|  37.9k|		dir_name = dir->dir_tab[i].d_name;
  526|  37.9k|		dir_type = dir->dir_tab[i].d_type;
  527|       |
  528|   265k|		for (sd = 0; sd < __arraycount(sectioninfo); sd++) {
  ------------------
  |  |  130|   265k|#define __arraycount(a) (sizeof(a) / sizeof(a[0]))
  ------------------
  |  Branch (528:16): [True: 227k, False: 37.9k]
  ------------------
  529|   227k|			const struct sinfo *si = &sectioninfo[sd];
  530|   569k|			for (j = 0; si->sections[j]; j++) {
  ------------------
  |  Branch (530:16): [True: 341k, False: 227k]
  ------------------
  531|   341k|				if (si->sections[j] == NULL)
  ------------------
  |  Branch (531:9): [True: 0, False: 341k]
  ------------------
  532|      0|					continue;
  533|   341k|				section_name = si->sections[j];
  534|   341k|				if (si->types[j] != dir_type ||
  ------------------
  |  Branch (534:9): [True: 329k, False: 12.3k]
  ------------------
  535|  12.3k|				    cdf_namecmp(section_name, dir_name,
  ------------------
  |  Branch (535:9): [True: 12.3k, False: 14]
  ------------------
  536|  12.3k|					strlen(section_name) + 1) != 0)
  537|   341k|				    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|     14|				if (NOTMIME(ms)) {
  ------------------
  |  |   42|     14|#define NOTMIME(ms) (((ms)->flags & MAGIC_MIME) == 0)
  |  |  ------------------
  |  |  |  |   44|     14|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|     14|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  |  |  ------------------
  |  |  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|     14|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (42:21): [True: 14, False: 0]
  |  |  ------------------
  ------------------
  545|     14|					if (file_printf(ms, "CDFV2 %s",
  ------------------
  |  Branch (545:10): [True: 0, False: 14]
  ------------------
  546|     14|					    si->name) == -1)
  547|      0|						return -1;
  548|     14|				} 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|     14|				return 1;
  554|     14|			}
  555|   227k|		}
  556|  37.9k|	}
  557|    973|	return -1;
  558|    987|}

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.5k|	for (ml = ms->mlist[0]->next; ml != ms->mlist[0]; ml = ml->next) {
  ------------------
  |  Branch (144:32): [True: 13.3k, False: 13.1k]
  ------------------
  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|    270|		case -1:
  ------------------
  |  Branch (150:3): [True: 270, False: 13.1k]
  ------------------
  151|    270|			return ret;
  152|  5.22k|		case 0:
  ------------------
  |  Branch (152:3): [True: 5.22k, False: 8.16k]
  ------------------
  153|  5.22k|			continue;
  154|  7.89k|		default:
  ------------------
  |  Branch (154:3): [True: 7.89k, False: 5.49k]
  ------------------
  155|  7.89k|			if ((ms->flags & MAGIC_CONTINUE) == 0)
  ------------------
  |  |   38|  7.89k|#define	MAGIC_CONTINUE		0x0000020 /* Return all matches */
  ------------------
  |  Branch (155:8): [True: 0, False: 7.89k]
  ------------------
  156|      0|				return ret;
  157|  7.89k|			rv = ret;
  158|  7.89k|			break;
  159|  13.3k|		}
  160|  13.3k|	}
  161|       |
  162|  13.1k|	return rv;
  163|  13.3k|}
softmagic.c:match:
  222|  89.6k|{
  223|  89.6k|	uint32_t magindex = 0;
  224|  89.6k|	unsigned int cont_level = 0;
  225|  89.6k|	int found_matchv = 0; /* if a match is found it is set to 1*/
  226|  89.6k|	int returnvalv = 0, e;
  227|  89.6k|	struct buffer bb;
  228|  89.6k|	int print = (ms->flags & MAGIC_NODESC) == 0;
  ------------------
  |  |   52|  89.6k|#define MAGIC_NODESC		(MAGIC_EXTENSION|MAGIC_MIME|MAGIC_APPLE)
  |  |  ------------------
  |  |  |  |   46|  89.6k|#define	MAGIC_EXTENSION		0x1000000 /* Return a /-separated list of
  |  |  ------------------
  |  |               #define MAGIC_NODESC		(MAGIC_EXTENSION|MAGIC_MIME|MAGIC_APPLE)
  |  |  ------------------
  |  |  |  |   44|  89.6k|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|  89.6k|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  |  |  ------------------
  |  |  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|  89.6k|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define MAGIC_NODESC		(MAGIC_EXTENSION|MAGIC_MIME|MAGIC_APPLE)
  |  |  ------------------
  |  |  |  |   45|  89.6k|#define	MAGIC_APPLE		0x0000800 /* Return the Apple creator/type */
  |  |  ------------------
  ------------------
  229|       |
  230|  89.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|  89.6k|	if (returnval == NULL)
  ------------------
  |  Branch (235:6): [True: 43.5k, False: 46.1k]
  ------------------
  236|  43.5k|		returnval = &returnvalv;
  237|  89.6k|	if (found_match == NULL)
  ------------------
  |  Branch (237:6): [True: 43.5k, False: 46.1k]
  ------------------
  238|  43.5k|		found_match = &found_matchv;
  239|       |
  240|  89.6k|	if (file_check_mem(ms, cont_level) == -1)
  ------------------
  |  Branch (240:6): [True: 0, False: 89.6k]
  ------------------
  241|      0|		return -1;
  242|       |
  243|   165M|	for (magindex = 0; magindex < nmagic; magindex++) {
  ------------------
  |  Branch (243:21): [True: 165M, False: 81.5k]
  ------------------
  244|   165M|		int flush = 0;
  245|   165M|		struct magic *m = &magic[magindex];
  246|   165M|		file_regex_t **m_rxcomp = &magic_rxcomp[magindex];
  247|       |
  248|   165M|		if (m->type != FILE_NAME)
  ------------------
  |  |  290|   165M|#define				FILE_NAME		45
  ------------------
  |  Branch (248:7): [True: 165M, False: 46.1k]
  ------------------
  249|   165M|		if ((IS_STRING(m->type) &&
  ------------------
  |  |  310|   330M|	((t) == FILE_STRING || \
  |  |  ------------------
  |  |  |  |  250|   330M|#define				FILE_STRING		5
  |  |  ------------------
  |  |  |  Branch (310:3): [True: 100M, False: 64.2M]
  |  |  ------------------
  |  |  311|   165M|	 (t) == FILE_PSTRING || \
  |  |  ------------------
  |  |  |  |  258|   229M|#define				FILE_PSTRING		13
  |  |  ------------------
  |  |  |  Branch (311:3): [True: 43.2k, False: 64.2M]
  |  |  ------------------
  |  |  312|   165M|	 (t) == FILE_BESTRING16 || \
  |  |  ------------------
  |  |  |  |  263|   229M|#define				FILE_BESTRING16		18
  |  |  ------------------
  |  |  |  Branch (312:3): [True: 0, False: 64.2M]
  |  |  ------------------
  |  |  313|   165M|	 (t) == FILE_LESTRING16 || \
  |  |  ------------------
  |  |  |  |  264|   229M|#define				FILE_LESTRING16		19
  |  |  ------------------
  |  |  |  Branch (313:3): [True: 86.5k, False: 64.1M]
  |  |  ------------------
  |  |  314|   165M|	 (t) == FILE_REGEX || \
  |  |  ------------------
  |  |  |  |  262|   229M|#define				FILE_REGEX		17
  |  |  ------------------
  |  |  |  Branch (314:3): [True: 3.16M, False: 60.9M]
  |  |  ------------------
  |  |  315|   165M|	 (t) == FILE_SEARCH || \
  |  |  ------------------
  |  |  |  |  265|   226M|#define				FILE_SEARCH		20
  |  |  ------------------
  |  |  |  Branch (315:3): [True: 11.2M, False: 49.6M]
  |  |  ------------------
  |  |  316|   165M|	 (t) == FILE_INDIRECT || \
  |  |  ------------------
  |  |  |  |  286|   214M|#define				FILE_INDIRECT		41
  |  |  ------------------
  |  |  |  Branch (316:3): [True: 0, False: 49.6M]
  |  |  ------------------
  |  |  317|   165M|	 (t) == FILE_NAME || \
  |  |  ------------------
  |  |  |  |  290|   214M|#define				FILE_NAME		45
  |  |  ------------------
  |  |  |  Branch (317:3): [True: 0, False: 49.6M]
  |  |  ------------------
  |  |  318|   165M|	 (t) == FILE_USE || \
  |  |  ------------------
  |  |  |  |  291|   214M|#define				FILE_USE		46
  |  |  ------------------
  |  |  |  Branch (318:3): [True: 0, False: 49.6M]
  |  |  ------------------
  |  |  319|   330M|	 (t) == FILE_OCTAL)
  |  |  ------------------
  |  |  |  |  306|  49.6M|#define				FILE_OCTAL		61
  |  |  ------------------
  |  |  |  Branch (319:3): [True: 0, False: 49.6M]
  |  |  ------------------
  ------------------
  250|   115M|#define FLT (STRING_BINTEST | STRING_TEXTTEST)
  251|   115M|		     ((text && (m->str_flags & FLT) == STRING_BINTEST) ||
  ------------------
  |  |  382|  12.0M|#define str_flags _u._s._flags
  ------------------
              		     ((text && (m->str_flags & FLT) == STRING_BINTEST) ||
  ------------------
  |  |  250|  12.0M|#define FLT (STRING_BINTEST | STRING_TEXTTEST)
  |  |  ------------------
  |  |  |  |  402|  12.0M|#define STRING_BINTEST				BIT(6)
  |  |  |  |  ------------------
  |  |  |  |  |  |  395|  12.0M|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define FLT (STRING_BINTEST | STRING_TEXTTEST)
  |  |  ------------------
  |  |  |  |  401|  12.0M|#define STRING_TEXTTEST				BIT(5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  395|  12.0M|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
              		     ((text && (m->str_flags & FLT) == STRING_BINTEST) ||
  ------------------
  |  |  402|  12.0M|#define STRING_BINTEST				BIT(6)
  |  |  ------------------
  |  |  |  |  395|  12.0M|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (251:10): [True: 12.0M, False: 103M]
  |  Branch (251:18): [True: 468k, False: 11.5M]
  ------------------
  252|   115M|		      (!text && (m->str_flags & FLT) == STRING_TEXTTEST))) ||
  ------------------
  |  |  382|   103M|#define str_flags _u._s._flags
  ------------------
              		      (!text && (m->str_flags & FLT) == STRING_TEXTTEST))) ||
  ------------------
  |  |  250|   103M|#define FLT (STRING_BINTEST | STRING_TEXTTEST)
  |  |  ------------------
  |  |  |  |  402|   103M|#define STRING_BINTEST				BIT(6)
  |  |  |  |  ------------------
  |  |  |  |  |  |  395|   103M|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define FLT (STRING_BINTEST | STRING_TEXTTEST)
  |  |  ------------------
  |  |  |  |  401|   103M|#define STRING_TEXTTEST				BIT(5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  395|   103M|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
              		      (!text && (m->str_flags & FLT) == STRING_TEXTTEST))) ||
  ------------------
  |  |  401|   103M|#define STRING_TEXTTEST				BIT(5)
  |  |  ------------------
  |  |  |  |  395|   103M|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (252:10): [True: 103M, False: 11.5M]
  |  Branch (252:19): [True: 5.10M, False: 98.4M]
  ------------------
  253|   159M|		    (m->flag & mode) != mode) {
  ------------------
  |  Branch (253:7): [True: 19.4M, False: 140M]
  ------------------
  254|   164M|flush:
  255|       |			/* Skip sub-tests */
  256|   742M|			while (magindex < nmagic - 1 &&
  ------------------
  |  Branch (256:11): [True: 742M, False: 4.70k]
  ------------------
  257|   742M|			    magic[magindex + 1].cont_level != 0) {
  ------------------
  |  Branch (257:8): [True: 577M, False: 164M]
  ------------------
  258|   577M|				magindex++;
  259|   577M|			}
  260|   164M|			cont_level = 0;
  261|   164M|			continue; /* Skip to next top-level test*/
  262|  25.0M|		}
  263|       |
  264|   140M|		if (msetoffset(ms, m, &bb, b, offset, cont_level) == -1) {
  ------------------
  |  Branch (264:7): [True: 83.8k, False: 140M]
  ------------------
  265|  83.8k|			if (b->elen == FILE_BADSIZE)
  ------------------
  |  |  175|  83.8k|#define FILE_BADSIZE CAST(size_t, ~0ul)
  |  |  ------------------
  |  |  |  |  452|  83.8k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (265:8): [True: 0, False: 83.8k]
  ------------------
  266|      0|				continue;
  267|  83.8k|			else
  268|  83.8k|				goto flush;
  269|  83.8k|		}
  270|   140M|		ms->line = m->lineno;
  271|       |
  272|       |		/* if main entry matches, print it... */
  273|   140M|		switch (mget(ms, m, b, &bb, offset, cont_level,
  274|   140M|		    mode, text, flip, indir_count, name_count,
  275|   140M|		    printed_something, need_separator, firstline, returnval,
  276|   140M|		    found_match))
  277|   140M|		{
  278|    165|		case -1:
  ------------------
  |  Branch (278:3): [True: 165, False: 140M]
  ------------------
  279|    165|			return -1;
  280|  14.9M|		case 0:
  ------------------
  |  Branch (280:3): [True: 14.9M, False: 125M]
  ------------------
  281|  14.9M|			flush = m->reln != '!';
  282|  14.9M|			break;
  283|   125M|		default:
  ------------------
  |  Branch (283:3): [True: 125M, False: 14.9M]
  ------------------
  284|   125M|			if (m->type == FILE_INDIRECT) {
  ------------------
  |  |  286|   125M|#define				FILE_INDIRECT		41
  ------------------
  |  Branch (284:8): [True: 0, False: 125M]
  ------------------
  285|      0|				*found_match = 1;
  286|      0|				*returnval = 1;
  287|      0|			}
  288|       |
  289|   125M|			switch (magiccheck(ms, m, m_rxcomp)) {
  290|      0|			case -1:
  ------------------
  |  Branch (290:4): [True: 0, False: 125M]
  ------------------
  291|      0|				return -1;
  292|   124M|			case 0:
  ------------------
  |  Branch (292:4): [True: 124M, False: 516k]
  ------------------
  293|   124M|				flush++;
  294|   124M|				break;
  295|   516k|			default:
  ------------------
  |  Branch (295:4): [True: 516k, False: 124M]
  ------------------
  296|   516k|				flush = 0;
  297|   516k|				break;
  298|   125M|			}
  299|   125M|			break;
  300|   140M|		}
  301|   140M|		if (flush) {
  ------------------
  |  Branch (301:7): [True: 139M, False: 516k]
  ------------------
  302|       |			/*
  303|       |			 * main entry didn't match,
  304|       |			 * flush its continuations
  305|       |			 */
  306|   139M|			goto flush;
  307|   139M|		}
  308|       |
  309|   516k|		if ((e = handle_annotation(ms, m, *firstline)) != 0)
  ------------------
  |  Branch (309:7): [True: 0, False: 516k]
  ------------------
  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|   516k|		if (*m->desc) {
  ------------------
  |  Branch (323:7): [True: 13.9k, False: 502k]
  ------------------
  324|  13.9k|			*found_match = 1;
  325|  13.9k|			if (print) {
  ------------------
  |  Branch (325:8): [True: 13.9k, False: 0]
  ------------------
  326|  13.9k|				*returnval = 1;
  327|  13.9k|				*need_separator = 1;
  328|  13.9k|				*printed_something = 1;
  329|  13.9k|				if (print_sep(ms, *firstline) == -1)
  ------------------
  |  Branch (329:9): [True: 0, False: 13.9k]
  ------------------
  330|      0|					return -1;
  331|  13.9k|				if (mprint(ms, m) == -1)
  ------------------
  |  Branch (331:9): [True: 0, False: 13.9k]
  ------------------
  332|      0|					return -1;
  333|  13.9k|			}
  334|  13.9k|		}
  335|       |
  336|   516k|		switch (moffset(ms, m, bb.flen, offset,
  337|   516k|		    &ms->c.li[cont_level].off)) {
  338|  23.8k|		case -1:
  ------------------
  |  Branch (338:3): [True: 23.8k, False: 492k]
  ------------------
  339|  23.8k|		case 0:
  ------------------
  |  Branch (339:3): [True: 0, False: 516k]
  ------------------
  340|  23.8k|			goto flush;
  341|   492k|		default:
  ------------------
  |  Branch (341:3): [True: 492k, False: 23.8k]
  ------------------
  342|   492k|			break;
  343|   516k|		}
  344|       |
  345|       |		/* and any continuations that match */
  346|   492k|		if (file_check_mem(ms, ++cont_level) == -1)
  ------------------
  |  Branch (346:7): [True: 0, False: 492k]
  ------------------
  347|      0|			return -1;
  348|       |
  349|  5.67M|		while (magindex + 1 < nmagic &&
  ------------------
  |  Branch (349:10): [True: 5.59M, False: 76.8k]
  ------------------
  350|  5.59M|		    magic[magindex + 1].cont_level != 0) {
  ------------------
  |  Branch (350:7): [True: 5.18M, False: 407k]
  ------------------
  351|  5.18M|			m = &magic[++magindex];
  352|  5.18M|			m_rxcomp = &magic_rxcomp[magindex];
  353|  5.18M|			ms->line = m->lineno; /* for messages */
  354|       |
  355|  5.18M|			if (cont_level < m->cont_level)
  ------------------
  |  Branch (355:8): [True: 3.80M, False: 1.37M]
  ------------------
  356|  3.80M|				continue;
  357|  1.37M|			if (cont_level > m->cont_level) {
  ------------------
  |  Branch (357:8): [True: 95.2k, False: 1.28M]
  ------------------
  358|       |				/*
  359|       |				 * We're at the end of the level
  360|       |				 * "cont_level" continuations.
  361|       |				 */
  362|  95.2k|				cont_level = m->cont_level;
  363|  95.2k|			}
  364|  1.37M|			if (msetoffset(ms, m, &bb, b, offset, cont_level)
  ------------------
  |  Branch (364:8): [True: 120, False: 1.37M]
  ------------------
  365|  1.37M|			    == -1) {
  366|    120|				if (b->elen == FILE_BADSIZE)
  ------------------
  |  |  175|    120|#define FILE_BADSIZE CAST(size_t, ~0ul)
  |  |  ------------------
  |  |  |  |  452|    120|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (366:9): [True: 0, False: 120]
  ------------------
  367|      0|					continue;
  368|    120|				else
  369|    120|					goto flush;
  370|    120|			}
  371|  1.37M|			if (m->flag & OFFADD) {
  ------------------
  |  |  227|  1.37M|#define OFFADD		0x02	/* if '>&' or '>...(&' appears */
  ------------------
  |  Branch (371:8): [True: 191k, False: 1.18M]
  ------------------
  372|   191k|				if (cont_level == 0) {
  ------------------
  |  Branch (372:9): [True: 0, False: 191k]
  ------------------
  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|   191k|				ms->offset +=
  380|   191k|				    ms->c.li[cont_level - 1].off;
  381|   191k|			}
  382|       |
  383|  1.37M|#ifdef ENABLE_CONDITIONALS
  384|  1.37M|			if (m->cond == COND_ELSE ||
  ------------------
  |  |  363|  2.75M|#define				COND_ELSE	3
  ------------------
  |  Branch (384:8): [True: 0, False: 1.37M]
  ------------------
  385|  1.37M|			    m->cond == COND_ELIF) {
  ------------------
  |  |  362|  1.37M|#define				COND_ELIF	2
  ------------------
  |  Branch (385:8): [True: 0, False: 1.37M]
  ------------------
  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.37M|#endif
  390|  1.37M|			switch (mget(ms, m, b, &bb, offset,
  391|  1.37M|			    cont_level, mode, text, flip, indir_count,
  392|  1.37M|			    name_count, printed_something, need_separator,
  393|  1.37M|			    firstline, returnval, found_match)) {
  394|  7.98k|			case -1:
  ------------------
  |  Branch (394:4): [True: 7.98k, False: 1.36M]
  ------------------
  395|  7.98k|				return -1;
  396|  93.3k|			case 0:
  ------------------
  |  Branch (396:4): [True: 93.3k, False: 1.28M]
  ------------------
  397|  93.3k|				if (m->reln != '!')
  ------------------
  |  Branch (397:9): [True: 91.7k, False: 1.63k]
  ------------------
  398|  91.7k|					continue;
  399|  1.63k|				flush = 1;
  400|  1.63k|				break;
  401|  1.27M|			default:
  ------------------
  |  Branch (401:4): [True: 1.27M, False: 101k]
  ------------------
  402|  1.27M|				if (m->type == FILE_INDIRECT) {
  ------------------
  |  |  286|  1.27M|#define				FILE_INDIRECT		41
  ------------------
  |  Branch (402:9): [True: 16.0k, False: 1.25M]
  ------------------
  403|  16.0k|					*found_match = 1;
  404|  16.0k|					*returnval = 1;
  405|  16.0k|				}
  406|  1.27M|				flush = 0;
  407|  1.27M|				break;
  408|  1.37M|			}
  409|       |
  410|  1.27M|			switch (flush ? 1 : magiccheck(ms, m, m_rxcomp)) {
  ------------------
  |  Branch (410:12): [True: 1.63k, False: 1.27M]
  ------------------
  411|      0|			case -1:
  ------------------
  |  Branch (411:4): [True: 0, False: 1.27M]
  ------------------
  412|      0|				return -1;
  413|   917k|			case 0:
  ------------------
  |  Branch (413:4): [True: 917k, False: 359k]
  ------------------
  414|   917k|#ifdef ENABLE_CONDITIONALS
  415|   917k|				ms->c.li[cont_level].last_match = 0;
  416|   917k|#endif
  417|   917k|				break;
  418|   359k|			default:
  ------------------
  |  Branch (418:4): [True: 359k, False: 917k]
  ------------------
  419|   359k|#ifdef ENABLE_CONDITIONALS
  420|   359k|				ms->c.li[cont_level].last_match = 1;
  421|   359k|#endif
  422|   359k|				if (m->type == FILE_CLEAR)
  ------------------
  |  |  292|   359k|#define				FILE_CLEAR		47
  ------------------
  |  Branch (422:9): [True: 1.44k, False: 358k]
  ------------------
  423|  1.44k|					ms->c.li[cont_level].got_match = 0;
  424|   358k|				else if (ms->c.li[cont_level].got_match) {
  ------------------
  |  Branch (424:14): [True: 70.4k, False: 287k]
  ------------------
  425|  70.4k|					if (m->type == FILE_DEFAULT)
  ------------------
  |  |  248|  70.4k|#define				FILE_DEFAULT		3
  ------------------
  |  Branch (425:10): [True: 1.32k, False: 69.1k]
  ------------------
  426|  1.32k|						break;
  427|  70.4k|				} else
  428|   287k|					ms->c.li[cont_level].got_match = 1;
  429|       |
  430|   358k|				if ((e = handle_annotation(ms, m, *firstline))
  ------------------
  |  Branch (430:9): [True: 0, False: 358k]
  ------------------
  431|   358k|				    != 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|   358k|				if (*m->desc) {
  ------------------
  |  Branch (439:9): [True: 82.7k, False: 275k]
  ------------------
  440|  82.7k|					*found_match = 1;
  441|  82.7k|				}
  442|   358k|				if (print && *m->desc) {
  ------------------
  |  Branch (442:9): [True: 358k, False: 0]
  |  Branch (442:18): [True: 82.7k, False: 275k]
  ------------------
  443|  82.7k|					*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|  82.7k|					if (!*printed_something) {
  ------------------
  |  Branch (455:10): [True: 13.8k, False: 68.9k]
  ------------------
  456|  13.8k|						*printed_something = 1;
  457|  13.8k|						if (print_sep(ms, *firstline)
  ------------------
  |  Branch (457:11): [True: 0, False: 13.8k]
  ------------------
  458|  13.8k|						    == -1)
  459|      0|							return -1;
  460|  13.8k|					}
  461|       |					/* space if previous printed */
  462|  82.7k|					if (*need_separator
  ------------------
  |  Branch (462:10): [True: 79.3k, False: 3.40k]
  ------------------
  463|  79.3k|					    && (m->flag & NOSPACE) == 0) {
  ------------------
  |  |  230|  79.3k|#define NOSPACE		0x10	/* suppress space character before output */
  ------------------
  |  Branch (463:13): [True: 31.4k, False: 47.9k]
  ------------------
  464|  31.4k|						if (file_printf(ms, " ") == -1)
  ------------------
  |  Branch (464:11): [True: 0, False: 31.4k]
  ------------------
  465|      0|							return -1;
  466|  31.4k|					}
  467|  82.7k|					if (mprint(ms, m) == -1)
  ------------------
  |  Branch (467:10): [True: 0, False: 82.7k]
  ------------------
  468|      0|						return -1;
  469|  82.7k|					*need_separator = 1;
  470|  82.7k|				}
  471|       |
  472|   358k|				switch (moffset(ms, m, bb.flen, offset,
  473|   358k|				    &ms->c.li[cont_level].off)) {
  474|  3.66k|				case -1:
  ------------------
  |  Branch (474:5): [True: 3.66k, False: 354k]
  ------------------
  475|  3.66k|				case 0:
  ------------------
  |  Branch (475:5): [True: 0, False: 358k]
  ------------------
  476|  3.66k|					cont_level--;
  477|  3.66k|					break;
  478|   354k|				default:
  ------------------
  |  Branch (478:5): [True: 354k, False: 3.66k]
  ------------------
  479|   354k|					break;
  480|   358k|				}
  481|       |
  482|       |				/*
  483|       |				 * If we see any continuations
  484|       |				 * at a higher level,
  485|       |				 * process them.
  486|       |				 */
  487|   358k|				if (file_check_mem(ms, ++cont_level) == -1)
  ------------------
  |  Branch (487:9): [True: 0, False: 358k]
  ------------------
  488|      0|					return -1;
  489|   358k|				break;
  490|  1.27M|			}
  491|  1.27M|		}
  492|   484k|		if (*printed_something) {
  ------------------
  |  Branch (492:7): [True: 44.8k, False: 439k]
  ------------------
  493|  44.8k|			*firstline = 0;
  494|  44.8k|		}
  495|   484k|		if (*found_match) {
  ------------------
  |  Branch (495:7): [True: 246k, False: 237k]
  ------------------
  496|   246k|			if ((ms->flags & MAGIC_CONTINUE) == 0)
  ------------------
  |  |   38|   246k|#define	MAGIC_CONTINUE		0x0000020 /* Return all matches */
  ------------------
  |  Branch (496:8): [True: 0, False: 246k]
  ------------------
  497|      0|				return *returnval;
  498|       |			// So that we print a separator
  499|   246k|			*printed_something = 0;
  500|   246k|			*firstline = 0;
  501|   246k|		}
  502|   484k|		cont_level = 0;
  503|   484k|	}
  504|  81.5k|	return *returnval;
  505|  89.6k|}
softmagic.c:msetoffset:
 1569|   141M|{
 1570|   141M|	int32_t offset;
 1571|   141M|	if (m->flag & OFFNEGATIVE) {
  ------------------
  |  |  234|   141M|#define OFFNEGATIVE	0x80	/* relative to the end of file */
  ------------------
  |  Branch (1571:6): [True: 447k, False: 141M]
  ------------------
 1572|   447k|		offset = -m->offset;
 1573|   447k|		if (cont_level > 0) {
  ------------------
  |  Branch (1573:7): [True: 38.3k, False: 408k]
  ------------------
 1574|  38.3k|			if (m->flag & (OFFADD|INDIROFFADD))
  ------------------
  |  |  227|  38.3k|#define OFFADD		0x02	/* if '>&' or '>...(&' appears */
  ------------------
              			if (m->flag & (OFFADD|INDIROFFADD))
  ------------------
  |  |  228|  38.3k|#define INDIROFFADD	0x04	/* if '>&(' appears */
  ------------------
  |  Branch (1574:8): [True: 34.6k, False: 3.69k]
  ------------------
 1575|  34.6k|				goto normal;
 1576|       |#if 0
 1577|       |			file_error(ms, 0, "negative offset %d at continuation"
 1578|       |			    "level %u", m->offset, cont_level);
 1579|       |			return -1;
 1580|       |#endif
 1581|  38.3k|		}
 1582|   412k|		if (buffer_fill(b) == -1)
  ------------------
  |  Branch (1582:7): [True: 0, False: 412k]
  ------------------
 1583|      0|			return -1;
 1584|   412k|		if (o != 0) {
  ------------------
  |  Branch (1584:7): [True: 44, False: 412k]
  ------------------
 1585|       |			// Not yet!
 1586|     44|			file_magerror(ms, "non zero offset %" SIZE_T_FORMAT
 1587|     44|			    "u at level %u", o, cont_level);
 1588|     44|			return -1;
 1589|     44|		}
 1590|   412k|		if (b->fd == -1) {
  ------------------
  |  Branch (1590:7): [True: 412k, False: 0]
  ------------------
 1591|   412k|			if (CAST(size_t, m->offset) > b->flen)
  ------------------
  |  |  452|   412k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (1591:8): [True: 83.9k, False: 328k]
  ------------------
 1592|  83.9k|				return -1;
 1593|   328k|			ms->eoffset = ms->offset =
 1594|   328k|			    CAST(int32_t, b->flen - m->offset);
  ------------------
  |  |  452|   328k|#define CAST(T, b)	((T)(b))
  ------------------
 1595|   328k|		} else {
 1596|      0|			if (CAST(size_t, m->offset) > b->elen)
  ------------------
  |  |  452|      0|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (1596:8): [True: 0, False: 0]
  ------------------
 1597|      0|				return -1;
 1598|      0|			buffer_init(bb, -1, NULL, b->ebuf, b->elen);
 1599|      0|			ms->eoffset = ms->offset =
 1600|      0|			    CAST(int32_t, b->elen - m->offset);
  ------------------
  |  |  452|      0|#define CAST(T, b)	((T)(b))
  ------------------
 1601|      0|		}
 1602|   141M|	} else {
 1603|   141M|		offset = m->offset;
 1604|   141M|		if ((m->flag & OFFPOSITIVE) || cont_level == 0) {
  ------------------
  |  |  235|   141M|#define OFFPOSITIVE	0x100	/* relative to the beginning of file */
  ------------------
  |  Branch (1604:7): [True: 52, False: 141M]
  |  Branch (1604:34): [True: 139M, False: 1.33M]
  ------------------
 1605|   139M|normal:
 1606|       |			// XXX: Pass real fd, then who frees bb?
 1607|   139M|			buffer_init(bb, -1, NULL, b->fbuf, b->flen);
 1608|   139M|			ms->offset = offset;
 1609|   139M|			ms->eoffset = 0;
 1610|   139M|		} else {
 1611|  1.33M|			ms->offset = ms->eoffset + offset;
 1612|  1.33M|		}
 1613|   141M|	}
 1614|   141M|	if ((ms->flags & MAGIC_DEBUG) != 0) {
  ------------------
  |  |   33|   141M|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1614:6): [True: 0, False: 141M]
  ------------------
 1615|       |		fprintf(stderr, "bb=[%p,%" SIZE_T_FORMAT "u,%"
 1616|      0|		    SIZE_T_FORMAT "u], %d [b=%p,%"
 1617|      0|		    SIZE_T_FORMAT "u,%" SIZE_T_FORMAT "u], [o=%#x, c=%d]\n",
 1618|      0|		    bb->fbuf, bb->flen, bb->elen, ms->offset, b->fbuf,
 1619|      0|		    b->flen, b->elen, offset, cont_level);
 1620|      0|	}
 1621|   141M|	return 0;
 1622|   141M|}
softmagic.c:mget:
 1652|   141M|{
 1653|   141M|	uint32_t eoffset, offset = ms->offset;
 1654|   141M|	struct buffer sbb;
 1655|   141M|	intmax_t lhs;
 1656|   141M|	file_pushbuf_t *pb;
 1657|   141M|	int rv, oneed_separator, in_type, nfound_match;
 1658|   141M|	char *rbuf;
 1659|   141M|	union VALUETYPE *p = &ms->ms_value;
 1660|   141M|	struct mlist ml, *mlp;
 1661|   141M|	struct cont c;
 1662|   141M|	const unsigned char *s = CAST(const unsigned char *, bb->fbuf);
  ------------------
  |  |  452|   141M|#define CAST(T, b)	((T)(b))
  ------------------
 1663|   141M|	size_t nbytes = bb->flen;
 1664|       |
 1665|   141M|	if (*indir_count >= ms->indir_max) {
  ------------------
  |  Branch (1665:6): [True: 163, False: 141M]
  ------------------
 1666|    163|		file_error(ms, 0, "indirect count (%hu) exceeded",
 1667|    163|		    *indir_count);
 1668|    163|		return -1;
 1669|    163|	}
 1670|       |
 1671|   141M|	if (*name_count >= ms->name_max) {
  ------------------
  |  Branch (1671:6): [True: 2, False: 141M]
  ------------------
 1672|      2|		file_error(ms, 0, "name use count (%hu) exceeded",
 1673|      2|		    *name_count);
 1674|      2|		return -1;
 1675|      2|	}
 1676|       |
 1677|       |
 1678|   141M|	if (mcopy(ms, p, m->type, m->flag & INDIR, s,
  ------------------
  |  |  226|   141M|#define INDIR		0x01	/* if '(...)' appears */
  ------------------
  |  Branch (1678:6): [True: 0, False: 141M]
  ------------------
 1679|   141M|	    CAST(uint32_t, offset + o), CAST(uint32_t, nbytes), m) == -1)
  ------------------
  |  |  452|   141M|#define CAST(T, b)	((T)(b))
  ------------------
              	    CAST(uint32_t, offset + o), CAST(uint32_t, nbytes), m) == -1)
  ------------------
  |  |  452|   141M|#define CAST(T, b)	((T)(b))
  ------------------
 1680|      0|		return -1;
 1681|       |
 1682|   141M|	if ((ms->flags & MAGIC_DEBUG) != 0) {
  ------------------
  |  |   33|   141M|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1682:6): [True: 0, False: 141M]
  ------------------
 1683|      0|		fprintf(stderr, "mget(type=%d, flag=%#x, offset=%u, o=%"
 1684|      0|		    SIZE_T_FORMAT "u, " "nbytes=%" SIZE_T_FORMAT
 1685|      0|		    "u, il=%hu, nc=%hu)\n",
 1686|      0|		    m->type, m->flag, offset, o, nbytes,
 1687|      0|		    *indir_count, *name_count);
 1688|      0|		mdebug(offset, RCAST(char *, RCAST(void *, p)),
  ------------------
  |  |  453|      0|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 1689|      0|		    sizeof(union VALUETYPE));
 1690|      0|#ifndef COMPILE_ONLY
 1691|      0|		file_mdump(m);
 1692|      0|#endif
 1693|      0|	}
 1694|       |
 1695|   141M|	if (m->flag & INDIR) {
  ------------------
  |  |  226|   141M|#define INDIR		0x01	/* if '(...)' appears */
  ------------------
  |  Branch (1695:6): [True: 963k, False: 140M]
  ------------------
 1696|   963k|		intmax_t off = m->in_offset;
 1697|   963k|		const int sgn = m->in_op & FILE_OPSIGNED;
  ------------------
  |  |  355|   963k|#define				FILE_OPSIGNED	0x20
  ------------------
 1698|   963k|		if (m->in_op & FILE_OPINDIRECT) {
  ------------------
  |  |  357|   963k|#define				FILE_OPINDIRECT	0x80
  ------------------
  |  Branch (1698:7): [True: 537, False: 962k]
  ------------------
 1699|    537|			uint8_t *hb;
 1700|    537|			uint16_t hs;
 1701|    537|			uint32_t hl;
 1702|    537|			int op;
 1703|       |
 1704|    537|			if (offset_oob(nbytes, offset + off, 0))
  ------------------
  |  Branch (1704:8): [True: 90, False: 447]
  ------------------
 1705|     90|				return 0;
 1706|    447|			hb = CCAST(uint8_t *, s + offset + off);
  ------------------
  |  |  454|    447|#define CCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 1707|    447|			switch (op = cvt_flip(m->in_type, flip)) {
 1708|      0|			case FILE_BYTE:
  ------------------
  |  |  246|      0|#define 			FILE_BYTE		1
  ------------------
  |  Branch (1708:4): [True: 0, False: 447]
  ------------------
 1709|      0|				if (offset_oob(nbytes, offset + off, 1))
  ------------------
  |  Branch (1709:9): [True: 0, False: 0]
  ------------------
 1710|      0|					return 0;
 1711|      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))
  |  |  ------------------
  ------------------
 1712|      0|				break;
 1713|      0|			case FILE_SHORT:
  ------------------
  |  |  247|      0|#define				FILE_SHORT		2
  ------------------
  |  Branch (1713:4): [True: 0, False: 447]
  ------------------
 1714|      0|				if (offset_oob(nbytes, offset + off, 2))
  ------------------
  |  Branch (1714:9): [True: 0, False: 0]
  ------------------
 1715|      0|					return 0;
 1716|      0|				memcpy(&hs, hb, sizeof(hs));
 1717|      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))
  |  |  ------------------
  ------------------
 1718|      0|				break;
 1719|      0|			case FILE_BESHORT:
  ------------------
  |  |  252|      0|#define				FILE_BESHORT		7
  ------------------
  |  Branch (1719:4): [True: 0, False: 447]
  ------------------
 1720|      0|				if (offset_oob(nbytes, offset + off, 2))
  ------------------
  |  Branch (1720:9): [True: 0, False: 0]
  ------------------
 1721|      0|					return 0;
 1722|      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))
  |  |  ------------------
  ------------------
 1723|      0|				break;
 1724|      0|			case FILE_LESHORT:
  ------------------
  |  |  255|      0|#define				FILE_LESHORT		10
  ------------------
  |  Branch (1724:4): [True: 0, False: 447]
  ------------------
 1725|      0|				if (offset_oob(nbytes, offset + off, 2))
  ------------------
  |  Branch (1725:9): [True: 0, False: 0]
  ------------------
 1726|      0|					return 0;
 1727|      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))
  |  |  ------------------
  ------------------
 1728|      0|				break;
 1729|      0|			case FILE_LONG:
  ------------------
  |  |  249|      0|#define				FILE_LONG		4
  ------------------
  |  Branch (1729:4): [True: 0, False: 447]
  ------------------
 1730|      0|				if (offset_oob(nbytes, offset + off, 4))
  ------------------
  |  Branch (1730:9): [True: 0, False: 0]
  ------------------
 1731|      0|					return 0;
 1732|      0|				memcpy(&hl, hb, sizeof(hl));
 1733|      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))
  |  |  ------------------
  ------------------
 1734|      0|				break;
 1735|      0|			case FILE_BELONG:
  ------------------
  |  |  253|      0|#define				FILE_BELONG		8
  ------------------
  |  Branch (1735:4): [True: 0, False: 447]
  ------------------
 1736|      0|			case FILE_BEID3:
  ------------------
  |  |  284|      0|#define				FILE_BEID3		39
  ------------------
  |  Branch (1736:4): [True: 0, False: 447]
  ------------------
 1737|      0|				if (offset_oob(nbytes, offset + off, 4))
  ------------------
  |  Branch (1737:9): [True: 0, False: 0]
  ------------------
 1738|      0|					return 0;
 1739|      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))
  |  |  ------------------
  ------------------
 1740|      0|				break;
 1741|      0|			case FILE_LEID3:
  ------------------
  |  |  285|      0|#define				FILE_LEID3		40
  ------------------
  |  Branch (1741:4): [True: 0, False: 447]
  ------------------
 1742|    447|			case FILE_LELONG:
  ------------------
  |  |  256|    447|#define				FILE_LELONG		11
  ------------------
  |  Branch (1742:4): [True: 447, False: 0]
  ------------------
 1743|    447|				if (offset_oob(nbytes, offset + off, 4))
  ------------------
  |  Branch (1743:9): [True: 68, False: 379]
  ------------------
 1744|     68|					return 0;
 1745|    379|				off = SEXT(sgn,32,LE32(hb));
  ------------------
  |  |  108|    379|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 379]
  |  |  ------------------
  |  |  109|    379|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|    379|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  452|    379|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1746|    379|				break;
 1747|      0|			case FILE_MELONG:
  ------------------
  |  |  268|      0|#define				FILE_MELONG		23
  ------------------
  |  Branch (1747:4): [True: 0, False: 447]
  ------------------
 1748|      0|				if (offset_oob(nbytes, offset + off, 4))
  ------------------
  |  Branch (1748:9): [True: 0, False: 0]
  ------------------
 1749|      0|					return 0;
 1750|      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))
  |  |  ------------------
  ------------------
 1751|      0|				break;
 1752|      0|			case FILE_BEQUAD:
  ------------------
  |  |  271|      0|#define				FILE_BEQUAD		26
  ------------------
  |  Branch (1752:4): [True: 0, False: 447]
  ------------------
 1753|      0|				if (offset_oob(nbytes, offset + off, 8))
  ------------------
  |  Branch (1753:9): [True: 0, False: 0]
  ------------------
 1754|      0|					return 0;
 1755|      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))
  |  |  ------------------
  ------------------
 1756|      0|				break;
 1757|      0|			case FILE_LEQUAD:
  ------------------
  |  |  270|      0|#define				FILE_LEQUAD		25
  ------------------
  |  Branch (1757:4): [True: 0, False: 447]
  ------------------
 1758|      0|				if (offset_oob(nbytes, offset + off, 8))
  ------------------
  |  Branch (1758:9): [True: 0, False: 0]
  ------------------
 1759|      0|					return 0;
 1760|      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))
  |  |  ------------------
  ------------------
 1761|      0|				break;
 1762|      0|			case FILE_OCTAL:
  ------------------
  |  |  306|      0|#define				FILE_OCTAL		61
  ------------------
  |  Branch (1762:4): [True: 0, False: 447]
  ------------------
 1763|      0|				if (offset_oob(nbytes, offset, m->vallen))
  ------------------
  |  Branch (1763:9): [True: 0, False: 0]
  ------------------
 1764|      0|					return 0;
 1765|      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))
  |  |  ------------------
  ------------------
 1766|      0|				break;
 1767|      0|			default:
  ------------------
  |  Branch (1767:4): [True: 0, False: 447]
  ------------------
 1768|      0|				if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|      0|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1768:9): [True: 0, False: 0]
  ------------------
 1769|      0|					fprintf(stderr, "bad op=%d\n", op);
 1770|      0|				return 0;
 1771|    447|			}
 1772|    379|			if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|    379|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1772:8): [True: 0, False: 379]
  ------------------
 1773|      0|				fprintf(stderr, "indirect offs=%jd\n", off);
 1774|    379|		}
 1775|   963k|		switch (in_type = cvt_flip(m->in_type, flip)) {
 1776|  18.3k|		case FILE_BYTE:
  ------------------
  |  |  246|  18.3k|#define 			FILE_BYTE		1
  ------------------
  |  Branch (1776:3): [True: 18.3k, False: 944k]
  ------------------
 1777|  18.3k|			if (offset_oob(nbytes, offset, 1))
  ------------------
  |  Branch (1777:8): [True: 36, False: 18.2k]
  ------------------
 1778|     36|				return 0;
 1779|  18.2k|			if (do_ops(ms, m, &offset, SEXT(sgn,8,p->b), off))
  ------------------
  |  |  108|  18.2k|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 18.2k]
  |  |  ------------------
  |  |  109|  18.2k|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|  18.2k|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  452|  18.2k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (1779:8): [True: 0, False: 18.2k]
  ------------------
 1780|      0|				return 0;
 1781|  18.2k|			break;
 1782|  18.2k|		case FILE_BESHORT:
  ------------------
  |  |  252|  11.2k|#define				FILE_BESHORT		7
  ------------------
  |  Branch (1782:3): [True: 11.2k, False: 951k]
  ------------------
 1783|  11.2k|			if (offset_oob(nbytes, offset, 2))
  ------------------
  |  Branch (1783:8): [True: 149, False: 11.1k]
  ------------------
 1784|    149|				return 0;
 1785|  11.1k|			if (do_ops(ms, m, &offset, SEXT(sgn,16,BE16(p->hs)), off))
  ------------------
  |  |  108|  11.1k|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 11.1k]
  |  |  ------------------
  |  |  109|  11.1k|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|  11.1k|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  452|  11.1k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (1785:8): [True: 0, False: 11.1k]
  ------------------
 1786|      0|				return 0;
 1787|  11.1k|			break;
 1788|  11.1k|		case FILE_LESHORT:
  ------------------
  |  |  255|  7.76k|#define				FILE_LESHORT		10
  ------------------
  |  Branch (1788:3): [True: 7.76k, False: 955k]
  ------------------
 1789|  7.76k|			if (offset_oob(nbytes, offset, 2))
  ------------------
  |  Branch (1789:8): [True: 1.12k, False: 6.64k]
  ------------------
 1790|  1.12k|				return 0;
 1791|  6.64k|			if (do_ops(ms, m, &offset, SEXT(sgn,16,LE16(p->hs)), off))
  ------------------
  |  |  108|  6.64k|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 6.64k]
  |  |  ------------------
  |  |  109|  6.64k|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|  6.64k|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  452|  6.64k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (1791:8): [True: 0, False: 6.64k]
  ------------------
 1792|      0|				return 0;
 1793|  6.64k|			break;
 1794|  6.64k|		case FILE_SHORT:
  ------------------
  |  |  247|      0|#define				FILE_SHORT		2
  ------------------
  |  Branch (1794:3): [True: 0, False: 963k]
  ------------------
 1795|      0|			if (offset_oob(nbytes, offset, 2))
  ------------------
  |  Branch (1795:8): [True: 0, False: 0]
  ------------------
 1796|      0|				return 0;
 1797|      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 (1797:8): [True: 0, False: 0]
  ------------------
 1798|      0|				return 0;
 1799|      0|			break;
 1800|  2.73k|		case FILE_BELONG:
  ------------------
  |  |  253|  2.73k|#define				FILE_BELONG		8
  ------------------
  |  Branch (1800:3): [True: 2.73k, False: 960k]
  ------------------
 1801|  2.90k|		case FILE_BEID3:
  ------------------
  |  |  284|  2.90k|#define				FILE_BEID3		39
  ------------------
  |  Branch (1801:3): [True: 172, False: 963k]
  ------------------
 1802|  2.90k|			if (offset_oob(nbytes, offset, 4))
  ------------------
  |  Branch (1802:8): [True: 188, False: 2.72k]
  ------------------
 1803|    188|				return 0;
 1804|  2.72k|			lhs = BE32(p->hl);
  ------------------
  |  |   95|  2.72k|#define BE32(p) ( \
  |  |   96|  2.72k|    (CAST(uint32_t, (p)[0])<<24)| \
  |  |  ------------------
  |  |  |  |  452|  2.72k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   97|  2.72k|    (CAST(uint32_t, (p)[1])<<16)| \
  |  |  ------------------
  |  |  |  |  452|  2.72k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   98|  2.72k|    (CAST(uint32_t, (p)[2])<<8)| \
  |  |  ------------------
  |  |  |  |  452|  2.72k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   99|  2.72k|    (CAST(uint32_t, (p)[3])))
  |  |  ------------------
  |  |  |  |  452|  2.72k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1805|  2.72k|			if (in_type == FILE_BEID3)
  ------------------
  |  |  284|  2.72k|#define				FILE_BEID3		39
  ------------------
  |  Branch (1805:8): [True: 102, False: 2.61k]
  ------------------
 1806|    102|				lhs = cvt_id3(ms, CAST(uint32_t, lhs));
  ------------------
  |  |  452|    102|#define CAST(T, b)	((T)(b))
  ------------------
 1807|  2.72k|			if (do_ops(ms, m, &offset, SEXT(sgn,32,lhs), off))
  ------------------
  |  |  108|  2.72k|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 2.72k]
  |  |  ------------------
  |  |  109|  2.72k|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|  2.72k|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  452|  2.72k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (1807:8): [True: 387, False: 2.33k]
  ------------------
 1808|    387|				return 0;
 1809|  2.33k|			break;
 1810|   918k|		case FILE_LELONG:
  ------------------
  |  |  256|   918k|#define				FILE_LELONG		11
  ------------------
  |  Branch (1810:3): [True: 918k, False: 44.9k]
  ------------------
 1811|   918k|		case FILE_LEID3:
  ------------------
  |  |  285|   918k|#define				FILE_LEID3		40
  ------------------
  |  Branch (1811:3): [True: 0, False: 963k]
  ------------------
 1812|   918k|			if (offset_oob(nbytes, offset, 4))
  ------------------
  |  Branch (1812:8): [True: 291k, False: 626k]
  ------------------
 1813|   291k|				return 0;
 1814|   626k|			lhs = LE32(p->hl);
  ------------------
  |  |   90|   626k|#define LE32(p) ( \
  |  |   91|   626k|    (CAST(uint32_t, (p)[3])<<24)| \
  |  |  ------------------
  |  |  |  |  452|   626k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   92|   626k|    (CAST(uint32_t, (p)[2])<<16)| \
  |  |  ------------------
  |  |  |  |  452|   626k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   93|   626k|    (CAST(uint32_t, (p)[1])<<8)| \
  |  |  ------------------
  |  |  |  |  452|   626k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   94|   626k|    (CAST(uint32_t, (p)[0])))
  |  |  ------------------
  |  |  |  |  452|   626k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1815|   626k|			if (in_type == FILE_LEID3)
  ------------------
  |  |  285|   626k|#define				FILE_LEID3		40
  ------------------
  |  Branch (1815:8): [True: 0, False: 626k]
  ------------------
 1816|      0|				lhs = cvt_id3(ms, CAST(uint32_t, lhs));
  ------------------
  |  |  452|      0|#define CAST(T, b)	((T)(b))
  ------------------
 1817|   626k|			if (do_ops(ms, m, &offset, SEXT(sgn,32,lhs), off))
  ------------------
  |  |  108|   626k|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 626k]
  |  |  ------------------
  |  |  109|   626k|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|   626k|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  452|   626k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (1817:8): [True: 11.0k, False: 615k]
  ------------------
 1818|  11.0k|				return 0;
 1819|   615k|			break;
 1820|   615k|		case FILE_MELONG:
  ------------------
  |  |  268|      0|#define				FILE_MELONG		23
  ------------------
  |  Branch (1820:3): [True: 0, False: 963k]
  ------------------
 1821|      0|			if (offset_oob(nbytes, offset, 4))
  ------------------
  |  Branch (1821:8): [True: 0, False: 0]
  ------------------
 1822|      0|				return 0;
 1823|      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 (1823:8): [True: 0, False: 0]
  ------------------
 1824|      0|				return 0;
 1825|      0|			break;
 1826|    403|		case FILE_LONG:
  ------------------
  |  |  249|    403|#define				FILE_LONG		4
  ------------------
  |  Branch (1826:3): [True: 403, False: 962k]
  ------------------
 1827|    403|			if (offset_oob(nbytes, offset, 4))
  ------------------
  |  Branch (1827:8): [True: 73, False: 330]
  ------------------
 1828|     73|				return 0;
 1829|    330|			if (do_ops(ms, m, &offset, SEXT(sgn,32,p->l), off))
  ------------------
  |  |  108|    330|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 330]
  |  |  ------------------
  |  |  109|    330|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|    330|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  452|    330|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (1829:8): [True: 110, False: 220]
  ------------------
 1830|    110|				return 0;
 1831|    220|			break;
 1832|  3.90k|		case FILE_LEQUAD:
  ------------------
  |  |  270|  3.90k|#define				FILE_LEQUAD		25
  ------------------
  |  Branch (1832:3): [True: 3.90k, False: 959k]
  ------------------
 1833|  3.90k|			if (offset_oob(nbytes, offset, 8))
  ------------------
  |  Branch (1833:8): [True: 114, False: 3.79k]
  ------------------
 1834|    114|				return 0;
 1835|  3.79k|			if (do_ops(ms, m, &offset, SEXT(sgn,64,LE64(p->hq)), off))	
  ------------------
  |  |  108|  3.79k|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 3.79k]
  |  |  ------------------
  |  |  109|  3.79k|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|  3.79k|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  452|  3.79k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (1835:8): [True: 1.92k, False: 1.87k]
  ------------------
 1836|  1.92k|				return 0;
 1837|  1.87k|			break;
 1838|  1.87k|		case FILE_BEQUAD:
  ------------------
  |  |  271|      0|#define				FILE_BEQUAD		26
  ------------------
  |  Branch (1838:3): [True: 0, False: 963k]
  ------------------
 1839|      0|			if (offset_oob(nbytes, offset, 8))
  ------------------
  |  Branch (1839:8): [True: 0, False: 0]
  ------------------
 1840|      0|				return 0;
 1841|      0|			if (do_ops(ms, m, &offset, SEXT(sgn,64,BE64(p->hq)), 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 (1841:8): [True: 0, False: 0]
  ------------------
 1842|      0|				return 0;
 1843|      0|			break;
 1844|    338|		case FILE_OCTAL:
  ------------------
  |  |  306|    338|#define				FILE_OCTAL		61
  ------------------
  |  Branch (1844:3): [True: 338, False: 962k]
  ------------------
 1845|    338|			if (offset_oob(nbytes, offset, m->vallen))
  ------------------
  |  Branch (1845:8): [True: 136, False: 202]
  ------------------
 1846|    136|				return 0;
 1847|    202|			if(do_ops(ms, m, &offset,
  ------------------
  |  Branch (1847:7): [True: 69, False: 133]
  ------------------
 1848|    202|			    SEXT(sgn,64,strtoull(p->s, NULL, 8)), off))
  ------------------
  |  |  108|    202|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 202]
  |  |  ------------------
  |  |  109|    202|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|    202|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  452|    202|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1849|     69|				return 0;
 1850|    133|			break;
 1851|    133|		default:
  ------------------
  |  Branch (1851:3): [True: 0, False: 963k]
  ------------------
 1852|      0|			if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|      0|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1852:8): [True: 0, False: 0]
  ------------------
 1853|      0|				fprintf(stderr, "bad in_type=%d\n", in_type);
 1854|      0|			return 0;
 1855|   963k|		}
 1856|       |
 1857|   656k|		if (m->flag & INDIROFFADD) {
  ------------------
  |  |  228|   656k|#define INDIROFFADD	0x04	/* if '>&(' appears */
  ------------------
  |  Branch (1857:7): [True: 3.25k, False: 652k]
  ------------------
 1858|  3.25k|			if (cont_level == 0) {
  ------------------
  |  Branch (1858:8): [True: 0, False: 3.25k]
  ------------------
 1859|      0|				if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|      0|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1859:9): [True: 0, False: 0]
  ------------------
 1860|      0|					fprintf(stderr,
 1861|      0|					    "indirect *zero* cont_level\n");
 1862|      0|				return 0;
 1863|      0|			}
 1864|  3.25k|			offset += ms->c.li[cont_level - 1].off;
 1865|  3.25k|			if (offset == 0) {
  ------------------
  |  Branch (1865:8): [True: 153, False: 3.10k]
  ------------------
 1866|    153|				if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|    153|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1866:9): [True: 0, False: 153]
  ------------------
 1867|      0|					fprintf(stderr,
 1868|      0|					    "indirect *zero* offset\n");
 1869|    153|				return 0;
 1870|    153|			}
 1871|  3.10k|			if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  3.10k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1871:8): [True: 0, False: 3.10k]
  ------------------
 1872|      0|				fprintf(stderr, "indirect +offs=%u\n", offset);
 1873|  3.10k|		}
 1874|   655k|		if (mcopy(ms, p, m->type, 0, s, offset, nbytes, m) == -1)
  ------------------
  |  Branch (1874:7): [True: 0, False: 655k]
  ------------------
 1875|      0|			return -1;
 1876|   655k|		ms->offset = offset;
 1877|       |
 1878|   655k|		if ((ms->flags & MAGIC_DEBUG) != 0) {
  ------------------
  |  |   33|   655k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1878:7): [True: 0, False: 655k]
  ------------------
 1879|      0|			mdebug(offset, RCAST(char *, RCAST(void *, p)),
  ------------------
  |  |  453|      0|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 1880|      0|			    sizeof(union VALUETYPE));
 1881|      0|#ifndef COMPILE_ONLY
 1882|      0|			file_mdump(m);
 1883|      0|#endif
 1884|      0|		}
 1885|   655k|	}
 1886|       |
 1887|       |	/* Verify we have enough data to match magic type */
 1888|   141M|	switch (m->type) {
 1889|  2.31M|	case FILE_BYTE:
  ------------------
  |  |  246|  2.31M|#define 			FILE_BYTE		1
  ------------------
  |  Branch (1889:2): [True: 2.31M, False: 138M]
  ------------------
 1890|  2.31M|		if (offset_oob(nbytes, offset, 1))
  ------------------
  |  Branch (1890:7): [True: 174k, False: 2.14M]
  ------------------
 1891|   174k|			return 0;
 1892|  2.14M|		break;
 1893|       |
 1894|  2.73M|	case FILE_SHORT:
  ------------------
  |  |  247|  2.73M|#define				FILE_SHORT		2
  ------------------
  |  Branch (1894:2): [True: 2.73M, False: 138M]
  ------------------
 1895|  8.42M|	case FILE_BESHORT:
  ------------------
  |  |  252|  8.42M|#define				FILE_BESHORT		7
  ------------------
  |  Branch (1895:2): [True: 5.68M, False: 135M]
  ------------------
 1896|  13.6M|	case FILE_LESHORT:
  ------------------
  |  |  255|  13.6M|#define				FILE_LESHORT		10
  ------------------
  |  Branch (1896:2): [True: 5.25M, False: 135M]
  ------------------
 1897|  13.6M|		if (offset_oob(nbytes, offset, 2))
  ------------------
  |  Branch (1897:7): [True: 925k, False: 12.7M]
  ------------------
 1898|   925k|			return 0;
 1899|  12.7M|		break;
 1900|       |
 1901|  12.7M|	case FILE_LONG:
  ------------------
  |  |  249|  2.03M|#define				FILE_LONG		4
  ------------------
  |  Branch (1901:2): [True: 2.03M, False: 139M]
  ------------------
 1902|  19.4M|	case FILE_BELONG:
  ------------------
  |  |  253|  19.4M|#define				FILE_BELONG		8
  ------------------
  |  Branch (1902:2): [True: 17.4M, False: 123M]
  ------------------
 1903|  28.5M|	case FILE_LELONG:
  ------------------
  |  |  256|  28.5M|#define				FILE_LELONG		11
  ------------------
  |  Branch (1903:2): [True: 9.13M, False: 132M]
  ------------------
 1904|  28.5M|	case FILE_MELONG:
  ------------------
  |  |  268|  28.5M|#define				FILE_MELONG		23
  ------------------
  |  Branch (1904:2): [True: 41, False: 141M]
  ------------------
 1905|  28.5M|	case FILE_DATE:
  ------------------
  |  |  251|  28.5M|#define				FILE_DATE		6
  ------------------
  |  Branch (1905:2): [True: 0, False: 141M]
  ------------------
 1906|  28.5M|	case FILE_BEDATE:
  ------------------
  |  |  254|  28.5M|#define				FILE_BEDATE		9
  ------------------
  |  Branch (1906:2): [True: 535, False: 141M]
  ------------------
 1907|  28.5M|	case FILE_LEDATE:
  ------------------
  |  |  257|  28.5M|#define				FILE_LEDATE		12
  ------------------
  |  Branch (1907:2): [True: 201, False: 141M]
  ------------------
 1908|  28.5M|	case FILE_MEDATE:
  ------------------
  |  |  266|  28.5M|#define				FILE_MEDATE		21
  ------------------
  |  Branch (1908:2): [True: 175, False: 141M]
  ------------------
 1909|  28.5M|	case FILE_LDATE:
  ------------------
  |  |  259|  28.5M|#define				FILE_LDATE		14
  ------------------
  |  Branch (1909:2): [True: 0, False: 141M]
  ------------------
 1910|  28.5M|	case FILE_BELDATE:
  ------------------
  |  |  260|  28.5M|#define				FILE_BELDATE		15
  ------------------
  |  Branch (1910:2): [True: 344, False: 141M]
  ------------------
 1911|  28.5M|	case FILE_LELDATE:
  ------------------
  |  |  261|  28.5M|#define				FILE_LELDATE		16
  ------------------
  |  Branch (1911:2): [True: 107, False: 141M]
  ------------------
 1912|  28.5M|	case FILE_MELDATE:
  ------------------
  |  |  267|  28.5M|#define				FILE_MELDATE		22
  ------------------
  |  Branch (1912:2): [True: 0, False: 141M]
  ------------------
 1913|  28.5M|	case FILE_FLOAT:
  ------------------
  |  |  278|  28.5M|#define				FILE_FLOAT		33
  ------------------
  |  Branch (1913:2): [True: 0, False: 141M]
  ------------------
 1914|  28.5M|	case FILE_BEFLOAT:
  ------------------
  |  |  279|  28.5M|#define				FILE_BEFLOAT		34
  ------------------
  |  Branch (1914:2): [True: 0, False: 141M]
  ------------------
 1915|  28.5M|	case FILE_LEFLOAT:
  ------------------
  |  |  280|  28.5M|#define				FILE_LEFLOAT		35
  ------------------
  |  Branch (1915:2): [True: 8.44k, False: 141M]
  ------------------
 1916|  28.5M|		if (offset_oob(nbytes, offset, 4))
  ------------------
  |  Branch (1916:7): [True: 1.87M, False: 26.7M]
  ------------------
 1917|  1.87M|			return 0;
 1918|  26.7M|		break;
 1919|       |
 1920|  26.7M|	case FILE_DOUBLE:
  ------------------
  |  |  281|      0|#define				FILE_DOUBLE		36
  ------------------
  |  Branch (1920:2): [True: 0, False: 141M]
  ------------------
 1921|    261|	case FILE_BEDOUBLE:
  ------------------
  |  |  282|    261|#define				FILE_BEDOUBLE		37
  ------------------
  |  Branch (1921:2): [True: 261, False: 141M]
  ------------------
 1922|  1.32k|	case FILE_LEDOUBLE:
  ------------------
  |  |  283|  1.32k|#define				FILE_LEDOUBLE		38
  ------------------
  |  Branch (1922:2): [True: 1.06k, False: 141M]
  ------------------
 1923|  1.32k|		if (offset_oob(nbytes, offset, 8))
  ------------------
  |  Branch (1923:7): [True: 419, False: 908]
  ------------------
 1924|    419|			return 0;
 1925|    908|		break;
 1926|       |
 1927|    908|	case FILE_LEGUID:
  ------------------
  |  |  295|      0|#define				FILE_LEGUID		50
  ------------------
  |  Branch (1927:2): [True: 0, False: 141M]
  ------------------
 1928|      0|	case FILE_BEGUID:
  ------------------
  |  |  296|      0|#define				FILE_BEGUID		51
  ------------------
  |  Branch (1928:2): [True: 0, False: 141M]
  ------------------
 1929|   305k|	case FILE_GUID:
  ------------------
  |  |  294|   305k|#define				FILE_GUID		49
  ------------------
  |  Branch (1929:2): [True: 305k, False: 140M]
  ------------------
 1930|   305k|		if (offset_oob(nbytes, offset, 16))
  ------------------
  |  Branch (1930:7): [True: 21.0k, False: 284k]
  ------------------
 1931|  21.0k|			return 0;
 1932|   284k|		break;
 1933|       |
 1934|  91.6M|	case FILE_STRING:
  ------------------
  |  |  250|  91.6M|#define				FILE_STRING		5
  ------------------
  |  Branch (1934:2): [True: 91.6M, False: 49.6M]
  ------------------
 1935|  91.6M|	case FILE_PSTRING:
  ------------------
  |  |  258|  91.6M|#define				FILE_PSTRING		13
  ------------------
  |  Branch (1935:2): [True: 44.0k, False: 141M]
  ------------------
 1936|  92.8M|	case FILE_SEARCH:
  ------------------
  |  |  265|  92.8M|#define				FILE_SEARCH		20
  ------------------
  |  Branch (1936:2): [True: 1.13M, False: 140M]
  ------------------
 1937|  92.8M|	case FILE_OCTAL:
  ------------------
  |  |  306|  92.8M|#define				FILE_OCTAL		61
  ------------------
  |  Branch (1937:2): [True: 0, False: 141M]
  ------------------
 1938|  92.8M|		if (offset_oob(nbytes, offset, m->vallen))
  ------------------
  |  Branch (1938:7): [True: 11.7M, False: 81.0M]
  ------------------
 1939|  11.7M|			return 0;
 1940|  81.0M|		break;
 1941|       |
 1942|  81.0M|	case FILE_REGEX:
  ------------------
  |  |  262|   324k|#define				FILE_REGEX		17
  ------------------
  |  Branch (1942:2): [True: 324k, False: 140M]
  ------------------
 1943|   324k|		if (nbytes < offset)
  ------------------
  |  Branch (1943:7): [True: 710, False: 324k]
  ------------------
 1944|    710|			return 0;
 1945|   324k|		break;
 1946|       |
 1947|   324k|	case FILE_INDIRECT:
  ------------------
  |  |  286|  31.9k|#define				FILE_INDIRECT		41
  ------------------
  |  Branch (1947:2): [True: 31.9k, False: 141M]
  ------------------
 1948|  31.9k|		if (m->str_flags & INDIRECT_RELATIVE)
  ------------------
  |  |  382|  31.9k|#define str_flags _u._s._flags
  ------------------
              		if (m->str_flags & INDIRECT_RELATIVE)
  ------------------
  |  |  435|  31.9k|#define	INDIRECT_RELATIVE			BIT(0)
  |  |  ------------------
  |  |  |  |  395|  31.9k|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (1948:7): [True: 1.92k, False: 30.0k]
  ------------------
 1949|  1.92k|			offset += CAST(uint32_t, o);
  ------------------
  |  |  452|  1.92k|#define CAST(T, b)	((T)(b))
  ------------------
 1950|  31.9k|		if (offset == 0)
  ------------------
  |  Branch (1950:7): [True: 305, False: 31.6k]
  ------------------
 1951|    305|			return 0;
 1952|       |
 1953|  31.6k|		if (nbytes < offset)
  ------------------
  |  Branch (1953:7): [True: 1.40k, False: 30.2k]
  ------------------
 1954|  1.40k|			return 0;
 1955|       |
 1956|  30.2k|		if ((pb = file_push_buffer(ms)) == NULL)
  ------------------
  |  Branch (1956:7): [True: 11, False: 30.2k]
  ------------------
 1957|     11|			return -1;
 1958|       |
 1959|  30.2k|		(*indir_count)++;
 1960|  30.2k|		sbb = *b;
 1961|  30.2k|		sbb.fbuf = s + offset;
 1962|  30.2k|		sbb.flen = nbytes - offset;
 1963|  30.2k|		sbb.ebuf = NULL;
 1964|  30.2k|		sbb.elen = 0;
 1965|  30.2k|		rv = -1;
 1966|  36.8k|		for (mlp = ms->mlist[0]->next; mlp != ms->mlist[0];
  ------------------
  |  Branch (1966:34): [True: 30.2k, False: 6.69k]
  ------------------
 1967|  30.2k|		    mlp = mlp->next)
 1968|  30.2k|		{
 1969|  30.2k|			if ((rv = match(ms, mlp->magic, mlp->magic_rxcomp,
  ------------------
  |  Branch (1969:8): [True: 23.5k, False: 6.69k]
  ------------------
 1970|  30.2k|			    mlp->nmagic, &sbb, 0, BINTEST, text, 0, indir_count,
  ------------------
  |  |  231|  30.2k|#define BINTEST		0x20	/* test is for a binary type (set only
  ------------------
 1971|  30.2k|			    name_count, printed_something, need_separator,
 1972|  30.2k|			    firstline, NULL, NULL)) != 0)
 1973|  23.5k|				break;
 1974|  30.2k|		}
 1975|  30.2k|		buffer_fini(&sbb);
 1976|       |
 1977|  30.2k|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  30.2k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1977:7): [True: 0, False: 30.2k]
  ------------------
 1978|      0|			fprintf(stderr, "indirect @offs=%u[%d]\n", offset, rv);
 1979|       |
 1980|  30.2k|		rbuf = file_pop_buffer(ms, pb);
 1981|  30.2k|		if (rbuf == NULL && ms->event_flags & EVENT_HAD_ERR)
  ------------------
  |  |  487|  12.0k|#define 		EVENT_HAD_ERR		0x01
  ------------------
  |  Branch (1981:7): [True: 12.0k, False: 18.1k]
  |  Branch (1981:23): [True: 7.39k, False: 4.69k]
  ------------------
 1982|  7.39k|			return -1;
 1983|       |
 1984|  22.8k|		if (rv == 1) {
  ------------------
  |  Branch (1984:7): [True: 16.1k, False: 6.69k]
  ------------------
 1985|  16.1k|			if ((ms->flags & MAGIC_NODESC) == 0 &&
  ------------------
  |  |   52|  16.1k|#define MAGIC_NODESC		(MAGIC_EXTENSION|MAGIC_MIME|MAGIC_APPLE)
  |  |  ------------------
  |  |  |  |   46|  16.1k|#define	MAGIC_EXTENSION		0x1000000 /* Return a /-separated list of
  |  |  ------------------
  |  |               #define MAGIC_NODESC		(MAGIC_EXTENSION|MAGIC_MIME|MAGIC_APPLE)
  |  |  ------------------
  |  |  |  |   44|  16.1k|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|  16.1k|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  |  |  ------------------
  |  |  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|  16.1k|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define MAGIC_NODESC		(MAGIC_EXTENSION|MAGIC_MIME|MAGIC_APPLE)
  |  |  ------------------
  |  |  |  |   45|  16.1k|#define	MAGIC_APPLE		0x0000800 /* Return the Apple creator/type */
  |  |  ------------------
  ------------------
  |  Branch (1985:8): [True: 16.1k, False: 0]
  ------------------
 1986|  16.1k|			    file_printf(ms, F(ms, m->desc, "%u"), offset) == -1)
  ------------------
  |  |  167|  16.1k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (1986:8): [True: 0, False: 16.1k]
  ------------------
 1987|      0|			{
 1988|      0|				free(rbuf);
 1989|      0|				return -1;
 1990|      0|			}
 1991|  16.1k|			if (file_printf(ms, "%s", rbuf) == -1) {
  ------------------
  |  Branch (1991:8): [True: 92, False: 16.0k]
  ------------------
 1992|     92|				free(rbuf);
 1993|     92|				return -1;
 1994|     92|			}
 1995|  16.1k|		}
 1996|  22.7k|		free(rbuf);
 1997|  22.7k|		return rv;
 1998|       |
 1999|  47.5k|	case FILE_USE:
  ------------------
  |  |  291|  47.5k|#define				FILE_USE		46
  ------------------
  |  Branch (1999:2): [True: 47.5k, False: 141M]
  ------------------
 2000|  47.5k|		if (nbytes < offset)
  ------------------
  |  Branch (2000:7): [True: 1.46k, False: 46.1k]
  ------------------
 2001|  1.46k|			return 0;
 2002|  46.1k|		rbuf = m->value.s;
 2003|  46.1k|		if (*rbuf == '^') {
  ------------------
  |  Branch (2003:7): [True: 1.02k, False: 45.0k]
  ------------------
 2004|  1.02k|			rbuf++;
 2005|  1.02k|			flip = !flip;
 2006|  1.02k|		}
 2007|  46.1k|		if (file_magicfind(ms, rbuf, &ml) == -1) {
  ------------------
  |  Branch (2007:7): [True: 0, False: 46.1k]
  ------------------
 2008|      0|			file_error(ms, 0, "cannot find entry `%s'", rbuf);
 2009|      0|			return -1;
 2010|      0|		}
 2011|  46.1k|		if (save_cont(ms, &c) == -1) {
  ------------------
  |  Branch (2011:7): [True: 0, False: 46.1k]
  ------------------
 2012|      0|			file_error(ms, errno, "can't allocate continuation");
 2013|      0|			return -1;
 2014|      0|		}
 2015|       |
 2016|  46.1k|		oneed_separator = *need_separator;
 2017|  46.1k|		if (m->flag & NOSPACE)
  ------------------
  |  |  230|  46.1k|#define NOSPACE		0x10	/* suppress space character before output */
  ------------------
  |  Branch (2017:7): [True: 1.17k, False: 44.9k]
  ------------------
 2018|  1.17k|			*need_separator = 0;
 2019|       |
 2020|  46.1k|		nfound_match = 0;
 2021|  46.1k|		(*name_count)++;
 2022|  46.1k|		eoffset = ms->eoffset;
 2023|  46.1k|		rv = match(ms, ml.magic, ml.magic_rxcomp, ml.nmagic, b,
 2024|  46.1k|		    offset + o, mode, text, flip, indir_count, name_count,
 2025|  46.1k|		    printed_something, need_separator, firstline, returnval,
 2026|  46.1k|		    &nfound_match);
 2027|  46.1k|		ms->ms_value.q = nfound_match;
 2028|  46.1k|		(*name_count)--;
 2029|  46.1k|		*found_match |= nfound_match;
 2030|       |
 2031|  46.1k|		restore_cont(ms, &c);
 2032|       |
 2033|  46.1k|		if (rv != 1)
  ------------------
  |  Branch (2033:7): [True: 11.0k, False: 35.0k]
  ------------------
 2034|  11.0k|		    *need_separator = oneed_separator;
 2035|  46.1k|		ms->offset = offset;
 2036|  46.1k|		ms->eoffset = eoffset;
 2037|  46.1k|		return rv ? rv : *found_match;
  ------------------
  |  Branch (2037:10): [True: 35.5k, False: 10.5k]
  ------------------
 2038|       |
 2039|  46.1k|	case FILE_NAME:
  ------------------
  |  |  290|  46.1k|#define				FILE_NAME		45
  ------------------
  |  Branch (2039:2): [True: 46.1k, False: 141M]
  ------------------
 2040|  46.1k|		if (ms->flags & MAGIC_NODESC)
  ------------------
  |  |   52|  46.1k|#define MAGIC_NODESC		(MAGIC_EXTENSION|MAGIC_MIME|MAGIC_APPLE)
  |  |  ------------------
  |  |  |  |   46|  46.1k|#define	MAGIC_EXTENSION		0x1000000 /* Return a /-separated list of
  |  |  ------------------
  |  |               #define MAGIC_NODESC		(MAGIC_EXTENSION|MAGIC_MIME|MAGIC_APPLE)
  |  |  ------------------
  |  |  |  |   44|  46.1k|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|  46.1k|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  |  |  ------------------
  |  |  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|  46.1k|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define MAGIC_NODESC		(MAGIC_EXTENSION|MAGIC_MIME|MAGIC_APPLE)
  |  |  ------------------
  |  |  |  |   45|  46.1k|#define	MAGIC_APPLE		0x0000800 /* Return the Apple creator/type */
  |  |  ------------------
  ------------------
  |  Branch (2040:7): [True: 0, False: 46.1k]
  ------------------
 2041|      0|			return 1;
 2042|  46.1k|		if (file_printf(ms, "%s", m->desc) == -1)
  ------------------
  |  Branch (2042:7): [True: 0, False: 46.1k]
  ------------------
 2043|      0|			return -1;
 2044|  46.1k|		return 1;
 2045|   514k|	case FILE_DER:
  ------------------
  |  |  293|   514k|#define				FILE_DER		48
  ------------------
  |  Branch (2045:2): [True: 514k, False: 140M]
  ------------------
 2046|   522k|	case FILE_DEFAULT:	/* nothing to check */
  ------------------
  |  |  248|   522k|#define				FILE_DEFAULT		3
  ------------------
  |  Branch (2046:2): [True: 8.32k, False: 141M]
  ------------------
 2047|   523k|	case FILE_CLEAR:
  ------------------
  |  |  292|   523k|#define				FILE_CLEAR		47
  ------------------
  |  Branch (2047:2): [True: 1.44k, False: 141M]
  ------------------
 2048|  3.07M|	default:
  ------------------
  |  Branch (2048:2): [True: 2.55M, False: 138M]
  ------------------
 2049|  3.07M|		break;
 2050|   141M|	}
 2051|   126M|	if (!mconvert(ms, m, flip))
  ------------------
  |  Branch (2051:6): [True: 78, False: 126M]
  ------------------
 2052|     78|		return 0;
 2053|   126M|	return 1;
 2054|   126M|}
softmagic.c:mcopy:
 1378|   142M|{
 1379|   142M|	size_t size = sizeof(*p);
 1380|       |	/*
 1381|       |	 * Note: FILE_SEARCH and FILE_REGEX do not actually copy
 1382|       |	 * anything, but setup pointers into the source
 1383|       |	 */
 1384|   142M|	if (indir == 0) {
  ------------------
  |  Branch (1384:6): [True: 141M, False: 963k]
  ------------------
 1385|   141M|		switch (type) {
 1386|   514k|		case FILE_DER:
  ------------------
  |  |  293|   514k|#define				FILE_DER		48
  ------------------
  |  Branch (1386:3): [True: 514k, False: 140M]
  ------------------
 1387|  1.64M|		case FILE_SEARCH:
  ------------------
  |  |  265|  1.64M|#define				FILE_SEARCH		20
  ------------------
  |  Branch (1387:3): [True: 1.13M, False: 140M]
  ------------------
 1388|  1.64M|			if (offset > nbytes)
  ------------------
  |  Branch (1388:8): [True: 62.1k, False: 1.58M]
  ------------------
 1389|  62.1k|				offset = CAST(uint32_t, nbytes);
  ------------------
  |  |  452|  62.1k|#define CAST(T, b)	((T)(b))
  ------------------
 1390|  1.64M|			ms->search.s = RCAST(const char *, s) + offset;
  ------------------
  |  |  453|  1.64M|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 1391|  1.64M|			ms->search.s_len = nbytes - offset;
 1392|  1.64M|			ms->search.offset = offset;
 1393|  1.64M|			return 0;
 1394|       |
 1395|   324k|		case FILE_REGEX: {
  ------------------
  |  |  262|   324k|#define				FILE_REGEX		17
  ------------------
  |  Branch (1395:3): [True: 324k, False: 140M]
  ------------------
 1396|   324k|			const char *b;
 1397|   324k|			const char *c;
 1398|   324k|			const char *last;	/* end of search region */
 1399|   324k|			const char *buf;	/* start of search region */
 1400|   324k|			const char *end;
 1401|   324k|			size_t lines, linecnt, bytecnt;
 1402|       |
 1403|   324k|			if (s == NULL || nbytes < offset) {
  ------------------
  |  Branch (1403:8): [True: 0, False: 324k]
  |  Branch (1403:21): [True: 710, False: 324k]
  ------------------
 1404|    710|				ms->search.s_len = 0;
 1405|    710|				ms->search.s = NULL;
 1406|    710|				return 0;
 1407|    710|			}
 1408|       |
 1409|   324k|			if (m->str_flags & REGEX_LINE_COUNT) {
  ------------------
  |  |  382|   324k|#define str_flags _u._s._flags
  ------------------
              			if (m->str_flags & REGEX_LINE_COUNT) {
  ------------------
  |  |  409|   324k|#define REGEX_LINE_COUNT			BIT(11)
  |  |  ------------------
  |  |  |  |  395|   324k|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (1409:8): [True: 58.8k, False: 265k]
  ------------------
 1410|  58.8k|				linecnt = m->str_range;
  ------------------
  |  |  381|  58.8k|#define str_range _u._s._count
  ------------------
 1411|  58.8k|				bytecnt = linecnt * 80;
 1412|   265k|			} else {
 1413|   265k|				linecnt = 0;
 1414|   265k|				bytecnt = m->str_range;
  ------------------
  |  |  381|   265k|#define str_range _u._s._count
  ------------------
 1415|   265k|			}
 1416|       |
 1417|   324k|			if (bytecnt == 0 || bytecnt > nbytes - offset)
  ------------------
  |  Branch (1417:8): [True: 240k, False: 83.5k]
  |  Branch (1417:24): [True: 69.8k, False: 13.7k]
  ------------------
 1418|   310k|				bytecnt = nbytes - offset;
 1419|   324k|			if (bytecnt > ms->regex_max)
  ------------------
  |  Branch (1419:8): [True: 65.2k, False: 259k]
  ------------------
 1420|  65.2k|				bytecnt = ms->regex_max;
 1421|       |
 1422|   324k|			buf = RCAST(const char *, s) + offset;
  ------------------
  |  |  453|   324k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 1423|   324k|			end = last = RCAST(const char *, s) + bytecnt + offset;
  ------------------
  |  |  453|   324k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 1424|       |			/* mget() guarantees buf <= last */
 1425|   503k|			for (lines = linecnt, b = buf; lines && b < end &&
  ------------------
  |  Branch (1425:35): [True: 236k, False: 267k]
  |  Branch (1425:44): [True: 233k, False: 2.72k]
  ------------------
 1426|   233k|			     ((b = CAST(const char *,
  ------------------
  |  |  452|   233k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (1426:10): [True: 109k, False: 124k]
  ------------------
 1427|   233k|				 memchr(c = b, '\n', CAST(size_t, (end - b)))))
 1428|   124k|			     || (b = CAST(const char *,
  ------------------
  |  |  452|   124k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (1428:12): [True: 69.7k, False: 54.3k]
  ------------------
 1429|   124k|				 memchr(c, '\r', CAST(size_t, (end - c))))));
 1430|   324k|			     lines--, b++) {
 1431|   179k|				if (b < end - 1 && b[0] == '\r' && b[1] == '\n')
  ------------------
  |  Branch (1431:9): [True: 177k, False: 1.98k]
  |  Branch (1431:24): [True: 69.1k, False: 107k]
  |  Branch (1431:40): [True: 0, False: 69.1k]
  ------------------
 1432|      0|					b++;
 1433|   179k|				if (b < end - 1 && b[0] == '\n')
  ------------------
  |  Branch (1433:9): [True: 177k, False: 1.98k]
  |  Branch (1433:24): [True: 107k, False: 69.1k]
  ------------------
 1434|   107k|					b++;
 1435|   179k|				last = b;
 1436|   179k|			}
 1437|   324k|			if (lines)
  ------------------
  |  Branch (1437:8): [True: 57.0k, False: 267k]
  ------------------
 1438|  57.0k|				last = end;
 1439|       |
 1440|   324k|			ms->search.s = buf;
 1441|   324k|			ms->search.s_len = last - buf;
 1442|   324k|			ms->search.offset = offset;
 1443|   324k|			ms->search.rm_len = 0;
 1444|   324k|			return 0;
 1445|   324k|		}
 1446|     85|		case FILE_BESTRING16:
  ------------------
  |  |  263|     85|#define				FILE_BESTRING16		18
  ------------------
  |  Branch (1446:3): [True: 85, False: 141M]
  ------------------
 1447|  82.6k|		case FILE_LESTRING16: {
  ------------------
  |  |  264|  82.6k|#define				FILE_LESTRING16		19
  ------------------
  |  Branch (1447:3): [True: 82.5k, False: 141M]
  ------------------
 1448|  82.6k|			const unsigned char *src = s + offset;
 1449|  82.6k|			const unsigned char *esrc = s + nbytes;
 1450|  82.6k|			char *dst = p->s;
 1451|  82.6k|			char *edst = &p->s[sizeof(p->s) - 1];
 1452|       |
 1453|  82.6k|			if (type == FILE_BESTRING16)
  ------------------
  |  |  263|  82.6k|#define				FILE_BESTRING16		18
  ------------------
  |  Branch (1453:8): [True: 85, False: 82.5k]
  ------------------
 1454|     85|				src++;
 1455|       |
 1456|       |			/* check that offset is within range */
 1457|  82.6k|			if (offset >= nbytes)
  ------------------
  |  Branch (1457:8): [True: 965, False: 81.6k]
  ------------------
 1458|    965|				break;
 1459|  5.86M|			for (/*EMPTY*/; src < esrc; src += 2, dst++) {
  ------------------
  |  Branch (1459:20): [True: 5.82M, False: 43.4k]
  ------------------
 1460|  5.82M|				if (dst < edst)
  ------------------
  |  Branch (1460:9): [True: 5.78M, False: 38.2k]
  ------------------
 1461|  5.78M|					*dst = *src;
 1462|  38.2k|				else
 1463|  38.2k|					break;
 1464|  5.78M|				if (*dst == '\0') {
  ------------------
  |  Branch (1464:9): [True: 2.51M, False: 3.26M]
  ------------------
 1465|  2.51M|					if (type == FILE_BESTRING16 ?
  ------------------
  |  |  263|  2.51M|#define				FILE_BESTRING16		18
  ------------------
  |  Branch (1465:10): [True: 2.95k, False: 2.51M]
  |  Branch (1465:10): [True: 416k, False: 2.10M]
  ------------------
 1466|  2.95k|					    *(src - 1) != '\0' :
 1467|  2.51M|					    ((src + 1 < esrc) &&
  ------------------
  |  Branch (1467:11): [True: 2.51M, False: 4.14k]
  ------------------
 1468|  2.51M|					    *(src + 1) != '\0'))
  ------------------
  |  Branch (1468:10): [True: 416k, False: 2.09M]
  ------------------
 1469|   416k|						*dst = ' ';
 1470|  2.51M|				}
 1471|  5.78M|			}
 1472|  81.6k|			*edst = '\0';
 1473|  81.6k|			*dst = '\0';
 1474|  81.6k|			return 0;
 1475|  82.6k|		}
 1476|  91.6M|		case FILE_STRING:	/* XXX - these two should not need */
  ------------------
  |  |  250|  91.6M|#define				FILE_STRING		5
  ------------------
  |  Branch (1476:3): [True: 91.6M, False: 49.6M]
  ------------------
 1477|  91.6M|		case FILE_PSTRING:	/* to copy anything, but do anyway. */
  ------------------
  |  |  258|  91.6M|#define				FILE_PSTRING		13
  ------------------
  |  Branch (1477:3): [True: 44.0k, False: 141M]
  ------------------
 1478|  91.6M|			if (m->str_range != 0 && m->str_range < sizeof(*p))
  ------------------
  |  |  381|  91.6M|#define str_range _u._s._count
  ------------------
              			if (m->str_range != 0 && m->str_range < sizeof(*p))
  ------------------
  |  |  381|  81.0k|#define str_range _u._s._count
  ------------------
  |  Branch (1478:8): [True: 81.0k, False: 91.5M]
  |  Branch (1478:29): [True: 81.0k, False: 0]
  ------------------
 1479|  81.0k|				size = m->str_range;
  ------------------
  |  |  381|  81.0k|#define str_range _u._s._count
  ------------------
 1480|  91.6M|			break;
 1481|  47.5M|		default:
  ------------------
  |  Branch (1481:3): [True: 47.5M, False: 93.7M]
  ------------------
 1482|  47.5M|			break;
 1483|   141M|		}
 1484|   141M|	}
 1485|       |
 1486|   140M|	if (type == FILE_OFFSET) {
  ------------------
  |  |  297|   140M|#define				FILE_OFFSET		52
  ------------------
  |  Branch (1486:6): [True: 4.27k, False: 140M]
  ------------------
 1487|  4.27k|		(void)memset(p, '\0', sizeof(*p));
 1488|  4.27k|		p->q = offset;
 1489|  4.27k|		return 0;
 1490|  4.27k|	}
 1491|       |
 1492|   140M|	if (offset >= nbytes) {
  ------------------
  |  Branch (1492:6): [True: 6.79M, False: 133M]
  ------------------
 1493|  6.79M|		(void)memset(p, '\0', sizeof(*p));
 1494|  6.79M|		return 0;
 1495|  6.79M|	}
 1496|   133M|	if (nbytes - offset < size)
  ------------------
  |  Branch (1496:6): [True: 65.6M, False: 67.6M]
  ------------------
 1497|  65.6M|		nbytes = nbytes - offset;
 1498|  67.6M|	else
 1499|  67.6M|		nbytes = size;
 1500|       |
 1501|   133M|	(void)memcpy(p, s + offset, nbytes);
 1502|       |
 1503|       |	/*
 1504|       |	 * the usefulness of padding with zeroes eludes me, it
 1505|       |	 * might even cause problems
 1506|       |	 */
 1507|   133M|	if (nbytes < sizeof(*p))
  ------------------
  |  Branch (1507:6): [True: 65.7M, False: 67.5M]
  ------------------
 1508|  65.7M|		(void)memset(RCAST(char *, RCAST(void *, p)) + nbytes, '\0',
  ------------------
  |  |  453|  65.7M|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 1509|  65.7M|		    sizeof(*p) - nbytes);
 1510|   133M|	return 0;
 1511|   140M|}
softmagic.c:offset_oob:
  114|   138M| {
  115|   138M|	if (o < 0)
  ------------------
  |  Branch (115:6): [True: 0, False: 138M]
  ------------------
  116|      0|		return 1;
  117|   138M|        if ((uintmax_t)o > n)
  ------------------
  |  Branch (117:13): [True: 6.23M, False: 132M]
  ------------------
  118|  6.23M|		return 1;
  119|   132M|        return i > n - (uintmax_t)o;
  120|   138M|}
softmagic.c:cvt_flip:
 1026|   127M|{
 1027|   127M|	if (flip == 0)
  ------------------
  |  Branch (1027:6): [True: 127M, False: 28.6k]
  ------------------
 1028|   127M|		return type;
 1029|  28.6k|	switch (type) {
 1030|     25|	case FILE_BESHORT:
  ------------------
  |  |  252|     25|#define				FILE_BESHORT		7
  ------------------
  |  Branch (1030:2): [True: 25, False: 28.6k]
  ------------------
 1031|     25|		return FILE_LESHORT;
  ------------------
  |  |  255|     25|#define				FILE_LESHORT		10
  ------------------
 1032|  7.20k|	case FILE_BELONG:
  ------------------
  |  |  253|  7.20k|#define				FILE_BELONG		8
  ------------------
  |  Branch (1032:2): [True: 7.20k, False: 21.4k]
  ------------------
 1033|  7.20k|		return FILE_LELONG;
  ------------------
  |  |  256|  7.20k|#define				FILE_LELONG		11
  ------------------
 1034|    118|	case FILE_BEDATE:
  ------------------
  |  |  254|    118|#define				FILE_BEDATE		9
  ------------------
  |  Branch (1034:2): [True: 118, False: 28.5k]
  ------------------
 1035|    118|		return FILE_LEDATE;
  ------------------
  |  |  257|    118|#define				FILE_LEDATE		12
  ------------------
 1036|      0|	case FILE_BELDATE:
  ------------------
  |  |  260|      0|#define				FILE_BELDATE		15
  ------------------
  |  Branch (1036:2): [True: 0, False: 28.6k]
  ------------------
 1037|      0|		return FILE_LELDATE;
  ------------------
  |  |  261|      0|#define				FILE_LELDATE		16
  ------------------
 1038|      0|	case FILE_BEQUAD:
  ------------------
  |  |  271|      0|#define				FILE_BEQUAD		26
  ------------------
  |  Branch (1038:2): [True: 0, False: 28.6k]
  ------------------
 1039|      0|		return FILE_LEQUAD;
  ------------------
  |  |  270|      0|#define				FILE_LEQUAD		25
  ------------------
 1040|    698|	case FILE_BEQDATE:
  ------------------
  |  |  274|    698|#define				FILE_BEQDATE		29
  ------------------
  |  Branch (1040:2): [True: 698, False: 27.9k]
  ------------------
 1041|    698|		return FILE_LEQDATE;
  ------------------
  |  |  273|    698|#define				FILE_LEQDATE		28
  ------------------
 1042|      0|	case FILE_BEQLDATE:
  ------------------
  |  |  277|      0|#define				FILE_BEQLDATE		32
  ------------------
  |  Branch (1042:2): [True: 0, False: 28.6k]
  ------------------
 1043|      0|		return FILE_LEQLDATE;
  ------------------
  |  |  276|      0|#define				FILE_LEQLDATE		31
  ------------------
 1044|      0|	case FILE_BEQWDATE:
  ------------------
  |  |  289|      0|#define				FILE_BEQWDATE		44
  ------------------
  |  Branch (1044:2): [True: 0, False: 28.6k]
  ------------------
 1045|      0|		return FILE_LEQWDATE;
  ------------------
  |  |  288|      0|#define				FILE_LEQWDATE		43
  ------------------
 1046|  13.4k|	case FILE_LESHORT:
  ------------------
  |  |  255|  13.4k|#define				FILE_LESHORT		10
  ------------------
  |  Branch (1046:2): [True: 13.4k, False: 15.1k]
  ------------------
 1047|  13.4k|		return FILE_BESHORT;
  ------------------
  |  |  252|  13.4k|#define				FILE_BESHORT		7
  ------------------
 1048|  3.06k|	case FILE_LELONG:
  ------------------
  |  |  256|  3.06k|#define				FILE_LELONG		11
  ------------------
  |  Branch (1048:2): [True: 3.06k, False: 25.5k]
  ------------------
 1049|  3.06k|		return FILE_BELONG;
  ------------------
  |  |  253|  3.06k|#define				FILE_BELONG		8
  ------------------
 1050|     59|	case FILE_LEDATE:
  ------------------
  |  |  257|     59|#define				FILE_LEDATE		12
  ------------------
  |  Branch (1050:2): [True: 59, False: 28.5k]
  ------------------
 1051|     59|		return FILE_BEDATE;
  ------------------
  |  |  254|     59|#define				FILE_BEDATE		9
  ------------------
 1052|      0|	case FILE_LELDATE:
  ------------------
  |  |  261|      0|#define				FILE_LELDATE		16
  ------------------
  |  Branch (1052:2): [True: 0, False: 28.6k]
  ------------------
 1053|      0|		return FILE_BELDATE;
  ------------------
  |  |  260|      0|#define				FILE_BELDATE		15
  ------------------
 1054|    696|	case FILE_LEQUAD:
  ------------------
  |  |  270|    696|#define				FILE_LEQUAD		25
  ------------------
  |  Branch (1054:2): [True: 696, False: 27.9k]
  ------------------
 1055|    696|		return FILE_BEQUAD;
  ------------------
  |  |  271|    696|#define				FILE_BEQUAD		26
  ------------------
 1056|      0|	case FILE_LEQDATE:
  ------------------
  |  |  273|      0|#define				FILE_LEQDATE		28
  ------------------
  |  Branch (1056:2): [True: 0, False: 28.6k]
  ------------------
 1057|      0|		return FILE_BEQDATE;
  ------------------
  |  |  274|      0|#define				FILE_BEQDATE		29
  ------------------
 1058|    173|	case FILE_LEQLDATE:
  ------------------
  |  |  276|    173|#define				FILE_LEQLDATE		31
  ------------------
  |  Branch (1058:2): [True: 173, False: 28.4k]
  ------------------
 1059|    173|		return FILE_BEQLDATE;
  ------------------
  |  |  277|    173|#define				FILE_BEQLDATE		32
  ------------------
 1060|      0|	case FILE_LEQWDATE:
  ------------------
  |  |  288|      0|#define				FILE_LEQWDATE		43
  ------------------
  |  Branch (1060:2): [True: 0, False: 28.6k]
  ------------------
 1061|      0|		return FILE_BEQWDATE;
  ------------------
  |  |  289|      0|#define				FILE_BEQWDATE		44
  ------------------
 1062|      0|	case FILE_BEFLOAT:
  ------------------
  |  |  279|      0|#define				FILE_BEFLOAT		34
  ------------------
  |  Branch (1062:2): [True: 0, False: 28.6k]
  ------------------
 1063|      0|		return FILE_LEFLOAT;
  ------------------
  |  |  280|      0|#define				FILE_LEFLOAT		35
  ------------------
 1064|      0|	case FILE_LEFLOAT:
  ------------------
  |  |  280|      0|#define				FILE_LEFLOAT		35
  ------------------
  |  Branch (1064:2): [True: 0, False: 28.6k]
  ------------------
 1065|      0|		return FILE_BEFLOAT;
  ------------------
  |  |  279|      0|#define				FILE_BEFLOAT		34
  ------------------
 1066|      0|	case FILE_BEDOUBLE:
  ------------------
  |  |  282|      0|#define				FILE_BEDOUBLE		37
  ------------------
  |  Branch (1066:2): [True: 0, False: 28.6k]
  ------------------
 1067|      0|		return FILE_LEDOUBLE;
  ------------------
  |  |  283|      0|#define				FILE_LEDOUBLE		38
  ------------------
 1068|      0|	case FILE_LEDOUBLE:
  ------------------
  |  |  283|      0|#define				FILE_LEDOUBLE		38
  ------------------
  |  Branch (1068:2): [True: 0, False: 28.6k]
  ------------------
 1069|      0|		return FILE_BEDOUBLE;
  ------------------
  |  |  282|      0|#define				FILE_BEDOUBLE		37
  ------------------
 1070|      0|	case FILE_BEMSDOSDATE:
  ------------------
  |  |  302|      0|#define				FILE_BEMSDOSDATE	57
  ------------------
  |  Branch (1070:2): [True: 0, False: 28.6k]
  ------------------
 1071|      0|		return FILE_LEMSDOSDATE;
  ------------------
  |  |  301|      0|#define				FILE_LEMSDOSDATE	56
  ------------------
 1072|      0|	case FILE_LEMSDOSDATE:
  ------------------
  |  |  301|      0|#define				FILE_LEMSDOSDATE	56
  ------------------
  |  Branch (1072:2): [True: 0, False: 28.6k]
  ------------------
 1073|      0|		return FILE_BEMSDOSDATE;
  ------------------
  |  |  302|      0|#define				FILE_BEMSDOSDATE	57
  ------------------
 1074|      0|	case FILE_BEMSDOSTIME:
  ------------------
  |  |  305|      0|#define				FILE_BEMSDOSTIME	60
  ------------------
  |  Branch (1074:2): [True: 0, False: 28.6k]
  ------------------
 1075|      0|		return FILE_LEMSDOSTIME;
  ------------------
  |  |  304|      0|#define				FILE_LEMSDOSTIME	59
  ------------------
 1076|      0|	case FILE_LEMSDOSTIME:
  ------------------
  |  |  304|      0|#define				FILE_LEMSDOSTIME	59
  ------------------
  |  Branch (1076:2): [True: 0, False: 28.6k]
  ------------------
 1077|      0|		return FILE_BEMSDOSTIME;
  ------------------
  |  |  305|      0|#define				FILE_BEMSDOSTIME	60
  ------------------
 1078|  3.11k|	default:
  ------------------
  |  Branch (1078:2): [True: 3.11k, False: 25.5k]
  ------------------
 1079|  3.11k|		return type;
 1080|  28.6k|	}
 1081|  28.6k|}
softmagic.c:do_ops:
 1516|   669k|{
 1517|   669k|	intmax_t offset;
 1518|       |	// On purpose not INTMAX_MAX
 1519|   669k|	if (lhs >= UINT_MAX || lhs <= INT_MIN ||
  ------------------
  |  Branch (1519:6): [True: 12.4k, False: 657k]
  |  Branch (1519:25): [True: 557, False: 656k]
  ------------------
 1520|   656k|	    off >= UINT_MAX || off <= INT_MIN) {
  ------------------
  |  Branch (1520:6): [True: 74, False: 656k]
  |  Branch (1520:25): [True: 0, False: 656k]
  ------------------
 1521|  13.0k|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  13.0k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1521:7): [True: 0, False: 13.0k]
  ------------------
 1522|      0|			fprintf(stderr, "lhs/off overflow %jd %jd\n", lhs, off);
 1523|  13.0k|		return 1;
 1524|  13.0k|	}
 1525|       |	   
 1526|   656k|	if (off) {
  ------------------
  |  Branch (1526:6): [True: 56.8k, False: 599k]
  ------------------
 1527|  56.8k|		switch (m->in_op & FILE_OPS_MASK) {
  ------------------
  |  |  352|  56.8k|#define				FILE_OPS_MASK	0x07 /* mask for above ops */
  ------------------
  |  Branch (1527:11): [True: 56.8k, False: 0]
  ------------------
 1528|     70|		case FILE_OPAND:
  ------------------
  |  |  344|     70|#define				FILE_OPAND	0
  ------------------
  |  Branch (1528:3): [True: 70, False: 56.7k]
  ------------------
 1529|     70|			offset = lhs & off;
 1530|     70|			break;
 1531|      0|		case FILE_OPOR:
  ------------------
  |  |  345|      0|#define				FILE_OPOR	1
  ------------------
  |  Branch (1531:3): [True: 0, False: 56.8k]
  ------------------
 1532|      0|			offset = lhs | off;
 1533|      0|			break;
 1534|      0|		case FILE_OPXOR:
  ------------------
  |  |  346|      0|#define				FILE_OPXOR	2
  ------------------
  |  Branch (1534:3): [True: 0, False: 56.8k]
  ------------------
 1535|      0|			offset = lhs ^ off;
 1536|      0|			break;
 1537|  50.3k|		case FILE_OPADD:
  ------------------
  |  |  347|  50.3k|#define				FILE_OPADD	3
  ------------------
  |  Branch (1537:3): [True: 50.3k, False: 6.53k]
  ------------------
 1538|  50.3k|			offset = lhs + off;
 1539|  50.3k|			break;
 1540|    904|		case FILE_OPMINUS:
  ------------------
  |  |  348|    904|#define				FILE_OPMINUS	4
  ------------------
  |  Branch (1540:3): [True: 904, False: 55.9k]
  ------------------
 1541|    904|			offset = lhs - off;
 1542|    904|			break;
 1543|  5.51k|		case FILE_OPMULTIPLY:
  ------------------
  |  |  349|  5.51k|#define				FILE_OPMULTIPLY	5
  ------------------
  |  Branch (1543:3): [True: 5.51k, False: 51.3k]
  ------------------
 1544|  5.51k|			offset = lhs * off;
 1545|  5.51k|			break;
 1546|     43|		case FILE_OPDIVIDE:
  ------------------
  |  |  350|     43|#define				FILE_OPDIVIDE	6
  ------------------
  |  Branch (1546:3): [True: 43, False: 56.8k]
  ------------------
 1547|     43|			offset = lhs / off;
 1548|     43|			break;
 1549|      0|		case FILE_OPMODULO:
  ------------------
  |  |  351|      0|#define				FILE_OPMODULO	7
  ------------------
  |  Branch (1549:3): [True: 0, False: 56.8k]
  ------------------
 1550|      0|			offset = lhs % off;
 1551|      0|			break;
 1552|  56.8k|		}
 1553|  56.8k|	} else
 1554|   599k|		offset = lhs;
 1555|   656k|	if (m->in_op & FILE_OPINVERSE)
  ------------------
  |  |  356|   656k|#define				FILE_OPINVERSE	0x40
  ------------------
  |  Branch (1555:6): [True: 0, False: 656k]
  ------------------
 1556|      0|		offset = ~offset;
 1557|   656k|	if (offset >= UINT_MAX) {
  ------------------
  |  Branch (1557:6): [True: 427, False: 656k]
  ------------------
 1558|    427|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|    427|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1558:7): [True: 0, False: 427]
  ------------------
 1559|      0|			fprintf(stderr, "offset overflow %jd\n", offset);
 1560|    427|		return 1;
 1561|    427|	}
 1562|   656k|	*rv = CAST(uint32_t, offset);
  ------------------
  |  |  452|   656k|#define CAST(T, b)	((T)(b))
  ------------------
 1563|   656k|	return 0;
 1564|   656k|}
softmagic.c:cvt_id3:
 1014|    102|{
 1015|    102|	v = ((((v >>  0) & 0x7f) <<  0) |
 1016|    102|	     (((v >>  8) & 0x7f) <<  7) |
 1017|    102|	     (((v >> 16) & 0x7f) << 14) |
 1018|    102|	     (((v >> 24) & 0x7f) << 21));
 1019|    102|	if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|    102|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1019:6): [True: 0, False: 102]
  ------------------
 1020|      0|		fprintf(stderr, "id3 offs=%u\n", v);
 1021|    102|	return v;
 1022|    102|}
softmagic.c:file_fmtcheck:
  172|   110k|{
  173|   110k|	const char *ptr;
  174|       |
  175|   110k|	if (strchr(desc, '%') == NULL)
  ------------------
  |  Branch (175:6): [True: 59.5k, False: 50.5k]
  ------------------
  176|  59.5k|		return desc;
  177|       |
  178|  50.5k|	ptr = fmtcheck(desc, def);
  179|  50.5k|	if (ptr == def)
  ------------------
  |  Branch (179:6): [True: 0, False: 50.5k]
  ------------------
  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|  50.5k|	return ptr;
  184|   110k|}
softmagic.c:save_cont:
 1626|  46.1k|{
 1627|  46.1k|	size_t len;
 1628|  46.1k|	*c = ms->c;
 1629|  46.1k|	len = c->len * sizeof(*c->li);
 1630|  46.1k|	ms->c.li = CAST(struct level_info *, malloc(len));
  ------------------
  |  |  452|  46.1k|#define CAST(T, b)	((T)(b))
  ------------------
 1631|  46.1k|	if (ms->c.li == NULL) {
  ------------------
  |  Branch (1631:6): [True: 0, False: 46.1k]
  ------------------
 1632|      0|		ms->c = *c;
 1633|      0|		return -1;
 1634|      0|	}
 1635|  46.1k|	memcpy(ms->c.li, c->li, len);
 1636|  46.1k|	return 0;
 1637|  46.1k|}
softmagic.c:restore_cont:
 1641|  46.1k|{
 1642|  46.1k|	free(ms->c.li);
 1643|  46.1k|	ms->c = *c;
 1644|  46.1k|}
softmagic.c:mconvert:
 1203|   126M|{
 1204|   126M|	union VALUETYPE *p = &ms->ms_value;
 1205|       |
 1206|   126M|	switch (cvt_flip(m->type, flip)) {
 1207|  2.14M|	case FILE_BYTE:
  ------------------
  |  |  246|  2.14M|#define 			FILE_BYTE		1
  ------------------
  |  Branch (1207:2): [True: 2.14M, False: 124M]
  ------------------
 1208|  2.14M|		if (cvt_8(p, m) == -1)
  ------------------
  |  Branch (1208:7): [True: 0, False: 2.14M]
  ------------------
 1209|      0|			goto out;
 1210|  2.14M|		return 1;
 1211|  2.33M|	case FILE_SHORT:
  ------------------
  |  |  247|  2.33M|#define				FILE_SHORT		2
  ------------------
  |  Branch (1211:2): [True: 2.33M, False: 124M]
  ------------------
 1212|  2.33M|	case FILE_MSDOSDATE:
  ------------------
  |  |  300|  2.33M|#define				FILE_MSDOSDATE		55
  ------------------
  |  Branch (1212:2): [True: 0, False: 126M]
  ------------------
 1213|  2.33M|	case FILE_MSDOSTIME:
  ------------------
  |  |  303|  2.33M|#define				FILE_MSDOSTIME		58
  ------------------
  |  Branch (1213:2): [True: 0, False: 126M]
  ------------------
 1214|  2.33M|		if (cvt_16(p, m) == -1)
  ------------------
  |  Branch (1214:7): [True: 0, False: 2.33M]
  ------------------
 1215|      0|			goto out;
 1216|  2.33M|		return 1;
 1217|  1.94M|	case FILE_LONG:
  ------------------
  |  |  249|  1.94M|#define				FILE_LONG		4
  ------------------
  |  Branch (1217:2): [True: 1.94M, False: 124M]
  ------------------
 1218|  1.94M|	case FILE_DATE:
  ------------------
  |  |  251|  1.94M|#define				FILE_DATE		6
  ------------------
  |  Branch (1218:2): [True: 0, False: 126M]
  ------------------
 1219|  1.94M|	case FILE_LDATE:
  ------------------
  |  |  259|  1.94M|#define				FILE_LDATE		14
  ------------------
  |  Branch (1219:2): [True: 0, False: 126M]
  ------------------
 1220|  1.94M|		if (cvt_32(p, m) == -1)
  ------------------
  |  Branch (1220:7): [True: 0, False: 1.94M]
  ------------------
 1221|      0|			goto out;
 1222|  1.94M|		return 1;
 1223|  83.7k|	case FILE_QUAD:
  ------------------
  |  |  269|  83.7k|#define				FILE_QUAD		24
  ------------------
  |  Branch (1223:2): [True: 83.7k, False: 126M]
  ------------------
 1224|  83.7k|	case FILE_QDATE:
  ------------------
  |  |  272|  83.7k|#define				FILE_QDATE		27
  ------------------
  |  Branch (1224:2): [True: 0, False: 126M]
  ------------------
 1225|  83.7k|	case FILE_QLDATE:
  ------------------
  |  |  275|  83.7k|#define				FILE_QLDATE		30
  ------------------
  |  Branch (1225:2): [True: 0, False: 126M]
  ------------------
 1226|  83.8k|	case FILE_QWDATE:
  ------------------
  |  |  287|  83.8k|#define				FILE_QWDATE		42
  ------------------
  |  Branch (1226:2): [True: 115, False: 126M]
  ------------------
 1227|  88.1k|	case FILE_OFFSET:
  ------------------
  |  |  297|  88.1k|#define				FILE_OFFSET		52
  ------------------
  |  Branch (1227:2): [True: 4.27k, False: 126M]
  ------------------
 1228|  88.1k|		if (cvt_64(p, m) == -1)
  ------------------
  |  Branch (1228:7): [True: 0, False: 88.1k]
  ------------------
 1229|      0|			goto out;
 1230|  88.1k|		return 1;
 1231|  80.3M|	case FILE_STRING:
  ------------------
  |  |  250|  80.3M|#define				FILE_STRING		5
  ------------------
  |  Branch (1231:2): [True: 80.3M, False: 46.0M]
  ------------------
 1232|  80.3M|	case FILE_BESTRING16:
  ------------------
  |  |  263|  80.3M|#define				FILE_BESTRING16		18
  ------------------
  |  Branch (1232:2): [True: 85, False: 126M]
  ------------------
 1233|  80.4M|	case FILE_LESTRING16:
  ------------------
  |  |  264|  80.4M|#define				FILE_LESTRING16		19
  ------------------
  |  Branch (1233:2): [True: 82.5k, False: 126M]
  ------------------
 1234|  80.4M|	case FILE_OCTAL: {
  ------------------
  |  |  306|  80.4M|#define				FILE_OCTAL		61
  ------------------
  |  Branch (1234:2): [True: 0, False: 126M]
  ------------------
 1235|       |		/* Null terminate and eat *trailing* return */
 1236|  80.4M|		p->s[sizeof(p->s) - 1] = '\0';
 1237|  80.4M|		return 1;
 1238|  80.4M|	}
 1239|  36.0k|	case FILE_PSTRING: {
  ------------------
  |  |  258|  36.0k|#define				FILE_PSTRING		13
  ------------------
  |  Branch (1239:2): [True: 36.0k, False: 126M]
  ------------------
 1240|  36.0k|		char *ptr1, *ptr2;
 1241|  36.0k|		size_t len, sz = file_pstring_length_size(ms, m);
 1242|  36.0k|		if (sz == FILE_BADSIZE)
  ------------------
  |  |  175|  36.0k|#define FILE_BADSIZE CAST(size_t, ~0ul)
  |  |  ------------------
  |  |  |  |  452|  36.0k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (1242:7): [True: 0, False: 36.0k]
  ------------------
 1243|      0|			return 0;
 1244|  36.0k|		ptr1 = p->s;
 1245|  36.0k|		ptr2 = ptr1 + sz;
 1246|  36.0k|		len = file_pstring_get_length(ms, m, ptr1);
 1247|  36.0k|		if (len == FILE_BADSIZE)
  ------------------
  |  |  175|  36.0k|#define FILE_BADSIZE CAST(size_t, ~0ul)
  |  |  ------------------
  |  |  |  |  452|  36.0k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (1247:7): [True: 78, False: 35.9k]
  ------------------
 1248|     78|			return 0;
 1249|  35.9k|		sz = sizeof(p->s) - sz; /* maximum length of string */
 1250|  35.9k|		if (len >= sz) {
  ------------------
  |  Branch (1250:7): [True: 6.73k, False: 29.2k]
  ------------------
 1251|       |			/*
 1252|       |			 * The size of the pascal string length (sz)
 1253|       |			 * is 1, 2, or 4. We need at least 1 byte for NUL
 1254|       |			 * termination, but we've already truncated the
 1255|       |			 * string by p->s, so we need to deduct sz.
 1256|       |			 * Because we can use one of the bytes of the length
 1257|       |			 * after we shifted as NUL termination.
 1258|       |			 */
 1259|  6.73k|			len = sz;
 1260|  6.73k|		}
 1261|  2.85M|		while (len--)
  ------------------
  |  Branch (1261:10): [True: 2.81M, False: 35.9k]
  ------------------
 1262|  2.81M|			*ptr1++ = *ptr2++;
 1263|  35.9k|		*ptr1 = '\0';
 1264|  35.9k|		return 1;
 1265|  36.0k|	}
 1266|  5.42M|	case FILE_BESHORT:
  ------------------
  |  |  252|  5.42M|#define				FILE_BESHORT		7
  ------------------
  |  Branch (1266:2): [True: 5.42M, False: 120M]
  ------------------
 1267|  5.42M|	case FILE_BEMSDOSDATE:
  ------------------
  |  |  302|  5.42M|#define				FILE_BEMSDOSDATE	57
  ------------------
  |  Branch (1267:2): [True: 0, False: 126M]
  ------------------
 1268|  5.42M|	case FILE_BEMSDOSTIME:
  ------------------
  |  |  305|  5.42M|#define				FILE_BEMSDOSTIME	60
  ------------------
  |  Branch (1268:2): [True: 0, False: 126M]
  ------------------
 1269|  5.42M|		p->h = CAST(short, BE16(p->hs));
  ------------------
  |  |  452|  5.42M|#define CAST(T, b)	((T)(b))
  ------------------
 1270|  5.42M|		if (cvt_16(p, m) == -1)
  ------------------
  |  Branch (1270:7): [True: 0, False: 5.42M]
  ------------------
 1271|      0|			goto out;
 1272|  5.42M|		return 1;
 1273|  16.4M|	case FILE_BELONG:
  ------------------
  |  |  253|  16.4M|#define				FILE_BELONG		8
  ------------------
  |  Branch (1273:2): [True: 16.4M, False: 109M]
  ------------------
 1274|  16.4M|	case FILE_BEDATE:
  ------------------
  |  |  254|  16.4M|#define				FILE_BEDATE		9
  ------------------
  |  Branch (1274:2): [True: 449, False: 126M]
  ------------------
 1275|  16.4M|	case FILE_BELDATE:
  ------------------
  |  |  260|  16.4M|#define				FILE_BELDATE		15
  ------------------
  |  Branch (1275:2): [True: 308, False: 126M]
  ------------------
 1276|  16.4M|		p->l = CAST(int32_t, BE32(p->hl));
  ------------------
  |  |  452|  16.4M|#define CAST(T, b)	((T)(b))
  ------------------
 1277|  16.4M|		if (cvt_32(p, m) == -1)
  ------------------
  |  Branch (1277:7): [True: 0, False: 16.4M]
  ------------------
 1278|      0|			goto out;
 1279|  16.4M|		return 1;
 1280|  1.31M|	case FILE_BEQUAD:
  ------------------
  |  |  271|  1.31M|#define				FILE_BEQUAD		26
  ------------------
  |  Branch (1280:2): [True: 1.31M, False: 125M]
  ------------------
 1281|  1.31M|	case FILE_BEQDATE:
  ------------------
  |  |  274|  1.31M|#define				FILE_BEQDATE		29
  ------------------
  |  Branch (1281:2): [True: 592, False: 126M]
  ------------------
 1282|  1.31M|	case FILE_BEQLDATE:
  ------------------
  |  |  277|  1.31M|#define				FILE_BEQLDATE		32
  ------------------
  |  Branch (1282:2): [True: 374, False: 126M]
  ------------------
 1283|  1.31M|	case FILE_BEQWDATE:
  ------------------
  |  |  289|  1.31M|#define				FILE_BEQWDATE		44
  ------------------
  |  Branch (1283:2): [True: 0, False: 126M]
  ------------------
 1284|  1.31M|		p->q = CAST(uint64_t, BE64(p->hq));
  ------------------
  |  |  452|  1.31M|#define CAST(T, b)	((T)(b))
  ------------------
 1285|  1.31M|		if (cvt_64(p, m) == -1)
  ------------------
  |  Branch (1285:7): [True: 0, False: 1.31M]
  ------------------
 1286|      0|			goto out;
 1287|  1.31M|		return 1;
 1288|  4.99M|	case FILE_LESHORT:
  ------------------
  |  |  255|  4.99M|#define				FILE_LESHORT		10
  ------------------
  |  Branch (1288:2): [True: 4.99M, False: 121M]
  ------------------
 1289|  4.99M|	case FILE_LEMSDOSDATE:
  ------------------
  |  |  301|  4.99M|#define				FILE_LEMSDOSDATE	56
  ------------------
  |  Branch (1289:2): [True: 135, False: 126M]
  ------------------
 1290|  4.99M|	case FILE_LEMSDOSTIME:
  ------------------
  |  |  304|  4.99M|#define				FILE_LEMSDOSTIME	59
  ------------------
  |  Branch (1290:2): [True: 135, False: 126M]
  ------------------
 1291|  4.99M|		p->h = CAST(short, LE16(p->hs));
  ------------------
  |  |  452|  4.99M|#define CAST(T, b)	((T)(b))
  ------------------
 1292|  4.99M|		if (cvt_16(p, m) == -1)
  ------------------
  |  Branch (1292:7): [True: 0, False: 4.99M]
  ------------------
 1293|      0|			goto out;
 1294|  4.99M|		return 1;
 1295|  8.35M|	case FILE_LELONG:
  ------------------
  |  |  256|  8.35M|#define				FILE_LELONG		11
  ------------------
  |  Branch (1295:2): [True: 8.35M, False: 118M]
  ------------------
 1296|  8.35M|	case FILE_LEDATE:
  ------------------
  |  |  257|  8.35M|#define				FILE_LEDATE		12
  ------------------
  |  Branch (1296:2): [True: 254, False: 126M]
  ------------------
 1297|  8.35M|	case FILE_LELDATE:
  ------------------
  |  |  261|  8.35M|#define				FILE_LELDATE		16
  ------------------
  |  Branch (1297:2): [True: 87, False: 126M]
  ------------------
 1298|  8.35M|		p->l = CAST(int32_t, LE32(p->hl));
  ------------------
  |  |  452|  8.35M|#define CAST(T, b)	((T)(b))
  ------------------
 1299|  8.35M|		if (cvt_32(p, m) == -1)
  ------------------
  |  Branch (1299:7): [True: 0, False: 8.35M]
  ------------------
 1300|      0|			goto out;
 1301|  8.35M|		return 1;
 1302|  1.06M|	case FILE_LEQUAD:
  ------------------
  |  |  270|  1.06M|#define				FILE_LEQUAD		25
  ------------------
  |  Branch (1302:2): [True: 1.06M, False: 125M]
  ------------------
 1303|  1.06M|	case FILE_LEQDATE:
  ------------------
  |  |  273|  1.06M|#define				FILE_LEQDATE		28
  ------------------
  |  Branch (1303:2): [True: 735, False: 126M]
  ------------------
 1304|  1.06M|	case FILE_LEQLDATE:
  ------------------
  |  |  276|  1.06M|#define				FILE_LEQLDATE		31
  ------------------
  |  Branch (1304:2): [True: 273, False: 126M]
  ------------------
 1305|  1.06M|	case FILE_LEQWDATE:
  ------------------
  |  |  288|  1.06M|#define				FILE_LEQWDATE		43
  ------------------
  |  Branch (1305:2): [True: 1.87k, False: 126M]
  ------------------
 1306|  1.06M|		p->q = CAST(uint64_t, LE64(p->hq));
  ------------------
  |  |  452|  1.06M|#define CAST(T, b)	((T)(b))
  ------------------
 1307|  1.06M|		if (cvt_64(p, m) == -1)
  ------------------
  |  Branch (1307:7): [True: 0, False: 1.06M]
  ------------------
 1308|      0|			goto out;
 1309|  1.06M|		return 1;
 1310|     41|	case FILE_MELONG:
  ------------------
  |  |  268|     41|#define				FILE_MELONG		23
  ------------------
  |  Branch (1310:2): [True: 41, False: 126M]
  ------------------
 1311|    216|	case FILE_MEDATE:
  ------------------
  |  |  266|    216|#define				FILE_MEDATE		21
  ------------------
  |  Branch (1311:2): [True: 175, False: 126M]
  ------------------
 1312|    216|	case FILE_MELDATE:
  ------------------
  |  |  267|    216|#define				FILE_MELDATE		22
  ------------------
  |  Branch (1312:2): [True: 0, False: 126M]
  ------------------
 1313|    216|		p->l = CAST(int32_t, ME32(p->hl));
  ------------------
  |  |  452|    216|#define CAST(T, b)	((T)(b))
  ------------------
 1314|    216|		if (cvt_32(p, m) == -1)
  ------------------
  |  Branch (1314:7): [True: 0, False: 216]
  ------------------
 1315|      0|			goto out;
 1316|    216|		return 1;
 1317|      0|	case FILE_FLOAT:
  ------------------
  |  |  278|      0|#define				FILE_FLOAT		33
  ------------------
  |  Branch (1317:2): [True: 0, False: 126M]
  ------------------
 1318|      0|		if (cvt_float(p, m) == -1)
  ------------------
  |  Branch (1318:7): [True: 0, False: 0]
  ------------------
 1319|      0|			goto out;
 1320|      0|		return 1;
 1321|      0|	case FILE_BEFLOAT:
  ------------------
  |  |  279|      0|#define				FILE_BEFLOAT		34
  ------------------
  |  Branch (1321:2): [True: 0, False: 126M]
  ------------------
 1322|      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))
  |  |  ------------------
  ------------------
 1323|      0|		if (cvt_float(p, m) == -1)
  ------------------
  |  Branch (1323:7): [True: 0, False: 0]
  ------------------
 1324|      0|			goto out;
 1325|      0|		return 1;
 1326|  8.44k|	case FILE_LEFLOAT:
  ------------------
  |  |  280|  8.44k|#define				FILE_LEFLOAT		35
  ------------------
  |  Branch (1326:2): [True: 8.44k, False: 126M]
  ------------------
 1327|  8.44k|		p->l = LE32(p->hl);
  ------------------
  |  |   90|  8.44k|#define LE32(p) ( \
  |  |   91|  8.44k|    (CAST(uint32_t, (p)[3])<<24)| \
  |  |  ------------------
  |  |  |  |  452|  8.44k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   92|  8.44k|    (CAST(uint32_t, (p)[2])<<16)| \
  |  |  ------------------
  |  |  |  |  452|  8.44k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   93|  8.44k|    (CAST(uint32_t, (p)[1])<<8)| \
  |  |  ------------------
  |  |  |  |  452|  8.44k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   94|  8.44k|    (CAST(uint32_t, (p)[0])))
  |  |  ------------------
  |  |  |  |  452|  8.44k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1328|  8.44k|		if (cvt_float(p, m) == -1)
  ------------------
  |  Branch (1328:7): [True: 0, False: 8.44k]
  ------------------
 1329|      0|			goto out;
 1330|  8.44k|		return 1;
 1331|      0|	case FILE_DOUBLE:
  ------------------
  |  |  281|      0|#define				FILE_DOUBLE		36
  ------------------
  |  Branch (1331:2): [True: 0, False: 126M]
  ------------------
 1332|      0|		if (cvt_double(p, m) == -1)
  ------------------
  |  Branch (1332:7): [True: 0, False: 0]
  ------------------
 1333|      0|			goto out;
 1334|      0|		return 1;
 1335|    216|	case FILE_BEDOUBLE:
  ------------------
  |  |  282|    216|#define				FILE_BEDOUBLE		37
  ------------------
  |  Branch (1335:2): [True: 216, False: 126M]
  ------------------
 1336|    216|		p->q = BE64(p->hq);
  ------------------
  |  |   72|    216|#define BE64(p) ( \
  |  |   73|    216|    (CAST(uint64_t, (p)[0])<<56)| \
  |  |  ------------------
  |  |  |  |  452|    216|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   74|    216|    (CAST(uint64_t, (p)[1])<<48)| \
  |  |  ------------------
  |  |  |  |  452|    216|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   75|    216|    (CAST(uint64_t, (p)[2])<<40)| \
  |  |  ------------------
  |  |  |  |  452|    216|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   76|    216|    (CAST(uint64_t, (p)[3])<<32)| \
  |  |  ------------------
  |  |  |  |  452|    216|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   77|    216|    (CAST(uint64_t, (p)[4])<<24)| \
  |  |  ------------------
  |  |  |  |  452|    216|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   78|    216|    (CAST(uint64_t, (p)[5])<<16)| \
  |  |  ------------------
  |  |  |  |  452|    216|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   79|    216|    (CAST(uint64_t, (p)[6])<<8)| \
  |  |  ------------------
  |  |  |  |  452|    216|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   80|    216|    (CAST(uint64_t, (p)[7])))
  |  |  ------------------
  |  |  |  |  452|    216|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1337|    216|		if (cvt_double(p, m) == -1)
  ------------------
  |  Branch (1337:7): [True: 0, False: 216]
  ------------------
 1338|      0|			goto out;
 1339|    216|		return 1;
 1340|    692|	case FILE_LEDOUBLE:
  ------------------
  |  |  283|    692|#define				FILE_LEDOUBLE		38
  ------------------
  |  Branch (1340:2): [True: 692, False: 126M]
  ------------------
 1341|    692|		p->q = LE64(p->hq);
  ------------------
  |  |   81|    692|#define LE64(p) ( \
  |  |   82|    692|    (CAST(uint64_t, (p)[7])<<56)| \
  |  |  ------------------
  |  |  |  |  452|    692|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   83|    692|    (CAST(uint64_t, (p)[6])<<48)| \
  |  |  ------------------
  |  |  |  |  452|    692|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   84|    692|    (CAST(uint64_t, (p)[5])<<40)| \
  |  |  ------------------
  |  |  |  |  452|    692|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   85|    692|    (CAST(uint64_t, (p)[4])<<32)| \
  |  |  ------------------
  |  |  |  |  452|    692|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   86|    692|    (CAST(uint64_t, (p)[3])<<24)| \
  |  |  ------------------
  |  |  |  |  452|    692|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   87|    692|    (CAST(uint64_t, (p)[2])<<16)| \
  |  |  ------------------
  |  |  |  |  452|    692|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   88|    692|    (CAST(uint64_t, (p)[1])<<8)| \
  |  |  ------------------
  |  |  |  |  452|    692|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   89|    692|    (CAST(uint64_t, (p)[0])))
  |  |  ------------------
  |  |  |  |  452|    692|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1342|    692|		if (cvt_double(p, m) == -1)
  ------------------
  |  Branch (1342:7): [True: 0, False: 692]
  ------------------
 1343|      0|			goto out;
 1344|    692|		return 1;
 1345|   324k|	case FILE_REGEX:
  ------------------
  |  |  262|   324k|#define				FILE_REGEX		17
  ------------------
  |  Branch (1345:2): [True: 324k, False: 126M]
  ------------------
 1346|  1.04M|	case FILE_SEARCH:
  ------------------
  |  |  265|  1.04M|#define				FILE_SEARCH		20
  ------------------
  |  Branch (1346:2): [True: 722k, False: 125M]
  ------------------
 1347|  1.05M|	case FILE_DEFAULT:
  ------------------
  |  |  248|  1.05M|#define				FILE_DEFAULT		3
  ------------------
  |  Branch (1347:2): [True: 8.32k, False: 126M]
  ------------------
 1348|  1.05M|	case FILE_CLEAR:
  ------------------
  |  |  292|  1.05M|#define				FILE_CLEAR		47
  ------------------
  |  Branch (1348:2): [True: 1.44k, False: 126M]
  ------------------
 1349|  1.05M|	case FILE_NAME:
  ------------------
  |  |  290|  1.05M|#define				FILE_NAME		45
  ------------------
  |  Branch (1349:2): [True: 0, False: 126M]
  ------------------
 1350|  1.05M|	case FILE_USE:
  ------------------
  |  |  291|  1.05M|#define				FILE_USE		46
  ------------------
  |  Branch (1350:2): [True: 0, False: 126M]
  ------------------
 1351|  1.57M|	case FILE_DER:
  ------------------
  |  |  293|  1.57M|#define				FILE_DER		48
  ------------------
  |  Branch (1351:2): [True: 514k, False: 125M]
  ------------------
 1352|  1.85M|	case FILE_GUID:
  ------------------
  |  |  294|  1.85M|#define				FILE_GUID		49
  ------------------
  |  Branch (1352:2): [True: 284k, False: 126M]
  ------------------
 1353|  1.85M|	case FILE_LEGUID:
  ------------------
  |  |  295|  1.85M|#define				FILE_LEGUID		50
  ------------------
  |  Branch (1353:2): [True: 0, False: 126M]
  ------------------
 1354|  1.85M|	case FILE_BEGUID:
  ------------------
  |  |  296|  1.85M|#define				FILE_BEGUID		51
  ------------------
  |  Branch (1354:2): [True: 0, False: 126M]
  ------------------
 1355|  1.85M|		return 1;
 1356|      0|	default:
  ------------------
  |  Branch (1356:2): [True: 0, False: 126M]
  ------------------
 1357|      0|		file_magerror(ms, "invalid type %d in mconvert()", m->type);
 1358|      0|		return 0;
 1359|   126M|	}
 1360|      0|out:
 1361|      0|	file_magerror(ms, "zerodivide/overflow/underflow in mconvert()");
 1362|      0|	return 0;
 1363|   126M|}
softmagic.c:cvt_8:
 1137|  2.14M|{
 1138|  2.14M|	DO_CVT(m, b, 8);
  ------------------
  |  | 1129|  2.14M|	if ((m)->flag & UNSIGNED) { \
  |  |  ------------------
  |  |  |  |  229|  2.14M|#define UNSIGNED	0x08	/* comparison is unsigned */
  |  |  ------------------
  |  |  |  Branch (1129:6): [True: 941k, False: 1.19M]
  |  |  ------------------
  |  | 1130|   941k|		DO_CVT1(fld, uint##size##_t, size, 0); \
  |  |  ------------------
  |  |  |  | 1092|   941k|	if (m->num_mask) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|   941k|#define num_mask _u._mask
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1092:6): [True: 140k, False: 801k]
  |  |  |  |  ------------------
  |  |  |  | 1093|   941k|		switch (m->mask_op & FILE_OPS_MASK) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|   140k|#define				FILE_OPS_MASK	0x07 /* mask for above ops */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1093:11): [True: 140k, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1094|   123k|		case FILE_OPAND: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  344|   123k|#define				FILE_OPAND	0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1094:3): [True: 123k, False: 16.8k]
  |  |  |  |  ------------------
  |  |  |  | 1095|   123k|			p->fld &= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|   123k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1096|   123k|			break; \
  |  |  |  | 1097|      0|		case FILE_OPOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  345|      0|#define				FILE_OPOR	1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1097:3): [True: 0, False: 140k]
  |  |  |  |  ------------------
  |  |  |  | 1098|      0|			p->fld |= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1099|      0|			break; \
  |  |  |  | 1100|      0|		case FILE_OPXOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  346|      0|#define				FILE_OPXOR	2
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1100:3): [True: 0, False: 140k]
  |  |  |  |  ------------------
  |  |  |  | 1101|      0|			p->fld ^= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1102|      0|			break; \
  |  |  |  | 1103|      0|		case FILE_OPADD: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  347|      0|#define				FILE_OPADD	3
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1103:3): [True: 0, False: 140k]
  |  |  |  |  ------------------
  |  |  |  | 1104|      0|			p->fld += CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1105|      0|			break; \
  |  |  |  | 1106|  16.2k|		case FILE_OPMINUS: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  348|  16.2k|#define				FILE_OPMINUS	4
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1106:3): [True: 16.2k, False: 123k]
  |  |  |  |  ------------------
  |  |  |  | 1107|  16.2k|			p->fld -= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|  16.2k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1108|  16.2k|			break; \
  |  |  |  | 1109|      0|		case FILE_OPMULTIPLY: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  349|      0|#define				FILE_OPMULTIPLY	5
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1109:3): [True: 0, False: 140k]
  |  |  |  |  ------------------
  |  |  |  | 1110|      0|			p->fld *= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1111|      0|			break; \
  |  |  |  | 1112|    298|		case FILE_OPDIVIDE: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  350|    298|#define				FILE_OPDIVIDE	6
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1112:3): [True: 298, False: 139k]
  |  |  |  |  ------------------
  |  |  |  | 1113|    298|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1085|    298|	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|    298|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1085:6): [Folded, False: 298]
  |  |  |  |  |  |  |  Branch (1085:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1085:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1086|    298|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|    298|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1086:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|    298|		return -1; \
  |  |  |  |  |  | 1088|    298|	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|    298|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:6): [Folded, False: 298]
  |  |  |  |  |  |  |  Branch (1088:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1088:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|    298|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|    298|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1089:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1090|    298|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1114|    298|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|    298|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1114:8): [True: 0, False: 298]
  |  |  |  |  ------------------
  |  |  |  | 1115|    298|				return -1; \
  |  |  |  | 1116|    298|			p->fld /= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|    298|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1117|    298|			break; \
  |  |  |  | 1118|    298|		case FILE_OPMODULO: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  351|    297|#define				FILE_OPMODULO	7
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1118:3): [True: 297, False: 139k]
  |  |  |  |  ------------------
  |  |  |  | 1119|    297|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1085|    297|	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|    297|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1085:6): [Folded, False: 297]
  |  |  |  |  |  |  |  Branch (1085:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1085:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1086|    297|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|    297|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1086:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|    297|		return -1; \
  |  |  |  |  |  | 1088|    297|	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|    297|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:6): [Folded, False: 297]
  |  |  |  |  |  |  |  Branch (1088:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1088:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|    297|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|    297|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1089:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1090|    297|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1120|    297|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|    297|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:8): [True: 0, False: 297]
  |  |  |  |  ------------------
  |  |  |  | 1121|    297|				return -1; \
  |  |  |  | 1122|    297|			p->fld %= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|    297|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1123|    297|			break; \
  |  |  |  | 1124|   140k|		} \
  |  |  |  | 1125|   941k|	if (m->mask_op & FILE_OPINVERSE) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  356|   941k|#define				FILE_OPINVERSE	0x40
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1125:6): [True: 0, False: 941k]
  |  |  |  |  ------------------
  |  |  |  | 1126|   941k|		p->fld = ~p->fld \
  |  |  ------------------
  |  | 1131|  1.19M|	} else { \
  |  | 1132|  1.19M|		DO_CVT1(s##fld, int##size##_t, size, 1); \
  |  |  ------------------
  |  |  |  | 1092|  1.19M|	if (m->num_mask) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|  1.19M|#define num_mask _u._mask
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1092:6): [True: 58.8k, False: 1.14M]
  |  |  |  |  ------------------
  |  |  |  | 1093|  1.19M|		switch (m->mask_op & FILE_OPS_MASK) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|  58.8k|#define				FILE_OPS_MASK	0x07 /* mask for above ops */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1093:11): [True: 58.8k, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1094|  48.2k|		case FILE_OPAND: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  344|  48.2k|#define				FILE_OPAND	0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1094:3): [True: 48.2k, False: 10.5k]
  |  |  |  |  ------------------
  |  |  |  | 1095|  48.2k|			p->fld &= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|  48.2k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1096|  48.2k|			break; \
  |  |  |  | 1097|      0|		case FILE_OPOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  345|      0|#define				FILE_OPOR	1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1097:3): [True: 0, False: 58.8k]
  |  |  |  |  ------------------
  |  |  |  | 1098|      0|			p->fld |= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1099|      0|			break; \
  |  |  |  | 1100|      0|		case FILE_OPXOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  346|      0|#define				FILE_OPXOR	2
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1100:3): [True: 0, False: 58.8k]
  |  |  |  |  ------------------
  |  |  |  | 1101|      0|			p->fld ^= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1102|      0|			break; \
  |  |  |  | 1103|      0|		case FILE_OPADD: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  347|      0|#define				FILE_OPADD	3
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1103:3): [True: 0, False: 58.8k]
  |  |  |  |  ------------------
  |  |  |  | 1104|      0|			p->fld += CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1105|      0|			break; \
  |  |  |  | 1106|  10.5k|		case FILE_OPMINUS: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  348|  10.5k|#define				FILE_OPMINUS	4
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1106:3): [True: 10.5k, False: 48.3k]
  |  |  |  |  ------------------
  |  |  |  | 1107|  10.5k|			p->fld -= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|  10.5k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1108|  10.5k|			break; \
  |  |  |  | 1109|      0|		case FILE_OPMULTIPLY: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  349|      0|#define				FILE_OPMULTIPLY	5
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1109:3): [True: 0, False: 58.8k]
  |  |  |  |  ------------------
  |  |  |  | 1110|      0|			p->fld *= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1111|      0|			break; \
  |  |  |  | 1112|     79|		case FILE_OPDIVIDE: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  350|     79|#define				FILE_OPDIVIDE	6
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1112:3): [True: 79, False: 58.7k]
  |  |  |  |  ------------------
  |  |  |  | 1113|     79|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1085|     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 (1085:6): [Folded, False: 79]
  |  |  |  |  |  |  |  Branch (1085:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1085:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1086|     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 (1086:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|     79|		return -1; \
  |  |  |  |  |  | 1088|     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 (1088:6): [Folded, False: 79]
  |  |  |  |  |  |  |  Branch (1088:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1088:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|     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 (1089:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1090|     79|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1114|     79|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|     79|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1114:8): [True: 0, False: 79]
  |  |  |  |  ------------------
  |  |  |  | 1115|     79|				return -1; \
  |  |  |  | 1116|     79|			p->fld /= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|     79|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1117|     79|			break; \
  |  |  |  | 1118|     79|		case FILE_OPMODULO: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  351|      0|#define				FILE_OPMODULO	7
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1118:3): [True: 0, False: 58.8k]
  |  |  |  |  ------------------
  |  |  |  | 1119|      0|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1085|      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 (1085:6): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1085:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1085:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1086|      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 (1086:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|      0|		return -1; \
  |  |  |  |  |  | 1088|      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 (1088:6): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1088:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1088:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|      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 (1089:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1090|      0|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1120|      0|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:8): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1121|      0|				return -1; \
  |  |  |  | 1122|      0|			p->fld %= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1123|      0|			break; \
  |  |  |  | 1124|  58.8k|		} \
  |  |  |  | 1125|  1.19M|	if (m->mask_op & FILE_OPINVERSE) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  356|  1.19M|#define				FILE_OPINVERSE	0x40
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1125:6): [True: 0, False: 1.19M]
  |  |  |  |  ------------------
  |  |  |  | 1126|  1.19M|		p->fld = ~p->fld \
  |  |  ------------------
  |  | 1133|  1.19M|	}
  ------------------
 1139|  2.14M|	return 0;
 1140|  2.14M|}
softmagic.c:cvt_16:
 1144|  12.7M|{
 1145|  12.7M|	DO_CVT(m, h, 16);
  ------------------
  |  | 1129|  12.7M|	if ((m)->flag & UNSIGNED) { \
  |  |  ------------------
  |  |  |  |  229|  12.7M|#define UNSIGNED	0x08	/* comparison is unsigned */
  |  |  ------------------
  |  |  |  Branch (1129:6): [True: 1.62M, False: 11.1M]
  |  |  ------------------
  |  | 1130|  1.62M|		DO_CVT1(fld, uint##size##_t, size, 0); \
  |  |  ------------------
  |  |  |  | 1092|  1.62M|	if (m->num_mask) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|  1.62M|#define num_mask _u._mask
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1092:6): [True: 165k, False: 1.45M]
  |  |  |  |  ------------------
  |  |  |  | 1093|  1.62M|		switch (m->mask_op & FILE_OPS_MASK) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|   165k|#define				FILE_OPS_MASK	0x07 /* mask for above ops */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1093:11): [True: 165k, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1094|   164k|		case FILE_OPAND: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  344|   164k|#define				FILE_OPAND	0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1094:3): [True: 164k, False: 827]
  |  |  |  |  ------------------
  |  |  |  | 1095|   164k|			p->fld &= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|   164k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1096|   164k|			break; \
  |  |  |  | 1097|      0|		case FILE_OPOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  345|      0|#define				FILE_OPOR	1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1097:3): [True: 0, False: 165k]
  |  |  |  |  ------------------
  |  |  |  | 1098|      0|			p->fld |= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1099|      0|			break; \
  |  |  |  | 1100|      0|		case FILE_OPXOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  346|      0|#define				FILE_OPXOR	2
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1100:3): [True: 0, False: 165k]
  |  |  |  |  ------------------
  |  |  |  | 1101|      0|			p->fld ^= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1102|      0|			break; \
  |  |  |  | 1103|     67|		case FILE_OPADD: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  347|     67|#define				FILE_OPADD	3
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1103:3): [True: 67, False: 165k]
  |  |  |  |  ------------------
  |  |  |  | 1104|     67|			p->fld += CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|     67|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1105|     67|			break; \
  |  |  |  | 1106|     85|		case FILE_OPMINUS: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  348|     85|#define				FILE_OPMINUS	4
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1106:3): [True: 85, False: 165k]
  |  |  |  |  ------------------
  |  |  |  | 1107|     85|			p->fld -= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|     85|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1108|     85|			break; \
  |  |  |  | 1109|     84|		case FILE_OPMULTIPLY: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  349|     84|#define				FILE_OPMULTIPLY	5
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1109:3): [True: 84, False: 165k]
  |  |  |  |  ------------------
  |  |  |  | 1110|     84|			p->fld *= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|     84|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1111|     84|			break; \
  |  |  |  | 1112|    501|		case FILE_OPDIVIDE: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  350|    501|#define				FILE_OPDIVIDE	6
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1112:3): [True: 501, False: 164k]
  |  |  |  |  ------------------
  |  |  |  | 1113|    501|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1085|    501|	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|    501|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1085:6): [Folded, False: 501]
  |  |  |  |  |  |  |  Branch (1085:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1085:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1086|    501|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|    501|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1086:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|    501|		return -1; \
  |  |  |  |  |  | 1088|    501|	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|    501|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:6): [Folded, False: 501]
  |  |  |  |  |  |  |  Branch (1088:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1088:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|    501|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|    501|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1089:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1090|    501|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1114|    501|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|    501|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1114:8): [True: 0, False: 501]
  |  |  |  |  ------------------
  |  |  |  | 1115|    501|				return -1; \
  |  |  |  | 1116|    501|			p->fld /= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|    501|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1117|    501|			break; \
  |  |  |  | 1118|    501|		case FILE_OPMODULO: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  351|     90|#define				FILE_OPMODULO	7
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1118:3): [True: 90, False: 165k]
  |  |  |  |  ------------------
  |  |  |  | 1119|     90|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1085|     90|	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|     90|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1085:6): [Folded, False: 90]
  |  |  |  |  |  |  |  Branch (1085:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1085:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1086|     90|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|     90|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1086:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|     90|		return -1; \
  |  |  |  |  |  | 1088|     90|	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|     90|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:6): [Folded, False: 90]
  |  |  |  |  |  |  |  Branch (1088:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1088:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|     90|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|     90|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1089:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1090|     90|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1120|     90|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|     90|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:8): [True: 0, False: 90]
  |  |  |  |  ------------------
  |  |  |  | 1121|     90|				return -1; \
  |  |  |  | 1122|     90|			p->fld %= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|     90|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1123|     90|			break; \
  |  |  |  | 1124|   165k|		} \
  |  |  |  | 1125|  1.62M|	if (m->mask_op & FILE_OPINVERSE) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  356|  1.62M|#define				FILE_OPINVERSE	0x40
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1125:6): [True: 0, False: 1.62M]
  |  |  |  |  ------------------
  |  |  |  | 1126|  1.62M|		p->fld = ~p->fld \
  |  |  ------------------
  |  | 1131|  11.1M|	} else { \
  |  | 1132|  11.1M|		DO_CVT1(s##fld, int##size##_t, size, 1); \
  |  |  ------------------
  |  |  |  | 1092|  11.1M|	if (m->num_mask) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|  11.1M|#define num_mask _u._mask
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1092:6): [True: 584k, False: 10.5M]
  |  |  |  |  ------------------
  |  |  |  | 1093|  11.1M|		switch (m->mask_op & FILE_OPS_MASK) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|   584k|#define				FILE_OPS_MASK	0x07 /* mask for above ops */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1093:11): [True: 584k, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1094|   553k|		case FILE_OPAND: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  344|   553k|#define				FILE_OPAND	0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1094:3): [True: 553k, False: 31.2k]
  |  |  |  |  ------------------
  |  |  |  | 1095|   553k|			p->fld &= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|   553k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1096|   553k|			break; \
  |  |  |  | 1097|      0|		case FILE_OPOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  345|      0|#define				FILE_OPOR	1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1097:3): [True: 0, False: 584k]
  |  |  |  |  ------------------
  |  |  |  | 1098|      0|			p->fld |= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1099|      0|			break; \
  |  |  |  | 1100|      0|		case FILE_OPXOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  346|      0|#define				FILE_OPXOR	2
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1100:3): [True: 0, False: 584k]
  |  |  |  |  ------------------
  |  |  |  | 1101|      0|			p->fld ^= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1102|      0|			break; \
  |  |  |  | 1103|    144|		case FILE_OPADD: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  347|    144|#define				FILE_OPADD	3
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1103:3): [True: 144, False: 584k]
  |  |  |  |  ------------------
  |  |  |  | 1104|    144|			p->fld += CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|    144|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1105|    144|			break; \
  |  |  |  | 1106|      0|		case FILE_OPMINUS: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  348|      0|#define				FILE_OPMINUS	4
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1106:3): [True: 0, False: 584k]
  |  |  |  |  ------------------
  |  |  |  | 1107|      0|			p->fld -= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1108|      0|			break; \
  |  |  |  | 1109|      0|		case FILE_OPMULTIPLY: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  349|      0|#define				FILE_OPMULTIPLY	5
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1109:3): [True: 0, False: 584k]
  |  |  |  |  ------------------
  |  |  |  | 1110|      0|			p->fld *= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1111|      0|			break; \
  |  |  |  | 1112|     68|		case FILE_OPDIVIDE: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  350|     68|#define				FILE_OPDIVIDE	6
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1112:3): [True: 68, False: 584k]
  |  |  |  |  ------------------
  |  |  |  | 1113|     68|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1085|     68|	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|     68|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1085:6): [Folded, False: 68]
  |  |  |  |  |  |  |  Branch (1085:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1085:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1086|     68|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|     68|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1086:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|     68|		return -1; \
  |  |  |  |  |  | 1088|     68|	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|     68|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:6): [Folded, False: 68]
  |  |  |  |  |  |  |  Branch (1088:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1088:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|     68|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|     68|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1089:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1090|     68|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1114|     68|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|     68|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1114:8): [True: 0, False: 68]
  |  |  |  |  ------------------
  |  |  |  | 1115|     68|				return -1; \
  |  |  |  | 1116|     68|			p->fld /= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|     68|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1117|     68|			break; \
  |  |  |  | 1118|  31.0k|		case FILE_OPMODULO: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  351|  31.0k|#define				FILE_OPMODULO	7
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1118:3): [True: 31.0k, False: 553k]
  |  |  |  |  ------------------
  |  |  |  | 1119|  31.0k|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1085|  31.0k|	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.0k|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1085:6): [Folded, False: 31.0k]
  |  |  |  |  |  |  |  Branch (1085:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1085:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1086|  31.0k|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|  31.0k|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1086:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|  31.0k|		return -1; \
  |  |  |  |  |  | 1088|  31.0k|	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.0k|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:6): [Folded, False: 31.0k]
  |  |  |  |  |  |  |  Branch (1088:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1088:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|  31.0k|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|  31.0k|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1089:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1090|  31.0k|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1120|  31.0k|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|  31.0k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:8): [True: 0, False: 31.0k]
  |  |  |  |  ------------------
  |  |  |  | 1121|  31.0k|				return -1; \
  |  |  |  | 1122|  31.0k|			p->fld %= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|  31.0k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1123|  31.0k|			break; \
  |  |  |  | 1124|   584k|		} \
  |  |  |  | 1125|  11.1M|	if (m->mask_op & FILE_OPINVERSE) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  356|  11.1M|#define				FILE_OPINVERSE	0x40
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1125:6): [True: 0, False: 11.1M]
  |  |  |  |  ------------------
  |  |  |  | 1126|  11.1M|		p->fld = ~p->fld \
  |  |  ------------------
  |  | 1133|  11.1M|	}
  ------------------
 1146|  12.7M|	return 0;
 1147|  12.7M|}
softmagic.c:cvt_32:
 1151|  26.7M|{
 1152|  26.7M|	DO_CVT(m, l, 32);
  ------------------
  |  | 1129|  26.7M|	if ((m)->flag & UNSIGNED) { \
  |  |  ------------------
  |  |  |  |  229|  26.7M|#define UNSIGNED	0x08	/* comparison is unsigned */
  |  |  ------------------
  |  |  |  Branch (1129:6): [True: 3.94M, False: 22.7M]
  |  |  ------------------
  |  | 1130|  3.94M|		DO_CVT1(fld, uint##size##_t, size, 0); \
  |  |  ------------------
  |  |  |  | 1092|  3.94M|	if (m->num_mask) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|  3.94M|#define num_mask _u._mask
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1092:6): [True: 600k, False: 3.34M]
  |  |  |  |  ------------------
  |  |  |  | 1093|  3.94M|		switch (m->mask_op & FILE_OPS_MASK) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|   600k|#define				FILE_OPS_MASK	0x07 /* mask for above ops */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1093:11): [True: 600k, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1094|   599k|		case FILE_OPAND: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  344|   599k|#define				FILE_OPAND	0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1094:3): [True: 599k, False: 1.25k]
  |  |  |  |  ------------------
  |  |  |  | 1095|   599k|			p->fld &= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|   599k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1096|   599k|			break; \
  |  |  |  | 1097|      0|		case FILE_OPOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  345|      0|#define				FILE_OPOR	1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1097:3): [True: 0, False: 600k]
  |  |  |  |  ------------------
  |  |  |  | 1098|      0|			p->fld |= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1099|      0|			break; \
  |  |  |  | 1100|     66|		case FILE_OPXOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  346|     66|#define				FILE_OPXOR	2
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1100:3): [True: 66, False: 600k]
  |  |  |  |  ------------------
  |  |  |  | 1101|     66|			p->fld ^= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|     66|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1102|     66|			break; \
  |  |  |  | 1103|    181|		case FILE_OPADD: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  347|    181|#define				FILE_OPADD	3
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1103:3): [True: 181, False: 600k]
  |  |  |  |  ------------------
  |  |  |  | 1104|    181|			p->fld += CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|    181|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1105|    181|			break; \
  |  |  |  | 1106|      0|		case FILE_OPMINUS: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  348|      0|#define				FILE_OPMINUS	4
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1106:3): [True: 0, False: 600k]
  |  |  |  |  ------------------
  |  |  |  | 1107|      0|			p->fld -= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1108|      0|			break; \
  |  |  |  | 1109|      0|		case FILE_OPMULTIPLY: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  349|      0|#define				FILE_OPMULTIPLY	5
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1109:3): [True: 0, False: 600k]
  |  |  |  |  ------------------
  |  |  |  | 1110|      0|			p->fld *= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1111|      0|			break; \
  |  |  |  | 1112|    675|		case FILE_OPDIVIDE: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  350|    675|#define				FILE_OPDIVIDE	6
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1112:3): [True: 675, False: 599k]
  |  |  |  |  ------------------
  |  |  |  | 1113|    675|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1085|    675|	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|    675|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1085:6): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1085:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1085:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1086|    675|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|    675|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1086:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|    675|		return -1; \
  |  |  |  |  |  | 1088|    675|	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|    675|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:6): [Folded, False: 675]
  |  |  |  |  |  |  |  Branch (1088:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1088:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|    675|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|    675|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1089:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1090|    675|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1114|    675|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|    675|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1114:8): [True: 0, False: 675]
  |  |  |  |  ------------------
  |  |  |  | 1115|    675|				return -1; \
  |  |  |  | 1116|    675|			p->fld /= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|    675|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1117|    675|			break; \
  |  |  |  | 1118|    675|		case FILE_OPMODULO: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  351|    333|#define				FILE_OPMODULO	7
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1118:3): [True: 333, False: 599k]
  |  |  |  |  ------------------
  |  |  |  | 1119|    333|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1085|    333|	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|    333|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1085:6): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1085:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1085:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1086|    333|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|    333|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1086:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|    333|		return -1; \
  |  |  |  |  |  | 1088|    333|	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|    333|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:6): [Folded, False: 333]
  |  |  |  |  |  |  |  Branch (1088:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1088:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|    333|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|    333|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1089:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1090|    333|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1120|    333|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|    333|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:8): [True: 0, False: 333]
  |  |  |  |  ------------------
  |  |  |  | 1121|    333|				return -1; \
  |  |  |  | 1122|    333|			p->fld %= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|    333|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1123|    333|			break; \
  |  |  |  | 1124|   600k|		} \
  |  |  |  | 1125|  3.94M|	if (m->mask_op & FILE_OPINVERSE) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  356|  3.94M|#define				FILE_OPINVERSE	0x40
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1125:6): [True: 0, False: 3.94M]
  |  |  |  |  ------------------
  |  |  |  | 1126|  3.94M|		p->fld = ~p->fld \
  |  |  ------------------
  |  | 1131|  22.7M|	} else { \
  |  | 1132|  22.7M|		DO_CVT1(s##fld, int##size##_t, size, 1); \
  |  |  ------------------
  |  |  |  | 1092|  22.7M|	if (m->num_mask) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|  22.7M|#define num_mask _u._mask
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1092:6): [True: 4.01M, False: 18.7M]
  |  |  |  |  ------------------
  |  |  |  | 1093|  22.7M|		switch (m->mask_op & FILE_OPS_MASK) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|  4.01M|#define				FILE_OPS_MASK	0x07 /* mask for above ops */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1093:11): [True: 4.01M, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1094|  4.01M|		case FILE_OPAND: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  344|  4.01M|#define				FILE_OPAND	0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1094:3): [True: 4.01M, False: 564]
  |  |  |  |  ------------------
  |  |  |  | 1095|  4.01M|			p->fld &= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|  4.01M|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1096|  4.01M|			break; \
  |  |  |  | 1097|      0|		case FILE_OPOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  345|      0|#define				FILE_OPOR	1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1097:3): [True: 0, False: 4.01M]
  |  |  |  |  ------------------
  |  |  |  | 1098|      0|			p->fld |= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1099|      0|			break; \
  |  |  |  | 1100|      0|		case FILE_OPXOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  346|      0|#define				FILE_OPXOR	2
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1100:3): [True: 0, False: 4.01M]
  |  |  |  |  ------------------
  |  |  |  | 1101|      0|			p->fld ^= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1102|      0|			break; \
  |  |  |  | 1103|     87|		case FILE_OPADD: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  347|     87|#define				FILE_OPADD	3
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1103:3): [True: 87, False: 4.01M]
  |  |  |  |  ------------------
  |  |  |  | 1104|     87|			p->fld += CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|     87|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1105|     87|			break; \
  |  |  |  | 1106|    268|		case FILE_OPMINUS: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  348|    268|#define				FILE_OPMINUS	4
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1106:3): [True: 268, False: 4.01M]
  |  |  |  |  ------------------
  |  |  |  | 1107|    268|			p->fld -= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|    268|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1108|    268|			break; \
  |  |  |  | 1109|      0|		case FILE_OPMULTIPLY: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  349|      0|#define				FILE_OPMULTIPLY	5
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1109:3): [True: 0, False: 4.01M]
  |  |  |  |  ------------------
  |  |  |  | 1110|      0|			p->fld *= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1111|      0|			break; \
  |  |  |  | 1112|      0|		case FILE_OPDIVIDE: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  350|      0|#define				FILE_OPDIVIDE	6
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1112:3): [True: 0, False: 4.01M]
  |  |  |  |  ------------------
  |  |  |  | 1113|      0|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1085|      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 (1085:6): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1085:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1085:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1086|      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 (1086:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|      0|		return -1; \
  |  |  |  |  |  | 1088|      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 (1088:6): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1088:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1088:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|      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 (1089:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1090|      0|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1114|      0|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1114:8): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1115|      0|				return -1; \
  |  |  |  | 1116|      0|			p->fld /= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1117|      0|			break; \
  |  |  |  | 1118|    209|		case FILE_OPMODULO: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  351|    209|#define				FILE_OPMODULO	7
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1118:3): [True: 209, False: 4.01M]
  |  |  |  |  ------------------
  |  |  |  | 1119|    209|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1085|    209|	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|    209|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|    418|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1085:6): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1085:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1085:28): [True: 72, False: 137]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1086|    209|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|     72|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|    281|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1086:9): [True: 0, False: 72]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|    209|		return -1; \
  |  |  |  |  |  | 1088|    209|	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|    209|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:6): [Folded, False: 209]
  |  |  |  |  |  |  |  Branch (1088:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1088:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|    209|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|    209|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1089:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1090|    209|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1120|    209|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|    209|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:8): [True: 0, False: 209]
  |  |  |  |  ------------------
  |  |  |  | 1121|    209|				return -1; \
  |  |  |  | 1122|    209|			p->fld %= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|    209|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1123|    209|			break; \
  |  |  |  | 1124|  4.01M|		} \
  |  |  |  | 1125|  22.7M|	if (m->mask_op & FILE_OPINVERSE) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  356|  22.7M|#define				FILE_OPINVERSE	0x40
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1125:6): [True: 0, False: 22.7M]
  |  |  |  |  ------------------
  |  |  |  | 1126|  22.7M|		p->fld = ~p->fld \
  |  |  ------------------
  |  | 1133|  22.7M|	}
  ------------------
 1153|  26.7M|	return 0;
 1154|  26.7M|}
softmagic.c:cvt_64:
 1158|  2.47M|{
 1159|  2.47M|	DO_CVT(m, q, 64);
  ------------------
  |  | 1129|  2.47M|	if ((m)->flag & UNSIGNED) { \
  |  |  ------------------
  |  |  |  |  229|  2.47M|#define UNSIGNED	0x08	/* comparison is unsigned */
  |  |  ------------------
  |  |  |  Branch (1129:6): [True: 946k, False: 1.52M]
  |  |  ------------------
  |  | 1130|   946k|		DO_CVT1(fld, uint##size##_t, size, 0); \
  |  |  ------------------
  |  |  |  | 1092|   946k|	if (m->num_mask) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|   946k|#define num_mask _u._mask
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1092:6): [True: 287k, False: 658k]
  |  |  |  |  ------------------
  |  |  |  | 1093|   946k|		switch (m->mask_op & FILE_OPS_MASK) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|   287k|#define				FILE_OPS_MASK	0x07 /* mask for above ops */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1093:11): [True: 287k, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1094|   287k|		case FILE_OPAND: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  344|   287k|#define				FILE_OPAND	0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1094:3): [True: 287k, False: 92]
  |  |  |  |  ------------------
  |  |  |  | 1095|   287k|			p->fld &= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|   287k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1096|   287k|			break; \
  |  |  |  | 1097|      0|		case FILE_OPOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  345|      0|#define				FILE_OPOR	1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1097:3): [True: 0, False: 287k]
  |  |  |  |  ------------------
  |  |  |  | 1098|      0|			p->fld |= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1099|      0|			break; \
  |  |  |  | 1100|      0|		case FILE_OPXOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  346|      0|#define				FILE_OPXOR	2
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1100:3): [True: 0, False: 287k]
  |  |  |  |  ------------------
  |  |  |  | 1101|      0|			p->fld ^= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1102|      0|			break; \
  |  |  |  | 1103|     46|		case FILE_OPADD: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  347|     46|#define				FILE_OPADD	3
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1103:3): [True: 46, False: 287k]
  |  |  |  |  ------------------
  |  |  |  | 1104|     46|			p->fld += CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|     46|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1105|     46|			break; \
  |  |  |  | 1106|      0|		case FILE_OPMINUS: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  348|      0|#define				FILE_OPMINUS	4
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1106:3): [True: 0, False: 287k]
  |  |  |  |  ------------------
  |  |  |  | 1107|      0|			p->fld -= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1108|      0|			break; \
  |  |  |  | 1109|      0|		case FILE_OPMULTIPLY: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  349|      0|#define				FILE_OPMULTIPLY	5
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1109:3): [True: 0, False: 287k]
  |  |  |  |  ------------------
  |  |  |  | 1110|      0|			p->fld *= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1111|      0|			break; \
  |  |  |  | 1112|     46|		case FILE_OPDIVIDE: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  350|     46|#define				FILE_OPDIVIDE	6
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1112:3): [True: 46, False: 287k]
  |  |  |  |  ------------------
  |  |  |  | 1113|     46|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1085|     46|	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|     46|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1085:6): [Folded, False: 46]
  |  |  |  |  |  |  |  Branch (1085:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1085:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1086|     46|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|     46|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1086:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|     46|		return -1; \
  |  |  |  |  |  | 1088|     46|	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|     46|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:6): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1088:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1088:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|     46|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|     46|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1089:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1090|     46|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1114|     46|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|     46|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1114:8): [True: 0, False: 46]
  |  |  |  |  ------------------
  |  |  |  | 1115|     46|				return -1; \
  |  |  |  | 1116|     46|			p->fld /= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|     46|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1117|     46|			break; \
  |  |  |  | 1118|     46|		case FILE_OPMODULO: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  351|      0|#define				FILE_OPMODULO	7
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1118:3): [True: 0, False: 287k]
  |  |  |  |  ------------------
  |  |  |  | 1119|      0|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1085|      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 (1085:6): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1085:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1085:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1086|      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 (1086:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|      0|		return -1; \
  |  |  |  |  |  | 1088|      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 (1088:6): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1088:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1088:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|      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 (1089:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1090|      0|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1120|      0|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:8): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1121|      0|				return -1; \
  |  |  |  | 1122|      0|			p->fld %= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1123|      0|			break; \
  |  |  |  | 1124|   287k|		} \
  |  |  |  | 1125|   946k|	if (m->mask_op & FILE_OPINVERSE) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  356|   946k|#define				FILE_OPINVERSE	0x40
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1125:6): [True: 0, False: 946k]
  |  |  |  |  ------------------
  |  |  |  | 1126|   946k|		p->fld = ~p->fld \
  |  |  ------------------
  |  | 1131|  1.52M|	} else { \
  |  | 1132|  1.52M|		DO_CVT1(s##fld, int##size##_t, size, 1); \
  |  |  ------------------
  |  |  |  | 1092|  1.52M|	if (m->num_mask) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|  1.52M|#define num_mask _u._mask
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1092:6): [True: 2.02k, False: 1.52M]
  |  |  |  |  ------------------
  |  |  |  | 1093|  1.52M|		switch (m->mask_op & FILE_OPS_MASK) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|  2.02k|#define				FILE_OPS_MASK	0x07 /* mask for above ops */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1093:11): [True: 2.02k, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1094|     34|		case FILE_OPAND: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  344|     34|#define				FILE_OPAND	0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1094:3): [True: 34, False: 1.99k]
  |  |  |  |  ------------------
  |  |  |  | 1095|     34|			p->fld &= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|     34|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1096|     34|			break; \
  |  |  |  | 1097|      0|		case FILE_OPOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  345|      0|#define				FILE_OPOR	1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1097:3): [True: 0, False: 2.02k]
  |  |  |  |  ------------------
  |  |  |  | 1098|      0|			p->fld |= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1099|      0|			break; \
  |  |  |  | 1100|      0|		case FILE_OPXOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  346|      0|#define				FILE_OPXOR	2
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1100:3): [True: 0, False: 2.02k]
  |  |  |  |  ------------------
  |  |  |  | 1101|      0|			p->fld ^= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1102|      0|			break; \
  |  |  |  | 1103|      0|		case FILE_OPADD: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  347|      0|#define				FILE_OPADD	3
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1103:3): [True: 0, False: 2.02k]
  |  |  |  |  ------------------
  |  |  |  | 1104|      0|			p->fld += CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1105|      0|			break; \
  |  |  |  | 1106|      0|		case FILE_OPMINUS: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  348|      0|#define				FILE_OPMINUS	4
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1106:3): [True: 0, False: 2.02k]
  |  |  |  |  ------------------
  |  |  |  | 1107|      0|			p->fld -= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1108|      0|			break; \
  |  |  |  | 1109|      0|		case FILE_OPMULTIPLY: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  349|      0|#define				FILE_OPMULTIPLY	5
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1109:3): [True: 0, False: 2.02k]
  |  |  |  |  ------------------
  |  |  |  | 1110|      0|			p->fld *= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1111|      0|			break; \
  |  |  |  | 1112|    201|		case FILE_OPDIVIDE: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  350|    201|#define				FILE_OPDIVIDE	6
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1112:3): [True: 201, False: 1.82k]
  |  |  |  |  ------------------
  |  |  |  | 1113|    201|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1085|    201|	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|    201|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1085:6): [Folded, False: 201]
  |  |  |  |  |  |  |  Branch (1085:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1085:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1086|    201|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|    201|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1086:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|    201|		return -1; \
  |  |  |  |  |  | 1088|    201|	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|    201|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|    402|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:6): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1088:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1088:28): [True: 34, False: 167]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|    201|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|     34|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|    235|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1089:9): [True: 0, False: 34]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1090|    201|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1114|    201|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|    201|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1114:8): [True: 0, False: 201]
  |  |  |  |  ------------------
  |  |  |  | 1115|    201|				return -1; \
  |  |  |  | 1116|    201|			p->fld /= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|    201|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1117|    201|			break; \
  |  |  |  | 1118|  1.79k|		case FILE_OPMODULO: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  351|  1.79k|#define				FILE_OPMODULO	7
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1118:3): [True: 1.79k, False: 235]
  |  |  |  |  ------------------
  |  |  |  | 1119|  1.79k|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1085|  1.79k|	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.79k|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1085:6): [Folded, False: 1.79k]
  |  |  |  |  |  |  |  Branch (1085:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1085:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1086|  1.79k|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|  1.79k|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1086:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|  1.79k|		return -1; \
  |  |  |  |  |  | 1088|  1.79k|	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|  1.79k|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|  3.58k|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:6): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1088:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1088:28): [True: 0, False: 1.79k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|  1.79k|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  452|  1.79k|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1089:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1090|  1.79k|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1120|  1.79k|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|  1.79k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:8): [True: 0, False: 1.79k]
  |  |  |  |  ------------------
  |  |  |  | 1121|  1.79k|				return -1; \
  |  |  |  | 1122|  1.79k|			p->fld %= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  452|  1.79k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1123|  1.79k|			break; \
  |  |  |  | 1124|  2.02k|		} \
  |  |  |  | 1125|  1.52M|	if (m->mask_op & FILE_OPINVERSE) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  356|  1.52M|#define				FILE_OPINVERSE	0x40
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1125:6): [True: 0, False: 1.52M]
  |  |  |  |  ------------------
  |  |  |  | 1126|  1.52M|		p->fld = ~p->fld \
  |  |  ------------------
  |  | 1133|  1.52M|	}
  ------------------
 1160|  2.47M|	return 0;
 1161|  2.47M|}
softmagic.c:cvt_float:
 1184|  8.44k|{
 1185|  8.44k|	DO_CVT2(f, float);
  ------------------
  |  | 1164|  8.44k|	if (m->num_mask) \
  |  |  ------------------
  |  |  |  |  380|  8.44k|#define num_mask _u._mask
  |  |  ------------------
  |  |  |  Branch (1164:6): [True: 0, False: 8.44k]
  |  |  ------------------
  |  | 1165|  8.44k|		switch (m->mask_op & FILE_OPS_MASK) { \
  |  |  ------------------
  |  |  |  |  352|      0|#define				FILE_OPS_MASK	0x07 /* mask for above ops */
  |  |  ------------------
  |  |  |  Branch (1165:11): [True: 0, False: 0]
  |  |  ------------------
  |  | 1166|      0|		case FILE_OPADD: \
  |  |  ------------------
  |  |  |  |  347|      0|#define				FILE_OPADD	3
  |  |  ------------------
  |  |  |  Branch (1166:3): [True: 0, False: 0]
  |  |  ------------------
  |  | 1167|      0|			p->fld += CAST(type, m->num_mask); \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  | 1168|      0|			break; \
  |  | 1169|      0|		case FILE_OPMINUS: \
  |  |  ------------------
  |  |  |  |  348|      0|#define				FILE_OPMINUS	4
  |  |  ------------------
  |  |  |  Branch (1169:3): [True: 0, False: 0]
  |  |  ------------------
  |  | 1170|      0|			p->fld -= CAST(type, m->num_mask); \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  | 1171|      0|			break; \
  |  | 1172|      0|		case FILE_OPMULTIPLY: \
  |  |  ------------------
  |  |  |  |  349|      0|#define				FILE_OPMULTIPLY	5
  |  |  ------------------
  |  |  |  Branch (1172:3): [True: 0, False: 0]
  |  |  ------------------
  |  | 1173|      0|			p->fld *= CAST(type, m->num_mask); \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  | 1174|      0|			break; \
  |  | 1175|      0|		case FILE_OPDIVIDE: \
  |  |  ------------------
  |  |  |  |  350|      0|#define				FILE_OPDIVIDE	6
  |  |  ------------------
  |  |  |  Branch (1175:3): [True: 0, False: 0]
  |  |  ------------------
  |  | 1176|      0|			if (CAST(type, m->num_mask) == 0) \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  |  Branch (1176:8): [True: 0, False: 0]
  |  |  ------------------
  |  | 1177|      0|				return -1; \
  |  | 1178|      0|			p->fld /= CAST(type, m->num_mask); \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  | 1179|      0|			break; \
  |  | 1180|      0|		} \
  ------------------
 1186|  8.44k|	return 0;
 1187|  8.44k|}
softmagic.c:cvt_double:
 1191|    908|{
 1192|    908|	DO_CVT2(d, double);
  ------------------
  |  | 1164|    908|	if (m->num_mask) \
  |  |  ------------------
  |  |  |  |  380|    908|#define num_mask _u._mask
  |  |  ------------------
  |  |  |  Branch (1164:6): [True: 0, False: 908]
  |  |  ------------------
  |  | 1165|    908|		switch (m->mask_op & FILE_OPS_MASK) { \
  |  |  ------------------
  |  |  |  |  352|      0|#define				FILE_OPS_MASK	0x07 /* mask for above ops */
  |  |  ------------------
  |  |  |  Branch (1165:11): [True: 0, False: 0]
  |  |  ------------------
  |  | 1166|      0|		case FILE_OPADD: \
  |  |  ------------------
  |  |  |  |  347|      0|#define				FILE_OPADD	3
  |  |  ------------------
  |  |  |  Branch (1166:3): [True: 0, False: 0]
  |  |  ------------------
  |  | 1167|      0|			p->fld += CAST(type, m->num_mask); \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  | 1168|      0|			break; \
  |  | 1169|      0|		case FILE_OPMINUS: \
  |  |  ------------------
  |  |  |  |  348|      0|#define				FILE_OPMINUS	4
  |  |  ------------------
  |  |  |  Branch (1169:3): [True: 0, False: 0]
  |  |  ------------------
  |  | 1170|      0|			p->fld -= CAST(type, m->num_mask); \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  | 1171|      0|			break; \
  |  | 1172|      0|		case FILE_OPMULTIPLY: \
  |  |  ------------------
  |  |  |  |  349|      0|#define				FILE_OPMULTIPLY	5
  |  |  ------------------
  |  |  |  Branch (1172:3): [True: 0, False: 0]
  |  |  ------------------
  |  | 1173|      0|			p->fld *= CAST(type, m->num_mask); \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  | 1174|      0|			break; \
  |  | 1175|      0|		case FILE_OPDIVIDE: \
  |  |  ------------------
  |  |  |  |  350|      0|#define				FILE_OPDIVIDE	6
  |  |  ------------------
  |  |  |  Branch (1175:3): [True: 0, False: 0]
  |  |  ------------------
  |  | 1176|      0|			if (CAST(type, m->num_mask) == 0) \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  |  Branch (1176:8): [True: 0, False: 0]
  |  |  ------------------
  |  | 1177|      0|				return -1; \
  |  | 1178|      0|			p->fld /= CAST(type, m->num_mask); \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  | 1179|      0|			break; \
  |  | 1180|      0|		} \
  ------------------
 1193|    908|	return 0;
 1194|    908|}
softmagic.c:magiccheck:
 2169|   126M|{
 2170|   126M|	uint64_t l = m->value.q;
 2171|   126M|	uint64_t v;
 2172|   126M|	float fl, fv;
 2173|   126M|	double dl, dv;
 2174|   126M|	int matched;
 2175|   126M|	union VALUETYPE *p = &ms->ms_value;
 2176|       |
 2177|   126M|	switch (m->type) {
 2178|  2.14M|	case FILE_BYTE:
  ------------------
  |  |  246|  2.14M|#define 			FILE_BYTE		1
  ------------------
  |  Branch (2178:2): [True: 2.14M, False: 124M]
  ------------------
 2179|  2.14M|		v = p->b;
 2180|  2.14M|		break;
 2181|       |
 2182|  2.33M|	case FILE_SHORT:
  ------------------
  |  |  247|  2.33M|#define				FILE_SHORT		2
  ------------------
  |  Branch (2182:2): [True: 2.33M, False: 124M]
  ------------------
 2183|  7.74M|	case FILE_BESHORT:
  ------------------
  |  |  252|  7.74M|#define				FILE_BESHORT		7
  ------------------
  |  Branch (2183:2): [True: 5.40M, False: 121M]
  ------------------
 2184|  12.7M|	case FILE_LESHORT:
  ------------------
  |  |  255|  12.7M|#define				FILE_LESHORT		10
  ------------------
  |  Branch (2184:2): [True: 5.00M, False: 121M]
  ------------------
 2185|  12.7M|	case FILE_MSDOSDATE:
  ------------------
  |  |  300|  12.7M|#define				FILE_MSDOSDATE		55
  ------------------
  |  Branch (2185:2): [True: 0, False: 126M]
  ------------------
 2186|  12.7M|	case FILE_LEMSDOSDATE:
  ------------------
  |  |  301|  12.7M|#define				FILE_LEMSDOSDATE	56
  ------------------
  |  Branch (2186:2): [True: 135, False: 126M]
  ------------------
 2187|  12.7M|	case FILE_BEMSDOSDATE:
  ------------------
  |  |  302|  12.7M|#define				FILE_BEMSDOSDATE	57
  ------------------
  |  Branch (2187:2): [True: 0, False: 126M]
  ------------------
 2188|  12.7M|	case FILE_MSDOSTIME:
  ------------------
  |  |  303|  12.7M|#define				FILE_MSDOSTIME		58
  ------------------
  |  Branch (2188:2): [True: 0, False: 126M]
  ------------------
 2189|  12.7M|	case FILE_LEMSDOSTIME:
  ------------------
  |  |  304|  12.7M|#define				FILE_LEMSDOSTIME	59
  ------------------
  |  Branch (2189:2): [True: 135, False: 126M]
  ------------------
 2190|  12.7M|	case FILE_BEMSDOSTIME:
  ------------------
  |  |  305|  12.7M|#define				FILE_BEMSDOSTIME	60
  ------------------
  |  Branch (2190:2): [True: 0, False: 126M]
  ------------------
 2191|  12.7M|		v = p->h;
 2192|  12.7M|		break;
 2193|       |
 2194|  1.94M|	case FILE_LONG:
  ------------------
  |  |  249|  1.94M|#define				FILE_LONG		4
  ------------------
  |  Branch (2194:2): [True: 1.94M, False: 124M]
  ------------------
 2195|  18.3M|	case FILE_BELONG:
  ------------------
  |  |  253|  18.3M|#define				FILE_BELONG		8
  ------------------
  |  Branch (2195:2): [True: 16.4M, False: 110M]
  ------------------
 2196|  26.7M|	case FILE_LELONG:
  ------------------
  |  |  256|  26.7M|#define				FILE_LELONG		11
  ------------------
  |  Branch (2196:2): [True: 8.35M, False: 118M]
  ------------------
 2197|  26.7M|	case FILE_MELONG:
  ------------------
  |  |  268|  26.7M|#define				FILE_MELONG		23
  ------------------
  |  Branch (2197:2): [True: 41, False: 126M]
  ------------------
 2198|  26.7M|	case FILE_DATE:
  ------------------
  |  |  251|  26.7M|#define				FILE_DATE		6
  ------------------
  |  Branch (2198:2): [True: 0, False: 126M]
  ------------------
 2199|  26.7M|	case FILE_BEDATE:
  ------------------
  |  |  254|  26.7M|#define				FILE_BEDATE		9
  ------------------
  |  Branch (2199:2): [True: 508, False: 126M]
  ------------------
 2200|  26.7M|	case FILE_LEDATE:
  ------------------
  |  |  257|  26.7M|#define				FILE_LEDATE		12
  ------------------
  |  Branch (2200:2): [True: 195, False: 126M]
  ------------------
 2201|  26.7M|	case FILE_MEDATE:
  ------------------
  |  |  266|  26.7M|#define				FILE_MEDATE		21
  ------------------
  |  Branch (2201:2): [True: 175, False: 126M]
  ------------------
 2202|  26.7M|	case FILE_LDATE:
  ------------------
  |  |  259|  26.7M|#define				FILE_LDATE		14
  ------------------
  |  Branch (2202:2): [True: 0, False: 126M]
  ------------------
 2203|  26.7M|	case FILE_BELDATE:
  ------------------
  |  |  260|  26.7M|#define				FILE_BELDATE		15
  ------------------
  |  Branch (2203:2): [True: 308, False: 126M]
  ------------------
 2204|  26.7M|	case FILE_LELDATE:
  ------------------
  |  |  261|  26.7M|#define				FILE_LELDATE		16
  ------------------
  |  Branch (2204:2): [True: 87, False: 126M]
  ------------------
 2205|  26.7M|	case FILE_MELDATE:
  ------------------
  |  |  267|  26.7M|#define				FILE_MELDATE		22
  ------------------
  |  Branch (2205:2): [True: 0, False: 126M]
  ------------------
 2206|  26.7M|		v = p->l;
 2207|  26.7M|		break;
 2208|       |
 2209|  83.7k|	case FILE_QUAD:
  ------------------
  |  |  269|  83.7k|#define				FILE_QUAD		24
  ------------------
  |  Branch (2209:2): [True: 83.7k, False: 126M]
  ------------------
 2210|  1.14M|	case FILE_LEQUAD:
  ------------------
  |  |  270|  1.14M|#define				FILE_LEQUAD		25
  ------------------
  |  Branch (2210:2): [True: 1.06M, False: 125M]
  ------------------
 2211|  2.46M|	case FILE_BEQUAD:
  ------------------
  |  |  271|  2.46M|#define				FILE_BEQUAD		26
  ------------------
  |  Branch (2211:2): [True: 1.31M, False: 125M]
  ------------------
 2212|  2.46M|	case FILE_QDATE:
  ------------------
  |  |  272|  2.46M|#define				FILE_QDATE		27
  ------------------
  |  Branch (2212:2): [True: 0, False: 126M]
  ------------------
 2213|  2.46M|	case FILE_BEQDATE:
  ------------------
  |  |  274|  2.46M|#define				FILE_BEQDATE		29
  ------------------
  |  Branch (2213:2): [True: 1.29k, False: 126M]
  ------------------
 2214|  2.46M|	case FILE_LEQDATE:
  ------------------
  |  |  273|  2.46M|#define				FILE_LEQDATE		28
  ------------------
  |  Branch (2214:2): [True: 37, False: 126M]
  ------------------
 2215|  2.46M|	case FILE_QLDATE:
  ------------------
  |  |  275|  2.46M|#define				FILE_QLDATE		30
  ------------------
  |  Branch (2215:2): [True: 0, False: 126M]
  ------------------
 2216|  2.46M|	case FILE_BEQLDATE:
  ------------------
  |  |  277|  2.46M|#define				FILE_BEQLDATE		32
  ------------------
  |  Branch (2216:2): [True: 201, False: 126M]
  ------------------
 2217|  2.46M|	case FILE_LEQLDATE:
  ------------------
  |  |  276|  2.46M|#define				FILE_LEQLDATE		31
  ------------------
  |  Branch (2217:2): [True: 446, False: 126M]
  ------------------
 2218|  2.46M|	case FILE_QWDATE:
  ------------------
  |  |  287|  2.46M|#define				FILE_QWDATE		42
  ------------------
  |  Branch (2218:2): [True: 115, False: 126M]
  ------------------
 2219|  2.46M|	case FILE_BEQWDATE:
  ------------------
  |  |  289|  2.46M|#define				FILE_BEQWDATE		44
  ------------------
  |  Branch (2219:2): [True: 0, False: 126M]
  ------------------
 2220|  2.46M|	case FILE_LEQWDATE:
  ------------------
  |  |  288|  2.46M|#define				FILE_LEQWDATE		43
  ------------------
  |  Branch (2220:2): [True: 1.87k, False: 126M]
  ------------------
 2221|  2.47M|	case FILE_OFFSET:
  ------------------
  |  |  297|  2.47M|#define				FILE_OFFSET		52
  ------------------
  |  Branch (2221:2): [True: 4.27k, False: 126M]
  ------------------
 2222|  2.47M|		v = p->q;
 2223|  2.47M|		break;
 2224|       |
 2225|      0|	case FILE_FLOAT:
  ------------------
  |  |  278|      0|#define				FILE_FLOAT		33
  ------------------
  |  Branch (2225:2): [True: 0, False: 126M]
  ------------------
 2226|      0|	case FILE_BEFLOAT:
  ------------------
  |  |  279|      0|#define				FILE_BEFLOAT		34
  ------------------
  |  Branch (2226:2): [True: 0, False: 126M]
  ------------------
 2227|  8.44k|	case FILE_LEFLOAT:
  ------------------
  |  |  280|  8.44k|#define				FILE_LEFLOAT		35
  ------------------
  |  Branch (2227:2): [True: 8.44k, False: 126M]
  ------------------
 2228|  8.44k|		fl = m->value.f;
 2229|  8.44k|		fv = p->f;
 2230|  8.44k|		switch (m->reln) {
 2231|    933|		case 'x':
  ------------------
  |  Branch (2231:3): [True: 933, False: 7.51k]
  ------------------
 2232|    933|			matched = 1;
 2233|    933|			break;
 2234|       |
 2235|      0|		case '!':
  ------------------
  |  Branch (2235:3): [True: 0, False: 8.44k]
  ------------------
 2236|      0|			matched = isunordered(fl, fv) ? 1 : fv != fl;
  ------------------
  |  Branch (2236:14): [True: 0, False: 0]
  ------------------
 2237|      0|			break;
 2238|       |
 2239|      0|		case '=':
  ------------------
  |  Branch (2239:3): [True: 0, False: 8.44k]
  ------------------
 2240|      0|			matched = isunordered(fl, fv) ? 0 : fv == fl;
  ------------------
  |  Branch (2240:14): [True: 0, False: 0]
  ------------------
 2241|      0|			break;
 2242|       |
 2243|  7.51k|		case '>':
  ------------------
  |  Branch (2243:3): [True: 7.51k, False: 933]
  ------------------
 2244|  7.51k|			matched = isgreater(fv, fl);
 2245|  7.51k|			break;
 2246|       |
 2247|      0|		case '<':
  ------------------
  |  Branch (2247:3): [True: 0, False: 8.44k]
  ------------------
 2248|      0|			matched = isless(fv, fl);
 2249|      0|			break;
 2250|       |
 2251|      0|		default:
  ------------------
  |  Branch (2251:3): [True: 0, False: 8.44k]
  ------------------
 2252|      0|			file_magerror(ms, "cannot happen with float: "
 2253|      0|			    "invalid relation `%c'", m->reln);
 2254|      0|			return -1;
 2255|  8.44k|		}
 2256|  8.44k|		return matched;
 2257|       |
 2258|      0|	case FILE_DOUBLE:
  ------------------
  |  |  281|      0|#define				FILE_DOUBLE		36
  ------------------
  |  Branch (2258:2): [True: 0, False: 126M]
  ------------------
 2259|    216|	case FILE_BEDOUBLE:
  ------------------
  |  |  282|    216|#define				FILE_BEDOUBLE		37
  ------------------
  |  Branch (2259:2): [True: 216, False: 126M]
  ------------------
 2260|    908|	case FILE_LEDOUBLE:
  ------------------
  |  |  283|    908|#define				FILE_LEDOUBLE		38
  ------------------
  |  Branch (2260:2): [True: 692, False: 126M]
  ------------------
 2261|    908|		dl = m->value.d;
 2262|    908|		dv = p->d;
 2263|    908|		switch (m->reln) {
 2264|    583|		case 'x':
  ------------------
  |  Branch (2264:3): [True: 583, False: 325]
  ------------------
 2265|    583|			matched = 1;
 2266|    583|			break;
 2267|       |
 2268|      0|		case '!':
  ------------------
  |  Branch (2268:3): [True: 0, False: 908]
  ------------------
 2269|      0|			matched = isunordered(dv, dl) ? 1 : dv != dl;
  ------------------
  |  Branch (2269:14): [True: 0, False: 0]
  ------------------
 2270|      0|			break;
 2271|       |
 2272|    325|		case '=':
  ------------------
  |  Branch (2272:3): [True: 325, False: 583]
  ------------------
 2273|    325|			matched = isunordered(dv, dl) ? 0 : dv == dl;
  ------------------
  |  Branch (2273:14): [True: 82, False: 243]
  ------------------
 2274|    325|			break;
 2275|       |
 2276|      0|		case '>':
  ------------------
  |  Branch (2276:3): [True: 0, False: 908]
  ------------------
 2277|      0|			matched = isgreater(dv, dl);
 2278|      0|			break;
 2279|       |
 2280|      0|		case '<':
  ------------------
  |  Branch (2280:3): [True: 0, False: 908]
  ------------------
 2281|      0|			matched = isless(dv, dl);
 2282|      0|			break;
 2283|       |
 2284|      0|		default:
  ------------------
  |  Branch (2284:3): [True: 0, False: 908]
  ------------------
 2285|      0|			file_magerror(ms, "cannot happen with double: "
 2286|      0|			    "invalid relation `%c'", m->reln);
 2287|      0|			return -1;
 2288|    908|		}
 2289|    908|		return matched;
 2290|       |
 2291|  8.32k|	case FILE_DEFAULT:
  ------------------
  |  |  248|  8.32k|#define				FILE_DEFAULT		3
  ------------------
  |  Branch (2291:2): [True: 8.32k, False: 126M]
  ------------------
 2292|  9.76k|	case FILE_CLEAR:
  ------------------
  |  |  292|  9.76k|#define				FILE_CLEAR		47
  ------------------
  |  Branch (2292:2): [True: 1.44k, False: 126M]
  ------------------
 2293|  9.76k|		l = 0;
 2294|  9.76k|		v = 0;
 2295|  9.76k|		break;
 2296|       |
 2297|  80.3M|	case FILE_STRING:
  ------------------
  |  |  250|  80.3M|#define				FILE_STRING		5
  ------------------
  |  Branch (2297:2): [True: 80.3M, False: 46.1M]
  ------------------
 2298|  80.3M|	case FILE_PSTRING:
  ------------------
  |  |  258|  80.3M|#define				FILE_PSTRING		13
  ------------------
  |  Branch (2298:2): [True: 35.9k, False: 126M]
  ------------------
 2299|  80.3M|	case FILE_OCTAL:
  ------------------
  |  |  306|  80.3M|#define				FILE_OCTAL		61
  ------------------
  |  Branch (2299:2): [True: 0, False: 126M]
  ------------------
 2300|  80.3M|		l = 0;
 2301|  80.3M|		v = file_strncmp(m->value.s, p->s, CAST(size_t, m->vallen),
  ------------------
  |  |  452|  80.3M|#define CAST(T, b)	((T)(b))
  ------------------
 2302|  80.3M|		    sizeof(p->s), m->str_flags);
  ------------------
  |  |  382|  80.3M|#define str_flags _u._s._flags
  ------------------
 2303|  80.3M|		break;
 2304|       |
 2305|     85|	case FILE_BESTRING16:
  ------------------
  |  |  263|     85|#define				FILE_BESTRING16		18
  ------------------
  |  Branch (2305:2): [True: 85, False: 126M]
  ------------------
 2306|  82.6k|	case FILE_LESTRING16:
  ------------------
  |  |  264|  82.6k|#define				FILE_LESTRING16		19
  ------------------
  |  Branch (2306:2): [True: 82.5k, False: 126M]
  ------------------
 2307|  82.6k|		l = 0;
 2308|  82.6k|		v = file_strncmp16(m->value.s, p->s, CAST(size_t, m->vallen),
  ------------------
  |  |  452|  82.6k|#define CAST(T, b)	((T)(b))
  ------------------
 2309|  82.6k|		    sizeof(p->s), m->str_flags);
  ------------------
  |  |  382|  82.6k|#define str_flags _u._s._flags
  ------------------
 2310|  82.6k|		break;
 2311|       |
 2312|   722k|	case FILE_SEARCH: { /* search ms->search.s for the string m->value.s */
  ------------------
  |  |  265|   722k|#define				FILE_SEARCH		20
  ------------------
  |  Branch (2312:2): [True: 722k, False: 125M]
  ------------------
 2313|   722k|		size_t slen;
 2314|   722k|		size_t idx;
 2315|       |
 2316|   722k|		if (ms->search.s == NULL)
  ------------------
  |  Branch (2316:7): [True: 0, False: 722k]
  ------------------
 2317|      0|			return 0;
 2318|       |
 2319|   722k|		slen = MIN(m->vallen, sizeof(m->value.s));
  ------------------
  |  Branch (2319:10): [True: 722k, False: 0]
  ------------------
 2320|   722k|		l = 0;
 2321|   722k|		v = 0;
 2322|   722k|		if ((ms->flags & MAGIC_DEBUG) != 0) {
  ------------------
  |  |   33|   722k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2322:7): [True: 0, False: 722k]
  ------------------
 2323|      0|			size_t xlen = ms->search.s_len > 100 ? 100
  ------------------
  |  Branch (2323:18): [True: 0, False: 0]
  ------------------
 2324|      0|			    : ms->search.s_len;
 2325|       |
 2326|      0|			fprintf(stderr, "search: [");
 2327|      0|			file_showstr(stderr, ms->search.s, xlen);
 2328|      0|			fprintf(stderr, "%s] for [", ms->search.s_len == xlen
  ------------------
  |  Branch (2328:33): [True: 0, False: 0]
  ------------------
 2329|      0|			    ? "" : "...");
 2330|      0|			file_showstr(stderr, m->value.s, slen);
 2331|      0|		}
 2332|   722k|#ifdef HAVE_MEMMEM
 2333|   722k|		if (slen > 0 && m->str_flags == 0) {
  ------------------
  |  |  382|   722k|#define str_flags _u._s._flags
  ------------------
  |  Branch (2333:7): [True: 722k, False: 0]
  |  Branch (2333:19): [True: 377k, False: 345k]
  ------------------
 2334|   377k|			const char *found;
 2335|   377k|			idx = m->str_range + slen;
  ------------------
  |  |  381|   377k|#define str_range _u._s._count
  ------------------
 2336|   377k|			if (m->str_range == 0 || ms->search.s_len < idx)
  ------------------
  |  |  381|   377k|#define str_range _u._s._count
  ------------------
  |  Branch (2336:8): [True: 4.18k, False: 373k]
  |  Branch (2336:29): [True: 102k, False: 270k]
  ------------------
 2337|   106k|				idx = ms->search.s_len;
 2338|   377k|			found = CAST(const char *, memmem(ms->search.s, idx,
  ------------------
  |  |  452|   377k|#define CAST(T, b)	((T)(b))
  ------------------
 2339|   377k|			    m->value.s, slen));
 2340|   377k|			if ((ms->flags & MAGIC_DEBUG) != 0) {
  ------------------
  |  |   33|   377k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2340:8): [True: 0, False: 377k]
  ------------------
 2341|      0|				fprintf(stderr, "] %sfound\n",
 2342|      0|				    found ? "" : "not ");
  ------------------
  |  Branch (2342:9): [True: 0, False: 0]
  ------------------
 2343|      0|			}
 2344|   377k|			if (!found) {
  ------------------
  |  Branch (2344:8): [True: 374k, False: 2.46k]
  ------------------
 2345|   374k|				v = 1;
 2346|   374k|				break;
 2347|   374k|			}
 2348|  2.46k|			idx = found - ms->search.s;
 2349|  2.46k|			ms->search.offset += idx;
 2350|  2.46k|			ms->search.rm_len = ms->search.s_len - idx;
 2351|  2.46k|			break;
 2352|   377k|		}
 2353|   345k|#endif
 2354|       |
 2355|  1.02G|		for (idx = 0; m->str_range == 0 || idx < m->str_range; idx++) {
  ------------------
  |  |  381|  1.02G|#define str_range _u._s._count
  ------------------
              		for (idx = 0; m->str_range == 0 || idx < m->str_range; idx++) {
  ------------------
  |  |  381|  1.02G|#define str_range _u._s._count
  ------------------
  |  Branch (2355:17): [True: 0, False: 1.02G]
  |  Branch (2355:38): [True: 1.02G, False: 192k]
  ------------------
 2356|  1.02G|			if (slen + idx > ms->search.s_len) {
  ------------------
  |  Branch (2356:8): [True: 132k, False: 1.02G]
  ------------------
 2357|   132k|				v = 1;
 2358|   132k|				break;
 2359|   132k|			}
 2360|       |
 2361|  1.02G|			v = file_strncmp(m->value.s, ms->search.s + idx, slen,
 2362|  1.02G|			    ms->search.s_len - idx, m->str_flags);
  ------------------
  |  |  382|  1.02G|#define str_flags _u._s._flags
  ------------------
 2363|  1.02G|			if (v == 0) {	/* found match */
  ------------------
  |  Branch (2363:8): [True: 20.0k, False: 1.02G]
  ------------------
 2364|  20.0k|				ms->search.offset += idx;
 2365|  20.0k|				ms->search.rm_len = ms->search.s_len - idx;
 2366|  20.0k|				break;
 2367|  20.0k|			}
 2368|  1.02G|		}
 2369|   345k|		if ((ms->flags & MAGIC_DEBUG) != 0) {
  ------------------
  |  |   33|   345k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2369:7): [True: 0, False: 345k]
  ------------------
 2370|      0|			fprintf(stderr, "] %sfound\n", v == 0 ? "" : "not ");
  ------------------
  |  Branch (2370:35): [True: 0, False: 0]
  ------------------
 2371|      0|		}
 2372|   345k|		break;
 2373|   722k|	}
 2374|   324k|	case FILE_REGEX: {
  ------------------
  |  |  262|   324k|#define				FILE_REGEX		17
  ------------------
  |  Branch (2374:2): [True: 324k, False: 126M]
  ------------------
 2375|   324k|		int rc;
 2376|   324k|		file_regex_t *rx = *m_cache;
 2377|   324k|		const char *search;
 2378|   324k|		regmatch_t pmatch;
 2379|   324k|		size_t slen = ms->search.s_len;
 2380|   324k|		char *copy;
 2381|       |
 2382|   324k|		if (ms->search.s == NULL)
  ------------------
  |  Branch (2382:7): [True: 0, False: 324k]
  ------------------
 2383|      0|			return 0;
 2384|       |
 2385|   324k|		if (rx == NULL) {
  ------------------
  |  Branch (2385:7): [True: 160, False: 324k]
  ------------------
 2386|    160|			rx = *m_cache = alloc_regex(ms, m);
 2387|    160|			if (rx == NULL)
  ------------------
  |  Branch (2387:8): [True: 0, False: 160]
  ------------------
 2388|      0|				return -1;
 2389|    160|		}
 2390|   324k|		l = 0;
 2391|   324k|		if (slen != 0) {
  ------------------
  |  Branch (2391:7): [True: 322k, False: 1.53k]
  ------------------
 2392|   322k|		    copy = CAST(char *, malloc(slen));
  ------------------
  |  |  452|   322k|#define CAST(T, b)	((T)(b))
  ------------------
 2393|   322k|		    if (copy == NULL)  {
  ------------------
  |  Branch (2393:11): [True: 0, False: 322k]
  ------------------
 2394|      0|			file_error(ms, errno,
 2395|      0|			    "can't allocate %" SIZE_T_FORMAT "u bytes",
 2396|      0|			    slen);
 2397|      0|			return -1;
 2398|      0|		    }
 2399|   322k|		    memcpy(copy, ms->search.s, slen);
 2400|   322k|		    copy[--slen] = '\0';
 2401|   322k|		    search = copy;
 2402|   322k|		} else {
 2403|  1.53k|		    search = CCAST(char *, "");
  ------------------
  |  |  454|  1.53k|#define CCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 2404|  1.53k|		    copy = NULL;
 2405|  1.53k|		}
 2406|   324k|		rc = file_regexec(ms, rx, RCAST(const char *, search),
  ------------------
  |  |  453|   324k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 2407|   324k|		    1, &pmatch, 0);
 2408|   324k|		free(copy);
 2409|   324k|		switch (rc) {
 2410|  3.33k|		case 0:
  ------------------
  |  Branch (2410:3): [True: 3.33k, False: 320k]
  ------------------
 2411|  3.33k|			ms->search.s += CAST(int, pmatch.rm_so);
  ------------------
  |  |  452|  3.33k|#define CAST(T, b)	((T)(b))
  ------------------
 2412|  3.33k|			ms->search.offset += CAST(size_t, pmatch.rm_so);
  ------------------
  |  |  452|  3.33k|#define CAST(T, b)	((T)(b))
  ------------------
 2413|  3.33k|			ms->search.rm_len = CAST(size_t,
  ------------------
  |  |  452|  3.33k|#define CAST(T, b)	((T)(b))
  ------------------
 2414|  3.33k|			    pmatch.rm_eo - pmatch.rm_so);
 2415|  3.33k|			v = 0;
 2416|  3.33k|			break;
 2417|       |
 2418|   320k|		case REG_NOMATCH:
  ------------------
  |  Branch (2418:3): [True: 320k, False: 3.33k]
  ------------------
 2419|   320k|			v = 1;
 2420|   320k|			break;
 2421|       |
 2422|      0|		default:
  ------------------
  |  Branch (2422:3): [True: 0, False: 324k]
  ------------------
 2423|      0|			return -1;
 2424|   324k|		}
 2425|   324k|		break;
 2426|   324k|	}
 2427|   324k|	case FILE_USE:
  ------------------
  |  |  291|  35.0k|#define				FILE_USE		46
  ------------------
  |  Branch (2427:2): [True: 35.0k, False: 126M]
  ------------------
 2428|  35.0k|		return ms->ms_value.q != 0;
 2429|  46.1k|	case FILE_NAME:
  ------------------
  |  |  290|  46.1k|#define				FILE_NAME		45
  ------------------
  |  Branch (2429:2): [True: 46.1k, False: 126M]
  ------------------
 2430|  62.1k|	case FILE_INDIRECT:
  ------------------
  |  |  286|  62.1k|#define				FILE_INDIRECT		41
  ------------------
  |  Branch (2430:2): [True: 16.0k, False: 126M]
  ------------------
 2431|  62.1k|		return 1;
 2432|   514k|	case FILE_DER:
  ------------------
  |  |  293|   514k|#define				FILE_DER		48
  ------------------
  |  Branch (2432:2): [True: 514k, False: 125M]
  ------------------
 2433|   514k|		matched = der_cmp(ms, m);
 2434|   514k|		if (matched == -1) {
  ------------------
  |  Branch (2434:7): [True: 190k, False: 323k]
  ------------------
 2435|   190k|			if ((ms->flags & MAGIC_DEBUG) != 0) {
  ------------------
  |  |   33|   190k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2435:8): [True: 0, False: 190k]
  ------------------
 2436|      0|				(void) fprintf(stderr,
 2437|      0|				    "EOF comparing DER entries\n");
 2438|      0|			}
 2439|   190k|			return 0;
 2440|   190k|		}
 2441|   323k|		return matched;
 2442|      0|	case FILE_BEGUID:
  ------------------
  |  |  296|      0|#define				FILE_BEGUID		51
  ------------------
  |  Branch (2442:2): [True: 0, False: 126M]
  ------------------
 2443|      0|	case FILE_LEGUID:
  ------------------
  |  |  295|      0|#define				FILE_LEGUID		50
  ------------------
  |  Branch (2443:2): [True: 0, False: 126M]
  ------------------
 2444|   284k|	case FILE_GUID:
  ------------------
  |  |  294|   284k|#define				FILE_GUID		49
  ------------------
  |  Branch (2444:2): [True: 284k, False: 126M]
  ------------------
 2445|   284k|		l = 0;
 2446|   284k|		v = memcmp(m->value.guid, p->guid, sizeof(p->guid));
 2447|   284k|		break;
 2448|      0|	default:
  ------------------
  |  Branch (2448:2): [True: 0, False: 126M]
  ------------------
 2449|      0|		file_magerror(ms, "invalid type %d in magiccheck()", m->type);
 2450|      0|		return -1;
 2451|   126M|	}
 2452|       |
 2453|   125M|	v = file_signextend(ms, m, v);
 2454|       |
 2455|   125M|	switch (m->reln) {
 2456|  85.1k|	case 'x':
  ------------------
  |  Branch (2456:2): [True: 85.1k, False: 125M]
  ------------------
 2457|  85.1k|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  85.1k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2457:7): [True: 0, False: 85.1k]
  ------------------
 2458|      0|			(void) fprintf(stderr, "%" INT64_T_FORMAT
 2459|      0|			    "u == *any* = 1", CAST(unsigned long long, v));
  ------------------
  |  |  452|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2460|  85.1k|		matched = 1;
 2461|  85.1k|		break;
 2462|       |
 2463|  57.9k|	case '!':
  ------------------
  |  Branch (2463:2): [True: 57.9k, False: 125M]
  ------------------
 2464|  57.9k|		matched = v != l;
 2465|  57.9k|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  57.9k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2465:7): [True: 0, False: 57.9k]
  ------------------
 2466|      0|			(void) fprintf(stderr, "%" INT64_T_FORMAT "u != %"
 2467|      0|			    INT64_T_FORMAT "u = %d",
 2468|      0|			    CAST(unsigned long long, v),
  ------------------
  |  |  452|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2469|      0|			    CAST(unsigned long long, l), matched);
  ------------------
  |  |  452|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2470|  57.9k|		break;
 2471|       |
 2472|   124M|	case '=':
  ------------------
  |  Branch (2472:2): [True: 124M, False: 912k]
  ------------------
 2473|   124M|		matched = v == l;
 2474|   124M|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|   124M|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2474:7): [True: 0, False: 124M]
  ------------------
 2475|      0|			(void) fprintf(stderr, "%" INT64_T_FORMAT "u == %"
 2476|      0|			    INT64_T_FORMAT "u = %d",
 2477|      0|			    CAST(unsigned long long, v),
  ------------------
  |  |  452|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2478|      0|			    CAST(unsigned long long, l), matched);
  ------------------
  |  |  452|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2479|   124M|		break;
 2480|       |
 2481|   282k|	case '>':
  ------------------
  |  Branch (2481:2): [True: 282k, False: 125M]
  ------------------
 2482|   282k|		if (m->flag & UNSIGNED) {
  ------------------
  |  |  229|   282k|#define UNSIGNED	0x08	/* comparison is unsigned */
  ------------------
  |  Branch (2482:7): [True: 202k, False: 79.3k]
  ------------------
 2483|   202k|			matched = v > l;
 2484|   202k|			if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|   202k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2484:8): [True: 0, False: 202k]
  ------------------
 2485|      0|				(void) fprintf(stderr, "%" INT64_T_FORMAT
 2486|      0|				    "u > %" INT64_T_FORMAT "u = %d",
 2487|      0|				    CAST(unsigned long long, v),
  ------------------
  |  |  452|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2488|      0|				    CAST(unsigned long long, l), matched);
  ------------------
  |  |  452|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2489|   202k|		}
 2490|  79.3k|		else {
 2491|  79.3k|			matched = CAST(int64_t, v) > CAST(int64_t, l);
  ------------------
  |  |  452|  79.3k|#define CAST(T, b)	((T)(b))
  ------------------
              			matched = CAST(int64_t, v) > CAST(int64_t, l);
  ------------------
  |  |  452|  79.3k|#define CAST(T, b)	((T)(b))
  ------------------
 2492|  79.3k|			if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  79.3k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2492:8): [True: 0, False: 79.3k]
  ------------------
 2493|      0|				(void) fprintf(stderr, "%" INT64_T_FORMAT
 2494|      0|				    "d > %" INT64_T_FORMAT "d = %d",
 2495|      0|				    CAST(long long, v),
  ------------------
  |  |  452|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2496|      0|				    CAST(long long, l), matched);
  ------------------
  |  |  452|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2497|  79.3k|		}
 2498|   282k|		break;
 2499|       |
 2500|   443k|	case '<':
  ------------------
  |  Branch (2500:2): [True: 443k, False: 125M]
  ------------------
 2501|   443k|		if (m->flag & UNSIGNED) {
  ------------------
  |  |  229|   443k|#define UNSIGNED	0x08	/* comparison is unsigned */
  ------------------
  |  Branch (2501:7): [True: 370k, False: 72.5k]
  ------------------
 2502|   370k|			matched = v < l;
 2503|   370k|			if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|   370k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2503:8): [True: 0, False: 370k]
  ------------------
 2504|      0|				(void) fprintf(stderr, "%" INT64_T_FORMAT
 2505|      0|				    "u < %" INT64_T_FORMAT "u = %d",
 2506|      0|				    CAST(unsigned long long, v),
  ------------------
  |  |  452|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2507|      0|				    CAST(unsigned long long, l), matched);
  ------------------
  |  |  452|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2508|   370k|		}
 2509|  72.5k|		else {
 2510|  72.5k|			matched = CAST(int64_t, v) < CAST(int64_t, l);
  ------------------
  |  |  452|  72.5k|#define CAST(T, b)	((T)(b))
  ------------------
              			matched = CAST(int64_t, v) < CAST(int64_t, l);
  ------------------
  |  |  452|  72.5k|#define CAST(T, b)	((T)(b))
  ------------------
 2511|  72.5k|			if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  72.5k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2511:8): [True: 0, False: 72.5k]
  ------------------
 2512|      0|				(void) fprintf(stderr, "%" INT64_T_FORMAT
 2513|      0|				    "d < %" INT64_T_FORMAT "d = %d",
 2514|      0|				     CAST(long long, v),
  ------------------
  |  |  452|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2515|      0|				     CAST(long long, l), matched);
  ------------------
  |  |  452|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2516|  72.5k|		}
 2517|   443k|		break;
 2518|       |
 2519|  42.1k|	case '&':
  ------------------
  |  Branch (2519:2): [True: 42.1k, False: 125M]
  ------------------
 2520|  42.1k|		matched = (v & l) == l;
 2521|  42.1k|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  42.1k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2521:7): [True: 0, False: 42.1k]
  ------------------
 2522|      0|			(void) fprintf(stderr, "((%" INT64_T_FORMAT "x & %"
 2523|      0|			    INT64_T_FORMAT "x) == %" INT64_T_FORMAT
 2524|      0|			    "x) = %d", CAST(unsigned long long, v),
  ------------------
  |  |  452|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2525|      0|			    CAST(unsigned long long, l),
  ------------------
  |  |  452|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2526|      0|			    CAST(unsigned long long, l),
  ------------------
  |  |  452|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2527|      0|			    matched);
 2528|  42.1k|		break;
 2529|       |
 2530|  1.08k|	case '^':
  ------------------
  |  Branch (2530:2): [True: 1.08k, False: 125M]
  ------------------
 2531|  1.08k|		matched = (v & l) != l;
 2532|  1.08k|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  1.08k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2532:7): [True: 0, False: 1.08k]
  ------------------
 2533|      0|			(void) fprintf(stderr, "((%" INT64_T_FORMAT "x & %"
 2534|      0|			    INT64_T_FORMAT "x) != %" INT64_T_FORMAT
 2535|      0|			    "x) = %d", CAST(unsigned long long, v),
  ------------------
  |  |  452|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2536|      0|			    CAST(unsigned long long, l),
  ------------------
  |  |  452|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2537|      0|			    CAST(unsigned long long, l), matched);
  ------------------
  |  |  452|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2538|  1.08k|		break;
 2539|       |
 2540|      0|	default:
  ------------------
  |  Branch (2540:2): [True: 0, False: 125M]
  ------------------
 2541|      0|		file_magerror(ms, "cannot happen: invalid relation `%c'",
 2542|      0|		    m->reln);
 2543|      0|		return -1;
 2544|   125M|	}
 2545|   125M|	if ((ms->flags & MAGIC_DEBUG) != 0) {
  ------------------
  |  |   33|   125M|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2545:6): [True: 0, False: 125M]
  ------------------
 2546|      0|		(void) fprintf(stderr, " strength=%zu\n",
 2547|      0|		    file_magic_strength(m, 1));
 2548|      0|	}
 2549|       |
 2550|   125M|	return matched;
 2551|   125M|}
softmagic.c:file_strncmp:
 2059|  1.10G|{
 2060|       |	/*
 2061|       |	 * Convert the source args to unsigned here so that (1) the
 2062|       |	 * compare will be unsigned as it is in strncmp() and (2) so
 2063|       |	 * the ctype functions will work correctly without extra
 2064|       |	 * casting.
 2065|       |	 */
 2066|  1.10G|	const unsigned char *a = RCAST(const unsigned char *, s1);
  ------------------
  |  |  453|  1.10G|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 2067|  1.10G|	const unsigned char *b = RCAST(const unsigned char *, s2);
  ------------------
  |  |  453|  1.10G|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 2068|  1.10G|	uint32_t ws = flags & (STRING_COMPACT_WHITESPACE |
  ------------------
  |  |  396|  1.10G|#define STRING_COMPACT_WHITESPACE		BIT(0)
  |  |  ------------------
  |  |  |  |  395|  1.10G|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
 2069|  1.10G|	    STRING_COMPACT_OPTIONAL_WHITESPACE);
  ------------------
  |  |  397|  1.10G|#define STRING_COMPACT_OPTIONAL_WHITESPACE	BIT(1)
  |  |  ------------------
  |  |  |  |  395|  1.10G|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
 2070|  1.10G|	const unsigned char *eb = b + (ws ? maxlen : len);
  ------------------
  |  Branch (2070:33): [True: 96.7M, False: 1.01G]
  ------------------
 2071|  1.10G|	uint64_t v;
 2072|       |
 2073|       |	/*
 2074|       |	 * What we want here is v = strncmp(s1, s2, len),
 2075|       |	 * but ignoring any nulls.
 2076|       |	 */
 2077|  1.10G|	v = 0;
 2078|  1.10G|	len++;
 2079|  1.10G|	if (0L == flags) { /* normal string: do it fast */
  ------------------
  |  Branch (2079:6): [True: 76.1M, False: 1.03G]
  ------------------
 2080|  78.2M|		while (--len > 0)
  ------------------
  |  Branch (2080:10): [True: 78.2M, False: 24.9k]
  ------------------
 2081|  78.2M|			if ((v = *b++ - *a++) != '\0')
  ------------------
  |  Branch (2081:8): [True: 76.1M, False: 2.12M]
  ------------------
 2082|  76.1M|				break;
 2083|  76.1M|	}
 2084|  1.03G|	else { /* combine the others */
 2085|  1.03G|		while (--len > 0) {
  ------------------
  |  Branch (2085:10): [True: 1.03G, False: 60.7k]
  ------------------
 2086|  1.03G|			if (b >= eb) {
  ------------------
  |  Branch (2086:8): [True: 157k, False: 1.03G]
  ------------------
 2087|   157k|				v = 1;
 2088|   157k|				break;
 2089|   157k|			}
 2090|  1.03G|			if ((flags & STRING_IGNORE_LOWERCASE) &&
  ------------------
  |  |  398|  1.03G|#define STRING_IGNORE_LOWERCASE			BIT(2)
  |  |  ------------------
  |  |  |  |  395|  1.03G|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (2090:8): [True: 98.4M, False: 934M]
  ------------------
 2091|  1.03G|			    islower(*a)) {
  ------------------
  |  Branch (2091:8): [True: 5.49M, False: 92.9M]
  ------------------
 2092|  5.49M|				if ((v = tolower(*b++) - *a++) != '\0')
  ------------------
  |  Branch (2092:9): [True: 5.47M, False: 21.0k]
  |  Branch (2092:14): [True: 0, False: 0]
  |  Branch (2092:14): [Folded, False: 0]
  |  Branch (2092:14): [Folded, False: 5.49M]
  ------------------
 2093|  5.47M|					break;
 2094|  5.49M|			}
 2095|  1.02G|			else if ((flags & STRING_IGNORE_UPPERCASE) &&
  ------------------
  |  |  399|  1.02G|#define STRING_IGNORE_UPPERCASE			BIT(3)
  |  |  ------------------
  |  |  |  |  395|  1.02G|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (2095:13): [True: 14.4k, False: 1.02G]
  ------------------
 2096|  1.02G|			    isupper(*a)) {
  ------------------
  |  Branch (2096:8): [True: 13.9k, False: 464]
  ------------------
 2097|  13.9k|				if ((v = toupper(*b++) - *a++) != '\0')
  ------------------
  |  Branch (2097:9): [True: 13.8k, False: 110]
  |  Branch (2097:14): [True: 0, False: 0]
  |  Branch (2097:14): [Folded, False: 0]
  |  Branch (2097:14): [Folded, False: 13.9k]
  ------------------
 2098|  13.8k|					break;
 2099|  13.9k|			}
 2100|  1.02G|			else if ((flags & STRING_COMPACT_WHITESPACE) &&
  ------------------
  |  |  396|  1.02G|#define STRING_COMPACT_WHITESPACE		BIT(0)
  |  |  ------------------
  |  |  |  |  395|  1.02G|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (2100:13): [True: 81.9M, False: 945M]
  ------------------
 2101|  1.02G|			    isspace(*a)) {
  ------------------
  |  Branch (2101:8): [True: 1.59M, False: 80.3M]
  ------------------
 2102|  1.59M|				a++;
 2103|  1.59M|				if (isspace(*b)) {
  ------------------
  |  Branch (2103:9): [True: 198k, False: 1.39M]
  ------------------
 2104|   198k|					b++;
 2105|   198k|					if (!isspace(*a))
  ------------------
  |  Branch (2105:10): [True: 198k, False: 0]
  ------------------
 2106|  5.53G|						while (b < eb && isspace(*b))
  ------------------
  |  Branch (2106:14): [True: 5.53G, False: 157k]
  |  Branch (2106:24): [True: 5.53G, False: 40.9k]
  ------------------
 2107|  5.53G|							b++;
 2108|   198k|				}
 2109|  1.39M|				else {
 2110|  1.39M|					v = 1;
 2111|  1.39M|					break;
 2112|  1.39M|				}
 2113|  1.59M|			}
 2114|  1.02G|			else if ((flags & STRING_COMPACT_OPTIONAL_WHITESPACE) &&
  ------------------
  |  |  397|  1.02G|#define STRING_COMPACT_OPTIONAL_WHITESPACE	BIT(1)
  |  |  ------------------
  |  |  |  |  395|  1.02G|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (2114:13): [True: 14.8M, False: 1.01G]
  ------------------
 2115|  1.02G|			    isspace(*a)) {
  ------------------
  |  Branch (2115:8): [True: 2.96k, False: 14.8M]
  ------------------
 2116|  2.96k|				a++;
 2117|   417k|				while (b < eb && isspace(*b))
  ------------------
  |  Branch (2117:12): [True: 417k, False: 48]
  |  Branch (2117:22): [True: 414k, False: 2.91k]
  ------------------
 2118|   414k|					b++;
 2119|  2.96k|			}
 2120|  1.02G|			else {
 2121|  1.02G|				if ((v = *b++ - *a++) != '\0')
  ------------------
  |  Branch (2121:9): [True: 1.02G, False: 1.87M]
  ------------------
 2122|  1.02G|					break;
 2123|  1.02G|			}
 2124|  1.03G|		}
 2125|  1.03G|		if (len == 0 && v == 0 && (flags & STRING_FULL_WORD)) {
  ------------------
  |  |  414|  60.7k|#define	STRING_FULL_WORD			BIT(14)
  |  |  ------------------
  |  |  |  |  395|  60.7k|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (2125:7): [True: 60.7k, False: 1.03G]
  |  Branch (2125:19): [True: 60.7k, False: 0]
  |  Branch (2125:29): [True: 146, False: 60.6k]
  ------------------
 2126|    146|			if (*b && !isspace(*b))
  ------------------
  |  Branch (2126:8): [True: 103, False: 43]
  |  Branch (2126:14): [True: 69, False: 34]
  ------------------
 2127|     69|				v = 1;
 2128|    146|		}
 2129|  1.03G|	}
 2130|  1.10G|	return v;
 2131|  1.10G|}
softmagic.c:file_strncmp16:
 2136|  82.6k|{
 2137|       |	/*
 2138|       |	 * XXX - The 16-bit string compare probably needs to be done
 2139|       |	 * differently, especially if the flags are to be supported.
 2140|       |	 * At the moment, I am unsure.
 2141|       |	 */
 2142|  82.6k|	flags = 0;
 2143|  82.6k|	return file_strncmp(a, b, len, maxlen, flags);
 2144|  82.6k|}
softmagic.c:alloc_regex:
 2148|    160|{
 2149|    160|	int rc;
 2150|    160|	file_regex_t *rx = CAST(file_regex_t *, malloc(sizeof(*rx)));
  ------------------
  |  |  452|    160|#define CAST(T, b)	((T)(b))
  ------------------
 2151|       |
 2152|    160|	if (rx == NULL) {
  ------------------
  |  Branch (2152:6): [True: 0, False: 160]
  ------------------
 2153|      0|		file_error(ms, errno, "can't allocate %" SIZE_T_FORMAT
 2154|      0|		    "u bytes", sizeof(*rx));
 2155|      0|		return NULL;
 2156|      0|	}
 2157|       |
 2158|    160|	rc = file_regcomp(ms, rx, m->value.s, REG_EXTENDED | REG_NEWLINE |
 2159|    160|	    REGEX_ICASE(m));
  ------------------
  |  |  432|    160|#define	REGEX_ICASE(m) (((m)->str_flags & STRING_IGNORE_CASE) ? REG_ICASE : 0)
  |  |  ------------------
  |  |  |  |  382|    160|#define str_flags _u._s._flags
  |  |  ------------------
  |  |               #define	REGEX_ICASE(m) (((m)->str_flags & STRING_IGNORE_CASE) ? REG_ICASE : 0)
  |  |  ------------------
  |  |  |  |  431|    160|#define STRING_IGNORE_CASE		(STRING_IGNORE_LOWERCASE|STRING_IGNORE_UPPERCASE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  398|    160|#define STRING_IGNORE_LOWERCASE			BIT(2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  395|    160|#define BIT(A)   (1 << (A))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define STRING_IGNORE_CASE		(STRING_IGNORE_LOWERCASE|STRING_IGNORE_UPPERCASE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  399|    160|#define STRING_IGNORE_UPPERCASE			BIT(3)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  395|    160|#define BIT(A)   (1 << (A))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (432:25): [True: 20, False: 140]
  |  |  ------------------
  ------------------
 2160|    160|	if (rc == 0)
  ------------------
  |  Branch (2160:6): [True: 160, False: 0]
  ------------------
 2161|    160|		return rx;
 2162|       |
 2163|      0|	free(rx);
 2164|       |	return NULL;
 2165|    160|}
softmagic.c:handle_annotation:
 2555|   874k|{
 2556|   874k|	if ((ms->flags & MAGIC_APPLE) && m->apple[0]) {
  ------------------
  |  |   45|   874k|#define	MAGIC_APPLE		0x0000800 /* Return the Apple creator/type */
  ------------------
  |  Branch (2556:6): [True: 0, False: 874k]
  |  Branch (2556:35): [True: 0, False: 0]
  ------------------
 2557|      0|		if (!firstline && !(ms->flags & MAGIC_CONTINUE))
  ------------------
  |  |   38|      0|#define	MAGIC_CONTINUE		0x0000020 /* Return all matches */
  ------------------
  |  Branch (2557:7): [True: 0, False: 0]
  |  Branch (2557:21): [True: 0, False: 0]
  ------------------
 2558|      0|			return 1;
 2559|      0|		if (print_sep(ms, firstline) == -1)
  ------------------
  |  Branch (2559:7): [True: 0, False: 0]
  ------------------
 2560|      0|			return -1;
 2561|      0|		if (file_printf(ms, "%.8s", m->apple) == -1)
  ------------------
  |  Branch (2561:7): [True: 0, False: 0]
  ------------------
 2562|      0|			return -1;
 2563|      0|		return 1;
 2564|      0|	}
 2565|   874k|	if ((ms->flags & MAGIC_EXTENSION) && m->ext[0]) {
  ------------------
  |  |   46|   874k|#define	MAGIC_EXTENSION		0x1000000 /* Return a /-separated list of
  ------------------
  |  Branch (2565:6): [True: 0, False: 874k]
  |  Branch (2565:39): [True: 0, False: 0]
  ------------------
 2566|      0|		if (!firstline && !(ms->flags & MAGIC_CONTINUE))
  ------------------
  |  |   38|      0|#define	MAGIC_CONTINUE		0x0000020 /* Return all matches */
  ------------------
  |  Branch (2566:7): [True: 0, False: 0]
  |  Branch (2566:21): [True: 0, False: 0]
  ------------------
 2567|      0|			return 1;
 2568|      0|		if (print_sep(ms, firstline) == -1)
  ------------------
  |  Branch (2568:7): [True: 0, False: 0]
  ------------------
 2569|      0|			return -1;
 2570|      0|		if (file_printf(ms, "%s", m->ext) == -1)
  ------------------
  |  Branch (2570:7): [True: 0, False: 0]
  ------------------
 2571|      0|			return -1;
 2572|      0|		return 1;
 2573|      0|	}
 2574|   874k|	if ((ms->flags & MAGIC_MIME_TYPE) && m->mimetype[0]) {
  ------------------
  |  |   37|   874k|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  ------------------
  |  Branch (2574:6): [True: 0, False: 874k]
  |  Branch (2574:39): [True: 0, False: 0]
  ------------------
 2575|      0|		char buf[1024];
 2576|      0|		const char *p;
 2577|      0|		if (!firstline && !(ms->flags & MAGIC_CONTINUE))
  ------------------
  |  |   38|      0|#define	MAGIC_CONTINUE		0x0000020 /* Return all matches */
  ------------------
  |  Branch (2577:7): [True: 0, False: 0]
  |  Branch (2577:21): [True: 0, False: 0]
  ------------------
 2578|      0|			return 1;
 2579|      0|		if (print_sep(ms, firstline) == -1)
  ------------------
  |  Branch (2579:7): [True: 0, False: 0]
  ------------------
 2580|      0|			return -1;
 2581|      0|		if (varexpand(ms, buf, sizeof(buf), m->mimetype) == -1)
  ------------------
  |  Branch (2581:7): [True: 0, False: 0]
  ------------------
 2582|      0|			p = m->mimetype;
 2583|      0|		else
 2584|      0|			p = buf;
 2585|      0|		if (file_printf(ms, "%s", p) == -1)
  ------------------
  |  Branch (2585:7): [True: 0, False: 0]
  ------------------
 2586|      0|			return -1;
 2587|      0|		return 1;
 2588|      0|	}
 2589|   874k|	return 0;
 2590|   874k|}
softmagic.c:varexpand:
  550|  96.7k|{
  551|  96.7k|	const char *ptr, *sptr, *e, *t, *ee, *et;
  552|  96.7k|	size_t l;
  553|       |
  554|  96.7k|	for (sptr = str; (ptr = strstr(sptr, "${")) != NULL;) {
  ------------------
  |  Branch (554:19): [True: 50, False: 96.7k]
  ------------------
  555|     50|		l = CAST(size_t, ptr - sptr);
  ------------------
  |  |  452|     50|#define CAST(T, b)	((T)(b))
  ------------------
  556|     50|		if (l >= len)
  ------------------
  |  Branch (556:7): [True: 0, False: 50]
  ------------------
  557|      0|			return -1;
  558|     50|		memcpy(buf, sptr, l);
  559|     50|		buf += l;
  560|     50|		len -= l;
  561|     50|		ptr += 2;
  562|     50|		if (!*ptr || ptr[1] != '?')
  ------------------
  |  Branch (562:7): [True: 0, False: 50]
  |  Branch (562:16): [True: 0, False: 50]
  ------------------
  563|      0|			return -1;
  564|    750|		for (et = t = ptr + 2; *et && *et != ':'; et++)
  ------------------
  |  Branch (564:26): [True: 750, False: 0]
  |  Branch (564:33): [True: 700, False: 50]
  ------------------
  565|    700|			continue;
  566|     50|		if (*et != ':')
  ------------------
  |  Branch (566:7): [True: 0, False: 50]
  ------------------
  567|      0|			return -1;
  568|    700|		for (ee = e = et + 1; *ee && *ee != '}'; ee++)
  ------------------
  |  Branch (568:25): [True: 700, False: 0]
  |  Branch (568:32): [True: 650, False: 50]
  ------------------
  569|    650|			continue;
  570|     50|		if (*ee != '}')
  ------------------
  |  Branch (570:7): [True: 0, False: 50]
  ------------------
  571|      0|			return -1;
  572|     50|		switch (*ptr) {
  573|     50|		case 'x':
  ------------------
  |  Branch (573:3): [True: 50, False: 0]
  ------------------
  574|     50|			if (ms->mode & 0111) {
  ------------------
  |  Branch (574:8): [True: 0, False: 50]
  ------------------
  575|      0|				ptr = t;
  576|      0|				l = et - t;
  577|     50|			} else {
  578|     50|				ptr = e;
  579|     50|				l = ee - e;
  580|     50|			}
  581|     50|			break;
  582|      0|		default:
  ------------------
  |  Branch (582:3): [True: 0, False: 50]
  ------------------
  583|      0|			return -1;
  584|     50|		}
  585|     50|		if (l >= len)
  ------------------
  |  Branch (585:7): [True: 0, False: 50]
  ------------------
  586|      0|			return -1;
  587|     50|		memcpy(buf, ptr, l);
  588|     50|		buf += l;
  589|     50|		len -= l;
  590|     50|		sptr = ee + 1;
  591|     50|	}
  592|       |
  593|  96.7k|	l = strlen(sptr);
  594|  96.7k|	if (l >= len)
  ------------------
  |  Branch (594:6): [True: 0, False: 96.7k]
  ------------------
  595|      0|		return -1;
  596|       |
  597|  96.7k|	memcpy(buf, sptr, l);
  598|  96.7k|	buf[l] = '\0';
  599|  96.7k|	return 0;
  600|  96.7k|}
softmagic.c:print_sep:
 2594|  27.7k|{
 2595|  27.7k|	if (firstline)
  ------------------
  |  Branch (2595:6): [True: 8.60k, False: 19.1k]
  ------------------
 2596|  8.60k|		return 0;
 2597|       |	/*
 2598|       |	 * we found another match
 2599|       |	 * put a newline and '-' to do some simple formatting
 2600|       |	 */
 2601|  19.1k|	return file_separator(ms);
 2602|  27.7k|}
softmagic.c:mprint:
  605|  96.7k|{
  606|  96.7k|	uint64_t v;
  607|  96.7k|	float vf;
  608|  96.7k|	double vd;
  609|  96.7k| 	char buf[128], tbuf[26], sbuf[512], ebuf[512];
  610|  96.7k|	const char *desc;
  611|  96.7k|	union VALUETYPE *p = &ms->ms_value;
  612|       |
  613|  96.7k|	if (varexpand(ms, ebuf, sizeof(ebuf), m->desc) == -1)
  ------------------
  |  Branch (613:6): [True: 0, False: 96.7k]
  ------------------
  614|      0|		desc = m->desc;
  615|  96.7k|	else
  616|  96.7k|		desc = ebuf;
  617|       |
  618|  96.7k|#define	PRINTER(value, format, stype, utype)	\
  619|  96.7k|	v = file_signextend(ms, m, CAST(uint64_t, value)); \
  620|  96.7k|	switch (check_fmt(ms, desc)) { \
  621|  96.7k|	case -1: \
  622|  96.7k|		return -1; \
  623|  96.7k|	case 1: \
  624|  96.7k|		if (m->flag & UNSIGNED) { \
  625|  96.7k|			(void)snprintf(buf, sizeof(buf), "%" format "u", \
  626|  96.7k|			    CAST(utype, v)); \
  627|  96.7k|		} else { \
  628|  96.7k|			(void)snprintf(buf, sizeof(buf), "%" format "d", \
  629|  96.7k|			    CAST(stype, v)); \
  630|  96.7k|		} \
  631|  96.7k|		if (file_printf(ms, F(ms, desc, "%s"), buf) == -1) \
  632|  96.7k|			return -1; \
  633|  96.7k|		break; \
  634|  96.7k|	default: \
  635|  96.7k|		if (m->flag & UNSIGNED) { \
  636|  96.7k|		       if (file_printf(ms, F(ms, desc, "%" format "u"), \
  637|  96.7k|			   CAST(utype, v)) == -1) \
  638|  96.7k|			   return -1; \
  639|  96.7k|		} else { \
  640|  96.7k|		       if (file_printf(ms, F(ms, desc, "%" format "d"), \
  641|  96.7k|			   CAST(stype, v)) == -1) \
  642|  96.7k|			   return -1; \
  643|  96.7k|		} \
  644|  96.7k|		break; \
  645|  96.7k|	} \
  646|  96.7k|	break
  647|       |
  648|  96.7k|  	switch (m->type) {
  649|  12.2k|  	case FILE_BYTE:
  ------------------
  |  |  246|  12.2k|#define 			FILE_BYTE		1
  ------------------
  |  Branch (649:4): [True: 12.2k, False: 84.4k]
  ------------------
  650|  12.2k|		PRINTER(p->b, "", int8_t, uint8_t);
  ------------------
  |  |  619|  12.2k|	v = file_signextend(ms, m, CAST(uint64_t, value)); \
  |  |  ------------------
  |  |  |  |  452|  12.2k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  620|  12.2k|	switch (check_fmt(ms, desc)) { \
  |  |  621|      0|	case -1: \
  |  |  ------------------
  |  |  |  Branch (621:2): [True: 0, False: 12.2k]
  |  |  ------------------
  |  |  622|      0|		return -1; \
  |  |  623|      0|	case 1: \
  |  |  ------------------
  |  |  |  Branch (623:2): [True: 0, False: 12.2k]
  |  |  ------------------
  |  |  624|      0|		if (m->flag & UNSIGNED) { \
  |  |  ------------------
  |  |  |  |  229|      0|#define UNSIGNED	0x08	/* comparison is unsigned */
  |  |  ------------------
  |  |  |  Branch (624:7): [True: 0, False: 0]
  |  |  ------------------
  |  |  625|      0|			(void)snprintf(buf, sizeof(buf), "%" format "u", \
  |  |  626|      0|			    CAST(utype, v)); \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  627|      0|		} else { \
  |  |  628|      0|			(void)snprintf(buf, sizeof(buf), "%" format "d", \
  |  |  629|      0|			    CAST(stype, v)); \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  630|      0|		} \
  |  |  631|      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 (631:7): [True: 0, False: 0]
  |  |  ------------------
  |  |  632|      0|			return -1; \
  |  |  633|      0|		break; \
  |  |  634|  12.2k|	default: \
  |  |  ------------------
  |  |  |  Branch (634:2): [True: 12.2k, False: 0]
  |  |  ------------------
  |  |  635|  12.2k|		if (m->flag & UNSIGNED) { \
  |  |  ------------------
  |  |  |  |  229|  12.2k|#define UNSIGNED	0x08	/* comparison is unsigned */
  |  |  ------------------
  |  |  |  Branch (635:7): [True: 5.95k, False: 6.32k]
  |  |  ------------------
  |  |  636|  5.95k|		       if (file_printf(ms, F(ms, desc, "%" format "u"), \
  |  |  ------------------
  |  |  |  |  167|  5.95k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  Branch (636:14): [True: 0, False: 5.95k]
  |  |  ------------------
  |  |  637|  5.95k|			   CAST(utype, v)) == -1) \
  |  |  ------------------
  |  |  |  |  452|  5.95k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  638|  5.95k|			   return -1; \
  |  |  639|  6.32k|		} else { \
  |  |  640|  6.32k|		       if (file_printf(ms, F(ms, desc, "%" format "d"), \
  |  |  ------------------
  |  |  |  |  167|  6.32k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  Branch (640:14): [True: 0, False: 6.32k]
  |  |  ------------------
  |  |  641|  6.32k|			   CAST(stype, v)) == -1) \
  |  |  ------------------
  |  |  |  |  452|  6.32k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  642|  6.32k|			   return -1; \
  |  |  643|  6.32k|		} \
  |  |  644|  12.2k|		break; \
  |  |  645|  12.2k|	} \
  |  |  646|  12.2k|	break
  ------------------
  651|       |
  652|  12.2k|  	case FILE_SHORT:
  ------------------
  |  |  247|  2.05k|#define				FILE_SHORT		2
  ------------------
  |  Branch (652:4): [True: 2.05k, False: 94.6k]
  ------------------
  653|  10.0k|  	case FILE_BESHORT:
  ------------------
  |  |  252|  10.0k|#define				FILE_BESHORT		7
  ------------------
  |  Branch (653:4): [True: 8.00k, False: 88.7k]
  ------------------
  654|  20.5k|  	case FILE_LESHORT:
  ------------------
  |  |  255|  20.5k|#define				FILE_LESHORT		10
  ------------------
  |  Branch (654:4): [True: 10.4k, False: 86.2k]
  ------------------
  655|  20.5k|		PRINTER(p->h, "", int16_t, uint16_t);
  ------------------
  |  |  619|  20.5k|	v = file_signextend(ms, m, CAST(uint64_t, value)); \
  |  |  ------------------
  |  |  |  |  452|  20.5k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  620|  20.5k|	switch (check_fmt(ms, desc)) { \
  |  |  621|      0|	case -1: \
  |  |  ------------------
  |  |  |  Branch (621:2): [True: 0, False: 20.5k]
  |  |  ------------------
  |  |  622|      0|		return -1; \
  |  |  623|      0|	case 1: \
  |  |  ------------------
  |  |  |  Branch (623:2): [True: 0, False: 20.5k]
  |  |  ------------------
  |  |  624|      0|		if (m->flag & UNSIGNED) { \
  |  |  ------------------
  |  |  |  |  229|      0|#define UNSIGNED	0x08	/* comparison is unsigned */
  |  |  ------------------
  |  |  |  Branch (624:7): [True: 0, False: 0]
  |  |  ------------------
  |  |  625|      0|			(void)snprintf(buf, sizeof(buf), "%" format "u", \
  |  |  626|      0|			    CAST(utype, v)); \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  627|      0|		} else { \
  |  |  628|      0|			(void)snprintf(buf, sizeof(buf), "%" format "d", \
  |  |  629|      0|			    CAST(stype, v)); \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  630|      0|		} \
  |  |  631|      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 (631:7): [True: 0, False: 0]
  |  |  ------------------
  |  |  632|      0|			return -1; \
  |  |  633|      0|		break; \
  |  |  634|  20.5k|	default: \
  |  |  ------------------
  |  |  |  Branch (634:2): [True: 20.5k, False: 0]
  |  |  ------------------
  |  |  635|  20.5k|		if (m->flag & UNSIGNED) { \
  |  |  ------------------
  |  |  |  |  229|  20.5k|#define UNSIGNED	0x08	/* comparison is unsigned */
  |  |  ------------------
  |  |  |  Branch (635:7): [True: 11.6k, False: 8.86k]
  |  |  ------------------
  |  |  636|  11.6k|		       if (file_printf(ms, F(ms, desc, "%" format "u"), \
  |  |  ------------------
  |  |  |  |  167|  11.6k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  Branch (636:14): [True: 0, False: 11.6k]
  |  |  ------------------
  |  |  637|  11.6k|			   CAST(utype, v)) == -1) \
  |  |  ------------------
  |  |  |  |  452|  11.6k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  638|  11.6k|			   return -1; \
  |  |  639|  11.6k|		} else { \
  |  |  640|  8.86k|		       if (file_printf(ms, F(ms, desc, "%" format "d"), \
  |  |  ------------------
  |  |  |  |  167|  8.86k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  Branch (640:14): [True: 0, False: 8.86k]
  |  |  ------------------
  |  |  641|  8.86k|			   CAST(stype, v)) == -1) \
  |  |  ------------------
  |  |  |  |  452|  8.86k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  642|  8.86k|			   return -1; \
  |  |  643|  8.86k|		} \
  |  |  644|  20.5k|		break; \
  |  |  645|  20.5k|	} \
  |  |  646|  20.5k|	break
  ------------------
  656|       |
  657|  20.5k|  	case FILE_LONG:
  ------------------
  |  |  249|    570|#define				FILE_LONG		4
  ------------------
  |  Branch (657:4): [True: 570, False: 96.1k]
  ------------------
  658|  8.02k|  	case FILE_BELONG:
  ------------------
  |  |  253|  8.02k|#define				FILE_BELONG		8
  ------------------
  |  Branch (658:4): [True: 7.45k, False: 89.2k]
  ------------------
  659|  28.0k|  	case FILE_LELONG:
  ------------------
  |  |  256|  28.0k|#define				FILE_LELONG		11
  ------------------
  |  Branch (659:4): [True: 20.0k, False: 76.6k]
  ------------------
  660|  28.1k|  	case FILE_MELONG:
  ------------------
  |  |  268|  28.1k|#define				FILE_MELONG		23
  ------------------
  |  Branch (660:4): [True: 41, False: 96.6k]
  ------------------
  661|  28.1k|		PRINTER(p->l, "", int32_t, uint32_t);
  ------------------
  |  |  619|  28.1k|	v = file_signextend(ms, m, CAST(uint64_t, value)); \
  |  |  ------------------
  |  |  |  |  452|  28.1k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  620|  28.1k|	switch (check_fmt(ms, desc)) { \
  |  |  621|      0|	case -1: \
  |  |  ------------------
  |  |  |  Branch (621:2): [True: 0, False: 28.1k]
  |  |  ------------------
  |  |  622|      0|		return -1; \
  |  |  623|      0|	case 1: \
  |  |  ------------------
  |  |  |  Branch (623:2): [True: 0, False: 28.1k]
  |  |  ------------------
  |  |  624|      0|		if (m->flag & UNSIGNED) { \
  |  |  ------------------
  |  |  |  |  229|      0|#define UNSIGNED	0x08	/* comparison is unsigned */
  |  |  ------------------
  |  |  |  Branch (624:7): [True: 0, False: 0]
  |  |  ------------------
  |  |  625|      0|			(void)snprintf(buf, sizeof(buf), "%" format "u", \
  |  |  626|      0|			    CAST(utype, v)); \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  627|      0|		} else { \
  |  |  628|      0|			(void)snprintf(buf, sizeof(buf), "%" format "d", \
  |  |  629|      0|			    CAST(stype, v)); \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  630|      0|		} \
  |  |  631|      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 (631:7): [True: 0, False: 0]
  |  |  ------------------
  |  |  632|      0|			return -1; \
  |  |  633|      0|		break; \
  |  |  634|  28.1k|	default: \
  |  |  ------------------
  |  |  |  Branch (634:2): [True: 28.1k, False: 0]
  |  |  ------------------
  |  |  635|  28.1k|		if (m->flag & UNSIGNED) { \
  |  |  ------------------
  |  |  |  |  229|  28.1k|#define UNSIGNED	0x08	/* comparison is unsigned */
  |  |  ------------------
  |  |  |  Branch (635:7): [True: 5.56k, False: 22.5k]
  |  |  ------------------
  |  |  636|  5.56k|		       if (file_printf(ms, F(ms, desc, "%" format "u"), \
  |  |  ------------------
  |  |  |  |  167|  5.56k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  Branch (636:14): [True: 0, False: 5.56k]
  |  |  ------------------
  |  |  637|  5.56k|			   CAST(utype, v)) == -1) \
  |  |  ------------------
  |  |  |  |  452|  5.56k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  638|  5.56k|			   return -1; \
  |  |  639|  22.5k|		} else { \
  |  |  640|  22.5k|		       if (file_printf(ms, F(ms, desc, "%" format "d"), \
  |  |  ------------------
  |  |  |  |  167|  22.5k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  Branch (640:14): [True: 0, False: 22.5k]
  |  |  ------------------
  |  |  641|  22.5k|			   CAST(stype, v)) == -1) \
  |  |  ------------------
  |  |  |  |  452|  22.5k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  642|  22.5k|			   return -1; \
  |  |  643|  22.5k|		} \
  |  |  644|  28.1k|		break; \
  |  |  645|  28.1k|	} \
  |  |  646|  28.1k|	break
  ------------------
  662|       |
  663|  28.1k|  	case FILE_QUAD:
  ------------------
  |  |  269|     93|#define				FILE_QUAD		24
  ------------------
  |  Branch (663:4): [True: 93, False: 96.6k]
  ------------------
  664|    686|  	case FILE_BEQUAD:
  ------------------
  |  |  271|    686|#define				FILE_BEQUAD		26
  ------------------
  |  Branch (664:4): [True: 593, False: 96.1k]
  ------------------
  665|  2.99k|  	case FILE_LEQUAD:
  ------------------
  |  |  270|  2.99k|#define				FILE_LEQUAD		25
  ------------------
  |  Branch (665:4): [True: 2.30k, False: 94.4k]
  ------------------
  666|  3.05k|	case FILE_OFFSET:
  ------------------
  |  |  297|  3.05k|#define				FILE_OFFSET		52
  ------------------
  |  Branch (666:2): [True: 64, False: 96.6k]
  ------------------
  667|  3.05k|		PRINTER(p->q, INT64_T_FORMAT, long long, unsigned long long);
  ------------------
  |  |  619|  3.05k|	v = file_signextend(ms, m, CAST(uint64_t, value)); \
  |  |  ------------------
  |  |  |  |  452|  3.05k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  620|  3.05k|	switch (check_fmt(ms, desc)) { \
  |  |  621|      0|	case -1: \
  |  |  ------------------
  |  |  |  Branch (621:2): [True: 0, False: 3.05k]
  |  |  ------------------
  |  |  622|      0|		return -1; \
  |  |  623|      0|	case 1: \
  |  |  ------------------
  |  |  |  Branch (623:2): [True: 0, False: 3.05k]
  |  |  ------------------
  |  |  624|      0|		if (m->flag & UNSIGNED) { \
  |  |  ------------------
  |  |  |  |  229|      0|#define UNSIGNED	0x08	/* comparison is unsigned */
  |  |  ------------------
  |  |  |  Branch (624:7): [True: 0, False: 0]
  |  |  ------------------
  |  |  625|      0|			(void)snprintf(buf, sizeof(buf), "%" format "u", \
  |  |  626|      0|			    CAST(utype, v)); \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  627|      0|		} else { \
  |  |  628|      0|			(void)snprintf(buf, sizeof(buf), "%" format "d", \
  |  |  629|      0|			    CAST(stype, v)); \
  |  |  ------------------
  |  |  |  |  452|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  630|      0|		} \
  |  |  631|      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 (631:7): [True: 0, False: 0]
  |  |  ------------------
  |  |  632|      0|			return -1; \
  |  |  633|      0|		break; \
  |  |  634|  3.05k|	default: \
  |  |  ------------------
  |  |  |  Branch (634:2): [True: 3.05k, False: 0]
  |  |  ------------------
  |  |  635|  3.05k|		if (m->flag & UNSIGNED) { \
  |  |  ------------------
  |  |  |  |  229|  3.05k|#define UNSIGNED	0x08	/* comparison is unsigned */
  |  |  ------------------
  |  |  |  Branch (635:7): [True: 726, False: 2.33k]
  |  |  ------------------
  |  |  636|    726|		       if (file_printf(ms, F(ms, desc, "%" format "u"), \
  |  |  ------------------
  |  |  |  |  167|    726|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  Branch (636:14): [True: 0, False: 726]
  |  |  ------------------
  |  |  637|    726|			   CAST(utype, v)) == -1) \
  |  |  ------------------
  |  |  |  |  452|    726|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  638|    726|			   return -1; \
  |  |  639|  2.33k|		} else { \
  |  |  640|  2.33k|		       if (file_printf(ms, F(ms, desc, "%" format "d"), \
  |  |  ------------------
  |  |  |  |  167|  2.33k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  Branch (640:14): [True: 0, False: 2.33k]
  |  |  ------------------
  |  |  641|  2.33k|			   CAST(stype, v)) == -1) \
  |  |  ------------------
  |  |  |  |  452|  2.33k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  642|  2.33k|			   return -1; \
  |  |  643|  2.33k|		} \
  |  |  644|  3.05k|		break; \
  |  |  645|  3.05k|	} \
  |  |  646|  3.05k|	break
  ------------------
  668|       |
  669|  18.4k|  	case FILE_STRING:
  ------------------
  |  |  250|  18.4k|#define				FILE_STRING		5
  ------------------
  |  Branch (669:4): [True: 18.4k, False: 78.2k]
  ------------------
  670|  21.2k|  	case FILE_PSTRING:
  ------------------
  |  |  258|  21.2k|#define				FILE_PSTRING		13
  ------------------
  |  Branch (670:4): [True: 2.76k, False: 93.9k]
  ------------------
  671|  21.3k|  	case FILE_BESTRING16:
  ------------------
  |  |  263|  21.3k|#define				FILE_BESTRING16		18
  ------------------
  |  Branch (671:4): [True: 85, False: 96.6k]
  ------------------
  672|  21.6k|  	case FILE_LESTRING16:
  ------------------
  |  |  264|  21.6k|#define				FILE_LESTRING16		19
  ------------------
  |  Branch (672:4): [True: 356, False: 96.3k]
  ------------------
  673|  21.6k|		if (m->reln == '=' || m->reln == '!') {
  ------------------
  |  Branch (673:7): [True: 9.60k, False: 12.0k]
  |  Branch (673:25): [True: 325, False: 11.7k]
  ------------------
  674|  9.93k|			if (file_printf(ms, F(ms, desc, "%s"),
  ------------------
  |  |  167|  9.93k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (674:8): [True: 0, False: 9.93k]
  ------------------
  675|  9.93k|			    file_printable(ms, sbuf, sizeof(sbuf), m->value.s,
  676|  9.93k|			    sizeof(m->value.s))) == -1)
  677|      0|				return -1;
  678|  9.93k|		}
  679|  11.7k|		else {
  680|  11.7k|			char *str = p->s;
  681|       |
  682|       |			/* compute t before we mangle the string? */
  683|       |
  684|  11.7k|			if (*m->value.s == '\0')
  ------------------
  |  Branch (684:8): [True: 10.4k, False: 1.33k]
  ------------------
  685|  10.4k|				str[strcspn(str, "\r\n")] = '\0';
  686|       |
  687|  11.7k|			if (m->str_flags & STRING_TRIM)
  ------------------
  |  |  382|  11.7k|#define str_flags _u._s._flags
  ------------------
              			if (m->str_flags & STRING_TRIM)
  ------------------
  |  |  413|  11.7k|#define	STRING_TRIM				BIT(13)
  |  |  ------------------
  |  |  |  |  395|  11.7k|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (687:8): [True: 507, False: 11.2k]
  ------------------
  688|    507|				str = file_strtrim(str);
  689|       |
  690|  11.7k|			if (file_printf(ms, F(ms, desc, "%s"),
  ------------------
  |  |  167|  11.7k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (690:8): [True: 0, False: 11.7k]
  ------------------
  691|  11.7k|			    file_printable(ms, sbuf, sizeof(sbuf), str,
  692|  11.7k|				sizeof(p->s) - (str - p->s))) == -1)
  693|      0|				return -1;
  694|       |
  695|  11.7k|			if (m->type == FILE_PSTRING) {
  ------------------
  |  |  258|  11.7k|#define				FILE_PSTRING		13
  ------------------
  |  Branch (695:8): [True: 2.66k, False: 9.07k]
  ------------------
  696|  2.66k|				size_t l = file_pstring_length_size(ms, m);
  697|  2.66k|				if (l == FILE_BADSIZE)
  ------------------
  |  |  175|  2.66k|#define FILE_BADSIZE CAST(size_t, ~0ul)
  |  |  ------------------
  |  |  |  |  452|  2.66k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (697:9): [True: 0, False: 2.66k]
  ------------------
  698|      0|					return -1;
  699|  2.66k|			}
  700|  11.7k|		}
  701|  21.6k|		break;
  702|       |
  703|  21.6k|	case FILE_DATE:
  ------------------
  |  |  251|      0|#define				FILE_DATE		6
  ------------------
  |  Branch (703:2): [True: 0, False: 96.7k]
  ------------------
  704|    325|	case FILE_BEDATE:
  ------------------
  |  |  254|    325|#define				FILE_BEDATE		9
  ------------------
  |  Branch (704:2): [True: 325, False: 96.3k]
  ------------------
  705|    494|	case FILE_LEDATE:
  ------------------
  |  |  257|    494|#define				FILE_LEDATE		12
  ------------------
  |  Branch (705:2): [True: 169, False: 96.5k]
  ------------------
  706|    669|	case FILE_MEDATE:
  ------------------
  |  |  266|    669|#define				FILE_MEDATE		21
  ------------------
  |  Branch (706:2): [True: 175, False: 96.5k]
  ------------------
  707|    669|		if (file_printf(ms, F(ms, desc, "%s"),
  ------------------
  |  |  167|    669|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (707:7): [True: 0, False: 669]
  ------------------
  708|    669|		    file_fmtdatetime(tbuf, sizeof(tbuf), p->l, 0)) == -1)
  709|      0|			return -1;
  710|    669|		break;
  711|       |
  712|    669|	case FILE_LDATE:
  ------------------
  |  |  259|      0|#define				FILE_LDATE		14
  ------------------
  |  Branch (712:2): [True: 0, False: 96.7k]
  ------------------
  713|    218|	case FILE_BELDATE:
  ------------------
  |  |  260|    218|#define				FILE_BELDATE		15
  ------------------
  |  Branch (713:2): [True: 218, False: 96.5k]
  ------------------
  714|    305|	case FILE_LELDATE:
  ------------------
  |  |  261|    305|#define				FILE_LELDATE		16
  ------------------
  |  Branch (714:2): [True: 87, False: 96.6k]
  ------------------
  715|    305|	case FILE_MELDATE:
  ------------------
  |  |  267|    305|#define				FILE_MELDATE		22
  ------------------
  |  Branch (715:2): [True: 0, False: 96.7k]
  ------------------
  716|    305|		if (file_printf(ms, F(ms, desc, "%s"),
  ------------------
  |  |  167|    305|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (716:7): [True: 0, False: 305]
  ------------------
  717|    305|		    file_fmtdatetime(tbuf, sizeof(tbuf), p->l, FILE_T_LOCAL))
  ------------------
  |  |  540|    305|#define FILE_T_LOCAL	1
  ------------------
  718|    305|			== -1)
  719|      0|			return -1;
  720|    305|		break;
  721|       |
  722|    305|	case FILE_QDATE:
  ------------------
  |  |  272|      0|#define				FILE_QDATE		27
  ------------------
  |  Branch (722:2): [True: 0, False: 96.7k]
  ------------------
  723|  1.29k|	case FILE_BEQDATE:
  ------------------
  |  |  274|  1.29k|#define				FILE_BEQDATE		29
  ------------------
  |  Branch (723:2): [True: 1.29k, False: 95.4k]
  ------------------
  724|  1.32k|	case FILE_LEQDATE:
  ------------------
  |  |  273|  1.32k|#define				FILE_LEQDATE		28
  ------------------
  |  Branch (724:2): [True: 37, False: 96.6k]
  ------------------
  725|  1.32k|		if (file_printf(ms, F(ms, desc, "%s"),
  ------------------
  |  |  167|  1.32k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (725:7): [True: 0, False: 1.32k]
  ------------------
  726|  1.32k|		    file_fmtdatetime(tbuf, sizeof(tbuf), p->q, 0)) == -1)
  727|      0|			return -1;
  728|  1.32k|		break;
  729|       |
  730|  1.32k|	case FILE_QLDATE:
  ------------------
  |  |  275|      0|#define				FILE_QLDATE		30
  ------------------
  |  Branch (730:2): [True: 0, False: 96.7k]
  ------------------
  731|    201|	case FILE_BEQLDATE:
  ------------------
  |  |  277|    201|#define				FILE_BEQLDATE		32
  ------------------
  |  Branch (731:2): [True: 201, False: 96.5k]
  ------------------
  732|    647|	case FILE_LEQLDATE:
  ------------------
  |  |  276|    647|#define				FILE_LEQLDATE		31
  ------------------
  |  Branch (732:2): [True: 446, False: 96.2k]
  ------------------
  733|    647|		if (file_printf(ms, F(ms, desc, "%s"),
  ------------------
  |  |  167|    647|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (733:7): [True: 0, False: 647]
  ------------------
  734|    647|		    file_fmtdatetime(tbuf, sizeof(tbuf), p->q, FILE_T_LOCAL)) == -1)
  ------------------
  |  |  540|    647|#define FILE_T_LOCAL	1
  ------------------
  735|      0|			return -1;
  736|    647|		break;
  737|       |
  738|    647|	case FILE_QWDATE:
  ------------------
  |  |  287|    115|#define				FILE_QWDATE		42
  ------------------
  |  Branch (738:2): [True: 115, False: 96.6k]
  ------------------
  739|    115|	case FILE_BEQWDATE:
  ------------------
  |  |  289|    115|#define				FILE_BEQWDATE		44
  ------------------
  |  Branch (739:2): [True: 0, False: 96.7k]
  ------------------
  740|  1.58k|	case FILE_LEQWDATE:
  ------------------
  |  |  288|  1.58k|#define				FILE_LEQWDATE		43
  ------------------
  |  Branch (740:2): [True: 1.47k, False: 95.2k]
  ------------------
  741|  1.58k|		if (file_printf(ms, F(ms, desc, "%s"),
  ------------------
  |  |  167|  1.58k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (741:7): [True: 0, False: 1.58k]
  ------------------
  742|  1.58k|		    file_fmtdatetime(tbuf, sizeof(tbuf), p->q, FILE_T_WINDOWS))
  ------------------
  |  |  541|  1.58k|#define FILE_T_WINDOWS	2
  ------------------
  743|  1.58k|		    == -1)
  744|      0|			return -1;
  745|  1.58k|		break;
  746|       |
  747|  1.58k|	case FILE_FLOAT:
  ------------------
  |  |  278|      0|#define				FILE_FLOAT		33
  ------------------
  |  Branch (747:2): [True: 0, False: 96.7k]
  ------------------
  748|      0|	case FILE_BEFLOAT:
  ------------------
  |  |  279|      0|#define				FILE_BEFLOAT		34
  ------------------
  |  Branch (748:2): [True: 0, False: 96.7k]
  ------------------
  749|  1.24k|	case FILE_LEFLOAT:
  ------------------
  |  |  280|  1.24k|#define				FILE_LEFLOAT		35
  ------------------
  |  Branch (749:2): [True: 1.24k, False: 95.4k]
  ------------------
  750|  1.24k|		vf = p->f;
  751|  1.24k|		switch (check_fmt(ms, desc)) {
  752|      0|		case -1:
  ------------------
  |  Branch (752:3): [True: 0, False: 1.24k]
  ------------------
  753|      0|			return -1;
  754|      0|		case 1:
  ------------------
  |  Branch (754:3): [True: 0, False: 1.24k]
  ------------------
  755|      0|			(void)snprintf(buf, sizeof(buf), "%g", vf);
  756|      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 (756:8): [True: 0, False: 0]
  ------------------
  757|      0|				return -1;
  758|      0|			break;
  759|  1.24k|		default:
  ------------------
  |  Branch (759:3): [True: 1.24k, False: 0]
  ------------------
  760|  1.24k|			if (file_printf(ms, F(ms, desc, "%g"), vf) == -1)
  ------------------
  |  |  167|  1.24k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (760:8): [True: 0, False: 1.24k]
  ------------------
  761|      0|				return -1;
  762|  1.24k|			break;
  763|  1.24k|		}
  764|  1.24k|  		break;
  765|       |
  766|  1.24k|	case FILE_DOUBLE:
  ------------------
  |  |  281|      0|#define				FILE_DOUBLE		36
  ------------------
  |  Branch (766:2): [True: 0, False: 96.7k]
  ------------------
  767|      0|	case FILE_BEDOUBLE:
  ------------------
  |  |  282|      0|#define				FILE_BEDOUBLE		37
  ------------------
  |  Branch (767:2): [True: 0, False: 96.7k]
  ------------------
  768|    583|	case FILE_LEDOUBLE:
  ------------------
  |  |  283|    583|#define				FILE_LEDOUBLE		38
  ------------------
  |  Branch (768:2): [True: 583, False: 96.1k]
  ------------------
  769|    583|		vd = p->d;
  770|    583|		switch (check_fmt(ms, desc)) {
  771|      0|		case -1:
  ------------------
  |  Branch (771:3): [True: 0, False: 583]
  ------------------
  772|      0|			return -1;
  773|      0|		case 1:
  ------------------
  |  Branch (773:3): [True: 0, False: 583]
  ------------------
  774|      0|			(void)snprintf(buf, sizeof(buf), "%g", vd);
  775|      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 (775:8): [True: 0, False: 0]
  ------------------
  776|      0|				return -1;
  777|      0|			break;
  778|    583|		default:
  ------------------
  |  Branch (778:3): [True: 583, False: 0]
  ------------------
  779|    583|			if (file_printf(ms, F(ms, desc, "%g"), vd) == -1)
  ------------------
  |  |  167|    583|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (779:8): [True: 0, False: 583]
  ------------------
  780|      0|				return -1;
  781|    583|			break;
  782|    583|		}
  783|    583|  		break;
  784|       |
  785|    583|	case FILE_SEARCH:
  ------------------
  |  |  265|    396|#define				FILE_SEARCH		20
  ------------------
  |  Branch (785:2): [True: 396, False: 96.3k]
  ------------------
  786|  1.12k|	case FILE_REGEX: {
  ------------------
  |  |  262|  1.12k|#define				FILE_REGEX		17
  ------------------
  |  Branch (786:2): [True: 729, False: 95.9k]
  ------------------
  787|  1.12k|		char *cp, *scp;
  788|  1.12k|		int rval;
  789|       |
  790|  1.12k|		cp = strndup(RCAST(const char *, ms->search.s),
  ------------------
  |  |  453|  1.12k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
  791|  1.12k|		    ms->search.rm_len);
  792|  1.12k|		if (cp == NULL) {
  ------------------
  |  Branch (792:7): [True: 0, False: 1.12k]
  ------------------
  793|      0|			file_oomem(ms, ms->search.rm_len);
  794|      0|			return -1;
  795|      0|		}
  796|  1.12k|		scp = (m->str_flags & STRING_TRIM) ? file_strtrim(cp) : cp;
  ------------------
  |  |  382|  1.12k|#define str_flags _u._s._flags
  ------------------
              		scp = (m->str_flags & STRING_TRIM) ? file_strtrim(cp) : cp;
  ------------------
  |  |  413|  1.12k|#define	STRING_TRIM				BIT(13)
  |  |  ------------------
  |  |  |  |  395|  1.12k|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (796:9): [True: 82, False: 1.04k]
  ------------------
  797|       |
  798|  1.12k|		rval = file_printf(ms, F(ms, desc, "%s"), file_printable(ms,
  ------------------
  |  |  167|  1.12k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  799|  1.12k|		    sbuf, sizeof(sbuf), scp, ms->search.rm_len));
  800|  1.12k|		free(cp);
  801|       |
  802|  1.12k|		if (rval == -1)
  ------------------
  |  Branch (802:7): [True: 0, False: 1.12k]
  ------------------
  803|      0|			return -1;
  804|  1.12k|		break;
  805|  1.12k|	}
  806|       |
  807|  1.60k|	case FILE_DEFAULT:
  ------------------
  |  |  248|  1.60k|#define				FILE_DEFAULT		3
  ------------------
  |  Branch (807:2): [True: 1.60k, False: 95.1k]
  ------------------
  808|  1.79k|	case FILE_CLEAR:
  ------------------
  |  |  292|  1.79k|#define				FILE_CLEAR		47
  ------------------
  |  Branch (808:2): [True: 192, False: 96.5k]
  ------------------
  809|  1.79k|	  	if (file_printf(ms, "%s", m->desc) == -1)
  ------------------
  |  Branch (809:9): [True: 0, False: 1.79k]
  ------------------
  810|      0|			return -1;
  811|  1.79k|		break;
  812|       |
  813|  1.79k|	case FILE_INDIRECT:
  ------------------
  |  |  286|     59|#define				FILE_INDIRECT		41
  ------------------
  |  Branch (813:2): [True: 59, False: 96.6k]
  ------------------
  814|    111|	case FILE_USE:
  ------------------
  |  |  291|    111|#define				FILE_USE		46
  ------------------
  |  Branch (814:2): [True: 52, False: 96.6k]
  ------------------
  815|    941|	case FILE_NAME:
  ------------------
  |  |  290|    941|#define				FILE_NAME		45
  ------------------
  |  Branch (815:2): [True: 830, False: 95.8k]
  ------------------
  816|    941|		break;
  817|    406|	case FILE_DER:
  ------------------
  |  |  293|    406|#define				FILE_DER		48
  ------------------
  |  Branch (817:2): [True: 406, False: 96.3k]
  ------------------
  818|    406|		if (file_printf(ms, F(ms, desc, "%s"),
  ------------------
  |  |  167|    406|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (818:7): [True: 0, False: 406]
  ------------------
  819|    406|		    file_printable(ms, sbuf, sizeof(sbuf), ms->ms_value.s,
  820|    406|			sizeof(ms->ms_value.s))) == -1)
  821|      0|			return -1;
  822|    406|		break;
  823|    406|	case FILE_GUID:
  ------------------
  |  |  294|    177|#define				FILE_GUID		49
  ------------------
  |  Branch (823:2): [True: 177, False: 96.5k]
  ------------------
  824|    177|	case FILE_LEGUID:
  ------------------
  |  |  295|    177|#define				FILE_LEGUID		50
  ------------------
  |  Branch (824:2): [True: 0, False: 96.7k]
  ------------------
  825|    177|		(void) file_print_leguid(buf, sizeof(buf), ms->ms_value.guid);
  826|    177|		if (file_printf(ms, F(ms, desc, "%s"), buf) == -1)
  ------------------
  |  |  167|    177|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (826:7): [True: 0, False: 177]
  ------------------
  827|      0|			return -1;
  828|    177|		break;
  829|    177|	case FILE_BEGUID:
  ------------------
  |  |  296|      0|#define				FILE_BEGUID		51
  ------------------
  |  Branch (829:2): [True: 0, False: 96.7k]
  ------------------
  830|      0|		(void) file_print_beguid(buf, sizeof(buf), ms->ms_value.guid);
  831|      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 (831:7): [True: 0, False: 0]
  ------------------
  832|      0|			return -1;
  833|      0|		break;
  834|      0|	case FILE_MSDOSDATE:
  ------------------
  |  |  300|      0|#define				FILE_MSDOSDATE		55
  ------------------
  |  Branch (834:2): [True: 0, False: 96.7k]
  ------------------
  835|      0|	case FILE_BEMSDOSDATE:
  ------------------
  |  |  302|      0|#define				FILE_BEMSDOSDATE	57
  ------------------
  |  Branch (835:2): [True: 0, False: 96.7k]
  ------------------
  836|    135|	case FILE_LEMSDOSDATE:
  ------------------
  |  |  301|    135|#define				FILE_LEMSDOSDATE	56
  ------------------
  |  Branch (836:2): [True: 135, False: 96.5k]
  ------------------
  837|    135|		if (file_printf(ms, F(ms, desc, "%s"),
  ------------------
  |  |  167|    135|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (837:7): [True: 0, False: 135]
  ------------------
  838|    135|		    file_fmtdate(tbuf, sizeof(tbuf), p->h)) == -1)
  839|      0|			return -1;
  840|    135|		break;
  841|    135|	case FILE_MSDOSTIME:
  ------------------
  |  |  303|      0|#define				FILE_MSDOSTIME		58
  ------------------
  |  Branch (841:2): [True: 0, False: 96.7k]
  ------------------
  842|      0|	case FILE_BEMSDOSTIME:
  ------------------
  |  |  305|      0|#define				FILE_BEMSDOSTIME	60
  ------------------
  |  Branch (842:2): [True: 0, False: 96.7k]
  ------------------
  843|    135|	case FILE_LEMSDOSTIME:
  ------------------
  |  |  304|    135|#define				FILE_LEMSDOSTIME	59
  ------------------
  |  Branch (843:2): [True: 135, False: 96.5k]
  ------------------
  844|    135|		if (file_printf(ms, F(ms, desc, "%s"),
  ------------------
  |  |  167|    135|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (844:7): [True: 0, False: 135]
  ------------------
  845|    135|		    file_fmttime(tbuf, sizeof(tbuf), p->h)) == -1)
  846|      0|			return -1;
  847|    135|		break;
  848|    135|	case FILE_OCTAL:
  ------------------
  |  |  306|      0|#define				FILE_OCTAL		61
  ------------------
  |  Branch (848:2): [True: 0, False: 96.7k]
  ------------------
  849|      0|		file_fmtnum(buf, sizeof(buf), m->value.s, 8);
  850|      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 (850:7): [True: 0, False: 0]
  ------------------
  851|      0|			return -1;
  852|      0|		break;
  853|      0|	default:
  ------------------
  |  Branch (853:2): [True: 0, False: 96.7k]
  ------------------
  854|      0|		file_magerror(ms, "invalid m->type (%d) in mprint()", m->type);
  855|      0|		return -1;
  856|  96.7k|	}
  857|  96.7k|	return 0;
  858|  96.7k|}
softmagic.c:check_fmt:
  509|  65.8k|{
  510|  65.8k|	file_regex_t rx;
  511|  65.8k|	int rc, rv = -1;
  512|  65.8k|        const char* pat = "%[-0-9\\.]*s";
  513|       |
  514|  65.8k|	if (strchr(fmt, '%') == NULL)
  ------------------
  |  Branch (514:6): [True: 30.9k, False: 34.8k]
  ------------------
  515|  30.9k|		return 0;
  516|       |
  517|  34.8k|	rc = file_regcomp(ms, &rx, pat, REG_EXTENDED|REG_NOSUB);
  518|  34.8k|	if (rc == 0) {
  ------------------
  |  Branch (518:6): [True: 34.8k, False: 0]
  ------------------
  519|  34.8k|		rc = file_regexec(ms, &rx, fmt, 0, 0, 0);
  520|  34.8k|		rv = !rc;
  521|  34.8k|	}
  522|  34.8k|	file_regfree(&rx);
  523|  34.8k|	return rv;
  524|  65.8k|}
softmagic.c:moffset:
  863|   874k|{
  864|   874k|	int32_t o;
  865|   874k|	size_t vlen;
  866|       |
  867|   874k|  	switch (m->type) {
  868|   277k|  	case FILE_BYTE:
  ------------------
  |  |  246|   277k|#define 			FILE_BYTE		1
  ------------------
  |  Branch (868:4): [True: 277k, False: 596k]
  ------------------
  869|   277k|		o = CAST(int32_t, (ms->offset + sizeof(char)));
  ------------------
  |  |  452|   277k|#define CAST(T, b)	((T)(b))
  ------------------
  870|   277k|		break;
  871|       |
  872|  26.2k|  	case FILE_SHORT:
  ------------------
  |  |  247|  26.2k|#define				FILE_SHORT		2
  ------------------
  |  Branch (872:4): [True: 26.2k, False: 848k]
  ------------------
  873|  73.9k|  	case FILE_BESHORT:
  ------------------
  |  |  252|  73.9k|#define				FILE_BESHORT		7
  ------------------
  |  Branch (873:4): [True: 47.6k, False: 826k]
  ------------------
  874|   139k|  	case FILE_LESHORT:
  ------------------
  |  |  255|   139k|#define				FILE_LESHORT		10
  ------------------
  |  Branch (874:4): [True: 66.0k, False: 808k]
  ------------------
  875|   139k|	case FILE_MSDOSDATE:
  ------------------
  |  |  300|   139k|#define				FILE_MSDOSDATE		55
  ------------------
  |  Branch (875:2): [True: 0, False: 874k]
  ------------------
  876|   140k|	case FILE_LEMSDOSDATE:
  ------------------
  |  |  301|   140k|#define				FILE_LEMSDOSDATE	56
  ------------------
  |  Branch (876:2): [True: 135, False: 874k]
  ------------------
  877|   140k|	case FILE_BEMSDOSDATE:
  ------------------
  |  |  302|   140k|#define				FILE_BEMSDOSDATE	57
  ------------------
  |  Branch (877:2): [True: 0, False: 874k]
  ------------------
  878|   140k|	case FILE_MSDOSTIME:
  ------------------
  |  |  303|   140k|#define				FILE_MSDOSTIME		58
  ------------------
  |  Branch (878:2): [True: 0, False: 874k]
  ------------------
  879|   140k|	case FILE_LEMSDOSTIME:
  ------------------
  |  |  304|   140k|#define				FILE_LEMSDOSTIME	59
  ------------------
  |  Branch (879:2): [True: 135, False: 874k]
  ------------------
  880|   140k|	case FILE_BEMSDOSTIME:
  ------------------
  |  |  305|   140k|#define				FILE_BEMSDOSTIME	60
  ------------------
  |  Branch (880:2): [True: 0, False: 874k]
  ------------------
  881|   140k|		o = CAST(int32_t, (ms->offset + sizeof(short)));
  ------------------
  |  |  452|   140k|#define CAST(T, b)	((T)(b))
  ------------------
  882|   140k|		break;
  883|       |
  884|  10.0k|  	case FILE_LONG:
  ------------------
  |  |  249|  10.0k|#define				FILE_LONG		4
  ------------------
  |  Branch (884:4): [True: 10.0k, False: 864k]
  ------------------
  885|   102k|  	case FILE_BELONG:
  ------------------
  |  |  253|   102k|#define				FILE_BELONG		8
  ------------------
  |  Branch (885:4): [True: 92.3k, False: 782k]
  ------------------
  886|   188k|  	case FILE_LELONG:
  ------------------
  |  |  256|   188k|#define				FILE_LELONG		11
  ------------------
  |  Branch (886:4): [True: 86.4k, False: 788k]
  ------------------
  887|   188k|  	case FILE_MELONG:
  ------------------
  |  |  268|   188k|#define				FILE_MELONG		23
  ------------------
  |  Branch (887:4): [True: 41, False: 874k]
  ------------------
  888|   188k|		o = CAST(int32_t, (ms->offset + sizeof(int32_t)));
  ------------------
  |  |  452|   188k|#define CAST(T, b)	((T)(b))
  ------------------
  889|   188k|		break;
  890|       |
  891|  30.7k|  	case FILE_QUAD:
  ------------------
  |  |  269|  30.7k|#define				FILE_QUAD		24
  ------------------
  |  Branch (891:4): [True: 30.7k, False: 843k]
  ------------------
  892|  35.5k|  	case FILE_BEQUAD:
  ------------------
  |  |  271|  35.5k|#define				FILE_BEQUAD		26
  ------------------
  |  Branch (892:4): [True: 4.79k, False: 869k]
  ------------------
  893|  38.1k|  	case FILE_LEQUAD:
  ------------------
  |  |  270|  38.1k|#define				FILE_LEQUAD		25
  ------------------
  |  Branch (893:4): [True: 2.62k, False: 871k]
  ------------------
  894|  38.1k|		o = CAST(int32_t, (ms->offset + sizeof(int64_t)));
  ------------------
  |  |  452|  38.1k|#define CAST(T, b)	((T)(b))
  ------------------
  895|  38.1k|		break;
  896|       |
  897|  75.1k|  	case FILE_STRING:
  ------------------
  |  |  250|  75.1k|#define				FILE_STRING		5
  ------------------
  |  Branch (897:4): [True: 75.1k, False: 799k]
  ------------------
  898|  77.9k|  	case FILE_PSTRING:
  ------------------
  |  |  258|  77.9k|#define				FILE_PSTRING		13
  ------------------
  |  Branch (898:4): [True: 2.78k, False: 871k]
  ------------------
  899|  78.0k|  	case FILE_BESTRING16:
  ------------------
  |  |  263|  78.0k|#define				FILE_BESTRING16		18
  ------------------
  |  Branch (899:4): [True: 85, False: 874k]
  ------------------
  900|  78.3k|  	case FILE_LESTRING16:
  ------------------
  |  |  264|  78.3k|#define				FILE_LESTRING16		19
  ------------------
  |  Branch (900:4): [True: 356, False: 874k]
  ------------------
  901|  78.3k|	case FILE_OCTAL:
  ------------------
  |  |  306|  78.3k|#define				FILE_OCTAL		61
  ------------------
  |  Branch (901:2): [True: 0, False: 874k]
  ------------------
  902|  78.3k|		if (m->reln == '=' || m->reln == '!') {
  ------------------
  |  Branch (902:7): [True: 25.9k, False: 52.4k]
  |  Branch (902:25): [True: 755, False: 51.6k]
  ------------------
  903|  26.6k|			o = ms->offset + m->vallen;
  904|  51.6k|		} else {
  905|  51.6k|			union VALUETYPE *p = &ms->ms_value;
  906|       |
  907|  51.6k|			if (*m->value.s == '\0')
  ------------------
  |  Branch (907:8): [True: 41.7k, False: 9.95k]
  ------------------
  908|  41.7k|				p->s[strcspn(p->s, "\r\n")] = '\0';
  909|  51.6k|			o = CAST(uint32_t, (ms->offset + strlen(p->s)));
  ------------------
  |  |  452|  51.6k|#define CAST(T, b)	((T)(b))
  ------------------
  910|  51.6k|			if (m->type == FILE_PSTRING) {
  ------------------
  |  |  258|  51.6k|#define				FILE_PSTRING		13
  ------------------
  |  Branch (910:8): [True: 2.68k, False: 49.0k]
  ------------------
  911|  2.68k|				size_t l = file_pstring_length_size(ms, m);
  912|  2.68k|				if (l == FILE_BADSIZE)
  ------------------
  |  |  175|  2.68k|#define FILE_BADSIZE CAST(size_t, ~0ul)
  |  |  ------------------
  |  |  |  |  452|  2.68k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (912:9): [True: 0, False: 2.68k]
  ------------------
  913|      0|					return -1;
  914|  2.68k|				o += CAST(uint32_t, l);
  ------------------
  |  |  452|  2.68k|#define CAST(T, b)	((T)(b))
  ------------------
  915|  2.68k|			}
  916|  51.6k|		}
  917|  78.3k|		break;
  918|       |
  919|  78.3k|	case FILE_DATE:
  ------------------
  |  |  251|      0|#define				FILE_DATE		6
  ------------------
  |  Branch (919:2): [True: 0, False: 874k]
  ------------------
  920|    325|	case FILE_BEDATE:
  ------------------
  |  |  254|    325|#define				FILE_BEDATE		9
  ------------------
  |  Branch (920:2): [True: 325, False: 874k]
  ------------------
  921|    494|	case FILE_LEDATE:
  ------------------
  |  |  257|    494|#define				FILE_LEDATE		12
  ------------------
  |  Branch (921:2): [True: 169, False: 874k]
  ------------------
  922|    669|	case FILE_MEDATE:
  ------------------
  |  |  266|    669|#define				FILE_MEDATE		21
  ------------------
  |  Branch (922:2): [True: 175, False: 874k]
  ------------------
  923|    669|		o = CAST(int32_t, (ms->offset + sizeof(uint32_t)));
  ------------------
  |  |  452|    669|#define CAST(T, b)	((T)(b))
  ------------------
  924|    669|		break;
  925|       |
  926|      0|	case FILE_LDATE:
  ------------------
  |  |  259|      0|#define				FILE_LDATE		14
  ------------------
  |  Branch (926:2): [True: 0, False: 874k]
  ------------------
  927|    218|	case FILE_BELDATE:
  ------------------
  |  |  260|    218|#define				FILE_BELDATE		15
  ------------------
  |  Branch (927:2): [True: 218, False: 874k]
  ------------------
  928|    305|	case FILE_LELDATE:
  ------------------
  |  |  261|    305|#define				FILE_LELDATE		16
  ------------------
  |  Branch (928:2): [True: 87, False: 874k]
  ------------------
  929|    305|	case FILE_MELDATE:
  ------------------
  |  |  267|    305|#define				FILE_MELDATE		22
  ------------------
  |  Branch (929:2): [True: 0, False: 874k]
  ------------------
  930|    305|		o = CAST(int32_t, (ms->offset + sizeof(uint32_t)));
  ------------------
  |  |  452|    305|#define CAST(T, b)	((T)(b))
  ------------------
  931|    305|		break;
  932|       |
  933|      0|	case FILE_QDATE:
  ------------------
  |  |  272|      0|#define				FILE_QDATE		27
  ------------------
  |  Branch (933:2): [True: 0, False: 874k]
  ------------------
  934|  1.29k|	case FILE_BEQDATE:
  ------------------
  |  |  274|  1.29k|#define				FILE_BEQDATE		29
  ------------------
  |  Branch (934:2): [True: 1.29k, False: 873k]
  ------------------
  935|  1.32k|	case FILE_LEQDATE:
  ------------------
  |  |  273|  1.32k|#define				FILE_LEQDATE		28
  ------------------
  |  Branch (935:2): [True: 37, False: 874k]
  ------------------
  936|  1.32k|		o = CAST(int32_t, (ms->offset + sizeof(uint64_t)));
  ------------------
  |  |  452|  1.32k|#define CAST(T, b)	((T)(b))
  ------------------
  937|  1.32k|		break;
  938|       |
  939|      0|	case FILE_QLDATE:
  ------------------
  |  |  275|      0|#define				FILE_QLDATE		30
  ------------------
  |  Branch (939:2): [True: 0, False: 874k]
  ------------------
  940|    201|	case FILE_BEQLDATE:
  ------------------
  |  |  277|    201|#define				FILE_BEQLDATE		32
  ------------------
  |  Branch (940:2): [True: 201, False: 874k]
  ------------------
  941|    647|	case FILE_LEQLDATE:
  ------------------
  |  |  276|    647|#define				FILE_LEQLDATE		31
  ------------------
  |  Branch (941:2): [True: 446, False: 874k]
  ------------------
  942|    647|		o = CAST(int32_t, (ms->offset + sizeof(uint64_t)));
  ------------------
  |  |  452|    647|#define CAST(T, b)	((T)(b))
  ------------------
  943|    647|		break;
  944|       |
  945|      0|  	case FILE_FLOAT:
  ------------------
  |  |  278|      0|#define				FILE_FLOAT		33
  ------------------
  |  Branch (945:4): [True: 0, False: 874k]
  ------------------
  946|      0|  	case FILE_BEFLOAT:
  ------------------
  |  |  279|      0|#define				FILE_BEFLOAT		34
  ------------------
  |  Branch (946:4): [True: 0, False: 874k]
  ------------------
  947|  1.24k|  	case FILE_LEFLOAT:
  ------------------
  |  |  280|  1.24k|#define				FILE_LEFLOAT		35
  ------------------
  |  Branch (947:4): [True: 1.24k, False: 873k]
  ------------------
  948|  1.24k|		o = CAST(int32_t, (ms->offset + sizeof(float)));
  ------------------
  |  |  452|  1.24k|#define CAST(T, b)	((T)(b))
  ------------------
  949|  1.24k|		break;
  950|       |
  951|      0|  	case FILE_DOUBLE:
  ------------------
  |  |  281|      0|#define				FILE_DOUBLE		36
  ------------------
  |  Branch (951:4): [True: 0, False: 874k]
  ------------------
  952|      0|  	case FILE_BEDOUBLE:
  ------------------
  |  |  282|      0|#define				FILE_BEDOUBLE		37
  ------------------
  |  Branch (952:4): [True: 0, False: 874k]
  ------------------
  953|    583|  	case FILE_LEDOUBLE:
  ------------------
  |  |  283|    583|#define				FILE_LEDOUBLE		38
  ------------------
  |  Branch (953:4): [True: 583, False: 873k]
  ------------------
  954|    583|		o = CAST(int32_t, (ms->offset + sizeof(double)));
  ------------------
  |  |  452|    583|#define CAST(T, b)	((T)(b))
  ------------------
  955|    583|		break;
  956|       |
  957|  1.28k|	case FILE_REGEX:
  ------------------
  |  |  262|  1.28k|#define				FILE_REGEX		17
  ------------------
  |  Branch (957:2): [True: 1.28k, False: 873k]
  ------------------
  958|       |		/* Why is regex and search different? */
  959|  1.28k|		vlen = (m->str_flags & REGEX_OFFSET_START) == 0 ?
  ------------------
  |  |  382|  1.28k|#define str_flags _u._s._flags
  ------------------
              		vlen = (m->str_flags & REGEX_OFFSET_START) == 0 ?
  ------------------
  |  |  400|  1.28k|#define REGEX_OFFSET_START			BIT(4)
  |  |  ------------------
  |  |  |  |  395|  1.28k|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (959:10): [True: 1.20k, False: 72]
  ------------------
  960|  1.20k|		    ms->search.rm_len : 0;
  961|  1.28k|		o = CAST(int32_t, ms->search.offset + vlen - offset);
  ------------------
  |  |  452|  1.28k|#define CAST(T, b)	((T)(b))
  ------------------
  962|  1.28k|		break;
  963|       |
  964|  26.9k|	case FILE_SEARCH:
  ------------------
  |  |  265|  26.9k|#define				FILE_SEARCH		20
  ------------------
  |  Branch (964:2): [True: 26.9k, False: 847k]
  ------------------
  965|  26.9k|		vlen = (m->str_flags & REGEX_OFFSET_START) == 0 ? m->vallen : 0;
  ------------------
  |  |  382|  26.9k|#define str_flags _u._s._flags
  ------------------
              		vlen = (m->str_flags & REGEX_OFFSET_START) == 0 ? m->vallen : 0;
  ------------------
  |  |  400|  26.9k|#define REGEX_OFFSET_START			BIT(4)
  |  |  ------------------
  |  |  |  |  395|  26.9k|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (965:10): [True: 26.7k, False: 167]
  ------------------
  966|  26.9k|		o = CAST(int32_t, ms->search.offset + vlen - offset);
  ------------------
  |  |  452|  26.9k|#define CAST(T, b)	((T)(b))
  ------------------
  967|  26.9k|		break;
  968|       |
  969|  1.44k|	case FILE_CLEAR:
  ------------------
  |  |  292|  1.44k|#define				FILE_CLEAR		47
  ------------------
  |  Branch (969:2): [True: 1.44k, False: 873k]
  ------------------
  970|  8.44k|	case FILE_DEFAULT:
  ------------------
  |  |  248|  8.44k|#define				FILE_DEFAULT		3
  ------------------
  |  Branch (970:2): [True: 6.99k, False: 867k]
  ------------------
  971|  24.4k|	case FILE_INDIRECT:
  ------------------
  |  |  286|  24.4k|#define				FILE_INDIRECT		41
  ------------------
  |  Branch (971:2): [True: 16.0k, False: 858k]
  ------------------
  972|  24.6k|	case FILE_OFFSET:
  ------------------
  |  |  297|  24.6k|#define				FILE_OFFSET		52
  ------------------
  |  Branch (972:2): [True: 182, False: 874k]
  ------------------
  973|  40.7k|	case FILE_USE:
  ------------------
  |  |  291|  40.7k|#define				FILE_USE		46
  ------------------
  |  Branch (973:2): [True: 16.0k, False: 858k]
  ------------------
  974|  40.7k|		o = ms->offset;
  975|  40.7k|		break;
  976|       |
  977|  29.3k|	case FILE_DER:
  ------------------
  |  |  293|  29.3k|#define				FILE_DER		48
  ------------------
  |  Branch (977:2): [True: 29.3k, False: 845k]
  ------------------
  978|  29.3k|		o = der_offs(ms, m, nbytes);
  979|  29.3k|		if (o == -1 || CAST(size_t, o) > nbytes) {
  ------------------
  |  |  452|  29.3k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (979:7): [True: 0, False: 29.3k]
  |  Branch (979:18): [True: 0, False: 29.3k]
  ------------------
  980|      0|			if ((ms->flags & MAGIC_DEBUG) != 0) {
  ------------------
  |  |   33|      0|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (980:8): [True: 0, False: 0]
  ------------------
  981|      0|				(void)fprintf(stderr,
  982|      0|				    "Bad DER offset %d nbytes=%"
  983|      0|				    SIZE_T_FORMAT "u", o, nbytes);
  984|      0|			}
  985|      0|			*op = 0;
  986|      0|			return 0;
  987|      0|		}
  988|  29.3k|		break;
  989|       |
  990|  29.3k|	case FILE_BEGUID:
  ------------------
  |  |  296|      0|#define				FILE_BEGUID		51
  ------------------
  |  Branch (990:2): [True: 0, False: 874k]
  ------------------
  991|      0|	case FILE_LEGUID:
  ------------------
  |  |  295|      0|#define				FILE_LEGUID		50
  ------------------
  |  Branch (991:2): [True: 0, False: 874k]
  ------------------
  992|    177|	case FILE_GUID:
  ------------------
  |  |  294|    177|#define				FILE_GUID		49
  ------------------
  |  Branch (992:2): [True: 177, False: 874k]
  ------------------
  993|    177|		o = CAST(int32_t, (ms->offset + 2 * sizeof(uint64_t)));
  ------------------
  |  |  452|    177|#define CAST(T, b)	((T)(b))
  ------------------
  994|    177|		break;
  995|       |
  996|  47.6k|	default:
  ------------------
  |  Branch (996:2): [True: 47.6k, False: 826k]
  ------------------
  997|  47.6k|		o = 0;
  998|  47.6k|		break;
  999|   874k|	}
 1000|       |
 1001|   874k|	if (CAST(size_t, o) > nbytes) {
  ------------------
  |  |  452|   874k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (1001:6): [True: 27.5k, False: 847k]
  ------------------
 1002|       |#if 0
 1003|       |		file_error(ms, 0, "Offset out of range %" SIZE_T_FORMAT
 1004|       |		    "u > %" SIZE_T_FORMAT "u", (size_t)o, nbytes);
 1005|       |#endif
 1006|  27.5k|		return -1;
 1007|  27.5k|	}
 1008|   847k|	*op = o;
 1009|   847k|	return 1;
 1010|   874k|}

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

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

