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

file_ascmagic:
   72|  10.7k|{
   73|  10.7k|	file_unichar_t *ubuf = NULL;
   74|  10.7k|	size_t ulen = 0;
   75|  10.7k|	int rv = 1;
   76|  10.7k|	struct buffer bb;
   77|       |
   78|  10.7k|	const char *code = NULL;
   79|  10.7k|	const char *code_mime = NULL;
   80|  10.7k|	const char *type = NULL;
   81|       |
   82|  10.7k|	bb = *b;
   83|  10.7k|	bb.flen = trim_nuls(CAST(const unsigned char *, b->fbuf), b->flen);
  ------------------
  |  |  460|  10.7k|#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|  10.7k|	if ((bb.flen & 1) && !(b->flen & 1))
  ------------------
  |  Branch (88:6): [True: 4.74k, False: 6.03k]
  |  Branch (88:23): [True: 1.04k, False: 3.70k]
  ------------------
   89|  1.04k|		bb.flen++;
   90|       |
   91|       |	/* If file doesn't look like any sort of text, give up. */
   92|  10.7k|	if (file_encoding(ms, &bb, &ubuf, &ulen, &code, &code_mime,
  ------------------
  |  Branch (92:6): [True: 8.30k, False: 2.47k]
  ------------------
   93|  10.7k|	    &type) == 0)
   94|  8.30k|		rv = 0;
   95|  2.47k|        else
   96|  2.47k|		rv = file_ascmagic_with_encoding(ms, &bb,
   97|  2.47k|		    ubuf, ulen, code, type, text);
   98|       |
   99|  10.7k|	free(ubuf);
  100|       |
  101|  10.7k|	return rv;
  102|  10.7k|}
file_ascmagic_with_encoding:
  108|  2.47k|{
  109|  2.47k|	struct buffer bb;
  110|  2.47k|	const unsigned char *buf = CAST(const unsigned char *, b->fbuf);
  ------------------
  |  |  460|  2.47k|#define CAST(T, b)	((T)(b))
  ------------------
  111|  2.47k|	size_t nbytes = b->flen;
  112|  2.47k|	unsigned char *utf8_buf = NULL, *utf8_end;
  113|  2.47k|	size_t mlen, i, len;
  114|  2.47k|	int rv = -1;
  115|  2.47k|	int mime = ms->flags & MAGIC_MIME;
  ------------------
  |  |   44|  2.47k|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   37|  2.47k|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  ------------------
  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   43|  2.47k|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  ------------------
  ------------------
  116|  2.47k|	int need_separator = 0;
  117|       |
  118|  2.47k|	const char *subtype = NULL;
  119|       |
  120|  2.47k|	int has_escapes = 0;
  121|  2.47k|	int has_backspace = 0;
  122|  2.47k|	int seen_cr = 0;
  123|       |
  124|  2.47k|	size_t n_crlf = 0;
  125|  2.47k|	size_t n_lf = 0;
  126|  2.47k|	size_t n_cr = 0;
  127|  2.47k|	size_t n_nel = 0;
  128|  2.47k|	int executable = 0;
  129|       |
  130|  2.47k|	size_t last_line_end = CAST(size_t, -1);
  ------------------
  |  |  460|  2.47k|#define CAST(T, b)	((T)(b))
  ------------------
  131|  2.47k|	size_t has_long_lines = 0;
  132|       |
  133|  2.47k|	nbytes = trim_nuls(buf, nbytes);
  134|       |
  135|       |	/* If we have fewer than 2 bytes, give up. */
  136|  2.47k|	if (nbytes <= 1) {
  ------------------
  |  Branch (136:6): [True: 29, False: 2.44k]
  ------------------
  137|     29|		rv = 0;
  138|     29|		goto done;
  139|     29|	}
  140|       |
  141|  2.44k|	if (ulen > 0 && (ms->flags & MAGIC_NO_CHECK_SOFT) == 0) {
  ------------------
  |  |   56|  2.36k|#define	MAGIC_NO_CHECK_SOFT	0x0004000 /* Don't check magic entries */
  ------------------
  |  Branch (141:6): [True: 2.36k, False: 78]
  |  Branch (141:18): [True: 2.36k, 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.36k|		if (ulen > SIZE_MAX / 6) {
  ------------------
  |  Branch (145:7): [True: 0, False: 2.36k]
  ------------------
  146|      0|			goto done;
  147|      0|		}
  148|  2.36k|		mlen = ulen * 6;
  149|  2.36k|		if ((utf8_buf = CAST(unsigned char *, malloc(mlen))) == NULL) {
  ------------------
  |  |  460|  2.36k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (149:7): [True: 0, False: 2.36k]
  ------------------
  150|      0|			file_oomem(ms, mlen);
  151|      0|			goto done;
  152|      0|		}
  153|  2.36k|		if ((utf8_end = encode_utf8(utf8_buf, mlen, ubuf, ulen))
  ------------------
  |  Branch (153:7): [True: 44, False: 2.32k]
  ------------------
  154|  2.36k|		    == NULL) {
  155|     44|			rv = 0;
  156|     44|			goto done;
  157|     44|		}
  158|  2.32k|		buffer_init(&bb, b->fd, &b->st, utf8_buf,
  159|  2.32k|		    CAST(size_t, utf8_end - utf8_buf));
  ------------------
  |  |  460|  2.32k|#define CAST(T, b)	((T)(b))
  ------------------
  160|       |
  161|  2.32k|		if ((rv = file_softmagic(ms, &bb, NULL, NULL,
  ------------------
  |  Branch (161:7): [True: 2.21k, False: 108]
  ------------------
  162|  2.32k|		    TEXTTEST, text)) == 0)
  ------------------
  |  |  241|  2.32k|#define TEXTTEST	0x40	/* for passing to file_softmagic */
  ------------------
  163|  2.21k|			rv = -1;
  164|    108|		else
  165|    108|			need_separator = 1;
  166|  2.32k|		buffer_fini(&bb);
  167|  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 (167:7): [True: 0, False: 2.32k]
  ------------------
  168|      0|			rv = rv == -1 ? 0 : 1;
  ------------------
  |  Branch (168:9): [True: 0, False: 0]
  ------------------
  169|      0|			goto done;
  170|      0|		}
  171|  2.32k|	}
  172|       |
  173|  2.40k|	if ((ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION))) {
  ------------------
  |  |   45|  2.40k|#define	MAGIC_APPLE		0x0000800 /* Return the Apple creator/type */
  ------------------
              	if ((ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION))) {
  ------------------
  |  |   46|  2.40k|#define	MAGIC_EXTENSION		0x1000000 /* Return a /-separated list of
  ------------------
  |  Branch (173:6): [True: 0, False: 2.40k]
  ------------------
  174|      0|		rv = 0;
  175|      0|		goto done;
  176|      0|	}
  177|       |
  178|       |	/* Now try to discover other details about the file. */
  179|  18.8M|	for (i = 0; i < ulen; i++) {
  ------------------
  |  Branch (179:14): [True: 18.8M, False: 2.40k]
  ------------------
  180|  18.8M|		if (ubuf[i] == '\n') {
  ------------------
  |  Branch (180:7): [True: 985k, False: 17.8M]
  ------------------
  181|   985k|			if (seen_cr)
  ------------------
  |  Branch (181:8): [True: 177k, False: 808k]
  ------------------
  182|   177k|				n_crlf++;
  183|   808k|			else
  184|   808k|				n_lf++;
  185|   985k|			last_line_end = i;
  186|  17.8M|		} else if (seen_cr)
  ------------------
  |  Branch (186:14): [True: 1.13M, False: 16.7M]
  ------------------
  187|  1.13M|			n_cr++;
  188|       |
  189|  18.8M|		seen_cr = (ubuf[i] == '\r');
  190|  18.8M|		if (seen_cr)
  ------------------
  |  Branch (190:7): [True: 1.30M, False: 17.5M]
  ------------------
  191|  1.30M|			last_line_end = i;
  192|       |
  193|  18.8M|		if (ubuf[i] == 0x85) { /* X3.64/ECMA-43 "next line" character */
  ------------------
  |  Branch (193:7): [True: 592k, False: 18.2M]
  ------------------
  194|   592k|			n_nel++;
  195|   592k|			last_line_end = i;
  196|   592k|		}
  197|       |
  198|       |		/* If this line is _longer_ than MAXLINELEN, remember it. */
  199|  18.8M|		if (i > last_line_end + MAXLINELEN) {
  ------------------
  |  |   49|  18.8M|#define MAXLINELEN 300	/* longest sane line length */
  ------------------
  |  Branch (199:7): [True: 14.6M, False: 4.21M]
  ------------------
  200|  14.6M|			size_t ll = i - last_line_end;
  201|  14.6M|			if (ll > has_long_lines)
  ------------------
  |  Branch (201:8): [True: 14.6M, False: 8.00k]
  ------------------
  202|  14.6M|				has_long_lines = ll;
  203|  14.6M|		}
  204|       |
  205|  18.8M|		if (ubuf[i] == '\033')
  ------------------
  |  Branch (205:7): [True: 132k, False: 18.7M]
  ------------------
  206|   132k|			has_escapes = 1;
  207|  18.8M|		if (ubuf[i] == '\b')
  ------------------
  |  Branch (207:7): [True: 83.4k, False: 18.7M]
  ------------------
  208|  83.4k|			has_backspace = 1;
  209|  18.8M|	}
  210|       |
  211|  2.40k|	if (seen_cr && n_cr == 0 && n_crlf == 0)
  ------------------
  |  Branch (211:6): [True: 72, False: 2.33k]
  |  Branch (211:17): [True: 29, False: 43]
  |  Branch (211:30): [True: 20, False: 9]
  ------------------
  212|     20|		n_cr++;
  213|       |
  214|  2.40k|	if (strcmp(type, "binary") == 0) {
  ------------------
  |  Branch (214:6): [True: 0, False: 2.40k]
  ------------------
  215|      0|		rv = 0;
  216|      0|		goto done;
  217|      0|	}
  218|  2.40k|	len = file_printedlen(ms);
  219|  2.40k|	if (mime) {
  ------------------
  |  Branch (219:6): [True: 0, False: 2.40k]
  ------------------
  220|      0|		if ((mime & MAGIC_MIME_TYPE) != 0) {
  ------------------
  |  |   37|      0|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  ------------------
  |  Branch (220:7): [True: 0, False: 0]
  ------------------
  221|      0|			if (len) {
  ------------------
  |  Branch (221:8): [True: 0, False: 0]
  ------------------
  222|       |				/*
  223|       |				 * Softmagic printed something, we
  224|       |				 * are either done, or we need a separator
  225|       |				 */
  226|      0|				if ((ms->flags & MAGIC_CONTINUE) == 0) {
  ------------------
  |  |   38|      0|#define	MAGIC_CONTINUE		0x0000020 /* Return all matches */
  ------------------
  |  Branch (226:9): [True: 0, False: 0]
  ------------------
  227|      0|					rv = 1;
  228|      0|					goto done;
  229|      0|				}
  230|      0|				if (need_separator && file_separator(ms) == -1)
  ------------------
  |  Branch (230:9): [True: 0, False: 0]
  |  Branch (230:27): [True: 0, False: 0]
  ------------------
  231|      0|					goto done;
  232|      0|			}
  233|      0|			if (file_printf(ms, "text/plain") == -1)
  ------------------
  |  Branch (233:8): [True: 0, False: 0]
  ------------------
  234|      0|				goto done;
  235|      0|		}
  236|  2.40k|	} else {
  237|  2.40k|		if (len) {
  ------------------
  |  Branch (237:7): [True: 878, False: 1.52k]
  ------------------
  238|    878|			switch (file_replace(ms, " text$", ", ")) {
  239|    843|			case 0:
  ------------------
  |  Branch (239:4): [True: 843, False: 35]
  ------------------
  240|    843|				switch (file_replace(ms, " text executable$",
  241|    843|				    ", ")) {
  242|    776|				case 0:
  ------------------
  |  Branch (242:5): [True: 776, False: 67]
  ------------------
  243|    776|					if (file_printf(ms, ", ") == -1)
  ------------------
  |  Branch (243:10): [True: 0, False: 776]
  ------------------
  244|      0|						goto done;
  245|    776|					break;
  246|    776|				case -1:
  ------------------
  |  Branch (246:5): [True: 0, False: 843]
  ------------------
  247|      0|					goto done;
  248|     67|				default:
  ------------------
  |  Branch (248:5): [True: 67, False: 776]
  ------------------
  249|     67|					executable = 1;
  250|     67|					break;
  251|    843|				}
  252|    843|				break;
  253|    843|			case -1:
  ------------------
  |  Branch (253:4): [True: 0, False: 878]
  ------------------
  254|      0|				goto done;
  255|     35|			default:
  ------------------
  |  Branch (255:4): [True: 35, False: 843]
  ------------------
  256|     35|				break;
  257|    878|			}
  258|    878|		}
  259|       |
  260|  2.40k|		if (file_printf(ms, "%s", code) == -1)
  ------------------
  |  Branch (260:7): [True: 0, False: 2.40k]
  ------------------
  261|      0|			goto done;
  262|       |
  263|  2.40k|		if (subtype) {
  ------------------
  |  Branch (263:7): [True: 0, False: 2.40k]
  ------------------
  264|      0|			if (file_printf(ms, " %s", subtype) == -1)
  ------------------
  |  Branch (264:8): [True: 0, False: 0]
  ------------------
  265|      0|				goto done;
  266|      0|		}
  267|       |
  268|  2.40k|		if (file_printf(ms, " %s", type) == -1)
  ------------------
  |  Branch (268:7): [True: 0, False: 2.40k]
  ------------------
  269|      0|			goto done;
  270|       |
  271|  2.40k|		if (executable)
  ------------------
  |  Branch (271:7): [True: 67, False: 2.33k]
  ------------------
  272|     67|			if (file_printf(ms, " executable") == -1)
  ------------------
  |  Branch (272:8): [True: 0, False: 67]
  ------------------
  273|      0|				goto done;
  274|       |
  275|  2.40k|		if (has_long_lines)
  ------------------
  |  Branch (275:7): [True: 340, False: 2.06k]
  ------------------
  276|    340|			if (file_printf(ms, ", with very long lines (%"
  ------------------
  |  Branch (276:8): [True: 0, False: 340]
  ------------------
  277|    340|			    SIZE_T_FORMAT "u)", has_long_lines) == -1)
  278|      0|				goto done;
  279|       |
  280|       |		/*
  281|       |		 * Only report line terminators if we find one other than LF,
  282|       |		 * or if we find none at all.
  283|       |		 */
  284|  2.40k|		if ((n_crlf == 0 && n_cr == 0 && n_nel == 0 && n_lf == 0) ||
  ------------------
  |  Branch (284:8): [True: 2.34k, False: 55]
  |  Branch (284:23): [True: 2.24k, False: 106]
  |  Branch (284:36): [True: 2.18k, False: 58]
  |  Branch (284:50): [True: 2.04k, False: 135]
  ------------------
  285|  2.26k|		    (n_crlf != 0 || n_cr != 0 || n_nel != 0)) {
  ------------------
  |  Branch (285:8): [True: 55, False: 299]
  |  Branch (285:23): [True: 106, False: 193]
  |  Branch (285:36): [True: 58, False: 135]
  ------------------
  286|  2.26k|			if (file_printf(ms, ", with") == -1)
  ------------------
  |  Branch (286:8): [True: 0, False: 2.26k]
  ------------------
  287|      0|				goto done;
  288|       |
  289|  2.26k|			if (n_crlf == 0 && n_cr == 0 &&
  ------------------
  |  Branch (289:8): [True: 2.21k, False: 55]
  |  Branch (289:23): [True: 2.10k, False: 106]
  ------------------
  290|  2.10k|			    n_nel == 0 && n_lf == 0) {
  ------------------
  |  Branch (290:8): [True: 2.04k, False: 58]
  |  Branch (290:22): [True: 2.04k, False: 0]
  ------------------
  291|  2.04k|				if (file_printf(ms, " no") == -1)
  ------------------
  |  Branch (291:9): [True: 0, False: 2.04k]
  ------------------
  292|      0|					goto done;
  293|  2.04k|			} else {
  294|    219|				if (n_crlf) {
  ------------------
  |  Branch (294:9): [True: 55, False: 164]
  ------------------
  295|     55|					if (file_printf(ms, " CRLF") == -1)
  ------------------
  |  Branch (295:10): [True: 0, False: 55]
  ------------------
  296|      0|						goto done;
  297|     55|					if (n_cr || n_lf || n_nel)
  ------------------
  |  Branch (297:10): [True: 23, False: 32]
  |  Branch (297:18): [True: 8, False: 24]
  |  Branch (297:26): [True: 4, False: 20]
  ------------------
  298|     35|						if (file_printf(ms, ",") == -1)
  ------------------
  |  Branch (298:11): [True: 0, False: 35]
  ------------------
  299|      0|							goto done;
  300|     55|				}
  301|    219|				if (n_cr) {
  ------------------
  |  Branch (301:9): [True: 129, False: 90]
  ------------------
  302|    129|					if (file_printf(ms, " CR") == -1)
  ------------------
  |  Branch (302:10): [True: 0, False: 129]
  ------------------
  303|      0|						goto done;
  304|    129|					if (n_lf || n_nel)
  ------------------
  |  Branch (304:10): [True: 17, False: 112]
  |  Branch (304:18): [True: 4, False: 108]
  ------------------
  305|     21|						if (file_printf(ms, ",") == -1)
  ------------------
  |  Branch (305:11): [True: 0, False: 21]
  ------------------
  306|      0|							goto done;
  307|    129|				}
  308|    219|				if (n_lf) {
  ------------------
  |  Branch (308:9): [True: 30, False: 189]
  ------------------
  309|     30|					if (file_printf(ms, " LF") == -1)
  ------------------
  |  Branch (309:10): [True: 0, False: 30]
  ------------------
  310|      0|						goto done;
  311|     30|					if (n_nel)
  ------------------
  |  Branch (311:10): [True: 6, False: 24]
  ------------------
  312|      6|						if (file_printf(ms, ",") == -1)
  ------------------
  |  Branch (312:11): [True: 0, False: 6]
  ------------------
  313|      0|							goto done;
  314|     30|				}
  315|    219|				if (n_nel)
  ------------------
  |  Branch (315:9): [True: 67, False: 152]
  ------------------
  316|     67|					if (file_printf(ms, " NEL") == -1)
  ------------------
  |  Branch (316:10): [True: 0, False: 67]
  ------------------
  317|      0|						goto done;
  318|    219|			}
  319|       |
  320|  2.26k|			if (file_printf(ms, " line terminators") == -1)
  ------------------
  |  Branch (320:8): [True: 0, False: 2.26k]
  ------------------
  321|      0|				goto done;
  322|  2.26k|		}
  323|       |
  324|  2.40k|		if (has_escapes)
  ------------------
  |  Branch (324:7): [True: 30, False: 2.37k]
  ------------------
  325|     30|			if (file_printf(ms, ", with escape sequences") == -1)
  ------------------
  |  Branch (325:8): [True: 0, False: 30]
  ------------------
  326|      0|				goto done;
  327|  2.40k|		if (has_backspace)
  ------------------
  |  Branch (327:7): [True: 64, False: 2.33k]
  ------------------
  328|     64|			if (file_printf(ms, ", with overstriking") == -1)
  ------------------
  |  Branch (328:8): [True: 0, False: 64]
  ------------------
  329|      0|				goto done;
  330|  2.40k|	}
  331|  2.40k|	rv = 1;
  332|  2.47k|done:
  333|  2.47k|	free(utf8_buf);
  334|       |
  335|  2.47k|	return rv;
  336|  2.40k|}
ascmagic.c:trim_nuls:
   63|  13.2k|{
   64|   181M|	while (nbytes > 1 && buf[nbytes - 1] == '\0')
  ------------------
  |  Branch (64:9): [True: 181M, False: 258]
  |  Branch (64:23): [True: 181M, False: 12.9k]
  ------------------
   65|   181M|		nbytes--;
   66|       |
   67|  13.2k|	return nbytes;
   68|  13.2k|}
ascmagic.c:encode_utf8:
  344|  2.36k|{
  345|  2.36k|	size_t i;
  346|  2.36k|	unsigned char *end = buf + len;
  347|       |
  348|  18.8M|	for (i = 0; i < ulen; i++) {
  ------------------
  |  Branch (348:14): [True: 18.8M, False: 2.32k]
  ------------------
  349|  18.8M|		if (ubuf[i] <= 0x7f) {
  ------------------
  |  Branch (349:7): [True: 13.0M, False: 5.76M]
  ------------------
  350|  13.0M|			if (end - buf < 1)
  ------------------
  |  Branch (350:8): [True: 0, False: 13.0M]
  ------------------
  351|      0|				return NULL;
  352|  13.0M|			*buf++ = CAST(unsigned char, ubuf[i]);
  ------------------
  |  |  460|  13.0M|#define CAST(T, b)	((T)(b))
  ------------------
  353|  13.0M|			continue;
  354|  13.0M|		} 
  355|  5.76M|		if (ubuf[i] <= 0x7ff) {
  ------------------
  |  Branch (355:7): [True: 5.42M, False: 340k]
  ------------------
  356|  5.42M|			if (end - buf < 2)
  ------------------
  |  Branch (356:8): [True: 0, False: 5.42M]
  ------------------
  357|      0|				return NULL;
  358|  5.42M|			*buf++ = CAST(unsigned char, (ubuf[i] >> 6) + 0xc0);
  ------------------
  |  |  460|  5.42M|#define CAST(T, b)	((T)(b))
  ------------------
  359|  5.42M|			goto out1;
  360|  5.42M|		}
  361|   340k|		if (ubuf[i] <= 0xffff) {
  ------------------
  |  Branch (361:7): [True: 244k, False: 95.7k]
  ------------------
  362|   244k|			if (end - buf < 3)
  ------------------
  |  Branch (362:8): [True: 0, False: 244k]
  ------------------
  363|      0|				return NULL;
  364|   244k|			*buf++ = CAST(unsigned char, (ubuf[i] >> 12) + 0xe0);
  ------------------
  |  |  460|   244k|#define CAST(T, b)	((T)(b))
  ------------------
  365|   244k|			goto out2;
  366|   244k|		}
  367|  95.7k|		if (ubuf[i] <= 0x1fffff) {
  ------------------
  |  Branch (367:7): [True: 23.6k, False: 72.0k]
  ------------------
  368|  23.6k|			if (end - buf < 4)
  ------------------
  |  Branch (368:8): [True: 0, False: 23.6k]
  ------------------
  369|      0|				return NULL;
  370|  23.6k|			*buf++ = CAST(unsigned char, (ubuf[i] >> 18) + 0xf0);
  ------------------
  |  |  460|  23.6k|#define CAST(T, b)	((T)(b))
  ------------------
  371|  23.6k|			goto out3;
  372|  23.6k|		}
  373|  72.0k|		if (ubuf[i] <= 0x3ffffff) {
  ------------------
  |  Branch (373:7): [True: 26.5k, False: 45.5k]
  ------------------
  374|  26.5k|			if (end - buf < 5)
  ------------------
  |  Branch (374:8): [True: 0, False: 26.5k]
  ------------------
  375|      0|				return NULL;
  376|  26.5k|			*buf++ = CAST(unsigned char, (ubuf[i] >> 24) + 0xf8);
  ------------------
  |  |  460|  26.5k|#define CAST(T, b)	((T)(b))
  ------------------
  377|  26.5k|			goto out4;
  378|  26.5k|		} 
  379|  45.5k|		if (ubuf[i] <= 0x7fffffff) {
  ------------------
  |  Branch (379:7): [True: 45.4k, False: 44]
  ------------------
  380|  45.4k|			if (end - buf < 6)
  ------------------
  |  Branch (380:8): [True: 0, False: 45.4k]
  ------------------
  381|      0|				return NULL;
  382|  45.4k|			*buf++ = CAST(unsigned char, (ubuf[i] >> 30) + 0xfc);
  ------------------
  |  |  460|  45.4k|#define CAST(T, b)	((T)(b))
  ------------------
  383|  45.4k|			goto out5;
  384|  45.4k|		} 
  385|       |		/* Invalid character */
  386|     44|		return NULL;
  387|  45.4k|	out5:	*buf++ = CAST(unsigned char, ((ubuf[i] >> 24) & 0x3f) + 0x80);
  ------------------
  |  |  460|  45.4k|#define CAST(T, b)	((T)(b))
  ------------------
  388|  72.0k|	out4:	*buf++ = CAST(unsigned char, ((ubuf[i] >> 18) & 0x3f) + 0x80);
  ------------------
  |  |  460|  72.0k|#define CAST(T, b)	((T)(b))
  ------------------
  389|  95.6k|	out3:	*buf++ = CAST(unsigned char, ((ubuf[i] >> 12) & 0x3f) + 0x80);
  ------------------
  |  |  460|  95.6k|#define CAST(T, b)	((T)(b))
  ------------------
  390|   340k|	out2:	*buf++ = CAST(unsigned char, ((ubuf[i] >>  6) & 0x3f) + 0x80);
  ------------------
  |  |  460|   340k|#define CAST(T, b)	((T)(b))
  ------------------
  391|  5.76M|	out1:	*buf++ = CAST(unsigned char, ((ubuf[i] >>  0) & 0x3f) + 0x80);
  ------------------
  |  |  460|  5.76M|#define CAST(T, b)	((T)(b))
  ------------------
  392|  5.76M|	}
  393|       |
  394|  2.32k|	return buf;
  395|  2.36k|}

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

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

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

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

der_offs:
  265|  28.6k|{
  266|  28.6k|	const uint8_t *b = RCAST(const uint8_t *, ms->search.s);
  ------------------
  |  |  461|  28.6k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
  267|  28.6k|	size_t offs = 0, len = ms->search.s_len ? ms->search.s_len : nbytes;
  ------------------
  |  Branch (267:25): [True: 28.6k, False: 0]
  ------------------
  268|       |
  269|  28.6k|	if (gettag(b, &offs, len) == DER_BAD) {
  ------------------
  |  |   62|  28.6k|#define DER_BAD	CAST(uint32_t, -1)
  |  |  ------------------
  |  |  |  |  460|  28.6k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (269:6): [True: 0, False: 28.6k]
  ------------------
  270|      0|		DPRINTF(("%s: bad tag 1\n", __func__));
  271|      0|		return -1;
  272|      0|	}
  273|  28.6k|	DPRINTF(("%s1: %u %" SIZE_T_FORMAT "u %d\n", __func__, ms->offset,
  274|  28.6k|	    offs, m->offset));
  275|       |
  276|  28.6k|	uint32_t tlen = getlength(b, &offs, len);
  277|  28.6k|	if (tlen == DER_BAD) {
  ------------------
  |  |   62|  28.6k|#define DER_BAD	CAST(uint32_t, -1)
  |  |  ------------------
  |  |  |  |  460|  28.6k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (277:6): [True: 0, False: 28.6k]
  ------------------
  278|      0|		DPRINTF(("%s: bad tag 2\n", __func__));
  279|      0|		return -1;
  280|      0|	}
  281|  28.6k|	DPRINTF(("%s2: %u %" SIZE_T_FORMAT "u %u\n", __func__, ms->offset,
  282|  28.6k|	    offs, tlen));
  283|       |
  284|  28.6k|	offs += ms->offset + m->offset;
  285|  28.6k|	DPRINTF(("cont_level = %d\n", m->cont_level));
  286|       |#ifdef DEBUG_DER
  287|       |	size_t i;
  288|       |	for (i = 0; i < m->cont_level; i++)
  289|       |		printf("cont_level[%" SIZE_T_FORMAT "u] = %d\n", i,
  290|       |		    ms->c.li[i].off);
  291|       |#endif
  292|  28.6k|	if (m->cont_level != 0) {
  ------------------
  |  Branch (292:6): [True: 4.17k, False: 24.4k]
  ------------------
  293|  4.17k|		if (offs + tlen > nbytes)
  ------------------
  |  Branch (293:7): [True: 0, False: 4.17k]
  ------------------
  294|      0|			return -1;
  295|  4.17k|		ms->c.li[m->cont_level - 1].off = CAST(int, offs + tlen);
  ------------------
  |  |  460|  4.17k|#define CAST(T, b)	((T)(b))
  ------------------
  296|  4.17k|		DPRINTF(("cont_level[%u] = %d\n", m->cont_level - 1,
  297|  4.17k|		    ms->c.li[m->cont_level - 1].off));
  298|  4.17k|	}
  299|  28.6k|	return CAST(int32_t, offs);
  ------------------
  |  |  460|  28.6k|#define CAST(T, b)	((T)(b))
  ------------------
  300|  28.6k|}
der_cmp:
  304|   518k|{
  305|   518k|	const uint8_t *b = RCAST(const uint8_t *, ms->search.s);
  ------------------
  |  |  461|   518k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
  306|   518k|	const char *s = m->value.s;
  307|   518k|	size_t offs = 0, len = ms->search.s_len;
  308|   518k|	uint32_t tag, tlen;
  309|   518k|	char buf[128];
  310|       |
  311|   518k|	DPRINTF(("%s: compare %zu bytes\n", __func__, len));
  312|       |
  313|   518k|	tag = gettag(b, &offs, len);
  314|   518k|	if (tag == DER_BAD) {
  ------------------
  |  |   62|   518k|#define DER_BAD	CAST(uint32_t, -1)
  |  |  ------------------
  |  |  |  |  460|   518k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (314:6): [True: 5.15k, False: 513k]
  ------------------
  315|  5.15k|		DPRINTF(("%s: bad tag 1\n", __func__));
  316|  5.15k|		return -1;
  317|  5.15k|	}
  318|       |
  319|   513k|	DPRINTF(("%s1: %d %" SIZE_T_FORMAT "u %d\n", __func__, ms->offset,
  320|   513k|	    offs, m->offset));
  321|       |
  322|   513k|	tlen = getlength(b, &offs, len);
  323|   513k|	if (tlen == DER_BAD) {
  ------------------
  |  |   62|   513k|#define DER_BAD	CAST(uint32_t, -1)
  |  |  ------------------
  |  |  |  |  460|   513k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (323:6): [True: 177k, False: 336k]
  ------------------
  324|   177k|		DPRINTF(("%s: bad tag 2\n", __func__));
  325|   177k|		return -1;
  326|   177k|	}
  327|       |
  328|   336k|	der_tag(buf, sizeof(buf), tag);
  329|   336k|	if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|   336k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (329:6): [True: 0, False: 336k]
  ------------------
  330|      0|		fprintf(stderr, "%s: tag %p got=%s exp=%s\n", __func__, b,
  331|      0|		    buf, s);
  332|   336k|	size_t slen = strlen(buf);
  333|       |
  334|   336k|	if (strncmp(buf, s, slen) != 0) {
  ------------------
  |  Branch (334:6): [True: 304k, False: 31.5k]
  ------------------
  335|   304k|		DPRINTF(("%s: no string match %s != %s\n", __func__, buf, s));
  336|   304k|		return 0;
  337|   304k|	}
  338|       |
  339|  31.5k|	s += slen;
  340|       |
  341|  32.8k|again:
  342|  32.8k|	switch (*s) {
  343|  27.7k|	case '\0':
  ------------------
  |  Branch (343:2): [True: 27.7k, False: 5.10k]
  ------------------
  344|  27.7k|		DPRINTF(("%s: EOF match\n", __func__));
  345|  27.7k|		return 1;
  346|  1.50k|	case '=':
  ------------------
  |  Branch (346:2): [True: 1.50k, False: 31.3k]
  ------------------
  347|  1.50k|		s++;
  348|  1.50k|		goto val;
  349|  3.60k|	default:
  ------------------
  |  Branch (349:2): [True: 3.60k, False: 29.2k]
  ------------------
  350|  3.60k|		if (!isdigit(CAST(unsigned char, *s))) {
  ------------------
  |  Branch (350:7): [True: 0, False: 3.60k]
  ------------------
  351|      0|			DPRINTF(("%s: no digit %c\n", __func__, *s));
  352|      0|			return 0;
  353|      0|		}
  354|       |
  355|  3.60k|		slen = 0;
  356|  3.60k|		do
  357|  5.64k|			slen = slen * 10 + *s - '0';
  358|  3.60k|		while (isdigit(CAST(unsigned char, *++s)));
  ------------------
  |  Branch (358:10): [True: 2.04k, False: 3.60k]
  ------------------
  359|  3.60k|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  3.60k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (359:7): [True: 0, False: 3.60k]
  ------------------
  360|      0|			fprintf(stderr, "%s: len %" SIZE_T_FORMAT "u %u\n",
  361|      0|			    __func__, slen, tlen);
  362|  3.60k|		if (tlen != slen) {
  ------------------
  |  Branch (362:7): [True: 2.26k, False: 1.33k]
  ------------------
  363|  2.26k|			DPRINTF(("%s: len %u != %zu\n", __func__, tlen, slen));
  364|  2.26k|			return 0;
  365|  2.26k|		}
  366|  1.33k|		goto again;
  367|  32.8k|	}
  368|  1.50k|val:
  369|  1.50k|	DPRINTF(("%s: before data %" SIZE_T_FORMAT "u %u\n", __func__, offs,
  370|  1.50k|	    tlen));
  371|  1.50k|	der_data(buf, sizeof(buf), tag, b + offs, tlen);
  372|  1.50k|	if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  1.50k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (372:6): [True: 0, False: 1.50k]
  ------------------
  373|      0|		fprintf(stderr, "%s: data %s %s\n", __func__, buf, s);
  374|  1.50k|	if (strcmp(buf, s) != 0 && strcmp("x", s) != 0) {
  ------------------
  |  Branch (374:6): [True: 854, False: 647]
  |  Branch (374:29): [True: 622, False: 232]
  ------------------
  375|    622|		DPRINTF(("%s: no string match %s != %s\n", __func__, buf, s));
  376|    622|		return 0;
  377|    622|	}
  378|    879|	strlcpy(ms->ms_value.s, buf, sizeof(ms->ms_value.s));
  379|    879|	DPRINTF(("%s: complete match\n", __func__));
  380|    879|	return 1;
  381|  1.50k|}
der.c:gettag:
  150|   547k|{
  151|   547k|	uint32_t tag;
  152|       |
  153|   547k|	if (c == NULL || *p >= l)
  ------------------
  |  Branch (153:6): [True: 0, False: 547k]
  |  Branch (153:19): [True: 1.42k, False: 545k]
  ------------------
  154|  1.42k|		return DER_BAD;
  ------------------
  |  |   62|  1.42k|#define DER_BAD	CAST(uint32_t, -1)
  |  |  ------------------
  |  |  |  |  460|  1.42k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  155|       |
  156|   545k|	tag = c[(*p)++] & 0x1f;
  157|       |
  158|   545k|	if (tag != 0x1f)
  ------------------
  |  Branch (158:6): [True: 477k, False: 68.7k]
  ------------------
  159|   477k|		return tag;
  160|       |
  161|  68.7k|	if (*p >= l)
  ------------------
  |  Branch (161:6): [True: 523, False: 68.1k]
  ------------------
  162|    523|		return DER_BAD;
  ------------------
  |  |   62|    523|#define DER_BAD	CAST(uint32_t, -1)
  |  |  ------------------
  |  |  |  |  460|    523|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  163|       |
  164|  1.32G|	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.81k, False: 1.31G]
  ------------------
  167|  2.81k|			return DER_BAD;
  ------------------
  |  |   62|  2.81k|#define DER_BAD	CAST(uint32_t, -1)
  |  |  ------------------
  |  |  |  |  460|  2.81k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  168|  1.31G|	}
  169|  65.3k|	return tag;
  170|  68.1k|}
der.c:getlength:
  183|   542k|{
  184|   542k|	uint8_t digits, i;
  185|   542k|	size_t len;
  186|   542k|	int is_onebyte_result;
  187|       |
  188|   542k|	if (*p >= l) {
  ------------------
  |  Branch (188:6): [True: 2.36k, False: 539k]
  ------------------
  189|  2.36k|		DPRINTF(("%s:[1] %zu >= %zu\n", __func__, *p, l));
  190|  2.36k|		return DER_BAD;
  ------------------
  |  |   62|  2.36k|#define DER_BAD	CAST(uint32_t, -1)
  |  |  ------------------
  |  |  |  |  460|  2.36k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  191|  2.36k|	}
  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|   539k|	is_onebyte_result = (c[*p] & 0x80) == 0;
  199|   539k|	digits = c[(*p)++] & 0x7f;
  200|   539k|	if (*p + digits >= l) {
  ------------------
  |  Branch (200:6): [True: 127k, False: 411k]
  ------------------
  201|   127k|		DPRINTF(("%s:[2] %zu + %u >= %zu\n", __func__, *p, digits, l));
  202|   127k|		return DER_BAD;
  ------------------
  |  |   62|   127k|#define DER_BAD	CAST(uint32_t, -1)
  |  |  ------------------
  |  |  |  |  460|   127k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  203|   127k|	}
  204|       |
  205|   411k|	if (is_onebyte_result)
  ------------------
  |  Branch (205:6): [True: 317k, False: 94.2k]
  ------------------
  206|   317k|		return digits;
  207|       |
  208|       |	/*
  209|       |	 * Decode len. We've already verified that we're allowed to read
  210|       |	 * `digits` bytes.
  211|       |	 */
  212|  94.2k|	len = 0;
  213|  8.14M|	for (i = 0; i < digits; i++)
  ------------------
  |  Branch (213:14): [True: 8.05M, False: 94.2k]
  ------------------
  214|  8.05M|		len = (len << 8) | c[(*p)++];
  215|       |
  216|  94.2k|	if (len > UINT32_MAX - *p || *p + len > l) {
  ------------------
  |  Branch (216:6): [True: 42.2k, False: 51.9k]
  |  Branch (216:31): [True: 4.64k, False: 47.2k]
  ------------------
  217|  46.9k|		DPRINTF(("%s:[3] bad len %zu + %zu >= %zu\n",
  218|  46.9k|		    __func__, *p, len, l));
  219|  46.9k|		return DER_BAD;
  ------------------
  |  |   62|  46.9k|#define DER_BAD	CAST(uint32_t, -1)
  |  |  ------------------
  |  |  |  |  460|  46.9k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  220|  46.9k|	}
  221|  47.2k|	return CAST(uint32_t, len);
  ------------------
  |  |  460|  47.2k|#define CAST(T, b)	((T)(b))
  ------------------
  222|  94.2k|}
der.c:der_tag:
  226|   336k|{
  227|   336k|	if (tag < DER_TAG_LAST)
  ------------------
  |  |  115|   336k|#define	DER_TAG_LAST			0x25
  ------------------
  |  Branch (227:6): [True: 296k, False: 39.5k]
  ------------------
  228|   296k|		strlcpy(buf, der__tag[tag], len);
  229|  39.5k|	else
  230|  39.5k|		snprintf(buf, len, "%#x", tag);
  231|   336k|	return buf;
  232|   336k|}
der.c:der_data:
  237|  1.50k|{
  238|  1.50k|	uint32_t i;
  239|  1.50k|	const uint8_t *d = CAST(const uint8_t *, q);
  ------------------
  |  |  460|  1.50k|#define CAST(T, b)	((T)(b))
  ------------------
  240|  1.50k|	switch (tag) {
  241|     75|	case DER_TAG_PRINTABLE_STRING:
  ------------------
  |  |   97|     75|#define	DER_TAG_PRINTABLE_STRING	0x13
  ------------------
  |  Branch (241:2): [True: 75, False: 1.42k]
  ------------------
  242|    168|	case DER_TAG_UTF8_STRING:
  ------------------
  |  |   90|    168|#define	DER_TAG_UTF8_STRING		0x0c
  ------------------
  |  Branch (242:2): [True: 93, False: 1.40k]
  ------------------
  243|    168|	case DER_TAG_IA5_STRING:
  ------------------
  |  |  100|    168|#define	DER_TAG_IA5_STRING		0x16
  ------------------
  |  Branch (243:2): [True: 0, False: 1.50k]
  ------------------
  244|    168|		return snprintf(buf, blen, "%.*s", len, RCAST(const char *, q));
  ------------------
  |  |  461|    168|#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.50k]
  ------------------
  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.33k|	default:
  ------------------
  |  Branch (251:2): [True: 1.33k, False: 168]
  ------------------
  252|  1.33k|		break;
  253|  1.50k|	}
  254|       |
  255|  6.32k|	for (i = 0; i < len; i++) {
  ------------------
  |  Branch (255:14): [True: 4.99k, False: 1.33k]
  ------------------
  256|  4.99k|		uint32_t z = i << 1;
  257|  4.99k|		if (z < blen - 2)
  ------------------
  |  Branch (257:7): [True: 4.75k, False: 242]
  ------------------
  258|  4.75k|			snprintf(buf + z, blen - z, "%.2x", d[i]);
  259|  4.99k|	}
  260|  1.33k|	return len * 2;
  261|  1.50k|}

file_encoding:
   78|  24.8k|{
   79|  24.8k|	const unsigned char *buf = CAST(const unsigned char *, b->fbuf);
  ------------------
  |  |  460|  24.8k|#define CAST(T, b)	((T)(b))
  ------------------
   80|  24.8k|	size_t nbytes = b->flen;
   81|  24.8k|	size_t mlen;
   82|  24.8k|	int rv = 1, ucs_type;
   83|  24.8k|	file_unichar_t *udefbuf;
   84|  24.8k|	size_t udeflen;
   85|       |
   86|  24.8k|	if (buf == NULL)
  ------------------
  |  Branch (86:6): [True: 0, False: 24.8k]
  ------------------
   87|      0|		return 0;
   88|  24.8k|	if (ubuf == NULL)
  ------------------
  |  Branch (88:6): [True: 14.0k, False: 10.7k]
  ------------------
   89|  14.0k|		ubuf = &udefbuf;
   90|  24.8k|	if (ulen == NULL)
  ------------------
  |  Branch (90:6): [True: 14.0k, False: 10.7k]
  ------------------
   91|  14.0k|		ulen = &udeflen;
   92|       |
   93|  24.8k|	*type = "text";
   94|  24.8k|	*ulen = 0;
   95|  24.8k|	*code = "unknown";
   96|  24.8k|	*code_mime = "binary";
   97|       |
   98|  24.8k|	if (nbytes > ms->encoding_max)
  ------------------
  |  Branch (98:6): [True: 1.97k, False: 22.8k]
  ------------------
   99|  1.97k|		nbytes = ms->encoding_max;
  100|       |
  101|  24.8k|	mlen = (nbytes + 1) * sizeof((*ubuf)[0]);
  102|  24.8k|	*ubuf = CAST(file_unichar_t *, calloc(CAST(size_t, 1), mlen));
  ------------------
  |  |  460|  24.8k|#define CAST(T, b)	((T)(b))
  ------------------
  103|  24.8k|	if (*ubuf == NULL) {
  ------------------
  |  Branch (103:6): [True: 0, False: 24.8k]
  ------------------
  104|      0|		file_oomem(ms, mlen);
  105|      0|		goto done;
  106|      0|	}
  107|  24.8k|	if (looks_ascii(buf, nbytes, *ubuf, ulen)) {
  ------------------
  |  Branch (107:6): [True: 1.85k, False: 23.0k]
  ------------------
  108|  1.85k|		if (looks_utf7(buf, nbytes, *ubuf, ulen) > 0) {
  ------------------
  |  Branch (108:7): [True: 12, False: 1.84k]
  ------------------
  109|     12|			DPRINTF(("utf-7 %" SIZE_T_FORMAT "u\n", *ulen));
  110|     12|			*code = "Unicode text, UTF-7";
  111|     12|			*code_mime = "utf-7";
  112|  1.84k|		} else {
  113|  1.84k|			DPRINTF(("ascii %" SIZE_T_FORMAT "u\n", *ulen));
  114|  1.84k|			*code = "ASCII";
  115|  1.84k|			*code_mime = "us-ascii";
  116|  1.84k|		}
  117|  23.0k|	} else if (looks_utf8_with_BOM(buf, nbytes, *ubuf, ulen) > 0) {
  ------------------
  |  Branch (117:13): [True: 9, False: 22.9k]
  ------------------
  118|      9|		DPRINTF(("utf8/bom %" SIZE_T_FORMAT "u\n", *ulen));
  119|      9|		*code = "Unicode text, UTF-8 (with BOM)";
  120|      9|		*code_mime = "utf-8";
  121|  22.9k|	} else if (file_looks_utf8(buf, nbytes, *ubuf, ulen) > 1) {
  ------------------
  |  Branch (121:13): [True: 173, False: 22.8k]
  ------------------
  122|    173|		DPRINTF(("utf8 %" SIZE_T_FORMAT "u\n", *ulen));
  123|    173|		*code = "Unicode text, UTF-8";
  124|    173|		*code_mime = "utf-8";
  125|  22.8k|	} else if ((ucs_type = looks_ucs32(buf, nbytes, *ubuf, ulen)) != 0) {
  ------------------
  |  Branch (125:13): [True: 463, False: 22.3k]
  ------------------
  126|    463|		if (ucs_type == 1) {
  ------------------
  |  Branch (126:7): [True: 259, False: 204]
  ------------------
  127|    259|			*code = "Unicode text, UTF-32, little-endian";
  128|    259|			*code_mime = "utf-32le";
  129|    259|		} else {
  130|    204|			*code = "Unicode text, UTF-32, big-endian";
  131|    204|			*code_mime = "utf-32be";
  132|    204|		}
  133|    463|		DPRINTF(("ucs32 %" SIZE_T_FORMAT "u\n", *ulen));
  134|  22.3k|	} else if ((ucs_type = looks_ucs16(buf, nbytes, *ubuf, ulen)) != 0) {
  ------------------
  |  Branch (134:13): [True: 427, False: 21.9k]
  ------------------
  135|    427|		if (ucs_type == 1) {
  ------------------
  |  Branch (135:7): [True: 271, False: 156]
  ------------------
  136|    271|			*code = "Unicode text, UTF-16, little-endian";
  137|    271|			*code_mime = "utf-16le";
  138|    271|		} else {
  139|    156|			*code = "Unicode text, UTF-16, big-endian";
  140|    156|			*code_mime = "utf-16be";
  141|    156|		}
  142|    427|		DPRINTF(("ucs16 %" SIZE_T_FORMAT "u\n", *ulen));
  143|  21.9k|	} else if (looks_latin1(buf, nbytes, *ubuf, ulen)) {
  ------------------
  |  Branch (143:13): [True: 1.09k, False: 20.8k]
  ------------------
  144|  1.09k|		DPRINTF(("latin1 %" SIZE_T_FORMAT "u\n", *ulen));
  145|  1.09k|		*code = "ISO-8859";
  146|  1.09k|		*code_mime = "iso-8859-1";
  147|  20.8k|	} else if (looks_extended(buf, nbytes, *ubuf, ulen)) {
  ------------------
  |  Branch (147:13): [True: 539, False: 20.3k]
  ------------------
  148|    539|		DPRINTF(("extended %" SIZE_T_FORMAT "u\n", *ulen));
  149|    539|		*code = "Non-ISO extended-ASCII";
  150|    539|		*code_mime = "unknown-8bit";
  151|  20.3k|	} else {
  152|  20.3k|		unsigned char *nbuf;
  153|       |
  154|  20.3k|		mlen = (nbytes + 1) * sizeof(nbuf[0]);
  155|  20.3k|		if ((nbuf = CAST(unsigned char *, malloc(mlen))) == NULL) {
  ------------------
  |  |  460|  20.3k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (155:7): [True: 0, False: 20.3k]
  ------------------
  156|      0|			file_oomem(ms, mlen);
  157|      0|			goto done;
  158|      0|		}
  159|  20.3k|		from_ebcdic(buf, nbytes, nbuf);
  160|       |
  161|  20.3k|		if (looks_ascii(nbuf, nbytes, *ubuf, ulen)) {
  ------------------
  |  Branch (161:7): [True: 91, False: 20.2k]
  ------------------
  162|     91|			DPRINTF(("ebcdic %" SIZE_T_FORMAT "u\n", *ulen));
  163|     91|			*code = "EBCDIC";
  164|     91|			*code_mime = "ebcdic";
  165|  20.2k|		} else if (looks_latin1(nbuf, nbytes, *ubuf, ulen)) {
  ------------------
  |  Branch (165:14): [True: 91, False: 20.1k]
  ------------------
  166|     91|			DPRINTF(("ebcdic/international %" SIZE_T_FORMAT "u\n",
  167|     91|			    *ulen));
  168|     91|			*code = "International EBCDIC";
  169|     91|			*code_mime = "ebcdic";
  170|  20.1k|		} else { /* Doesn't look like text at all */
  171|  20.1k|			DPRINTF(("binary\n"));
  172|  20.1k|			rv = 0;
  173|  20.1k|			*type = "binary";
  174|  20.1k|		}
  175|  20.3k|		free(nbuf);
  176|  20.3k|	}
  177|       |
  178|  24.8k| done:
  179|  24.8k|	if (ubuf == &udefbuf)
  ------------------
  |  Branch (179:6): [True: 14.0k, False: 10.7k]
  ------------------
  180|  14.0k|		free(udefbuf);
  181|       |
  182|  24.8k|	return rv;
  183|  24.8k|}
file_looks_utf8:
  358|  23.0k|{
  359|  23.0k|	size_t i;
  360|  23.0k|	int n;
  361|  23.0k|	file_unichar_t c;
  362|  23.0k|	int gotone = 0, ctrl = 0;
  363|       |
  364|  23.0k|	if (ubuf)
  ------------------
  |  Branch (364:6): [True: 23.0k, False: 0]
  ------------------
  365|  23.0k|		*ulen = 0;
  366|       |
  367|  32.1M|	for (i = 0; i < nbytes; i++) {
  ------------------
  |  Branch (367:14): [True: 32.1M, False: 1.93k]
  ------------------
  368|  32.1M|		if ((buf[i] & 0x80) == 0) {	   /* 0xxxxxxx is plain ASCII */
  ------------------
  |  Branch (368:7): [True: 31.7M, False: 327k]
  ------------------
  369|       |			/*
  370|       |			 * Even if the whole file is valid UTF-8 sequences,
  371|       |			 * still reject it if it uses weird control characters.
  372|       |			 */
  373|       |
  374|  31.7M|			if (text_chars[buf[i]] != T)
  ------------------
  |  |  238|  31.7M|#define T 1   /* character appears in plain ASCII text */
  ------------------
  |  Branch (374:8): [True: 26.1M, False: 5.59M]
  ------------------
  375|  26.1M|				ctrl = 1;
  376|       |
  377|  31.7M|			if (ubuf)
  ------------------
  |  Branch (377:8): [True: 31.7M, False: 0]
  ------------------
  378|  31.7M|				ubuf[(*ulen)++] = buf[i];
  379|  31.7M|		} else if ((buf[i] & 0x40) == 0) { /* 10xxxxxx never 1st byte */
  ------------------
  |  Branch (379:14): [True: 12.7k, False: 314k]
  ------------------
  380|  12.7k|			return -1;
  381|   314k|		} else {			   /* 11xxxxxx begins UTF-8 */
  382|   314k|			int following;
  383|   314k|			uint8_t x = first[buf[i]];
  384|   314k|			const struct accept_range *ar =
  385|   314k|			    &accept_ranges[(unsigned int)x >> 4];
  386|   314k|			if (x == XX)
  ------------------
  |  |  306|   314k|#define	XX 0xF1 // invalid: size 1
  ------------------
  |  Branch (386:8): [True: 3.49k, False: 311k]
  ------------------
  387|  3.49k|				return -1;
  388|       |
  389|   311k|			if ((buf[i] & 0x20) == 0) {		/* 110xxxxx */
  ------------------
  |  Branch (389:8): [True: 280k, False: 30.8k]
  ------------------
  390|   280k|				c = buf[i] & 0x1f;
  391|   280k|				following = 1;
  392|   280k|			} else if ((buf[i] & 0x10) == 0) {	/* 1110xxxx */
  ------------------
  |  Branch (392:15): [True: 15.9k, False: 14.9k]
  ------------------
  393|  15.9k|				c = buf[i] & 0x0f;
  394|  15.9k|				following = 2;
  395|  15.9k|			} else if ((buf[i] & 0x08) == 0) {	/* 11110xxx */
  ------------------
  |  Branch (395:15): [True: 14.9k, False: 0]
  ------------------
  396|  14.9k|				c = buf[i] & 0x07;
  397|  14.9k|				following = 3;
  398|  14.9k|			} else if ((buf[i] & 0x04) == 0) {	/* 111110xx */
  ------------------
  |  Branch (398:15): [True: 0, False: 0]
  ------------------
  399|      0|				c = buf[i] & 0x03;
  400|      0|				following = 4;
  401|      0|			} else if ((buf[i] & 0x02) == 0) {	/* 1111110x */
  ------------------
  |  Branch (401:15): [True: 0, False: 0]
  ------------------
  402|      0|				c = buf[i] & 0x01;
  403|      0|				following = 5;
  404|      0|			} else
  405|      0|				return -1;
  406|       |
  407|   662k|			for (n = 0; n < following; n++) {
  ------------------
  |  Branch (407:16): [True: 356k, False: 306k]
  ------------------
  408|   356k|				i++;
  409|   356k|				if (i >= nbytes)
  ------------------
  |  Branch (409:9): [True: 228, False: 355k]
  ------------------
  410|    228|					goto done;
  411|       |
  412|   355k|				if (n == 0 &&
  ------------------
  |  Branch (412:9): [True: 310k, False: 44.8k]
  ------------------
  413|   310k|				     (buf[i] < ar->lo || buf[i] > ar->hi))
  ------------------
  |  Branch (413:11): [True: 933, False: 310k]
  |  Branch (413:30): [True: 3.62k, False: 306k]
  ------------------
  414|  4.55k|					return -1;
  415|       |
  416|   351k|				if ((buf[i] & 0x80) == 0 || (buf[i] & 0x40))
  ------------------
  |  Branch (416:9): [True: 84, False: 351k]
  |  Branch (416:33): [True: 47, False: 351k]
  ------------------
  417|    131|					return -1;
  418|       |
  419|   351k|				c = (c << 6) + (buf[i] & 0x3f);
  420|   351k|			}
  421|       |
  422|   306k|			if (ubuf)
  ------------------
  |  Branch (422:8): [True: 306k, False: 0]
  ------------------
  423|   306k|				ubuf[(*ulen)++] = c;
  424|   306k|			gotone = 1;
  425|   306k|		}
  426|  32.1M|	}
  427|  2.16k|done:
  428|  2.16k|	return ctrl ? 0 : (gotone ? 2 : 1);
  ------------------
  |  Branch (428:9): [True: 1.87k, False: 287]
  |  Branch (428:21): [True: 173, False: 114]
  ------------------
  429|  23.0k|}
encoding.c:looks_ascii:
  271|  45.1k|    size_t *ulen) \
  272|  45.1k|{ \
  273|  45.1k|	size_t i; \
  274|  45.1k|\
  275|  45.1k|	*ulen = 0; \
  276|  45.1k|\
  277|  21.1M|	for (i = 0; i < nbytes; i++) { \
  ------------------
  |  Branch (277:14): [True: 21.1M, False: 1.94k]
  ------------------
  278|  21.1M|		int t = text_chars[buf[i]]; \
  279|  21.1M|\
  280|  21.1M|		if (COND) \
  ------------------
  |  Branch (280:7): [True: 43.2k, False: 21.1M]
  ------------------
  281|  21.1M|			return 0; \
  282|  21.1M|\
  283|  21.1M|		ubuf[(*ulen)++] = buf[i]; \
  284|  21.1M|	} \
  285|  45.1k|	return 1; \
  286|  45.1k|}
encoding.c:looks_latin1:
  271|  42.1k|    size_t *ulen) \
  272|  42.1k|{ \
  273|  42.1k|	size_t i; \
  274|  42.1k|\
  275|  42.1k|	*ulen = 0; \
  276|  42.1k|\
  277|  11.1M|	for (i = 0; i < nbytes; i++) { \
  ------------------
  |  Branch (277:14): [True: 11.1M, False: 1.18k]
  ------------------
  278|  11.1M|		int t = text_chars[buf[i]]; \
  279|  11.1M|\
  280|  29.6M|		if (COND) \
  ------------------
  |  Branch (280:7): [True: 7.40M, False: 3.71M]
  |  Branch (280:7): [True: 40.9k, False: 7.35M]
  ------------------
  281|  11.1M|			return 0; \
  282|  11.1M|\
  283|  11.1M|		ubuf[(*ulen)++] = buf[i]; \
  284|  11.0M|	} \
  285|  42.1k|	return 1; \
  286|  42.1k|}
encoding.c:looks_extended:
  271|  20.8k|    size_t *ulen) \
  272|  20.8k|{ \
  273|  20.8k|	size_t i; \
  274|  20.8k|\
  275|  20.8k|	*ulen = 0; \
  276|  20.8k|\
  277|  5.67M|	for (i = 0; i < nbytes; i++) { \
  ------------------
  |  Branch (277:14): [True: 5.67M, False: 539]
  ------------------
  278|  5.67M|		int t = text_chars[buf[i]]; \
  279|  5.67M|\
  280|  20.3M|		if (COND) \
  ------------------
  |  Branch (280:7): [True: 2.14M, False: 3.52M]
  |  Branch (280:7): [True: 1.20M, False: 940k]
  |  Branch (280:7): [True: 20.3k, False: 1.18M]
  ------------------
  281|  5.67M|			return 0; \
  282|  5.67M|\
  283|  5.67M|		ubuf[(*ulen)++] = buf[i]; \
  284|  5.65M|	} \
  285|  20.8k|	return 1; \
  286|  20.8k|}
encoding.c:looks_utf8_with_BOM:
  439|  23.0k|{
  440|  23.0k|	if (nbytes > 3 && buf[0] == 0xef && buf[1] == 0xbb && buf[2] == 0xbf)
  ------------------
  |  Branch (440:6): [True: 21.6k, False: 1.34k]
  |  Branch (440:20): [True: 143, False: 21.5k]
  |  Branch (440:38): [True: 110, False: 33]
  |  Branch (440:56): [True: 77, False: 33]
  ------------------
  441|     77|		return file_looks_utf8(buf + 3, nbytes - 3, ubuf, ulen);
  442|  22.9k|	else
  443|  22.9k|		return -1;
  444|  23.0k|}
encoding.c:looks_utf7:
  449|  1.85k|{
  450|  1.85k|	if (nbytes > 4 && buf[0] == '+' && buf[1] == '/' && buf[2] == 'v')
  ------------------
  |  Branch (450:6): [True: 1.08k, False: 767]
  |  Branch (450:20): [True: 47, False: 1.04k]
  |  Branch (450:37): [True: 34, False: 13]
  |  Branch (450:54): [True: 15, False: 19]
  ------------------
  451|     15|		switch (buf[3]) {
  452|      3|		case '8':
  ------------------
  |  Branch (452:3): [True: 3, False: 12]
  ------------------
  453|      6|		case '9':
  ------------------
  |  Branch (453:3): [True: 3, False: 12]
  ------------------
  454|      9|		case '+':
  ------------------
  |  Branch (454:3): [True: 3, False: 12]
  ------------------
  455|     12|		case '/':
  ------------------
  |  Branch (455:3): [True: 3, False: 12]
  ------------------
  456|     12|			if (ubuf)
  ------------------
  |  Branch (456:8): [True: 12, False: 0]
  ------------------
  457|     12|				*ulen = 0;
  458|     12|			return 1;
  459|      3|		default:
  ------------------
  |  Branch (459:3): [True: 3, False: 12]
  ------------------
  460|      3|			return -1;
  461|     15|		}
  462|  1.84k|	else
  463|  1.84k|		return -1;
  464|  1.85k|}
encoding.c:looks_ucs16:
  475|  22.3k|{
  476|  22.3k|	int bigend;
  477|  22.3k|	uint32_t hi;
  478|  22.3k|	size_t i;
  479|       |
  480|  22.3k|	if (nbytes < 2)
  ------------------
  |  Branch (480:6): [True: 81, False: 22.2k]
  ------------------
  481|     81|		return 0;
  482|       |
  483|  22.2k|	if (bf[0] == 0xff && bf[1] == 0xfe)
  ------------------
  |  Branch (483:6): [True: 1.25k, False: 21.0k]
  |  Branch (483:23): [True: 365, False: 893]
  ------------------
  484|    365|		bigend = 0;
  485|  21.9k|	else if (bf[0] == 0xfe && bf[1] == 0xff)
  ------------------
  |  Branch (485:11): [True: 293, False: 21.6k]
  |  Branch (485:28): [True: 208, False: 85]
  ------------------
  486|    208|		bigend = 1;
  487|  21.7k|	else
  488|  21.7k|		return 0;
  489|       |
  490|    573|	*ulen = 0;
  491|    573|	hi = 0;
  492|       |
  493|   889k|	for (i = 2; i + 1 < nbytes; i += 2) {
  ------------------
  |  Branch (493:14): [True: 889k, False: 427]
  ------------------
  494|   889k|		uint32_t uc;
  495|       |
  496|   889k|		if (bigend)
  ------------------
  |  Branch (496:7): [True: 366k, False: 522k]
  ------------------
  497|   366k|			uc = CAST(uint32_t,
  ------------------
  |  |  460|   366k|#define CAST(T, b)	((T)(b))
  ------------------
  498|   889k|			    bf[i + 1] | (CAST(file_unichar_t, bf[i]) << 8));
  499|   522k|		else
  500|   522k|			uc = CAST(uint32_t,
  ------------------
  |  |  460|   522k|#define CAST(T, b)	((T)(b))
  ------------------
  501|   889k|			    bf[i] | (CAST(file_unichar_t, bf[i + 1]) << 8));
  502|       |
  503|   889k|		uc &= 0xffff;
  504|       |
  505|   889k|		switch (uc) {
  506|     13|		case 0xfffe:
  ------------------
  |  Branch (506:3): [True: 13, False: 889k]
  ------------------
  507|     33|		case 0xffff:
  ------------------
  |  Branch (507:3): [True: 20, False: 889k]
  ------------------
  508|     33|			return 0;
  509|   889k|		default:
  ------------------
  |  Branch (509:3): [True: 889k, False: 33]
  ------------------
  510|   889k|			if (UCS16_NOCHAR(uc))
  ------------------
  |  |  466|   889k|#define UCS16_NOCHAR(c) ((c) >= 0xfdd0 && (c) <= 0xfdef)
  |  |  ------------------
  |  |  |  Branch (466:26): [True: 117k, False: 772k]
  |  |  |  Branch (466:43): [True: 13, False: 117k]
  |  |  ------------------
  ------------------
  511|     13|				return 0;
  512|   889k|			break;
  513|   889k|		}
  514|   889k|		if (hi) {
  ------------------
  |  Branch (514:7): [True: 22.2k, False: 867k]
  ------------------
  515|  22.2k|			if (!UCS16_LOSURR(uc))
  ------------------
  |  |  468|  22.2k|#define UCS16_LOSURR(c) ((c) >= 0xdc00 && (c) <= 0xdfff)
  |  |  ------------------
  |  |  |  Branch (468:26): [True: 22.2k, False: 40]
  |  |  |  Branch (468:43): [True: 22.1k, False: 11]
  |  |  ------------------
  ------------------
  516|     51|				return 0;
  517|  22.1k|			uc = 0x10000 + 0x400 * (hi - 1) + (uc - 0xdc00);
  518|  22.1k|			hi = 0;
  519|  22.1k|		}
  520|   889k|		if (NOTTEXT(uc))
  ------------------
  |  |  470|   889k|    ((C) < 128 && text_chars[CAST(size_t, (C))] != T && (C) != '\0')
  |  |  ------------------
  |  |  |  |  460|   292k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |                   ((C) < 128 && text_chars[CAST(size_t, (C))] != T && (C) != '\0')
  |  |  ------------------
  |  |  |  |  238|  1.18M|#define T 1   /* character appears in plain ASCII text */
  |  |  ------------------
  |  |  |  Branch (470:6): [True: 292k, False: 596k]
  |  |  |  Branch (470:19): [True: 271k, False: 21.0k]
  |  |  |  Branch (470:57): [True: 15, False: 271k]
  |  |  ------------------
  ------------------
  521|     15|			return 0;
  522|   889k|		ubf[(*ulen)++] = uc;
  523|   889k|		if (UCS16_HISURR(uc))
  ------------------
  |  |  467|   889k|#define UCS16_HISURR(c) ((c) >= 0xd800 && (c) <= 0xdbff)
  |  |  ------------------
  |  |  |  Branch (467:26): [True: 221k, False: 668k]
  |  |  |  Branch (467:43): [True: 22.2k, False: 198k]
  |  |  ------------------
  ------------------
  524|  22.2k|			hi = uc - 0xd800 + 1;
  525|   889k|		if (UCS16_LOSURR(uc))
  ------------------
  |  |  468|   889k|#define UCS16_LOSURR(c) ((c) >= 0xdc00 && (c) <= 0xdfff)
  |  |  ------------------
  |  |  |  Branch (468:26): [True: 198k, False: 690k]
  |  |  |  Branch (468:43): [True: 34, False: 198k]
  |  |  ------------------
  ------------------
  526|     34|			return 0;
  527|   889k|	}
  528|       |
  529|    427|	return 1 + bigend;
  530|    573|}
encoding.c:looks_ucs32:
  536|  22.8k|{
  537|  22.8k|	int bigend;
  538|  22.8k|	file_unichar_t uc;
  539|  22.8k|	size_t i;
  540|       |
  541|  22.8k|	if (nbytes < 4)
  ------------------
  |  Branch (541:6): [True: 1.25k, False: 21.5k]
  ------------------
  542|  1.25k|		return 0;
  543|       |
  544|  21.5k|	if (bf[0] == 0xff && bf[1] == 0xfe && bf[2] == 0 && bf[3] == 0)
  ------------------
  |  Branch (544:6): [True: 1.43k, False: 20.1k]
  |  Branch (544:23): [True: 602, False: 834]
  |  Branch (544:40): [True: 319, False: 283]
  |  Branch (544:54): [True: 273, False: 46]
  ------------------
  545|    273|		bigend = 0;
  546|  21.2k|	else if (bf[0] == 0 && bf[1] == 0 && bf[2] == 0xfe && bf[3] == 0xff)
  ------------------
  |  Branch (546:11): [True: 1.13k, False: 20.1k]
  |  Branch (546:25): [True: 699, False: 438]
  |  Branch (546:39): [True: 279, False: 420]
  |  Branch (546:56): [True: 212, False: 67]
  ------------------
  547|    212|		bigend = 1;
  548|  21.0k|	else
  549|  21.0k|		return 0;
  550|       |
  551|    485|	*ulen = 0;
  552|       |
  553|   287k|	for (i = 4; i + 3 < nbytes; i += 4) {
  ------------------
  |  Branch (553:14): [True: 286k, False: 463]
  ------------------
  554|       |		/* XXX fix to properly handle chars > 65536 */
  555|       |
  556|   286k|		if (bigend)
  ------------------
  |  Branch (556:7): [True: 9.30k, False: 277k]
  ------------------
  557|  9.30k|			ubf[(*ulen)++] = CAST(file_unichar_t, bf[i + 3])
  ------------------
  |  |  460|  9.30k|#define CAST(T, b)	((T)(b))
  ------------------
  558|  9.30k|			    | (CAST(file_unichar_t, bf[i + 2]) << 8)
  ------------------
  |  |  460|  9.30k|#define CAST(T, b)	((T)(b))
  ------------------
  559|  9.30k|			    | (CAST(file_unichar_t, bf[i + 1]) << 16)
  ------------------
  |  |  460|  9.30k|#define CAST(T, b)	((T)(b))
  ------------------
  560|  9.30k|			    | (CAST(file_unichar_t, bf[i]) << 24);
  ------------------
  |  |  460|  9.30k|#define CAST(T, b)	((T)(b))
  ------------------
  561|   277k|		else
  562|   277k|			ubf[(*ulen)++] = CAST(file_unichar_t, bf[i + 0])
  ------------------
  |  |  460|   277k|#define CAST(T, b)	((T)(b))
  ------------------
  563|   277k|			    | (CAST(file_unichar_t, bf[i + 1]) << 8) 
  ------------------
  |  |  460|   277k|#define CAST(T, b)	((T)(b))
  ------------------
  564|   277k|			    | (CAST(file_unichar_t, bf[i + 2]) << 16)
  ------------------
  |  |  460|   277k|#define CAST(T, b)	((T)(b))
  ------------------
  565|   277k|			    | (CAST(file_unichar_t, bf[i + 3]) << 24);
  ------------------
  |  |  460|   277k|#define CAST(T, b)	((T)(b))
  ------------------
  566|       |
  567|   286k|		uc = ubf[*ulen - 1];
  568|   286k|		if (uc == 0xfffe || NOTTEXT(uc))
  ------------------
  |  |  470|   286k|    ((C) < 128 && text_chars[CAST(size_t, (C))] != T && (C) != '\0')
  |  |  ------------------
  |  |  |  |  460|  90.6k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |                   ((C) < 128 && text_chars[CAST(size_t, (C))] != T && (C) != '\0')
  |  |  ------------------
  |  |  |  |  238|   377k|#define T 1   /* character appears in plain ASCII text */
  |  |  ------------------
  |  |  |  Branch (470:6): [True: 90.6k, False: 196k]
  |  |  |  Branch (470:19): [True: 90.6k, False: 26]
  |  |  |  Branch (470:57): [True: 13, False: 90.6k]
  |  |  ------------------
  ------------------
  |  Branch (568:7): [True: 9, False: 286k]
  ------------------
  569|     22|			return 0;
  570|   286k|	}
  571|       |
  572|    463|	return 1 + bigend;
  573|    485|}
encoding.c:from_ebcdic:
  660|  20.3k|{
  661|  20.3k|	size_t i;
  662|       |
  663|   146M|	for (i = 0; i < nbytes; i++) {
  ------------------
  |  Branch (663:14): [True: 146M, False: 20.3k]
  ------------------
  664|   146M|		out[i] = ebcdic_to_ascii[buf[i]];
  665|   146M|	}
  666|  20.3k|}

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

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

file_is_json:
  423|  10.7k|{
  424|  10.7k|	const unsigned char *uc = CAST(const unsigned char *, b->fbuf);
  ------------------
  |  |  460|  10.7k|#define CAST(T, b)	((T)(b))
  ------------------
  425|  10.7k|	const unsigned char *ue = uc + b->flen;
  426|  10.7k|	size_t st[JSON_MAX];
  427|  10.7k|	int mime = ms->flags & MAGIC_MIME;
  ------------------
  |  |   44|  10.7k|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   37|  10.7k|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  ------------------
  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   43|  10.7k|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  ------------------
  ------------------
  428|  10.7k|	int jt;
  429|       |
  430|       |
  431|  10.7k|	if ((ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION)) != 0)
  ------------------
  |  |   45|  10.7k|#define	MAGIC_APPLE		0x0000800 /* Return the Apple creator/type */
  ------------------
              	if ((ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION)) != 0)
  ------------------
  |  |   46|  10.7k|#define	MAGIC_EXTENSION		0x1000000 /* Return a /-separated list of
  ------------------
  |  Branch (431:6): [True: 0, False: 10.7k]
  ------------------
  432|      0|		return 0;
  433|       |
  434|  10.7k|	memset(st, 0, sizeof(st));
  435|       |
  436|  10.7k|	if ((jt = json_parse(&uc, ue, st, 0)) == 0)
  ------------------
  |  Branch (436:6): [True: 10.7k, False: 31]
  ------------------
  437|  10.7k|		return 0;
  438|       |
  439|     31|	if (mime == MAGIC_MIME_ENCODING)
  ------------------
  |  |   43|     31|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  ------------------
  |  Branch (439:6): [True: 0, False: 31]
  ------------------
  440|      0|		return 1;
  441|     31|	if (mime) {
  ------------------
  |  Branch (441:6): [True: 0, False: 31]
  ------------------
  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|     31|	if (file_printf(ms, "%sJSON text data",
  ------------------
  |  Branch (447:6): [True: 0, False: 31]
  ------------------
  448|     31|	    jt == 1 ? "" : "New Line Delimited ") == -1)
  ------------------
  |  Branch (448:6): [True: 21, False: 10]
  ------------------
  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|     31|	return 1;
  462|     31|}
is_json.c:json_parse:
  348|  9.91M|{
  349|  9.91M|	const unsigned char *uc, *ouc;
  350|  9.91M|	int rv = 0;
  351|  9.91M|	int t;
  352|       |
  353|  9.91M|	ouc = uc = json_skip_space(*ucp, ue);
  354|  9.91M|	if (uc == ue)
  ------------------
  |  Branch (354:6): [True: 87, False: 9.91M]
  ------------------
  355|     87|		goto out;
  356|       |
  357|       |	// Avoid recursion
  358|  9.91M|	if (lvl > 500) {
  ------------------
  |  Branch (358:6): [True: 11, False: 9.91M]
  ------------------
  359|     11|		DPRINTF("Too many levels", uc, *ucp);
  ------------------
  |  |   52|     11|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 11]
  |  |  ------------------
  ------------------
  360|     11|		return 0;
  361|     11|	}
  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|  9.91M|	DPRINTF("Parse general: ", uc, *ucp);
  ------------------
  |  |   52|  9.91M|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 9.91M]
  |  |  ------------------
  ------------------
  369|  9.91M|	switch (*uc++) {
  370|  1.44M|	case '"':
  ------------------
  |  Branch (370:2): [True: 1.44M, False: 8.46M]
  ------------------
  371|  1.44M|		rv = json_parse_string(&uc, ue, lvl + 1);
  372|  1.44M|		t = JSON_STRING;
  ------------------
  |  |   60|  1.44M|#define JSON_STRING	4
  ------------------
  373|  1.44M|		break;
  374|   257k|	case '[':
  ------------------
  |  Branch (374:2): [True: 257k, False: 9.65M]
  ------------------
  375|   257k|		rv = json_parse_array(&uc, ue, st, lvl + 1);
  376|   257k|		t = JSON_ARRAY;
  ------------------
  |  |   56|   257k|#define JSON_ARRAY	0
  ------------------
  377|   257k|		break;
  378|    935|	case '{': /* '}' */
  ------------------
  |  Branch (378:2): [True: 935, False: 9.90M]
  ------------------
  379|    935|		rv = json_parse_object(&uc, ue, st, lvl + 1);
  380|    935|		t = JSON_OBJECT;
  ------------------
  |  |   59|    935|#define JSON_OBJECT	3
  ------------------
  381|    935|		break;
  382|  1.08M|	case 't':
  ------------------
  |  Branch (382:2): [True: 1.08M, False: 8.82M]
  ------------------
  383|  1.08M|		rv = json_parse_const(&uc, ue, "true", sizeof("true"), lvl + 1);
  384|  1.08M|		t = JSON_CONSTANT;
  ------------------
  |  |   57|  1.08M|#define JSON_CONSTANT	1
  ------------------
  385|  1.08M|		break;
  386|    319|	case 'f':
  ------------------
  |  Branch (386:2): [True: 319, False: 9.91M]
  ------------------
  387|    319|		rv = json_parse_const(&uc, ue, "false", sizeof("false"),
  388|    319|		    lvl + 1);
  389|    319|		t = JSON_CONSTANT;
  ------------------
  |  |   57|    319|#define JSON_CONSTANT	1
  ------------------
  390|    319|		break;
  391|  1.97M|	case 'n':
  ------------------
  |  Branch (391:2): [True: 1.97M, False: 7.93M]
  ------------------
  392|  1.97M|		rv = json_parse_const(&uc, ue, "null", sizeof("null"), lvl + 1);
  393|  1.97M|		t = JSON_CONSTANT;
  ------------------
  |  |   57|  1.97M|#define JSON_CONSTANT	1
  ------------------
  394|  1.97M|		break;
  395|  5.14M|	default:
  ------------------
  |  Branch (395:2): [True: 5.14M, False: 4.76M]
  ------------------
  396|  5.14M|		--uc;
  397|  5.14M|		rv = json_parse_number(&uc, ue, lvl + 1);
  398|  5.14M|		t = JSON_NUMBER;
  ------------------
  |  |   58|  5.14M|#define JSON_NUMBER	2
  ------------------
  399|  5.14M|		break;
  400|  9.91M|	}
  401|  9.91M|	if (rv)
  ------------------
  |  Branch (401:6): [True: 9.89M, False: 16.4k]
  ------------------
  402|  9.89M|		st[t]++;
  403|  9.91M|	uc = json_skip_space(uc, ue);
  404|  9.91M|out:
  405|  9.91M|	DPRINTF("End general: ", uc, *ucp);
  ------------------
  |  |   52|  9.91M|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 9.91M]
  |  |  ------------------
  ------------------
  406|  9.91M|	*ucp = uc;
  407|  9.91M|	if (lvl == 0) {
  ------------------
  |  Branch (407:6): [True: 10.7k, False: 9.89M]
  ------------------
  408|  10.7k|		if (!rv)
  ------------------
  |  Branch (408:7): [True: 10.4k, False: 352]
  ------------------
  409|  10.4k|			return 0;
  410|    352|		if (uc == ue)
  ------------------
  |  Branch (410:7): [True: 106, False: 246]
  ------------------
  411|    106|			return (st[JSON_ARRAYN] || st[JSON_OBJECT]) ? 1 : 0;
  ------------------
  |  |   61|    106|#define JSON_ARRAYN	5
  ------------------
              			return (st[JSON_ARRAYN] || st[JSON_OBJECT]) ? 1 : 0;
  ------------------
  |  |   59|     95|#define JSON_OBJECT	3
  ------------------
  |  Branch (411:12): [True: 11, False: 95]
  |  Branch (411:31): [True: 10, False: 85]
  ------------------
  412|    246|		if (*ouc == *uc && json_parse(&uc, ue, st, 1))
  ------------------
  |  Branch (412:7): [True: 50, False: 196]
  |  Branch (412:22): [True: 37, False: 13]
  ------------------
  413|     37|			return (st[JSON_ARRAYN] || st[JSON_OBJECT]) ? 2 : 0;
  ------------------
  |  |   61|     37|#define JSON_ARRAYN	5
  ------------------
              			return (st[JSON_ARRAYN] || st[JSON_OBJECT]) ? 2 : 0;
  ------------------
  |  |   59|     30|#define JSON_OBJECT	3
  ------------------
  |  Branch (413:12): [True: 7, False: 30]
  |  Branch (413:31): [True: 3, False: 27]
  ------------------
  414|    209|		else
  415|    209|			return 0;
  416|    246|	}
  417|  9.89M|	return rv;
  418|  9.91M|}
is_json.c:json_skip_space:
  119|  30.5M|{
  120|  66.5M|	while (uc < ue && json_isspace(*uc))
  ------------------
  |  Branch (120:9): [True: 66.5M, False: 3.53k]
  |  Branch (120:20): [True: 35.9M, False: 30.5M]
  ------------------
  121|  35.9M|		uc++;
  122|  30.5M|	return uc;
  123|  30.5M|}
is_json.c:json_isspace:
   79|  66.5M|{
   80|  66.5M|	switch (uc) {
   81|  10.2M|	case ' ':
  ------------------
  |  Branch (81:2): [True: 10.2M, False: 56.3M]
  ------------------
   82|  21.8M|	case '\n':
  ------------------
  |  Branch (82:2): [True: 11.6M, False: 54.8M]
  ------------------
   83|  34.6M|	case '\r':
  ------------------
  |  Branch (83:2): [True: 12.7M, False: 53.7M]
  ------------------
   84|  35.9M|	case '\t':
  ------------------
  |  Branch (84:2): [True: 1.31M, False: 65.1M]
  ------------------
   85|  35.9M|		return 1;
   86|  30.5M|	default:
  ------------------
  |  Branch (86:2): [True: 30.5M, False: 35.9M]
  ------------------
   87|  30.5M|		return 0;
   88|  66.5M|	}
   89|  66.5M|}
is_json.c:json_parse_string:
  129|  2.05M|{
  130|  2.05M|	const unsigned char *uc = *ucp;
  131|  2.05M|	size_t i;
  132|       |
  133|  2.05M|	DPRINTF("Parse string: ", uc, *ucp);
  ------------------
  |  |   52|  2.05M|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 2.05M]
  |  |  ------------------
  ------------------
  134|  78.4M|	while (uc < ue) {
  ------------------
  |  Branch (134:9): [True: 78.4M, False: 120]
  ------------------
  135|  78.4M|		switch (*uc++) {
  136|      9|		case '\0':
  ------------------
  |  Branch (136:3): [True: 9, False: 78.4M]
  ------------------
  137|      9|			goto out;
  138|  42.2M|		case '\\':
  ------------------
  |  Branch (138:3): [True: 42.2M, False: 36.2M]
  ------------------
  139|  42.2M|			if (uc == ue)
  ------------------
  |  Branch (139:8): [True: 21, False: 42.2M]
  ------------------
  140|     21|				goto out;
  141|  42.2M|			switch (*uc++) {
  142|      0|			case '\0':
  ------------------
  |  Branch (142:4): [True: 0, False: 42.2M]
  ------------------
  143|      0|				goto out;
  144|  4.63M|			case '"':
  ------------------
  |  Branch (144:4): [True: 4.63M, False: 37.6M]
  ------------------
  145|  6.11M|			case '\\':
  ------------------
  |  Branch (145:4): [True: 1.48M, False: 40.7M]
  ------------------
  146|  15.6M|			case '/':
  ------------------
  |  Branch (146:4): [True: 9.51M, False: 32.7M]
  ------------------
  147|  24.1M|			case 'b':
  ------------------
  |  Branch (147:4): [True: 8.50M, False: 33.7M]
  ------------------
  148|  28.1M|			case 'f':
  ------------------
  |  Branch (148:4): [True: 4.03M, False: 38.2M]
  ------------------
  149|  30.7M|			case 'n':
  ------------------
  |  Branch (149:4): [True: 2.61M, False: 39.6M]
  ------------------
  150|  32.9M|			case 'r':
  ------------------
  |  Branch (150:4): [True: 2.20M, False: 40.0M]
  ------------------
  151|  39.9M|			case 't':
  ------------------
  |  Branch (151:4): [True: 6.94M, False: 35.3M]
  ------------------
  152|  39.9M|				continue;
  153|  2.32M|			case 'u':
  ------------------
  |  Branch (153:4): [True: 2.32M, False: 39.9M]
  ------------------
  154|  2.32M|				if (ue - uc < 4) {
  ------------------
  |  Branch (154:9): [True: 9, False: 2.32M]
  ------------------
  155|      9|					uc = ue;
  156|      9|					goto out;
  157|      9|				}
  158|  11.6M|				for (i = 0; i < 4; i++)
  ------------------
  |  Branch (158:17): [True: 9.29M, False: 2.32M]
  ------------------
  159|  9.29M|					if (!json_isxdigit(*uc++))
  ------------------
  |  Branch (159:10): [True: 27, False: 9.29M]
  ------------------
  160|     27|						goto out;
  161|  2.32M|				continue;
  162|  2.32M|			default:
  ------------------
  |  Branch (162:4): [True: 15, False: 42.2M]
  ------------------
  163|     15|				goto out;
  164|  42.2M|			}
  165|  2.05M|		case '"':
  ------------------
  |  Branch (165:3): [True: 2.05M, False: 76.4M]
  ------------------
  166|  2.05M|			DPRINTF("Good string: ", uc, *ucp);
  ------------------
  |  |   52|  2.05M|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 2.05M]
  |  |  ------------------
  ------------------
  167|  2.05M|			*ucp = uc;
  168|  2.05M|			return 1;
  169|  34.1M|		default:
  ------------------
  |  Branch (169:3): [True: 34.1M, False: 44.3M]
  ------------------
  170|  34.1M|			continue;
  171|  78.4M|		}
  172|  78.4M|	}
  173|    201|out:
  174|    201|	DPRINTF("Bad string: ", uc, *ucp);
  ------------------
  |  |   52|    201|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 201]
  |  |  ------------------
  ------------------
  175|    201|	*ucp = uc;
  176|    201|	return 0;
  177|  2.05M|}
is_json.c:json_isxdigit:
  105|  9.29M|{
  106|  9.29M|	if (json_isdigit(uc))
  ------------------
  |  Branch (106:6): [True: 930k, False: 8.36M]
  ------------------
  107|   930k|		return 1;
  108|  8.36M|	switch (uc) {
  109|  4.24M|	case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
  ------------------
  |  Branch (109:2): [True: 179k, False: 8.18M]
  |  Branch (109:12): [True: 997k, False: 7.36M]
  |  Branch (109:22): [True: 888k, False: 7.47M]
  |  Branch (109:32): [True: 592k, False: 7.77M]
  |  Branch (109:42): [True: 772k, False: 7.59M]
  |  Branch (109:52): [True: 816k, False: 7.54M]
  ------------------
  110|  8.36M|	case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
  ------------------
  |  Branch (110:2): [True: 291k, False: 8.07M]
  |  Branch (110:12): [True: 815k, False: 7.55M]
  |  Branch (110:22): [True: 2.95k, False: 8.36M]
  |  Branch (110:32): [True: 292k, False: 8.07M]
  |  Branch (110:42): [True: 2.12M, False: 6.24M]
  |  Branch (110:52): [True: 595k, False: 7.77M]
  ------------------
  111|  8.36M|		return 1;
  112|     27|	default:
  ------------------
  |  Branch (112:2): [True: 27, False: 8.36M]
  ------------------
  113|     27|		return 0;
  114|  8.36M|	}
  115|  8.36M|}
is_json.c:json_isdigit:
   93|  60.8M|{
   94|  60.8M|	switch (uc) {
   95|  30.4M|	case '0': case '1': case '2': case '3': case '4':
  ------------------
  |  Branch (95:2): [True: 23.8M, False: 37.0M]
  |  Branch (95:12): [True: 5.38M, False: 55.4M]
  |  Branch (95:22): [True: 781k, False: 60.0M]
  |  Branch (95:32): [True: 332k, False: 60.5M]
  |  Branch (95:42): [True: 61.8k, False: 60.8M]
  ------------------
   96|  37.5M|	case '5': case '6': case '7': case '8': case '9':
  ------------------
  |  Branch (96:2): [True: 1.39M, False: 59.4M]
  |  Branch (96:12): [True: 193k, False: 60.6M]
  |  Branch (96:22): [True: 19, False: 60.8M]
  |  Branch (96:32): [True: 24, False: 60.8M]
  |  Branch (96:42): [True: 5.56M, False: 55.3M]
  ------------------
   97|  37.5M|		return 1;
   98|  23.3M|	default:
  ------------------
  |  Branch (98:2): [True: 23.3M, False: 37.5M]
  ------------------
   99|  23.3M|		return 0;
  100|  60.8M|	}
  101|  60.8M|}
is_json.c:json_parse_array:
  182|   257k|{
  183|   257k|	const unsigned char *uc = *ucp;
  184|       |
  185|   257k|	DPRINTF("Parse array: ", uc, *ucp);
  ------------------
  |  |   52|   257k|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 257k]
  |  |  ------------------
  ------------------
  186|  9.54M|	while (uc < ue) {
  ------------------
  |  Branch (186:9): [True: 9.54M, False: 35]
  ------------------
  187|  9.54M|		uc = json_skip_space(uc, ue);
  188|  9.54M|		if (uc == ue)
  ------------------
  |  Branch (188:7): [True: 20, False: 9.54M]
  ------------------
  189|     20|			goto out;
  190|  9.54M|		if (*uc == ']')
  ------------------
  |  Branch (190:7): [True: 251k, False: 9.28M]
  ------------------
  191|   251k|			goto done;
  192|  9.28M|		if (!json_parse(&uc, ue, st, lvl + 1))
  ------------------
  |  Branch (192:7): [True: 5.75k, False: 9.28M]
  ------------------
  193|  5.75k|			goto out;
  194|  9.28M|		if (uc == ue)
  ------------------
  |  Branch (194:7): [True: 39, False: 9.28M]
  ------------------
  195|     39|			goto out;
  196|  9.28M|		switch (*uc) {
  197|  9.28M|		case ',':
  ------------------
  |  Branch (197:3): [True: 9.28M, False: 349]
  ------------------
  198|  9.28M|			uc++;
  199|  9.28M|			continue;
  200|    331|		case ']':
  ------------------
  |  Branch (200:3): [True: 331, False: 9.28M]
  ------------------
  201|   252k|		done:
  202|   252k|			st[JSON_ARRAYN]++;
  ------------------
  |  |   61|   252k|#define JSON_ARRAYN	5
  ------------------
  203|   252k|			DPRINTF("Good array: ", uc, *ucp);
  ------------------
  |  |   52|   252k|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 252k]
  |  |  ------------------
  ------------------
  204|   252k|			*ucp = uc + 1;
  205|   252k|			return 1;
  206|     18|		default:
  ------------------
  |  Branch (206:3): [True: 18, False: 9.28M]
  ------------------
  207|     18|			goto out;
  208|  9.28M|		}
  209|  9.28M|	}
  210|  5.86k|out:
  211|  5.86k|	DPRINTF("Bad array: ", uc,  *ucp);
  ------------------
  |  |   52|  5.86k|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 5.86k]
  |  |  ------------------
  ------------------
  212|  5.86k|	*ucp = uc;
  213|  5.86k|	return 0;
  214|   257k|}
is_json.c:json_parse_object:
  219|    935|{
  220|    935|	const unsigned char *uc = *ucp;
  221|    935|	DPRINTF("Parse object: ", uc, *ucp);
  ------------------
  |  |   52|    935|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 935]
  |  |  ------------------
  ------------------
  222|   611k|	while (uc < ue) {
  ------------------
  |  Branch (222:9): [True: 611k, False: 7]
  ------------------
  223|   611k|		uc = json_skip_space(uc, ue);
  224|   611k|		if (uc == ue)
  ------------------
  |  Branch (224:7): [True: 14, False: 611k]
  ------------------
  225|     14|			goto out;
  226|   611k|		if (*uc == '}') {
  ------------------
  |  Branch (226:7): [True: 235, False: 611k]
  ------------------
  227|    235|			uc++;
  228|    235|			goto done;
  229|    235|		}
  230|   611k|		if (*uc++ != '"') {
  ------------------
  |  Branch (230:7): [True: 35, False: 611k]
  ------------------
  231|     35|			DPRINTF("not string", uc, *ucp);
  ------------------
  |  |   52|     35|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 35]
  |  |  ------------------
  ------------------
  232|     35|			goto out;
  233|     35|		}
  234|   611k|		DPRINTF("next field", uc, *ucp);
  ------------------
  |  |   52|   611k|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 611k]
  |  |  ------------------
  ------------------
  235|   611k|		if (!json_parse_string(&uc, ue, lvl)) {
  ------------------
  |  Branch (235:7): [True: 7, False: 611k]
  ------------------
  236|      7|			DPRINTF("not string", uc, *ucp);
  ------------------
  |  |   52|      7|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 7]
  |  |  ------------------
  ------------------
  237|      7|			goto out;
  238|      7|		}
  239|   611k|		uc = json_skip_space(uc, ue);
  240|   611k|		if (uc == ue)
  ------------------
  |  Branch (240:7): [True: 12, False: 610k]
  ------------------
  241|     12|			goto out;
  242|   610k|		if (*uc++ != ':') {
  ------------------
  |  Branch (242:7): [True: 23, False: 610k]
  ------------------
  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|   610k|		if (!json_parse(&uc, ue, st, lvl + 1)) {
  ------------------
  |  Branch (246:7): [True: 379, False: 610k]
  ------------------
  247|    379|			DPRINTF("not json", uc, *ucp);
  ------------------
  |  |   52|    379|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 379]
  |  |  ------------------
  ------------------
  248|    379|			goto out;
  249|    379|		}
  250|   610k|		if (uc == ue)
  ------------------
  |  Branch (250:7): [True: 3, False: 610k]
  ------------------
  251|      3|			goto out;
  252|   610k|		switch (*uc++) {
  253|   610k|		case ',':
  ------------------
  |  Branch (253:3): [True: 610k, False: 220]
  ------------------
  254|   610k|			continue;
  255|    217|		case '}': /* { */
  ------------------
  |  Branch (255:3): [True: 217, False: 610k]
  ------------------
  256|    452|		done:
  257|    452|			DPRINTF("Good object: ", uc, *ucp);
  ------------------
  |  |   52|    452|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 452]
  |  |  ------------------
  ------------------
  258|    452|			*ucp = uc;
  259|    452|			return 1;
  260|      3|		default:
  ------------------
  |  Branch (260:3): [True: 3, False: 610k]
  ------------------
  261|      3|			DPRINTF("not more", uc, *ucp);
  ------------------
  |  |   52|      3|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 3]
  |  |  ------------------
  ------------------
  262|      3|			*ucp = uc - 1;
  263|      3|			goto out;
  264|   610k|		}
  265|   610k|	}
  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|    935|}
is_json.c:json_parse_const:
  328|  3.06M|{
  329|  3.06M|	const unsigned char *uc = *ucp;
  330|       |
  331|  3.06M|	DPRINTF("Parse const: ", uc, *ucp);
  ------------------
  |  |   52|  3.06M|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 3.06M]
  |  |  ------------------
  ------------------
  332|  3.06M|	*ucp += --len - 1;
  333|  3.06M|	if (*ucp > ue)
  ------------------
  |  Branch (333:6): [True: 59, False: 3.06M]
  ------------------
  334|     59|		*ucp = ue;
  335|  12.2M|	for (; uc < ue && --len;) {
  ------------------
  |  Branch (335:9): [True: 12.2M, False: 45]
  |  Branch (335:20): [True: 9.19M, False: 3.06M]
  ------------------
  336|  9.19M|		if (*uc++ != *++str) {
  ------------------
  |  Branch (336:7): [True: 85, False: 9.19M]
  ------------------
  337|     85|			DPRINTF("Bad const: ", uc, *ucp);
  ------------------
  |  |   52|     85|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 85]
  |  |  ------------------
  ------------------
  338|     85|			return 0;
  339|     85|		}
  340|  9.19M|	}
  341|  3.06M|	DPRINTF("Good const: ", uc, *ucp);
  ------------------
  |  |   52|  3.06M|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 3.06M]
  |  |  ------------------
  ------------------
  342|  3.06M|	return 1;
  343|  3.06M|}
is_json.c:json_parse_number:
  276|  5.14M|{
  277|  5.14M|	const unsigned char *uc = *ucp;
  278|  5.14M|	int got = 0;
  279|       |
  280|  5.14M|	DPRINTF("Parse number: ", uc, *ucp);
  ------------------
  |  |   52|  5.14M|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 5.14M]
  |  |  ------------------
  ------------------
  281|  5.14M|	if (uc == ue)
  ------------------
  |  Branch (281:6): [True: 0, False: 5.14M]
  ------------------
  282|      0|		return 0;
  283|  5.14M|	if (*uc == '-')
  ------------------
  |  Branch (283:6): [True: 195k, False: 4.94M]
  ------------------
  284|   195k|		uc++;
  285|       |
  286|  35.4M|	for (; uc < ue; uc++) {
  ------------------
  |  Branch (286:9): [True: 35.4M, False: 48]
  ------------------
  287|  35.4M|		if (!json_isdigit(*uc))
  ------------------
  |  Branch (287:7): [True: 5.14M, False: 30.3M]
  ------------------
  288|  5.14M|			break;
  289|  30.3M|		got = 1;
  290|  30.3M|	}
  291|  5.14M|	if (uc == ue)
  ------------------
  |  Branch (291:6): [True: 48, False: 5.14M]
  ------------------
  292|     48|		goto out;
  293|  5.14M|	if (*uc == '.')
  ------------------
  |  Branch (293:6): [True: 126k, False: 5.01M]
  ------------------
  294|   126k|		uc++;
  295|  6.27M|	for (; uc < ue; uc++) {
  ------------------
  |  Branch (295:9): [True: 6.27M, False: 21]
  ------------------
  296|  6.27M|		if (!json_isdigit(*uc))
  ------------------
  |  Branch (296:7): [True: 5.14M, False: 1.13M]
  ------------------
  297|  5.14M|			break;
  298|  1.13M|		got = 1;
  299|  1.13M|	}
  300|  5.14M|	if (uc == ue)
  ------------------
  |  Branch (300:6): [True: 21, False: 5.14M]
  ------------------
  301|     21|		goto out;
  302|  5.14M|	if (got && (*uc == 'e' || *uc == 'E')) {
  ------------------
  |  Branch (302:6): [True: 5.13M, False: 9.79k]
  |  Branch (302:14): [True: 1.56M, False: 3.56M]
  |  Branch (302:28): [True: 3.08M, False: 474k]
  ------------------
  303|  4.65M|		uc++;
  304|  4.65M|		got = 0;
  305|  4.65M|		if (uc == ue)
  ------------------
  |  Branch (305:7): [True: 15, False: 4.65M]
  ------------------
  306|     15|			goto out;
  307|  4.65M|		if (*uc == '+' || *uc == '-')
  ------------------
  |  Branch (307:7): [True: 488k, False: 4.16M]
  |  Branch (307:21): [True: 912k, False: 3.25M]
  ------------------
  308|  1.40M|			uc++;
  309|  9.82M|		for (; uc < ue; uc++) {
  ------------------
  |  Branch (309:10): [True: 9.82M, False: 22]
  ------------------
  310|  9.82M|			if (!json_isdigit(*uc))
  ------------------
  |  Branch (310:8): [True: 4.65M, False: 5.16M]
  ------------------
  311|  4.65M|				break;
  312|  5.16M|			got = 1;
  313|  5.16M|		}
  314|  4.65M|	}
  315|  5.14M|out:
  316|  5.14M|	if (!got)
  ------------------
  |  Branch (316:6): [True: 9.84k, False: 5.13M]
  ------------------
  317|  9.84k|		DPRINTF("Bad number: ", uc, *ucp);
  ------------------
  |  |   52|  9.84k|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 9.84k]
  |  |  ------------------
  ------------------
  318|  5.13M|	else
  319|  5.13M|		DPRINTF("Good number: ", uc, *ucp);
  ------------------
  |  |   52|  5.13M|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 5.13M]
  |  |  ------------------
  ------------------
  320|  5.14M|	*ucp = uc;
  321|  5.14M|	return got;
  322|  5.14M|}

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

file_is_tar:
   64|  10.7k|{
   65|  10.7k|	const unsigned char *buf = CAST(const unsigned char *, b->fbuf);
  ------------------
  |  |  460|  10.7k|#define CAST(T, b)	((T)(b))
  ------------------
   66|  10.7k|	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|  10.7k|	int tar;
   72|  10.7k|	int mime = ms->flags & MAGIC_MIME;
  ------------------
  |  |   44|  10.7k|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   37|  10.7k|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  ------------------
  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   43|  10.7k|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  ------------------
  ------------------
   73|       |
   74|  10.7k|	if ((ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION)) != 0)
  ------------------
  |  |   45|  10.7k|#define	MAGIC_APPLE		0x0000800 /* Return the Apple creator/type */
  ------------------
              	if ((ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION)) != 0)
  ------------------
  |  |   46|  10.7k|#define	MAGIC_EXTENSION		0x1000000 /* Return a /-separated list of
  ------------------
  |  Branch (74:6): [True: 0, False: 10.7k]
  ------------------
   75|      0|		return 0;
   76|       |
   77|  10.7k|	tar = is_tar(buf, nbytes);
   78|  10.7k|	if (tar < 1 || tar > 3)
  ------------------
  |  Branch (78:6): [True: 10.7k, False: 32]
  |  Branch (78:17): [True: 0, False: 32]
  ------------------
   79|  10.7k|		return 0;
   80|       |
   81|     32|	if (mime == MAGIC_MIME_ENCODING)
  ------------------
  |  |   43|     32|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  ------------------
  |  Branch (81:6): [True: 0, False: 32]
  ------------------
   82|      0|		return 1;
   83|       |
   84|     32|	if (file_printf(ms, "%s", mime ? "application/x-tar" :
  ------------------
  |  Branch (84:6): [True: 0, False: 32]
  |  Branch (84:28): [True: 0, False: 32]
  ------------------
   85|     32|	    tartype[tar - 1]) == -1)
   86|      0|		return -1;
   87|       |
   88|     32|	return 1;
   89|     32|}
is_tar.c:is_tar:
  100|  10.7k|{
  101|  10.7k|	static const char gpkg_match[] = "/gpkg-1";
  102|       |
  103|  10.7k|	const union record *header = RCAST(const union record *,
  ------------------
  |  |  461|  10.7k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
  104|  10.7k|	    RCAST(const void *, buf));
  105|  10.7k|	size_t i;
  106|  10.7k|	int sum, recsum;
  107|  10.7k|	const unsigned char *p, *ep;
  108|  10.7k|	const char *nulp;
  109|       |
  110|  10.7k|	if (nbytes < sizeof(*header))
  ------------------
  |  Branch (110:6): [True: 7.53k, False: 3.24k]
  ------------------
  111|  7.53k|		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.24k|	nulp = CAST(const char *,
  ------------------
  |  |  460|  3.24k|#define CAST(T, b)	((T)(b))
  ------------------
  117|  3.24k|	    memchr(header->header.name, 0, sizeof(header->header.name)));
  118|  3.24k|	if (nulp != NULL && nulp >= header->header.name + sizeof(gpkg_match) &&
  ------------------
  |  Branch (118:6): [True: 2.79k, False: 449]
  |  Branch (118:22): [True: 1.91k, False: 884]
  ------------------
  119|  1.91k|	    memcmp(nulp - sizeof(gpkg_match) + 1, gpkg_match,
  ------------------
  |  Branch (119:6): [True: 10, False: 1.90k]
  ------------------
  120|  1.91k|	    sizeof(gpkg_match)) == 0)
  121|     10|	    return 0;
  122|       |
  123|  3.23k|	recsum = from_oct(header->header.chksum, sizeof(header->header.chksum));
  124|       |
  125|  3.23k|	sum = 0;
  126|  3.23k|	p = header->charptr;
  127|  3.23k|	ep = header->charptr + sizeof(*header);
  128|  1.66M|	while (p < ep)
  ------------------
  |  Branch (128:9): [True: 1.65M, False: 3.23k]
  ------------------
  129|  1.65M|		sum += *p++;
  130|       |
  131|       |	/* Adjust checksum to count the "chksum" field as blanks. */
  132|  29.1k|	for (i = 0; i < sizeof(header->header.chksum); i++)
  ------------------
  |  Branch (132:14): [True: 25.8k, False: 3.23k]
  ------------------
  133|  25.8k|		sum -= header->header.chksum[i];
  134|  3.23k|	sum += ' ' * sizeof(header->header.chksum);
  135|       |
  136|  3.23k|	if (sum != recsum)
  ------------------
  |  Branch (136:6): [True: 3.20k, False: 32]
  ------------------
  137|  3.20k|		return 0;	/* Not a tar archive */
  138|       |
  139|     32|	if (strncmp(header->header.magic, GNUTMAGIC,
  ------------------
  |  |   73|     32|#define	GNUTMAGIC	"ustar  "	/* 7 chars and a null */
  ------------------
  |  Branch (139:6): [True: 3, False: 29]
  ------------------
  140|     32|	    sizeof(header->header.magic)) == 0)
  141|      3|		return 3;		/* GNU Unix Standard tar archive */
  142|       |
  143|     29|	if (strncmp(header->header.magic, TMAGIC,
  ------------------
  |  |   72|     29|#define	TMAGIC		"ustar"		/* 5 chars and a null */
  ------------------
  |  Branch (143:6): [True: 3, False: 26]
  ------------------
  144|     29|	    sizeof(header->header.magic)) == 0)
  145|      3|		return 2;		/* Unix Standard tar archive */
  146|       |
  147|     26|	return 1;			/* Old fashioned tar archive */
  148|     29|}
is_tar.c:from_oct:
  158|  3.23k|{
  159|  3.23k|	int	value;
  160|       |
  161|  4.00k|	while (digs > 0 && isspace(CAST(unsigned char, *where))) {	/* Skip spaces */
  ------------------
  |  Branch (161:9): [True: 3.94k, False: 62]
  |  Branch (161:21): [True: 768, False: 3.17k]
  ------------------
  162|    768|		where++;
  163|    768|		digs--;
  164|    768|	}
  165|  3.23k|	if (digs == 0)
  ------------------
  |  Branch (165:6): [True: 62, False: 3.17k]
  ------------------
  166|     62|		return -1;		/* All blank field */
  167|  3.17k|	value = 0;
  168|  3.72k|	while (digs > 0 && isodigit(*where)) {	/* Scan til non-octal */
  ------------------
  |  |   51|  3.68k|#define	isodigit(c)	( ((c) >= '0') && ((c) <= '7') )
  |  |  ------------------
  |  |  |  Branch (51:23): [True: 1.21k, False: 2.47k]
  |  |  |  Branch (51:39): [True: 554, False: 658]
  |  |  ------------------
  ------------------
  |  Branch (168:9): [True: 3.68k, False: 45]
  ------------------
  169|    554|		value = (value << 3) | (*where++ - '0');
  170|    554|		digs--;
  171|    554|	}
  172|       |
  173|  3.17k|	if (digs > 0 && *where && !isspace(CAST(unsigned char, *where)))
  ------------------
  |  Branch (173:6): [True: 3.13k, False: 45]
  |  Branch (173:18): [True: 1.68k, False: 1.44k]
  |  Branch (173:28): [True: 1.66k, False: 14]
  ------------------
  174|  1.66k|		return -1;			/* Ended on non-(space/NUL) */
  175|       |
  176|  1.50k|	return value;
  177|  3.17k|}

magic_getpath:
  256|      2|{
  257|      2|	if (magicfile != NULL)
  ------------------
  |  Branch (257:6): [True: 2, False: 0]
  ------------------
  258|      2|		return magicfile;
  259|       |
  260|      0|	magicfile = getenv("MAGIC");
  261|      0|	if (magicfile != NULL)
  ------------------
  |  Branch (261:6): [True: 0, False: 0]
  ------------------
  262|      0|		return magicfile;
  263|       |
  264|      0|	return action == FILE_LOAD ? get_default_magic() : MAGIC;
  ------------------
  |  |  195|      0|#define	FILE_LOAD	0
  ------------------
  |  Branch (264:9): [True: 0, False: 0]
  ------------------
  265|      0|}
magic_open:
  269|      2|{
  270|      2|	return file_ms_alloc(flags);
  271|      2|}
magic_load:
  319|      2|{
  320|      2|	if (ms == NULL)
  ------------------
  |  Branch (320:6): [True: 0, False: 2]
  ------------------
  321|      0|		return -1;
  322|      2|	return file_apprentice(ms, magicfile, FILE_LOAD);
  ------------------
  |  |  195|      2|#define	FILE_LOAD	0
  ------------------
  323|      2|}
magic_buffer:
  570|  7.27k|{
  571|  7.27k|	if (ms == NULL)
  ------------------
  |  Branch (571:6): [True: 0, False: 7.27k]
  ------------------
  572|      0|		return NULL;
  573|  7.27k|	if (file_reset(ms, 1) == -1)
  ------------------
  |  Branch (573:6): [True: 0, False: 7.27k]
  ------------------
  574|      0|		return NULL;
  575|       |	/*
  576|       |	 * The main work is done here!
  577|       |	 * We have the file name and/or the data buffer to be identified.
  578|       |	 */
  579|  7.27k|	if (file_buffer(ms, -1, NULL, NULL, buf, nb) == -1) {
  ------------------
  |  Branch (579:6): [True: 299, False: 6.98k]
  ------------------
  580|    299|		return NULL;
  581|    299|	}
  582|  6.98k|	return file_getbuffer(ms);
  583|  7.27k|}
magic_setflags:
  613|      2|{
  614|      2|	if (ms == NULL)
  ------------------
  |  Branch (614:6): [True: 0, False: 2]
  ------------------
  615|      0|		return -1;
  616|       |#if !defined(HAVE_UTIME) && !defined(HAVE_UTIMES)
  617|       |	if (flags & MAGIC_PRESERVE_ATIME)
  618|       |		return -1;
  619|       |#endif
  620|      2|	ms->flags = flags;
  621|      2|	return 0;
  622|      2|}

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

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

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

file_softmagic:
  130|  13.1k|{
  131|  13.1k|	struct mlist *ml;
  132|  13.1k|	int rv = 0, printed_something = 0, need_separator = 0, firstline = 1;
  133|  13.1k|	uint16_t nc, ic;
  134|       |
  135|  13.1k|	if (name_count == NULL) {
  ------------------
  |  Branch (135:6): [True: 13.1k, False: 0]
  ------------------
  136|  13.1k|		nc = 0;
  137|  13.1k|		name_count = &nc;
  138|  13.1k|	}
  139|  13.1k|	if (indir_count == NULL) {
  ------------------
  |  Branch (139:6): [True: 13.1k, False: 0]
  ------------------
  140|  13.1k|		ic = 0;
  141|  13.1k|		indir_count = &ic;
  142|  13.1k|	}
  143|       |
  144|  25.8k|	for (ml = ms->mlist[0]->next; ml != ms->mlist[0]; ml = ml->next) {
  ------------------
  |  Branch (144:32): [True: 13.1k, False: 12.7k]
  ------------------
  145|  13.1k|		int ret = match(ms, ml->magic, ml->magic_rxcomp, ml->nmagic, b,
  146|  13.1k|		    0, mode, text, 0, indir_count, name_count,
  147|  13.1k|		    &printed_something, &need_separator, &firstline,
  148|  13.1k|		    NULL, NULL);
  149|  13.1k|		switch (ret) {
  150|    383|		case -1:
  ------------------
  |  Branch (150:3): [True: 383, False: 12.7k]
  ------------------
  151|    383|			return ret;
  152|  5.33k|		case 0:
  ------------------
  |  Branch (152:3): [True: 5.33k, False: 7.76k]
  ------------------
  153|  5.33k|			continue;
  154|  7.38k|		default:
  ------------------
  |  Branch (154:3): [True: 7.38k, False: 5.71k]
  ------------------
  155|  7.38k|			if ((ms->flags & MAGIC_CONTINUE) == 0)
  ------------------
  |  |   38|  7.38k|#define	MAGIC_CONTINUE		0x0000020 /* Return all matches */
  ------------------
  |  Branch (155:8): [True: 0, False: 7.38k]
  ------------------
  156|      0|				return ret;
  157|  7.38k|			rv = ret;
  158|  7.38k|			break;
  159|  13.1k|		}
  160|  13.1k|	}
  161|       |
  162|  12.7k|	return rv;
  163|  13.1k|}
softmagic.c:match:
  222|  95.3k|{
  223|  95.3k|	uint32_t magindex = 0;
  224|  95.3k|	unsigned int cont_level = 0;
  225|  95.3k|	int found_matchv = 0; /* if a match is found it is set to 1*/
  226|  95.3k|	int returnvalv = 0, e;
  227|  95.3k|	struct buffer bb;
  228|  95.3k|	int print = (ms->flags & MAGIC_NODESC) == 0;
  ------------------
  |  |   52|  95.3k|#define MAGIC_NODESC		(MAGIC_EXTENSION|MAGIC_MIME|MAGIC_APPLE)
  |  |  ------------------
  |  |  |  |   46|  95.3k|#define	MAGIC_EXTENSION		0x1000000 /* Return a /-separated list of
  |  |  ------------------
  |  |               #define MAGIC_NODESC		(MAGIC_EXTENSION|MAGIC_MIME|MAGIC_APPLE)
  |  |  ------------------
  |  |  |  |   44|  95.3k|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|  95.3k|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  |  |  ------------------
  |  |  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|  95.3k|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define MAGIC_NODESC		(MAGIC_EXTENSION|MAGIC_MIME|MAGIC_APPLE)
  |  |  ------------------
  |  |  |  |   45|  95.3k|#define	MAGIC_APPLE		0x0000800 /* Return the Apple creator/type */
  |  |  ------------------
  ------------------
  229|       |
  230|  95.3k|	(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|  95.3k|	if (returnval == NULL)
  ------------------
  |  Branch (235:6): [True: 46.4k, False: 48.9k]
  ------------------
  236|  46.4k|		returnval = &returnvalv;
  237|  95.3k|	if (found_match == NULL)
  ------------------
  |  Branch (237:6): [True: 46.4k, False: 48.9k]
  ------------------
  238|  46.4k|		found_match = &found_matchv;
  239|       |
  240|  95.3k|	if (file_check_mem(ms, cont_level) == -1)
  ------------------
  |  Branch (240:6): [True: 0, False: 95.3k]
  ------------------
  241|      0|		return -1;
  242|       |
  243|   173M|	for (magindex = 0; magindex < nmagic; magindex++) {
  ------------------
  |  Branch (243:21): [True: 173M, False: 82.4k]
  ------------------
  244|   173M|		int flush = 0;
  245|   173M|		struct magic *m = &magic[magindex];
  246|   173M|		file_regex_t **m_rxcomp = &magic_rxcomp[magindex];
  247|       |
  248|   173M|		if (m->type != FILE_NAME)
  ------------------
  |  |  298|   173M|#define				FILE_NAME		45
  ------------------
  |  Branch (248:7): [True: 173M, False: 48.9k]
  ------------------
  249|   173M|		if ((IS_STRING(m->type) &&
  ------------------
  |  |  318|   347M|	((t) == FILE_STRING || \
  |  |  ------------------
  |  |  |  |  258|   347M|#define				FILE_STRING		5
  |  |  ------------------
  |  |  |  Branch (318:3): [True: 106M, False: 66.9M]
  |  |  ------------------
  |  |  319|   173M|	 (t) == FILE_PSTRING || \
  |  |  ------------------
  |  |  |  |  266|   240M|#define				FILE_PSTRING		13
  |  |  ------------------
  |  |  |  Branch (319:3): [True: 45.7k, False: 66.8M]
  |  |  ------------------
  |  |  320|   173M|	 (t) == FILE_BESTRING16 || \
  |  |  ------------------
  |  |  |  |  271|   240M|#define				FILE_BESTRING16		18
  |  |  ------------------
  |  |  |  Branch (320:3): [True: 0, False: 66.8M]
  |  |  ------------------
  |  |  321|   173M|	 (t) == FILE_LESTRING16 || \
  |  |  ------------------
  |  |  |  |  272|   240M|#define				FILE_LESTRING16		19
  |  |  ------------------
  |  |  |  Branch (321:3): [True: 91.5k, False: 66.7M]
  |  |  ------------------
  |  |  322|   173M|	 (t) == FILE_REGEX || \
  |  |  ------------------
  |  |  |  |  270|   240M|#define				FILE_REGEX		17
  |  |  ------------------
  |  |  |  Branch (322:3): [True: 3.43M, False: 63.3M]
  |  |  ------------------
  |  |  323|   173M|	 (t) == FILE_SEARCH || \
  |  |  ------------------
  |  |  |  |  273|   237M|#define				FILE_SEARCH		20
  |  |  ------------------
  |  |  |  Branch (323:3): [True: 11.6M, False: 51.7M]
  |  |  ------------------
  |  |  324|   173M|	 (t) == FILE_INDIRECT || \
  |  |  ------------------
  |  |  |  |  294|   225M|#define				FILE_INDIRECT		41
  |  |  ------------------
  |  |  |  Branch (324:3): [True: 0, False: 51.7M]
  |  |  ------------------
  |  |  325|   173M|	 (t) == FILE_NAME || \
  |  |  ------------------
  |  |  |  |  298|   225M|#define				FILE_NAME		45
  |  |  ------------------
  |  |  |  Branch (325:3): [True: 0, False: 51.7M]
  |  |  ------------------
  |  |  326|   173M|	 (t) == FILE_USE || \
  |  |  ------------------
  |  |  |  |  299|   225M|#define				FILE_USE		46
  |  |  ------------------
  |  |  |  Branch (326:3): [True: 0, False: 51.7M]
  |  |  ------------------
  |  |  327|   347M|	 (t) == FILE_OCTAL)
  |  |  ------------------
  |  |  |  |  314|  51.7M|#define				FILE_OCTAL		61
  |  |  ------------------
  |  |  |  Branch (327:3): [True: 0, False: 51.7M]
  |  |  ------------------
  ------------------
  250|   122M|#define FLT (STRING_BINTEST | STRING_TEXTTEST)
  251|   122M|		     ((text && (m->str_flags & FLT) == STRING_BINTEST) ||
  ------------------
  |  |  390|  13.0M|#define str_flags _u._s._flags
  ------------------
              		     ((text && (m->str_flags & FLT) == STRING_BINTEST) ||
  ------------------
  |  |  250|  13.0M|#define FLT (STRING_BINTEST | STRING_TEXTTEST)
  |  |  ------------------
  |  |  |  |  410|  13.0M|#define STRING_BINTEST				BIT(6)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|  13.0M|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define FLT (STRING_BINTEST | STRING_TEXTTEST)
  |  |  ------------------
  |  |  |  |  409|  13.0M|#define STRING_TEXTTEST				BIT(5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|  13.0M|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
              		     ((text && (m->str_flags & FLT) == STRING_BINTEST) ||
  ------------------
  |  |  410|  13.0M|#define STRING_BINTEST				BIT(6)
  |  |  ------------------
  |  |  |  |  403|  13.0M|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (251:10): [True: 13.0M, False: 108M]
  |  Branch (251:18): [True: 523k, False: 12.5M]
  ------------------
  252|   121M|		      (!text && (m->str_flags & FLT) == STRING_TEXTTEST))) ||
  ------------------
  |  |  390|   108M|#define str_flags _u._s._flags
  ------------------
              		      (!text && (m->str_flags & FLT) == STRING_TEXTTEST))) ||
  ------------------
  |  |  250|   108M|#define FLT (STRING_BINTEST | STRING_TEXTTEST)
  |  |  ------------------
  |  |  |  |  410|   108M|#define STRING_BINTEST				BIT(6)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|   108M|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define FLT (STRING_BINTEST | STRING_TEXTTEST)
  |  |  ------------------
  |  |  |  |  409|   108M|#define STRING_TEXTTEST				BIT(5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|   108M|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
              		      (!text && (m->str_flags & FLT) == STRING_TEXTTEST))) ||
  ------------------
  |  |  409|   108M|#define STRING_TEXTTEST				BIT(5)
  |  |  ------------------
  |  |  |  |  403|   108M|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (252:10): [True: 108M, False: 12.5M]
  |  Branch (252:19): [True: 5.77M, False: 103M]
  ------------------
  253|   167M|		    (m->flag & mode) != mode) {
  ------------------
  |  Branch (253:7): [True: 20.0M, False: 147M]
  ------------------
  254|   173M|flush:
  255|       |			/* Skip sub-tests */
  256|   782M|			while (magindex < nmagic - 1 &&
  ------------------
  |  Branch (256:11): [True: 782M, False: 5.02k]
  ------------------
  257|   782M|			    magic[magindex + 1].cont_level != 0) {
  ------------------
  |  Branch (257:8): [True: 608M, False: 173M]
  ------------------
  258|   608M|				magindex++;
  259|   608M|			}
  260|   173M|			cont_level = 0;
  261|   173M|			continue; /* Skip to next top-level test*/
  262|  26.3M|		}
  263|       |
  264|   147M|		if (msetoffset(ms, m, &bb, b, offset, cont_level) == -1) {
  ------------------
  |  Branch (264:7): [True: 83.6k, False: 147M]
  ------------------
  265|  83.6k|			if (b->elen == FILE_BADSIZE)
  ------------------
  |  |  183|  83.6k|#define FILE_BADSIZE CAST(size_t, ~0ul)
  |  |  ------------------
  |  |  |  |  460|  83.6k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (265:8): [True: 0, False: 83.6k]
  ------------------
  266|      0|				continue;
  267|  83.6k|			else
  268|  83.6k|				goto flush;
  269|  83.6k|		}
  270|   147M|		ms->line = m->lineno;
  271|       |
  272|       |		/* if main entry matches, print it... */
  273|   147M|		switch (mget(ms, m, b, &bb, offset, cont_level,
  274|   147M|		    mode, text, flip, indir_count, name_count,
  275|   147M|		    printed_something, need_separator, firstline, returnval,
  276|   147M|		    found_match))
  277|   147M|		{
  278|    265|		case -1:
  ------------------
  |  Branch (278:3): [True: 265, False: 147M]
  ------------------
  279|    265|			return -1;
  280|  15.1M|		case 0:
  ------------------
  |  Branch (280:3): [True: 15.1M, False: 132M]
  ------------------
  281|  15.1M|			flush = m->reln != '!';
  282|  15.1M|			break;
  283|   132M|		default:
  ------------------
  |  Branch (283:3): [True: 132M, False: 15.1M]
  ------------------
  284|   132M|			if (m->type == FILE_INDIRECT) {
  ------------------
  |  |  294|   132M|#define				FILE_INDIRECT		41
  ------------------
  |  Branch (284:8): [True: 0, False: 132M]
  ------------------
  285|      0|				*found_match = 1;
  286|      0|				*returnval = 1;
  287|      0|			}
  288|       |
  289|   132M|			switch (magiccheck(ms, m, m_rxcomp)) {
  290|      0|			case -1:
  ------------------
  |  Branch (290:4): [True: 0, False: 132M]
  ------------------
  291|      0|				return -1;
  292|   131M|			case 0:
  ------------------
  |  Branch (292:4): [True: 131M, False: 527k]
  ------------------
  293|   131M|				flush++;
  294|   131M|				break;
  295|   527k|			default:
  ------------------
  |  Branch (295:4): [True: 527k, False: 131M]
  ------------------
  296|   527k|				flush = 0;
  297|   527k|				break;
  298|   132M|			}
  299|   132M|			break;
  300|   147M|		}
  301|   147M|		if (flush) {
  ------------------
  |  Branch (301:7): [True: 146M, False: 527k]
  ------------------
  302|       |			/*
  303|       |			 * main entry didn't match,
  304|       |			 * flush its continuations
  305|       |			 */
  306|   146M|			goto flush;
  307|   146M|		}
  308|       |
  309|   527k|		if ((e = handle_annotation(ms, m, *firstline)) != 0)
  ------------------
  |  Branch (309:7): [True: 0, False: 527k]
  ------------------
  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|   527k|		if (*m->desc) {
  ------------------
  |  Branch (323:7): [True: 15.0k, False: 512k]
  ------------------
  324|  15.0k|			*found_match = 1;
  325|  15.0k|			if (print) {
  ------------------
  |  Branch (325:8): [True: 15.0k, False: 0]
  ------------------
  326|  15.0k|				*returnval = 1;
  327|  15.0k|				*need_separator = 1;
  328|  15.0k|				*printed_something = 1;
  329|  15.0k|				if (print_sep(ms, *firstline) == -1)
  ------------------
  |  Branch (329:9): [True: 0, False: 15.0k]
  ------------------
  330|      0|					return -1;
  331|  15.0k|				if (mprint(ms, m) == -1)
  ------------------
  |  Branch (331:9): [True: 0, False: 15.0k]
  ------------------
  332|      0|					return -1;
  333|  15.0k|			}
  334|  15.0k|		}
  335|       |
  336|   527k|		switch (moffset(ms, m, bb.flen, offset,
  337|   527k|		    &ms->c.li[cont_level].off)) {
  338|  22.0k|		case -1:
  ------------------
  |  Branch (338:3): [True: 22.0k, False: 505k]
  ------------------
  339|  22.0k|		case 0:
  ------------------
  |  Branch (339:3): [True: 0, False: 527k]
  ------------------
  340|  22.0k|			goto flush;
  341|   505k|		default:
  ------------------
  |  Branch (341:3): [True: 505k, False: 22.0k]
  ------------------
  342|   505k|			break;
  343|   527k|		}
  344|       |
  345|       |		/* and any continuations that match */
  346|   505k|		if (file_check_mem(ms, ++cont_level) == -1)
  ------------------
  |  Branch (346:7): [True: 0, False: 505k]
  ------------------
  347|      0|			return -1;
  348|       |
  349|  5.77M|		while (magindex + 1 < nmagic &&
  ------------------
  |  Branch (349:10): [True: 5.69M, False: 77.4k]
  ------------------
  350|  5.69M|		    magic[magindex + 1].cont_level != 0) {
  ------------------
  |  Branch (350:7): [True: 5.28M, False: 415k]
  ------------------
  351|  5.28M|			m = &magic[++magindex];
  352|  5.28M|			m_rxcomp = &magic_rxcomp[magindex];
  353|  5.28M|			ms->line = m->lineno; /* for messages */
  354|       |
  355|  5.28M|			if (cont_level < m->cont_level)
  ------------------
  |  Branch (355:8): [True: 3.81M, False: 1.46M]
  ------------------
  356|  3.81M|				continue;
  357|  1.46M|			if (cont_level > m->cont_level) {
  ------------------
  |  Branch (357:8): [True: 116k, False: 1.35M]
  ------------------
  358|       |				/*
  359|       |				 * We're at the end of the level
  360|       |				 * "cont_level" continuations.
  361|       |				 */
  362|   116k|				cont_level = m->cont_level;
  363|   116k|			}
  364|  1.46M|			if (msetoffset(ms, m, &bb, b, offset, cont_level)
  ------------------
  |  Branch (364:8): [True: 120, False: 1.46M]
  ------------------
  365|  1.46M|			    == -1) {
  366|    120|				if (b->elen == FILE_BADSIZE)
  ------------------
  |  |  183|    120|#define FILE_BADSIZE CAST(size_t, ~0ul)
  |  |  ------------------
  |  |  |  |  460|    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.46M|			if (m->flag & OFFADD) {
  ------------------
  |  |  235|  1.46M|#define OFFADD		0x02	/* if '>&' or '>...(&' appears */
  ------------------
  |  Branch (371:8): [True: 184k, False: 1.28M]
  ------------------
  372|   184k|				if (cont_level == 0) {
  ------------------
  |  Branch (372:9): [True: 0, False: 184k]
  ------------------
  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|   184k|				ms->offset +=
  380|   184k|				    ms->c.li[cont_level - 1].off;
  381|   184k|			}
  382|       |
  383|  1.46M|#ifdef ENABLE_CONDITIONALS
  384|  1.46M|			if (m->cond == COND_ELSE ||
  ------------------
  |  |  371|  2.93M|#define				COND_ELSE	3
  ------------------
  |  Branch (384:8): [True: 0, False: 1.46M]
  ------------------
  385|  1.46M|			    m->cond == COND_ELIF) {
  ------------------
  |  |  370|  1.46M|#define				COND_ELIF	2
  ------------------
  |  Branch (385:8): [True: 0, False: 1.46M]
  ------------------
  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.46M|#endif
  390|  1.46M|			switch (mget(ms, m, b, &bb, offset,
  391|  1.46M|			    cont_level, mode, text, flip, indir_count,
  392|  1.46M|			    name_count, printed_something, need_separator,
  393|  1.46M|			    firstline, returnval, found_match)) {
  394|  12.6k|			case -1:
  ------------------
  |  Branch (394:4): [True: 12.6k, False: 1.45M]
  ------------------
  395|  12.6k|				return -1;
  396|  94.8k|			case 0:
  ------------------
  |  Branch (396:4): [True: 94.8k, False: 1.37M]
  ------------------
  397|  94.8k|				if (m->reln != '!')
  ------------------
  |  Branch (397:9): [True: 93.0k, False: 1.74k]
  ------------------
  398|  93.0k|					continue;
  399|  1.74k|				flush = 1;
  400|  1.74k|				break;
  401|  1.36M|			default:
  ------------------
  |  Branch (401:4): [True: 1.36M, False: 107k]
  ------------------
  402|  1.36M|				if (m->type == FILE_INDIRECT) {
  ------------------
  |  |  294|  1.36M|#define				FILE_INDIRECT		41
  ------------------
  |  Branch (402:9): [True: 15.3k, False: 1.34M]
  ------------------
  403|  15.3k|					*found_match = 1;
  404|  15.3k|					*returnval = 1;
  405|  15.3k|				}
  406|  1.36M|				flush = 0;
  407|  1.36M|				break;
  408|  1.46M|			}
  409|       |
  410|  1.36M|			switch (flush ? 1 : magiccheck(ms, m, m_rxcomp)) {
  ------------------
  |  Branch (410:12): [True: 1.74k, False: 1.36M]
  ------------------
  411|      0|			case -1:
  ------------------
  |  Branch (411:4): [True: 0, False: 1.36M]
  ------------------
  412|      0|				return -1;
  413|   967k|			case 0:
  ------------------
  |  Branch (413:4): [True: 967k, False: 395k]
  ------------------
  414|   967k|#ifdef ENABLE_CONDITIONALS
  415|   967k|				ms->c.li[cont_level].last_match = 0;
  416|   967k|#endif
  417|   967k|				break;
  418|   395k|			default:
  ------------------
  |  Branch (418:4): [True: 395k, False: 967k]
  ------------------
  419|   395k|#ifdef ENABLE_CONDITIONALS
  420|   395k|				ms->c.li[cont_level].last_match = 1;
  421|   395k|#endif
  422|   395k|				if (m->type == FILE_CLEAR)
  ------------------
  |  |  300|   395k|#define				FILE_CLEAR		47
  ------------------
  |  Branch (422:9): [True: 1.76k, False: 394k]
  ------------------
  423|  1.76k|					ms->c.li[cont_level].got_match = 0;
  424|   394k|				else if (ms->c.li[cont_level].got_match) {
  ------------------
  |  Branch (424:14): [True: 89.4k, False: 304k]
  ------------------
  425|  89.4k|					if (m->type == FILE_DEFAULT)
  ------------------
  |  |  256|  89.4k|#define				FILE_DEFAULT		3
  ------------------
  |  Branch (425:10): [True: 1.54k, False: 87.8k]
  ------------------
  426|  1.54k|						break;
  427|  89.4k|				} else
  428|   304k|					ms->c.li[cont_level].got_match = 1;
  429|       |
  430|   394k|				if ((e = handle_annotation(ms, m, *firstline))
  ------------------
  |  Branch (430:9): [True: 0, False: 394k]
  ------------------
  431|   394k|				    != 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|   394k|				if (*m->desc) {
  ------------------
  |  Branch (439:9): [True: 104k, False: 290k]
  ------------------
  440|   104k|					*found_match = 1;
  441|   104k|				}
  442|   394k|				if (print && *m->desc) {
  ------------------
  |  Branch (442:9): [True: 394k, False: 0]
  |  Branch (442:18): [True: 104k, False: 290k]
  ------------------
  443|   104k|					*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|   104k|					if (!*printed_something) {
  ------------------
  |  Branch (455:10): [True: 15.2k, False: 89.0k]
  ------------------
  456|  15.2k|						*printed_something = 1;
  457|  15.2k|						if (print_sep(ms, *firstline)
  ------------------
  |  Branch (457:11): [True: 0, False: 15.2k]
  ------------------
  458|  15.2k|						    == -1)
  459|      0|							return -1;
  460|  15.2k|					}
  461|       |					/* space if previous printed */
  462|   104k|					if (*need_separator
  ------------------
  |  Branch (462:10): [True: 101k, False: 2.99k]
  ------------------
  463|   101k|					    && (m->flag & NOSPACE) == 0) {
  ------------------
  |  |  238|   101k|#define NOSPACE		0x10	/* suppress space character before output */
  ------------------
  |  Branch (463:13): [True: 37.5k, False: 63.7k]
  ------------------
  464|  37.5k|						if (file_printf(ms, " ") == -1)
  ------------------
  |  Branch (464:11): [True: 0, False: 37.5k]
  ------------------
  465|      0|							return -1;
  466|  37.5k|					}
  467|   104k|					if (mprint(ms, m) == -1)
  ------------------
  |  Branch (467:10): [True: 0, False: 104k]
  ------------------
  468|      0|						return -1;
  469|   104k|					*need_separator = 1;
  470|   104k|				}
  471|       |
  472|   394k|				switch (moffset(ms, m, bb.flen, offset,
  473|   394k|				    &ms->c.li[cont_level].off)) {
  474|  3.92k|				case -1:
  ------------------
  |  Branch (474:5): [True: 3.92k, False: 390k]
  ------------------
  475|  3.92k|				case 0:
  ------------------
  |  Branch (475:5): [True: 0, False: 394k]
  ------------------
  476|  3.92k|					cont_level--;
  477|  3.92k|					break;
  478|   390k|				default:
  ------------------
  |  Branch (478:5): [True: 390k, False: 3.92k]
  ------------------
  479|   390k|					break;
  480|   394k|				}
  481|       |
  482|       |				/*
  483|       |				 * If we see any continuations
  484|       |				 * at a higher level,
  485|       |				 * process them.
  486|       |				 */
  487|   394k|				if (file_check_mem(ms, ++cont_level) == -1)
  ------------------
  |  Branch (487:9): [True: 0, False: 394k]
  ------------------
  488|      0|					return -1;
  489|   394k|				break;
  490|  1.36M|			}
  491|  1.36M|		}
  492|   492k|		if (*printed_something) {
  ------------------
  |  Branch (492:7): [True: 51.9k, False: 440k]
  ------------------
  493|  51.9k|			*firstline = 0;
  494|  51.9k|		}
  495|   492k|		if (*found_match) {
  ------------------
  |  Branch (495:7): [True: 249k, False: 243k]
  ------------------
  496|   249k|			if ((ms->flags & MAGIC_CONTINUE) == 0)
  ------------------
  |  |   38|   249k|#define	MAGIC_CONTINUE		0x0000020 /* Return all matches */
  ------------------
  |  Branch (496:8): [True: 0, False: 249k]
  ------------------
  497|      0|				return *returnval;
  498|       |			// So that we print a separator
  499|   249k|			*printed_something = 0;
  500|   249k|			*firstline = 0;
  501|   249k|		}
  502|   492k|		cont_level = 0;
  503|   492k|	}
  504|  82.4k|	return *returnval;
  505|  95.3k|}
softmagic.c:msetoffset:
 1571|   148M|{
 1572|   148M|	int32_t offset;
 1573|   148M|	if (m->flag & OFFNEGATIVE) {
  ------------------
  |  |  242|   148M|#define OFFNEGATIVE	0x80	/* relative to the end of file */
  ------------------
  |  Branch (1573:6): [True: 466k, False: 148M]
  ------------------
 1574|   466k|		offset = -m->offset;
 1575|   466k|		if (cont_level > 0) {
  ------------------
  |  Branch (1575:7): [True: 38.8k, False: 427k]
  ------------------
 1576|  38.8k|			if (m->flag & (OFFADD|INDIROFFADD))
  ------------------
  |  |  235|  38.8k|#define OFFADD		0x02	/* if '>&' or '>...(&' appears */
  ------------------
              			if (m->flag & (OFFADD|INDIROFFADD))
  ------------------
  |  |  236|  38.8k|#define INDIROFFADD	0x04	/* if '>&(' appears */
  ------------------
  |  Branch (1576:8): [True: 33.8k, False: 5.03k]
  ------------------
 1577|  33.8k|				goto normal;
 1578|       |#if 0
 1579|       |			file_error(ms, 0, "negative offset %d at continuation"
 1580|       |			    "level %u", m->offset, cont_level);
 1581|       |			return -1;
 1582|       |#endif
 1583|  38.8k|		}
 1584|   432k|		if (buffer_fill(b) == -1)
  ------------------
  |  Branch (1584:7): [True: 0, False: 432k]
  ------------------
 1585|      0|			return -1;
 1586|   432k|		if (o != 0) {
  ------------------
  |  Branch (1586:7): [True: 26, False: 432k]
  ------------------
 1587|       |			// Not yet!
 1588|     26|			file_magerror(ms, "non zero offset %" SIZE_T_FORMAT
 1589|     26|			    "u at level %u", o, cont_level);
 1590|     26|			return -1;
 1591|     26|		}
 1592|   432k|		if (b->fd == -1) {
  ------------------
  |  Branch (1592:7): [True: 432k, False: 0]
  ------------------
 1593|   432k|			if (CAST(size_t, m->offset) > b->flen)
  ------------------
  |  |  460|   432k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (1593:8): [True: 83.7k, False: 349k]
  ------------------
 1594|  83.7k|				return -1;
 1595|   349k|			ms->eoffset = ms->offset =
 1596|   349k|			    CAST(int32_t, b->flen - m->offset);
  ------------------
  |  |  460|   349k|#define CAST(T, b)	((T)(b))
  ------------------
 1597|   349k|		} else {
 1598|      0|			if (CAST(size_t, m->offset) > b->elen)
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (1598:8): [True: 0, False: 0]
  ------------------
 1599|      0|				return -1;
 1600|      0|			buffer_init(bb, -1, NULL, b->ebuf, b->elen);
 1601|      0|			ms->eoffset = ms->offset =
 1602|      0|			    CAST(int32_t, b->elen - m->offset);
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 1603|      0|		}
 1604|   148M|	} else {
 1605|   148M|		offset = m->offset;
 1606|   148M|		if ((m->flag & OFFPOSITIVE) || cont_level == 0) {
  ------------------
  |  |  243|   148M|#define OFFPOSITIVE	0x100	/* relative to the beginning of file */
  ------------------
  |  Branch (1606:7): [True: 75, False: 148M]
  |  Branch (1606:34): [True: 147M, False: 1.43M]
  ------------------
 1607|   147M|normal:
 1608|       |			// XXX: Pass real fd, then who frees bb?
 1609|   147M|			buffer_init(bb, -1, NULL, b->fbuf, b->flen);
 1610|   147M|			ms->offset = offset;
 1611|   147M|			ms->eoffset = 0;
 1612|   147M|		} else {
 1613|  1.43M|			ms->offset = ms->eoffset + offset;
 1614|  1.43M|		}
 1615|   148M|	}
 1616|   148M|	if ((ms->flags & MAGIC_DEBUG) != 0) {
  ------------------
  |  |   33|   148M|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1616:6): [True: 0, False: 148M]
  ------------------
 1617|       |		fprintf(stderr, "bb=[%p,%" SIZE_T_FORMAT "u,%"
 1618|      0|		    SIZE_T_FORMAT "u], %d [b=%p,%"
 1619|      0|		    SIZE_T_FORMAT "u,%" SIZE_T_FORMAT "u], [o=%#x, c=%d]\n",
 1620|      0|		    bb->fbuf, bb->flen, bb->elen, ms->offset, b->fbuf,
 1621|      0|		    b->flen, b->elen, offset, cont_level);
 1622|      0|	}
 1623|   148M|	return 0;
 1624|   148M|}
softmagic.c:mget:
 1654|   148M|{
 1655|   148M|	uint32_t eoffset, offset = ms->offset;
 1656|   148M|	struct buffer sbb;
 1657|   148M|	intmax_t lhs;
 1658|   148M|	file_pushbuf_t *pb;
 1659|   148M|	int rv, oneed_separator, in_type, nfound_match;
 1660|   148M|	char *rbuf;
 1661|   148M|	union VALUETYPE *p = &ms->ms_value;
 1662|   148M|	struct mlist ml, *mlp;
 1663|   148M|	struct cont c;
 1664|   148M|	const unsigned char *s = CAST(const unsigned char *, bb->fbuf);
  ------------------
  |  |  460|   148M|#define CAST(T, b)	((T)(b))
  ------------------
 1665|   148M|	size_t nbytes = bb->flen;
 1666|       |
 1667|   148M|	if (*indir_count >= ms->indir_max) {
  ------------------
  |  Branch (1667:6): [True: 263, False: 148M]
  ------------------
 1668|    263|		file_error(ms, 0, "indirect count (%hu) exceeded",
 1669|    263|		    *indir_count);
 1670|    263|		return -1;
 1671|    263|	}
 1672|       |
 1673|   148M|	if (*name_count >= ms->name_max) {
  ------------------
  |  Branch (1673:6): [True: 2, False: 148M]
  ------------------
 1674|      2|		file_error(ms, 0, "name use count (%hu) exceeded",
 1675|      2|		    *name_count);
 1676|      2|		return -1;
 1677|      2|	}
 1678|       |
 1679|       |
 1680|   148M|	if (mcopy(ms, p, m->type, m->flag & INDIR, s,
  ------------------
  |  |  234|   148M|#define INDIR		0x01	/* if '(...)' appears */
  ------------------
  |  Branch (1680:6): [True: 0, False: 148M]
  ------------------
 1681|   148M|	    CAST(uint32_t, offset + o), CAST(uint32_t, nbytes), m) == -1)
  ------------------
  |  |  460|   148M|#define CAST(T, b)	((T)(b))
  ------------------
              	    CAST(uint32_t, offset + o), CAST(uint32_t, nbytes), m) == -1)
  ------------------
  |  |  460|   148M|#define CAST(T, b)	((T)(b))
  ------------------
 1682|      0|		return -1;
 1683|       |
 1684|   148M|	if ((ms->flags & MAGIC_DEBUG) != 0) {
  ------------------
  |  |   33|   148M|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1684:6): [True: 0, False: 148M]
  ------------------
 1685|      0|		fprintf(stderr, "mget(type=%d, flag=%#x, offset=%u, o=%"
 1686|      0|		    SIZE_T_FORMAT "u, " "nbytes=%" SIZE_T_FORMAT
 1687|      0|		    "u, il=%hu, nc=%hu)\n",
 1688|      0|		    m->type, m->flag, offset, o, nbytes,
 1689|      0|		    *indir_count, *name_count);
 1690|      0|		mdebug(offset, RCAST(char *, RCAST(void *, p)),
  ------------------
  |  |  461|      0|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 1691|      0|		    sizeof(union VALUETYPE));
 1692|      0|#ifndef COMPILE_ONLY
 1693|      0|		file_mdump(m);
 1694|      0|#endif
 1695|      0|	}
 1696|       |
 1697|   148M|	if (m->flag & INDIR) {
  ------------------
  |  |  234|   148M|#define INDIR		0x01	/* if '(...)' appears */
  ------------------
  |  Branch (1697:6): [True: 991k, False: 147M]
  ------------------
 1698|   991k|		intmax_t off = m->in_offset;
 1699|   991k|		const int sgn = m->in_op & FILE_OPSIGNED;
  ------------------
  |  |  363|   991k|#define				FILE_OPSIGNED	0x20
  ------------------
 1700|   991k|		if (m->in_op & FILE_OPINDIRECT) {
  ------------------
  |  |  365|   991k|#define				FILE_OPINDIRECT	0x80
  ------------------
  |  Branch (1700:7): [True: 1.07k, False: 990k]
  ------------------
 1701|  1.07k|			uint8_t *hb;
 1702|  1.07k|			uint16_t hs;
 1703|  1.07k|			uint32_t hl;
 1704|  1.07k|			int op;
 1705|       |
 1706|  1.07k|			if (offset_oob(nbytes, offset + off, 0))
  ------------------
  |  Branch (1706:8): [True: 91, False: 985]
  ------------------
 1707|     91|				return 0;
 1708|    985|			hb = CCAST(uint8_t *, s + offset + off);
  ------------------
  |  |  462|    985|#define CCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 1709|    985|			switch (op = cvt_flip(m->in_type, flip)) {
 1710|      0|			case FILE_BYTE:
  ------------------
  |  |  254|      0|#define 			FILE_BYTE		1
  ------------------
  |  Branch (1710:4): [True: 0, False: 985]
  ------------------
 1711|      0|				if (offset_oob(nbytes, offset + off, 1))
  ------------------
  |  Branch (1711:9): [True: 0, False: 0]
  ------------------
 1712|      0|					return 0;
 1713|      0|				off = SEXT(sgn,8,hb[0]);
  ------------------
  |  |  108|      0|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 0]
  |  |  ------------------
  |  |  109|      0|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|      0|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1714|      0|				break;
 1715|      0|			case FILE_SHORT:
  ------------------
  |  |  255|      0|#define				FILE_SHORT		2
  ------------------
  |  Branch (1715:4): [True: 0, False: 985]
  ------------------
 1716|      0|				if (offset_oob(nbytes, offset + off, 2))
  ------------------
  |  Branch (1716:9): [True: 0, False: 0]
  ------------------
 1717|      0|					return 0;
 1718|      0|				memcpy(&hs, hb, sizeof(hs));
 1719|      0|				off = SEXT(sgn,16,hs);
  ------------------
  |  |  108|      0|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 0]
  |  |  ------------------
  |  |  109|      0|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|      0|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1720|      0|				break;
 1721|      0|			case FILE_BESHORT:
  ------------------
  |  |  260|      0|#define				FILE_BESHORT		7
  ------------------
  |  Branch (1721:4): [True: 0, False: 985]
  ------------------
 1722|      0|				if (offset_oob(nbytes, offset + off, 2))
  ------------------
  |  Branch (1722:9): [True: 0, False: 0]
  ------------------
 1723|      0|					return 0;
 1724|      0|				off = SEXT(sgn,16,BE16(hb));
  ------------------
  |  |  108|      0|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 0]
  |  |  ------------------
  |  |  109|      0|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|      0|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1725|      0|				break;
 1726|      0|			case FILE_LESHORT:
  ------------------
  |  |  263|      0|#define				FILE_LESHORT		10
  ------------------
  |  Branch (1726:4): [True: 0, False: 985]
  ------------------
 1727|      0|				if (offset_oob(nbytes, offset + off, 2))
  ------------------
  |  Branch (1727:9): [True: 0, False: 0]
  ------------------
 1728|      0|					return 0;
 1729|      0|				off = SEXT(sgn,16,LE16(hb));
  ------------------
  |  |  108|      0|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 0]
  |  |  ------------------
  |  |  109|      0|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|      0|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1730|      0|				break;
 1731|      0|			case FILE_LONG:
  ------------------
  |  |  257|      0|#define				FILE_LONG		4
  ------------------
  |  Branch (1731:4): [True: 0, False: 985]
  ------------------
 1732|      0|				if (offset_oob(nbytes, offset + off, 4))
  ------------------
  |  Branch (1732:9): [True: 0, False: 0]
  ------------------
 1733|      0|					return 0;
 1734|      0|				memcpy(&hl, hb, sizeof(hl));
 1735|      0|				off = SEXT(sgn,32,hl);
  ------------------
  |  |  108|      0|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 0]
  |  |  ------------------
  |  |  109|      0|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|      0|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1736|      0|				break;
 1737|      0|			case FILE_BELONG:
  ------------------
  |  |  261|      0|#define				FILE_BELONG		8
  ------------------
  |  Branch (1737:4): [True: 0, False: 985]
  ------------------
 1738|      0|			case FILE_BEID3:
  ------------------
  |  |  292|      0|#define				FILE_BEID3		39
  ------------------
  |  Branch (1738:4): [True: 0, False: 985]
  ------------------
 1739|      0|				if (offset_oob(nbytes, offset + off, 4))
  ------------------
  |  Branch (1739:9): [True: 0, False: 0]
  ------------------
 1740|      0|					return 0;
 1741|      0|				off = SEXT(sgn,32,BE32(hb));
  ------------------
  |  |  108|      0|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 0]
  |  |  ------------------
  |  |  109|      0|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|      0|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1742|      0|				break;
 1743|      0|			case FILE_LEID3:
  ------------------
  |  |  293|      0|#define				FILE_LEID3		40
  ------------------
  |  Branch (1743:4): [True: 0, False: 985]
  ------------------
 1744|    985|			case FILE_LELONG:
  ------------------
  |  |  264|    985|#define				FILE_LELONG		11
  ------------------
  |  Branch (1744:4): [True: 985, False: 0]
  ------------------
 1745|    985|				if (offset_oob(nbytes, offset + off, 4))
  ------------------
  |  Branch (1745:9): [True: 89, False: 896]
  ------------------
 1746|     89|					return 0;
 1747|    896|				off = SEXT(sgn,32,LE32(hb));
  ------------------
  |  |  108|    896|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 896]
  |  |  ------------------
  |  |  109|    896|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|    896|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  460|    896|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1748|    896|				break;
 1749|      0|			case FILE_MELONG:
  ------------------
  |  |  276|      0|#define				FILE_MELONG		23
  ------------------
  |  Branch (1749:4): [True: 0, False: 985]
  ------------------
 1750|      0|				if (offset_oob(nbytes, offset + off, 4))
  ------------------
  |  Branch (1750:9): [True: 0, False: 0]
  ------------------
 1751|      0|					return 0;
 1752|      0|				off = SEXT(sgn,32,ME32(hb));
  ------------------
  |  |  108|      0|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 0]
  |  |  ------------------
  |  |  109|      0|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|      0|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1753|      0|				break;
 1754|      0|			case FILE_BEQUAD:
  ------------------
  |  |  279|      0|#define				FILE_BEQUAD		26
  ------------------
  |  Branch (1754:4): [True: 0, False: 985]
  ------------------
 1755|      0|				if (offset_oob(nbytes, offset + off, 8))
  ------------------
  |  Branch (1755:9): [True: 0, False: 0]
  ------------------
 1756|      0|					return 0;
 1757|      0|				off = SEXT(sgn,64,BE64(hb));
  ------------------
  |  |  108|      0|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 0]
  |  |  ------------------
  |  |  109|      0|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|      0|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1758|      0|				break;
 1759|      0|			case FILE_LEQUAD:
  ------------------
  |  |  278|      0|#define				FILE_LEQUAD		25
  ------------------
  |  Branch (1759:4): [True: 0, False: 985]
  ------------------
 1760|      0|				if (offset_oob(nbytes, offset + off, 8))
  ------------------
  |  Branch (1760:9): [True: 0, False: 0]
  ------------------
 1761|      0|					return 0;
 1762|      0|				off = SEXT(sgn,64,LE64(hb));
  ------------------
  |  |  108|      0|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 0]
  |  |  ------------------
  |  |  109|      0|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|      0|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1763|      0|				break;
 1764|      0|			case FILE_OCTAL:
  ------------------
  |  |  314|      0|#define				FILE_OCTAL		61
  ------------------
  |  Branch (1764:4): [True: 0, False: 985]
  ------------------
 1765|      0|				if (offset_oob(nbytes, offset, m->vallen))
  ------------------
  |  Branch (1765:9): [True: 0, False: 0]
  ------------------
 1766|      0|					return 0;
 1767|      0|				off = SEXT(sgn,64,strtoull(p->s, NULL, 8));
  ------------------
  |  |  108|      0|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 0]
  |  |  ------------------
  |  |  109|      0|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|      0|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1768|      0|				break;
 1769|      0|			default:
  ------------------
  |  Branch (1769:4): [True: 0, False: 985]
  ------------------
 1770|      0|				if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|      0|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1770:9): [True: 0, False: 0]
  ------------------
 1771|      0|					fprintf(stderr, "bad op=%d\n", op);
 1772|      0|				return 0;
 1773|    985|			}
 1774|    896|			if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|    896|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1774:8): [True: 0, False: 896]
  ------------------
 1775|      0|				fprintf(stderr, "indirect offs=%jd\n", off);
 1776|    896|		}
 1777|   991k|		switch (in_type = cvt_flip(m->in_type, flip)) {
 1778|  18.8k|		case FILE_BYTE:
  ------------------
  |  |  254|  18.8k|#define 			FILE_BYTE		1
  ------------------
  |  Branch (1778:3): [True: 18.8k, False: 972k]
  ------------------
 1779|  18.8k|			if (offset_oob(nbytes, offset, 1))
  ------------------
  |  Branch (1779:8): [True: 36, False: 18.7k]
  ------------------
 1780|     36|				return 0;
 1781|  18.7k|			if (do_ops(ms, m, &offset, SEXT(sgn,8,p->b), off))
  ------------------
  |  |  108|  18.7k|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 18.7k]
  |  |  ------------------
  |  |  109|  18.7k|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|  18.7k|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  460|  18.7k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (1781:8): [True: 0, False: 18.7k]
  ------------------
 1782|      0|				return 0;
 1783|  18.7k|			break;
 1784|  18.7k|		case FILE_BESHORT:
  ------------------
  |  |  260|  12.9k|#define				FILE_BESHORT		7
  ------------------
  |  Branch (1784:3): [True: 12.9k, False: 978k]
  ------------------
 1785|  12.9k|			if (offset_oob(nbytes, offset, 2))
  ------------------
  |  Branch (1785:8): [True: 138, False: 12.7k]
  ------------------
 1786|    138|				return 0;
 1787|  12.7k|			if (do_ops(ms, m, &offset, SEXT(sgn,16,BE16(p->hs)), off))
  ------------------
  |  |  108|  12.7k|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 12.7k]
  |  |  ------------------
  |  |  109|  12.7k|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|  12.7k|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  460|  12.7k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (1787:8): [True: 0, False: 12.7k]
  ------------------
 1788|      0|				return 0;
 1789|  12.7k|			break;
 1790|  12.7k|		case FILE_LESHORT:
  ------------------
  |  |  263|  9.27k|#define				FILE_LESHORT		10
  ------------------
  |  Branch (1790:3): [True: 9.27k, False: 982k]
  ------------------
 1791|  9.27k|			if (offset_oob(nbytes, offset, 2))
  ------------------
  |  Branch (1791:8): [True: 807, False: 8.47k]
  ------------------
 1792|    807|				return 0;
 1793|  8.47k|			if (do_ops(ms, m, &offset, SEXT(sgn,16,LE16(p->hs)), off))
  ------------------
  |  |  108|  8.47k|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 8.47k]
  |  |  ------------------
  |  |  109|  8.47k|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|  8.47k|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  460|  8.47k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (1793:8): [True: 0, False: 8.47k]
  ------------------
 1794|      0|				return 0;
 1795|  8.47k|			break;
 1796|  8.47k|		case FILE_SHORT:
  ------------------
  |  |  255|      0|#define				FILE_SHORT		2
  ------------------
  |  Branch (1796:3): [True: 0, False: 991k]
  ------------------
 1797|      0|			if (offset_oob(nbytes, offset, 2))
  ------------------
  |  Branch (1797:8): [True: 0, False: 0]
  ------------------
 1798|      0|				return 0;
 1799|      0|			if (do_ops(ms, m, &offset, SEXT(sgn,16,p->h), off))
  ------------------
  |  |  108|      0|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 0]
  |  |  ------------------
  |  |  109|      0|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|      0|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (1799:8): [True: 0, False: 0]
  ------------------
 1800|      0|				return 0;
 1801|      0|			break;
 1802|  2.71k|		case FILE_BELONG:
  ------------------
  |  |  261|  2.71k|#define				FILE_BELONG		8
  ------------------
  |  Branch (1802:3): [True: 2.71k, False: 988k]
  ------------------
 1803|  2.85k|		case FILE_BEID3:
  ------------------
  |  |  292|  2.85k|#define				FILE_BEID3		39
  ------------------
  |  Branch (1803:3): [True: 138, False: 991k]
  ------------------
 1804|  2.85k|			if (offset_oob(nbytes, offset, 4))
  ------------------
  |  Branch (1804:8): [True: 220, False: 2.63k]
  ------------------
 1805|    220|				return 0;
 1806|  2.63k|			lhs = BE32(p->hl);
  ------------------
  |  |   95|  2.63k|#define BE32(p) ( \
  |  |   96|  2.63k|    (CAST(uint32_t, (p)[0])<<24)| \
  |  |  ------------------
  |  |  |  |  460|  2.63k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   97|  2.63k|    (CAST(uint32_t, (p)[1])<<16)| \
  |  |  ------------------
  |  |  |  |  460|  2.63k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   98|  2.63k|    (CAST(uint32_t, (p)[2])<<8)| \
  |  |  ------------------
  |  |  |  |  460|  2.63k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   99|  2.63k|    (CAST(uint32_t, (p)[3])))
  |  |  ------------------
  |  |  |  |  460|  2.63k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1807|  2.63k|			if (in_type == FILE_BEID3)
  ------------------
  |  |  292|  2.63k|#define				FILE_BEID3		39
  ------------------
  |  Branch (1807:8): [True: 95, False: 2.53k]
  ------------------
 1808|     95|				lhs = cvt_id3(ms, CAST(uint32_t, lhs));
  ------------------
  |  |  460|     95|#define CAST(T, b)	((T)(b))
  ------------------
 1809|  2.63k|			if (do_ops(ms, m, &offset, SEXT(sgn,32,lhs), off))
  ------------------
  |  |  108|  2.63k|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 2.63k]
  |  |  ------------------
  |  |  109|  2.63k|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|  2.63k|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  460|  2.63k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (1809:8): [True: 319, False: 2.31k]
  ------------------
 1810|    319|				return 0;
 1811|  2.31k|			break;
 1812|   942k|		case FILE_LELONG:
  ------------------
  |  |  264|   942k|#define				FILE_LELONG		11
  ------------------
  |  Branch (1812:3): [True: 942k, False: 49.2k]
  ------------------
 1813|   942k|		case FILE_LEID3:
  ------------------
  |  |  293|   942k|#define				FILE_LEID3		40
  ------------------
  |  Branch (1813:3): [True: 0, False: 991k]
  ------------------
 1814|   942k|			if (offset_oob(nbytes, offset, 4))
  ------------------
  |  Branch (1814:8): [True: 300k, False: 642k]
  ------------------
 1815|   300k|				return 0;
 1816|   642k|			lhs = LE32(p->hl);
  ------------------
  |  |   90|   642k|#define LE32(p) ( \
  |  |   91|   642k|    (CAST(uint32_t, (p)[3])<<24)| \
  |  |  ------------------
  |  |  |  |  460|   642k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   92|   642k|    (CAST(uint32_t, (p)[2])<<16)| \
  |  |  ------------------
  |  |  |  |  460|   642k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   93|   642k|    (CAST(uint32_t, (p)[1])<<8)| \
  |  |  ------------------
  |  |  |  |  460|   642k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   94|   642k|    (CAST(uint32_t, (p)[0])))
  |  |  ------------------
  |  |  |  |  460|   642k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1817|   642k|			if (in_type == FILE_LEID3)
  ------------------
  |  |  293|   642k|#define				FILE_LEID3		40
  ------------------
  |  Branch (1817:8): [True: 0, False: 642k]
  ------------------
 1818|      0|				lhs = cvt_id3(ms, CAST(uint32_t, lhs));
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 1819|   642k|			if (do_ops(ms, m, &offset, SEXT(sgn,32,lhs), off))
  ------------------
  |  |  108|   642k|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 642k]
  |  |  ------------------
  |  |  109|   642k|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|   642k|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  460|   642k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (1819:8): [True: 9.38k, False: 632k]
  ------------------
 1820|  9.38k|				return 0;
 1821|   632k|			break;
 1822|   632k|		case FILE_MELONG:
  ------------------
  |  |  276|      0|#define				FILE_MELONG		23
  ------------------
  |  Branch (1822:3): [True: 0, False: 991k]
  ------------------
 1823|      0|			if (offset_oob(nbytes, offset, 4))
  ------------------
  |  Branch (1823:8): [True: 0, False: 0]
  ------------------
 1824|      0|				return 0;
 1825|      0|			if (do_ops(ms, m, &offset, SEXT(sgn,32,ME32(p->hl)), off))
  ------------------
  |  |  108|      0|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 0]
  |  |  ------------------
  |  |  109|      0|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|      0|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (1825:8): [True: 0, False: 0]
  ------------------
 1826|      0|				return 0;
 1827|      0|			break;
 1828|    351|		case FILE_LONG:
  ------------------
  |  |  257|    351|#define				FILE_LONG		4
  ------------------
  |  Branch (1828:3): [True: 351, False: 991k]
  ------------------
 1829|    351|			if (offset_oob(nbytes, offset, 4))
  ------------------
  |  Branch (1829:8): [True: 78, False: 273]
  ------------------
 1830|     78|				return 0;
 1831|    273|			if (do_ops(ms, m, &offset, SEXT(sgn,32,p->l), off))
  ------------------
  |  |  108|    273|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 273]
  |  |  ------------------
  |  |  109|    273|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|    273|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  460|    273|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (1831:8): [True: 93, False: 180]
  ------------------
 1832|     93|				return 0;
 1833|    180|			break;
 1834|  4.19k|		case FILE_LEQUAD:
  ------------------
  |  |  278|  4.19k|#define				FILE_LEQUAD		25
  ------------------
  |  Branch (1834:3): [True: 4.19k, False: 987k]
  ------------------
 1835|  4.19k|			if (offset_oob(nbytes, offset, 8))
  ------------------
  |  Branch (1835:8): [True: 93, False: 4.10k]
  ------------------
 1836|     93|				return 0;
 1837|  4.10k|			if (do_ops(ms, m, &offset, SEXT(sgn,64,LE64(p->hq)), off))	
  ------------------
  |  |  108|  4.10k|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 4.10k]
  |  |  ------------------
  |  |  109|  4.10k|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|  4.10k|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  460|  4.10k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (1837:8): [True: 1.44k, False: 2.65k]
  ------------------
 1838|  1.44k|				return 0;
 1839|  2.65k|			break;
 1840|  2.65k|		case FILE_BEQUAD:
  ------------------
  |  |  279|    469|#define				FILE_BEQUAD		26
  ------------------
  |  Branch (1840:3): [True: 469, False: 991k]
  ------------------
 1841|    469|			if (offset_oob(nbytes, offset, 8))
  ------------------
  |  Branch (1841:8): [True: 0, False: 469]
  ------------------
 1842|      0|				return 0;
 1843|    469|			if (do_ops(ms, m, &offset, SEXT(sgn,64,BE64(p->hq)), off))
  ------------------
  |  |  108|    469|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 469]
  |  |  ------------------
  |  |  109|    469|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|    469|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  460|    469|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (1843:8): [True: 277, False: 192]
  ------------------
 1844|    277|				return 0;
 1845|    192|			break;
 1846|    391|		case FILE_OCTAL:
  ------------------
  |  |  314|    391|#define				FILE_OCTAL		61
  ------------------
  |  Branch (1846:3): [True: 391, False: 991k]
  ------------------
 1847|    391|			if (offset_oob(nbytes, offset, m->vallen))
  ------------------
  |  Branch (1847:8): [True: 143, False: 248]
  ------------------
 1848|    143|				return 0;
 1849|    248|			if(do_ops(ms, m, &offset,
  ------------------
  |  Branch (1849:7): [True: 67, False: 181]
  ------------------
 1850|    248|			    SEXT(sgn,64,strtoull(p->s, NULL, 8)), off))
  ------------------
  |  |  108|    248|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 248]
  |  |  ------------------
  |  |  109|    248|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|    248|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  460|    248|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1851|     67|				return 0;
 1852|    181|			break;
 1853|    181|		default:
  ------------------
  |  Branch (1853:3): [True: 0, False: 991k]
  ------------------
 1854|      0|			if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|      0|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1854:8): [True: 0, False: 0]
  ------------------
 1855|      0|				fprintf(stderr, "bad in_type=%d\n", in_type);
 1856|      0|			return 0;
 1857|   991k|		}
 1858|       |
 1859|   678k|		if (m->flag & INDIROFFADD) {
  ------------------
  |  |  236|   678k|#define INDIROFFADD	0x04	/* if '>&(' appears */
  ------------------
  |  Branch (1859:7): [True: 4.80k, False: 673k]
  ------------------
 1860|  4.80k|			if (cont_level == 0) {
  ------------------
  |  Branch (1860:8): [True: 0, False: 4.80k]
  ------------------
 1861|      0|				if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|      0|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1861:9): [True: 0, False: 0]
  ------------------
 1862|      0|					fprintf(stderr,
 1863|      0|					    "indirect *zero* cont_level\n");
 1864|      0|				return 0;
 1865|      0|			}
 1866|  4.80k|			offset += ms->c.li[cont_level - 1].off;
 1867|  4.80k|			if (offset == 0) {
  ------------------
  |  Branch (1867:8): [True: 174, False: 4.63k]
  ------------------
 1868|    174|				if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|    174|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1868:9): [True: 0, False: 174]
  ------------------
 1869|      0|					fprintf(stderr,
 1870|      0|					    "indirect *zero* offset\n");
 1871|    174|				return 0;
 1872|    174|			}
 1873|  4.63k|			if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  4.63k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1873:8): [True: 0, False: 4.63k]
  ------------------
 1874|      0|				fprintf(stderr, "indirect +offs=%u\n", offset);
 1875|  4.63k|		}
 1876|   678k|		if (mcopy(ms, p, m->type, 0, s, offset, nbytes, m) == -1)
  ------------------
  |  Branch (1876:7): [True: 0, False: 678k]
  ------------------
 1877|      0|			return -1;
 1878|   678k|		ms->offset = offset;
 1879|       |
 1880|   678k|		if ((ms->flags & MAGIC_DEBUG) != 0) {
  ------------------
  |  |   33|   678k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1880:7): [True: 0, False: 678k]
  ------------------
 1881|      0|			mdebug(offset, RCAST(char *, RCAST(void *, p)),
  ------------------
  |  |  461|      0|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 1882|      0|			    sizeof(union VALUETYPE));
 1883|      0|#ifndef COMPILE_ONLY
 1884|      0|			file_mdump(m);
 1885|      0|#endif
 1886|      0|		}
 1887|   678k|	}
 1888|       |
 1889|       |	/* Verify we have enough data to match magic type */
 1890|   148M|	switch (m->type) {
 1891|  2.41M|	case FILE_BYTE:
  ------------------
  |  |  254|  2.41M|#define 			FILE_BYTE		1
  ------------------
  |  Branch (1891:2): [True: 2.41M, False: 146M]
  ------------------
 1892|  2.41M|		if (offset_oob(nbytes, offset, 1))
  ------------------
  |  Branch (1892:7): [True: 166k, False: 2.24M]
  ------------------
 1893|   166k|			return 0;
 1894|  2.24M|		break;
 1895|       |
 1896|  2.78M|	case FILE_SHORT:
  ------------------
  |  |  255|  2.78M|#define				FILE_SHORT		2
  ------------------
  |  Branch (1896:2): [True: 2.78M, False: 145M]
  ------------------
 1897|  8.60M|	case FILE_BESHORT:
  ------------------
  |  |  260|  8.60M|#define				FILE_BESHORT		7
  ------------------
  |  Branch (1897:2): [True: 5.82M, False: 142M]
  ------------------
 1898|  14.0M|	case FILE_LESHORT:
  ------------------
  |  |  263|  14.0M|#define				FILE_LESHORT		10
  ------------------
  |  Branch (1898:2): [True: 5.42M, False: 143M]
  ------------------
 1899|  14.0M|		if (offset_oob(nbytes, offset, 2))
  ------------------
  |  Branch (1899:7): [True: 896k, False: 13.1M]
  ------------------
 1900|   896k|			return 0;
 1901|  13.1M|		break;
 1902|       |
 1903|  13.1M|	case FILE_LONG:
  ------------------
  |  |  257|  2.15M|#define				FILE_LONG		4
  ------------------
  |  Branch (1903:2): [True: 2.15M, False: 146M]
  ------------------
 1904|  20.3M|	case FILE_BELONG:
  ------------------
  |  |  261|  20.3M|#define				FILE_BELONG		8
  ------------------
  |  Branch (1904:2): [True: 18.1M, False: 130M]
  ------------------
 1905|  29.8M|	case FILE_LELONG:
  ------------------
  |  |  264|  29.8M|#define				FILE_LELONG		11
  ------------------
  |  Branch (1905:2): [True: 9.52M, False: 139M]
  ------------------
 1906|  29.8M|	case FILE_MELONG:
  ------------------
  |  |  276|  29.8M|#define				FILE_MELONG		23
  ------------------
  |  Branch (1906:2): [True: 39, False: 148M]
  ------------------
 1907|  29.8M|	case FILE_DATE:
  ------------------
  |  |  259|  29.8M|#define				FILE_DATE		6
  ------------------
  |  Branch (1907:2): [True: 0, False: 148M]
  ------------------
 1908|  29.8M|	case FILE_BEDATE:
  ------------------
  |  |  262|  29.8M|#define				FILE_BEDATE		9
  ------------------
  |  Branch (1908:2): [True: 665, False: 148M]
  ------------------
 1909|  29.8M|	case FILE_LEDATE:
  ------------------
  |  |  265|  29.8M|#define				FILE_LEDATE		12
  ------------------
  |  Branch (1909:2): [True: 227, False: 148M]
  ------------------
 1910|  29.8M|	case FILE_MEDATE:
  ------------------
  |  |  274|  29.8M|#define				FILE_MEDATE		21
  ------------------
  |  Branch (1910:2): [True: 143, False: 148M]
  ------------------
 1911|  29.8M|	case FILE_LDATE:
  ------------------
  |  |  267|  29.8M|#define				FILE_LDATE		14
  ------------------
  |  Branch (1911:2): [True: 0, False: 148M]
  ------------------
 1912|  29.8M|	case FILE_BELDATE:
  ------------------
  |  |  268|  29.8M|#define				FILE_BELDATE		15
  ------------------
  |  Branch (1912:2): [True: 453, False: 148M]
  ------------------
 1913|  29.8M|	case FILE_LELDATE:
  ------------------
  |  |  269|  29.8M|#define				FILE_LELDATE		16
  ------------------
  |  Branch (1913:2): [True: 138, False: 148M]
  ------------------
 1914|  29.8M|	case FILE_MELDATE:
  ------------------
  |  |  275|  29.8M|#define				FILE_MELDATE		22
  ------------------
  |  Branch (1914:2): [True: 0, False: 148M]
  ------------------
 1915|  29.8M|	case FILE_FLOAT:
  ------------------
  |  |  286|  29.8M|#define				FILE_FLOAT		33
  ------------------
  |  Branch (1915:2): [True: 0, False: 148M]
  ------------------
 1916|  29.8M|	case FILE_BEFLOAT:
  ------------------
  |  |  287|  29.8M|#define				FILE_BEFLOAT		34
  ------------------
  |  Branch (1916:2): [True: 0, False: 148M]
  ------------------
 1917|  29.8M|	case FILE_LEFLOAT:
  ------------------
  |  |  288|  29.8M|#define				FILE_LEFLOAT		35
  ------------------
  |  Branch (1917:2): [True: 8.27k, False: 148M]
  ------------------
 1918|  29.8M|		if (offset_oob(nbytes, offset, 4))
  ------------------
  |  Branch (1918:7): [True: 1.90M, False: 27.9M]
  ------------------
 1919|  1.90M|			return 0;
 1920|  27.9M|		break;
 1921|       |
 1922|  27.9M|	case FILE_DOUBLE:
  ------------------
  |  |  289|      0|#define				FILE_DOUBLE		36
  ------------------
  |  Branch (1922:2): [True: 0, False: 148M]
  ------------------
 1923|    201|	case FILE_BEDOUBLE:
  ------------------
  |  |  290|    201|#define				FILE_BEDOUBLE		37
  ------------------
  |  Branch (1923:2): [True: 201, False: 148M]
  ------------------
 1924|  3.19k|	case FILE_LEDOUBLE:
  ------------------
  |  |  291|  3.19k|#define				FILE_LEDOUBLE		38
  ------------------
  |  Branch (1924:2): [True: 2.99k, False: 148M]
  ------------------
 1925|  3.19k|		if (offset_oob(nbytes, offset, 8))
  ------------------
  |  Branch (1925:7): [True: 633, False: 2.55k]
  ------------------
 1926|    633|			return 0;
 1927|  2.55k|		break;
 1928|       |
 1929|  2.55k|	case FILE_LEGUID:
  ------------------
  |  |  303|      0|#define				FILE_LEGUID		50
  ------------------
  |  Branch (1929:2): [True: 0, False: 148M]
  ------------------
 1930|    127|	case FILE_BEGUID:
  ------------------
  |  |  304|    127|#define				FILE_BEGUID		51
  ------------------
  |  Branch (1930:2): [True: 127, False: 148M]
  ------------------
 1931|   332k|	case FILE_GUID:
  ------------------
  |  |  302|   332k|#define				FILE_GUID		49
  ------------------
  |  Branch (1931:2): [True: 332k, False: 148M]
  ------------------
 1932|   332k|		if (offset_oob(nbytes, offset, 16))
  ------------------
  |  Branch (1932:7): [True: 21.7k, False: 310k]
  ------------------
 1933|  21.7k|			return 0;
 1934|   310k|		break;
 1935|       |
 1936|  96.5M|	case FILE_STRING:
  ------------------
  |  |  258|  96.5M|#define				FILE_STRING		5
  ------------------
  |  Branch (1936:2): [True: 96.5M, False: 51.9M]
  ------------------
 1937|  96.6M|	case FILE_PSTRING:
  ------------------
  |  |  266|  96.6M|#define				FILE_PSTRING		13
  ------------------
  |  Branch (1937:2): [True: 46.5k, False: 148M]
  ------------------
 1938|  97.9M|	case FILE_SEARCH:
  ------------------
  |  |  273|  97.9M|#define				FILE_SEARCH		20
  ------------------
  |  Branch (1938:2): [True: 1.32M, False: 147M]
  ------------------
 1939|  97.9M|	case FILE_OCTAL:
  ------------------
  |  |  314|  97.9M|#define				FILE_OCTAL		61
  ------------------
  |  Branch (1939:2): [True: 0, False: 148M]
  ------------------
 1940|  97.9M|		if (offset_oob(nbytes, offset, m->vallen))
  ------------------
  |  Branch (1940:7): [True: 11.9M, False: 85.9M]
  ------------------
 1941|  11.9M|			return 0;
 1942|  85.9M|		break;
 1943|       |
 1944|  85.9M|	case FILE_REGEX:
  ------------------
  |  |  270|   559k|#define				FILE_REGEX		17
  ------------------
  |  Branch (1944:2): [True: 559k, False: 147M]
  ------------------
 1945|   559k|		if (nbytes < offset)
  ------------------
  |  Branch (1945:7): [True: 696, False: 559k]
  ------------------
 1946|    696|			return 0;
 1947|   559k|		break;
 1948|       |
 1949|   559k|	case FILE_INDIRECT:
  ------------------
  |  |  294|  35.2k|#define				FILE_INDIRECT		41
  ------------------
  |  Branch (1949:2): [True: 35.2k, False: 148M]
  ------------------
 1950|  35.2k|		if (m->str_flags & INDIRECT_RELATIVE)
  ------------------
  |  |  390|  35.2k|#define str_flags _u._s._flags
  ------------------
              		if (m->str_flags & INDIRECT_RELATIVE)
  ------------------
  |  |  443|  35.2k|#define	INDIRECT_RELATIVE			BIT(0)
  |  |  ------------------
  |  |  |  |  403|  35.2k|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (1950:7): [True: 2.35k, False: 32.8k]
  ------------------
 1951|  2.35k|			offset += CAST(uint32_t, o);
  ------------------
  |  |  460|  2.35k|#define CAST(T, b)	((T)(b))
  ------------------
 1952|  35.2k|		if (offset == 0)
  ------------------
  |  Branch (1952:7): [True: 289, False: 34.9k]
  ------------------
 1953|    289|			return 0;
 1954|       |
 1955|  34.9k|		if (nbytes < offset)
  ------------------
  |  Branch (1955:7): [True: 1.64k, False: 33.3k]
  ------------------
 1956|  1.64k|			return 0;
 1957|       |
 1958|  33.3k|		if ((pb = file_push_buffer(ms)) == NULL)
  ------------------
  |  Branch (1958:7): [True: 4, False: 33.3k]
  ------------------
 1959|      4|			return -1;
 1960|       |
 1961|  33.3k|		(*indir_count)++;
 1962|  33.3k|		sbb = *b;
 1963|  33.3k|		sbb.fbuf = s + offset;
 1964|  33.3k|		sbb.flen = nbytes - offset;
 1965|  33.3k|		sbb.ebuf = NULL;
 1966|  33.3k|		sbb.elen = 0;
 1967|  33.3k|		rv = -1;
 1968|  39.4k|		for (mlp = ms->mlist[0]->next; mlp != ms->mlist[0];
  ------------------
  |  Branch (1968:34): [True: 33.3k, False: 6.12k]
  ------------------
 1969|  33.3k|		    mlp = mlp->next)
 1970|  33.3k|		{
 1971|  33.3k|			if ((rv = match(ms, mlp->magic, mlp->magic_rxcomp,
  ------------------
  |  Branch (1971:8): [True: 27.1k, False: 6.12k]
  ------------------
 1972|  33.3k|			    mlp->nmagic, &sbb, 0, BINTEST, text, 0, indir_count,
  ------------------
  |  |  239|  33.3k|#define BINTEST		0x20	/* test is for a binary type (set only
  ------------------
 1973|  33.3k|			    name_count, printed_something, need_separator,
 1974|  33.3k|			    firstline, NULL, NULL)) != 0)
 1975|  27.1k|				break;
 1976|  33.3k|		}
 1977|  33.3k|		buffer_fini(&sbb);
 1978|       |
 1979|  33.3k|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  33.3k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1979:7): [True: 0, False: 33.3k]
  ------------------
 1980|      0|			fprintf(stderr, "indirect @offs=%u[%d]\n", offset, rv);
 1981|       |
 1982|  33.3k|		rbuf = file_pop_buffer(ms, pb);
 1983|  33.3k|		if (rbuf == NULL && ms->event_flags & EVENT_HAD_ERR)
  ------------------
  |  |  495|  15.7k|#define 		EVENT_HAD_ERR		0x01
  ------------------
  |  Branch (1983:7): [True: 15.7k, False: 17.5k]
  |  Branch (1983:23): [True: 11.6k, False: 4.07k]
  ------------------
 1984|  11.6k|			return -1;
 1985|       |
 1986|  21.6k|		if (rv == 1) {
  ------------------
  |  Branch (1986:7): [True: 15.5k, False: 6.12k]
  ------------------
 1987|  15.5k|			if ((ms->flags & MAGIC_NODESC) == 0 &&
  ------------------
  |  |   52|  15.5k|#define MAGIC_NODESC		(MAGIC_EXTENSION|MAGIC_MIME|MAGIC_APPLE)
  |  |  ------------------
  |  |  |  |   46|  15.5k|#define	MAGIC_EXTENSION		0x1000000 /* Return a /-separated list of
  |  |  ------------------
  |  |               #define MAGIC_NODESC		(MAGIC_EXTENSION|MAGIC_MIME|MAGIC_APPLE)
  |  |  ------------------
  |  |  |  |   44|  15.5k|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|  15.5k|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  |  |  ------------------
  |  |  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|  15.5k|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define MAGIC_NODESC		(MAGIC_EXTENSION|MAGIC_MIME|MAGIC_APPLE)
  |  |  ------------------
  |  |  |  |   45|  15.5k|#define	MAGIC_APPLE		0x0000800 /* Return the Apple creator/type */
  |  |  ------------------
  ------------------
  |  Branch (1987:8): [True: 15.5k, False: 0]
  ------------------
 1988|  15.5k|			    file_printf(ms, F(ms, m->desc, "%u"), offset) == -1)
  ------------------
  |  |  167|  15.5k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (1988:8): [True: 0, False: 15.5k]
  ------------------
 1989|      0|				goto out;
 1990|  15.5k|			if (rbuf && file_printf(ms, "%s", rbuf) == -1) {
  ------------------
  |  Branch (1990:8): [True: 15.5k, False: 0]
  |  Branch (1990:16): [True: 111, False: 15.3k]
  ------------------
 1991|    111|out:				free(rbuf);
 1992|    111|				return -1;
 1993|    111|			}
 1994|  15.5k|		}
 1995|  21.5k|		free(rbuf);
 1996|  21.5k|		return rv;
 1997|       |
 1998|  50.9k|	case FILE_USE:
  ------------------
  |  |  299|  50.9k|#define				FILE_USE		46
  ------------------
  |  Branch (1998:2): [True: 50.9k, False: 148M]
  ------------------
 1999|  50.9k|		if (nbytes < offset)
  ------------------
  |  Branch (1999:7): [True: 2.04k, False: 48.9k]
  ------------------
 2000|  2.04k|			return 0;
 2001|  48.9k|		rbuf = m->value.s;
 2002|  48.9k|		if (*rbuf == '^') {
  ------------------
  |  Branch (2002:7): [True: 1.42k, False: 47.4k]
  ------------------
 2003|  1.42k|			rbuf++;
 2004|  1.42k|			flip = !flip;
 2005|  1.42k|		}
 2006|  48.9k|		if (file_magicfind(ms, rbuf, &ml) == -1) {
  ------------------
  |  Branch (2006:7): [True: 0, False: 48.9k]
  ------------------
 2007|      0|			file_error(ms, 0, "cannot find entry `%s'", rbuf);
 2008|      0|			return -1;
 2009|      0|		}
 2010|  48.9k|		if (save_cont(ms, &c) == -1) {
  ------------------
  |  Branch (2010:7): [True: 0, False: 48.9k]
  ------------------
 2011|      0|			file_error(ms, errno, "can't allocate continuation");
 2012|      0|			return -1;
 2013|      0|		}
 2014|       |
 2015|  48.9k|		oneed_separator = *need_separator;
 2016|  48.9k|		if (m->flag & NOSPACE)
  ------------------
  |  |  238|  48.9k|#define NOSPACE		0x10	/* suppress space character before output */
  ------------------
  |  Branch (2016:7): [True: 982, False: 47.9k]
  ------------------
 2017|    982|			*need_separator = 0;
 2018|       |
 2019|  48.9k|		nfound_match = 0;
 2020|  48.9k|		(*name_count)++;
 2021|  48.9k|		eoffset = ms->eoffset;
 2022|  48.9k|		rv = match(ms, ml.magic, ml.magic_rxcomp, ml.nmagic, b,
 2023|  48.9k|		    offset + o, mode, text, flip, indir_count, name_count,
 2024|  48.9k|		    printed_something, need_separator, firstline, returnval,
 2025|  48.9k|		    &nfound_match);
 2026|  48.9k|		ms->ms_value.q = nfound_match;
 2027|  48.9k|		(*name_count)--;
 2028|  48.9k|		*found_match |= nfound_match;
 2029|       |
 2030|  48.9k|		restore_cont(ms, &c);
 2031|       |
 2032|  48.9k|		if (rv != 1)
  ------------------
  |  Branch (2032:7): [True: 11.9k, False: 36.9k]
  ------------------
 2033|  11.9k|		    *need_separator = oneed_separator;
 2034|  48.9k|		ms->offset = offset;
 2035|  48.9k|		ms->eoffset = eoffset;
 2036|  48.9k|		return rv ? rv : *found_match;
  ------------------
  |  Branch (2036:10): [True: 37.7k, False: 11.1k]
  ------------------
 2037|       |
 2038|  48.9k|	case FILE_NAME:
  ------------------
  |  |  298|  48.9k|#define				FILE_NAME		45
  ------------------
  |  Branch (2038:2): [True: 48.9k, False: 148M]
  ------------------
 2039|  48.9k|		if (ms->flags & MAGIC_NODESC)
  ------------------
  |  |   52|  48.9k|#define MAGIC_NODESC		(MAGIC_EXTENSION|MAGIC_MIME|MAGIC_APPLE)
  |  |  ------------------
  |  |  |  |   46|  48.9k|#define	MAGIC_EXTENSION		0x1000000 /* Return a /-separated list of
  |  |  ------------------
  |  |               #define MAGIC_NODESC		(MAGIC_EXTENSION|MAGIC_MIME|MAGIC_APPLE)
  |  |  ------------------
  |  |  |  |   44|  48.9k|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|  48.9k|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  |  |  ------------------
  |  |  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|  48.9k|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define MAGIC_NODESC		(MAGIC_EXTENSION|MAGIC_MIME|MAGIC_APPLE)
  |  |  ------------------
  |  |  |  |   45|  48.9k|#define	MAGIC_APPLE		0x0000800 /* Return the Apple creator/type */
  |  |  ------------------
  ------------------
  |  Branch (2039:7): [True: 0, False: 48.9k]
  ------------------
 2040|      0|			return 1;
 2041|  48.9k|		if (file_printf(ms, "%s", m->desc) == -1)
  ------------------
  |  Branch (2041:7): [True: 0, False: 48.9k]
  ------------------
 2042|      0|			return -1;
 2043|  48.9k|		return 1;
 2044|   518k|	case FILE_DER:
  ------------------
  |  |  301|   518k|#define				FILE_DER		48
  ------------------
  |  Branch (2044:2): [True: 518k, False: 148M]
  ------------------
 2045|   527k|	case FILE_DEFAULT:	/* nothing to check */
  ------------------
  |  |  256|   527k|#define				FILE_DEFAULT		3
  ------------------
  |  Branch (2045:2): [True: 8.72k, False: 148M]
  ------------------
 2046|   529k|	case FILE_CLEAR:
  ------------------
  |  |  300|   529k|#define				FILE_CLEAR		47
  ------------------
  |  Branch (2046:2): [True: 1.76k, False: 148M]
  ------------------
 2047|  3.28M|	default:
  ------------------
  |  Branch (2047:2): [True: 2.75M, False: 145M]
  ------------------
 2048|  3.28M|		break;
 2049|   148M|	}
 2050|   133M|	if (!mconvert(ms, m, flip))
  ------------------
  |  Branch (2050:6): [True: 83, False: 133M]
  ------------------
 2051|     83|		return 0;
 2052|   133M|	return 1;
 2053|   133M|}
softmagic.c:mcopy:
 1380|   149M|{
 1381|   149M|	size_t size = sizeof(*p);
 1382|       |	/*
 1383|       |	 * Note: FILE_SEARCH and FILE_REGEX do not actually copy
 1384|       |	 * anything, but setup pointers into the source
 1385|       |	 */
 1386|   149M|	if (indir == 0) {
  ------------------
  |  Branch (1386:6): [True: 148M, False: 991k]
  ------------------
 1387|   148M|		switch (type) {
 1388|   518k|		case FILE_DER:
  ------------------
  |  |  301|   518k|#define				FILE_DER		48
  ------------------
  |  Branch (1388:3): [True: 518k, False: 148M]
  ------------------
 1389|  1.84M|		case FILE_SEARCH:
  ------------------
  |  |  273|  1.84M|#define				FILE_SEARCH		20
  ------------------
  |  Branch (1389:3): [True: 1.32M, False: 147M]
  ------------------
 1390|  1.84M|			if (offset > nbytes)
  ------------------
  |  Branch (1390:8): [True: 61.6k, False: 1.77M]
  ------------------
 1391|  61.6k|				offset = CAST(uint32_t, nbytes);
  ------------------
  |  |  460|  61.6k|#define CAST(T, b)	((T)(b))
  ------------------
 1392|  1.84M|			ms->search.s = RCAST(const char *, s) + offset;
  ------------------
  |  |  461|  1.84M|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 1393|  1.84M|			ms->search.s_len = nbytes - offset;
 1394|  1.84M|			ms->search.offset = offset;
 1395|  1.84M|			return 0;
 1396|       |
 1397|   559k|		case FILE_REGEX: {
  ------------------
  |  |  270|   559k|#define				FILE_REGEX		17
  ------------------
  |  Branch (1397:3): [True: 559k, False: 147M]
  ------------------
 1398|   559k|			const char *b;
 1399|   559k|			const char *c;
 1400|   559k|			const char *last;	/* end of search region */
 1401|   559k|			const char *buf;	/* start of search region */
 1402|   559k|			const char *end;
 1403|   559k|			size_t lines, linecnt, bytecnt;
 1404|       |
 1405|   559k|			if (s == NULL || nbytes < offset) {
  ------------------
  |  Branch (1405:8): [True: 0, False: 559k]
  |  Branch (1405:21): [True: 766, False: 559k]
  ------------------
 1406|    766|				ms->search.s_len = 0;
 1407|    766|				ms->search.s = NULL;
 1408|    766|				return 0;
 1409|    766|			}
 1410|       |
 1411|   559k|			if (m->str_flags & REGEX_LINE_COUNT) {
  ------------------
  |  |  390|   559k|#define str_flags _u._s._flags
  ------------------
              			if (m->str_flags & REGEX_LINE_COUNT) {
  ------------------
  |  |  417|   559k|#define REGEX_LINE_COUNT			BIT(11)
  |  |  ------------------
  |  |  |  |  403|   559k|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (1411:8): [True: 61.0k, False: 498k]
  ------------------
 1412|  61.0k|				linecnt = m->str_range;
  ------------------
  |  |  389|  61.0k|#define str_range _u._s._count
  ------------------
 1413|  61.0k|				bytecnt = linecnt * 80;
 1414|   498k|			} else {
 1415|   498k|				linecnt = 0;
 1416|   498k|				bytecnt = m->str_range;
  ------------------
  |  |  389|   498k|#define str_range _u._s._count
  ------------------
 1417|   498k|			}
 1418|       |
 1419|   559k|			if (bytecnt == 0 || bytecnt > nbytes - offset)
  ------------------
  |  Branch (1419:8): [True: 243k, False: 316k]
  |  Branch (1419:24): [True: 188k, False: 127k]
  ------------------
 1420|   431k|				bytecnt = nbytes - offset;
 1421|   559k|			if (bytecnt > ms->regex_max)
  ------------------
  |  Branch (1421:8): [True: 74.1k, False: 485k]
  ------------------
 1422|  74.1k|				bytecnt = ms->regex_max;
 1423|       |
 1424|   559k|			buf = RCAST(const char *, s) + offset;
  ------------------
  |  |  461|   559k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 1425|   559k|			end = last = RCAST(const char *, s) + bytecnt + offset;
  ------------------
  |  |  461|   559k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 1426|       |			/* mget() guarantees buf <= last */
 1427|   788k|			for (lines = linecnt, b = buf; lines && b < end &&
  ------------------
  |  Branch (1427:35): [True: 287k, False: 500k]
  |  Branch (1427:44): [True: 284k, False: 3.57k]
  ------------------
 1428|   284k|			     ((b = CAST(const char *,
  ------------------
  |  |  460|   284k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (1428:10): [True: 139k, False: 144k]
  ------------------
 1429|   284k|				 memchr(c = b, '\n', CAST(size_t, (end - b)))))
 1430|   144k|			     || (b = CAST(const char *,
  ------------------
  |  |  460|   144k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (1430:12): [True: 89.4k, False: 55.2k]
  ------------------
 1431|   144k|				 memchr(c, '\r', CAST(size_t, (end - c))))));
 1432|   559k|			     lines--, b++) {
 1433|   229k|				if (b < end - 1 && b[0] == '\r' && b[1] == '\n')
  ------------------
  |  Branch (1433:9): [True: 226k, False: 2.94k]
  |  Branch (1433:24): [True: 88.3k, False: 137k]
  |  Branch (1433:40): [True: 0, False: 88.3k]
  ------------------
 1434|      0|					b++;
 1435|   229k|				if (b < end - 1 && b[0] == '\n')
  ------------------
  |  Branch (1435:9): [True: 226k, False: 2.94k]
  |  Branch (1435:24): [True: 137k, False: 88.3k]
  ------------------
 1436|   137k|					b++;
 1437|   229k|				last = b;
 1438|   229k|			}
 1439|   559k|			if (lines)
  ------------------
  |  Branch (1439:8): [True: 58.8k, False: 500k]
  ------------------
 1440|  58.8k|				last = end;
 1441|       |
 1442|   559k|			ms->search.s = buf;
 1443|   559k|			ms->search.s_len = last - buf;
 1444|   559k|			ms->search.offset = offset;
 1445|   559k|			ms->search.rm_len = 0;
 1446|   559k|			return 0;
 1447|   559k|		}
 1448|    159|		case FILE_BESTRING16:
  ------------------
  |  |  271|    159|#define				FILE_BESTRING16		18
  ------------------
  |  Branch (1448:3): [True: 159, False: 148M]
  ------------------
 1449|  87.8k|		case FILE_LESTRING16: {
  ------------------
  |  |  272|  87.8k|#define				FILE_LESTRING16		19
  ------------------
  |  Branch (1449:3): [True: 87.7k, False: 148M]
  ------------------
 1450|  87.8k|			const unsigned char *src = s + offset;
 1451|  87.8k|			const unsigned char *esrc = s + nbytes;
 1452|  87.8k|			char *dst = p->s;
 1453|  87.8k|			char *edst = &p->s[sizeof(p->s) - 1];
 1454|       |
 1455|  87.8k|			if (type == FILE_BESTRING16)
  ------------------
  |  |  271|  87.8k|#define				FILE_BESTRING16		18
  ------------------
  |  Branch (1455:8): [True: 159, False: 87.7k]
  ------------------
 1456|    159|				src++;
 1457|       |
 1458|       |			/* check that offset is within range */
 1459|  87.8k|			if (offset >= nbytes)
  ------------------
  |  Branch (1459:8): [True: 1.13k, False: 86.7k]
  ------------------
 1460|  1.13k|				break;
 1461|  6.78M|			for (/*EMPTY*/; src < esrc; src += 2, dst++) {
  ------------------
  |  Branch (1461:20): [True: 6.74M, False: 39.3k]
  ------------------
 1462|  6.74M|				if (dst < edst)
  ------------------
  |  Branch (1462:9): [True: 6.69M, False: 47.4k]
  ------------------
 1463|  6.69M|					*dst = *src;
 1464|  47.4k|				else
 1465|  47.4k|					break;
 1466|  6.69M|				if (*dst == '\0') {
  ------------------
  |  Branch (1466:9): [True: 3.02M, False: 3.67M]
  ------------------
 1467|  3.02M|					if (type == FILE_BESTRING16 ?
  ------------------
  |  |  271|  3.02M|#define				FILE_BESTRING16		18
  ------------------
  |  Branch (1467:10): [True: 9.37k, False: 3.01M]
  |  Branch (1467:10): [True: 497k, False: 2.52M]
  ------------------
 1468|  9.37k|					    *(src - 1) != '\0' :
 1469|  3.02M|					    ((src + 1 < esrc) &&
  ------------------
  |  Branch (1469:11): [True: 3.00M, False: 3.13k]
  ------------------
 1470|  3.00M|					    *(src + 1) != '\0'))
  ------------------
  |  Branch (1470:10): [True: 495k, False: 2.51M]
  ------------------
 1471|   497k|						*dst = ' ';
 1472|  3.02M|				}
 1473|  6.69M|			}
 1474|  86.7k|			*edst = '\0';
 1475|  86.7k|			*dst = '\0';
 1476|  86.7k|			return 0;
 1477|  87.8k|		}
 1478|  96.5M|		case FILE_STRING:	/* XXX - these two should not need */
  ------------------
  |  |  258|  96.5M|#define				FILE_STRING		5
  ------------------
  |  Branch (1478:3): [True: 96.5M, False: 51.9M]
  ------------------
 1479|  96.6M|		case FILE_PSTRING:	/* to copy anything, but do anyway. */
  ------------------
  |  |  266|  96.6M|#define				FILE_PSTRING		13
  ------------------
  |  Branch (1479:3): [True: 46.5k, False: 148M]
  ------------------
 1480|  96.6M|			if (m->str_range != 0 && m->str_range < sizeof(*p))
  ------------------
  |  |  389|  96.6M|#define str_range _u._s._count
  ------------------
              			if (m->str_range != 0 && m->str_range < sizeof(*p))
  ------------------
  |  |  389|  82.6k|#define str_range _u._s._count
  ------------------
  |  Branch (1480:8): [True: 82.6k, False: 96.5M]
  |  Branch (1480:29): [True: 82.6k, False: 0]
  ------------------
 1481|  82.6k|				size = m->str_range;
  ------------------
  |  |  389|  82.6k|#define str_range _u._s._count
  ------------------
 1482|  96.6M|			break;
 1483|  49.4M|		default:
  ------------------
  |  Branch (1483:3): [True: 49.4M, False: 99.0M]
  ------------------
 1484|  49.4M|			break;
 1485|   148M|		}
 1486|   148M|	}
 1487|       |
 1488|   147M|	if (type == FILE_OFFSET) {
  ------------------
  |  |  305|   147M|#define				FILE_OFFSET		52
  ------------------
  |  Branch (1488:6): [True: 5.52k, False: 147M]
  ------------------
 1489|  5.52k|		(void)memset(p, '\0', sizeof(*p));
 1490|  5.52k|		p->q = offset;
 1491|  5.52k|		return 0;
 1492|  5.52k|	}
 1493|       |
 1494|   147M|	if (offset >= nbytes) {
  ------------------
  |  Branch (1494:6): [True: 6.61M, False: 140M]
  ------------------
 1495|  6.61M|		(void)memset(p, '\0', sizeof(*p));
 1496|  6.61M|		return 0;
 1497|  6.61M|	}
 1498|   140M|	if (nbytes - offset < size)
  ------------------
  |  Branch (1498:6): [True: 61.6M, False: 78.7M]
  ------------------
 1499|  61.6M|		nbytes = nbytes - offset;
 1500|  78.7M|	else
 1501|  78.7M|		nbytes = size;
 1502|       |
 1503|   140M|	(void)memcpy(p, s + offset, nbytes);
 1504|       |
 1505|       |	/*
 1506|       |	 * the usefulness of padding with zeroes eludes me, it
 1507|       |	 * might even cause problems
 1508|       |	 */
 1509|   140M|	if (nbytes < sizeof(*p))
  ------------------
  |  Branch (1509:6): [True: 61.7M, False: 78.7M]
  ------------------
 1510|  61.7M|		(void)memset(RCAST(char *, RCAST(void *, p)) + nbytes, '\0',
  ------------------
  |  |  461|  61.7M|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 1511|  61.7M|		    sizeof(*p) - nbytes);
 1512|   140M|	return 0;
 1513|   147M|}
softmagic.c:offset_oob:
  114|   145M| {
  115|   145M|	if (o < 0)
  ------------------
  |  Branch (115:6): [True: 0, False: 145M]
  ------------------
  116|      0|		return 1;
  117|   145M|        if ((uintmax_t)o > n)
  ------------------
  |  Branch (117:13): [True: 6.03M, False: 139M]
  ------------------
  118|  6.03M|		return 1;
  119|   139M|        return i > n - (uintmax_t)o;
  120|   145M|}
softmagic.c:cvt_flip:
 1028|   134M|{
 1029|   134M|	if (flip == 0)
  ------------------
  |  Branch (1029:6): [True: 134M, False: 26.0k]
  ------------------
 1030|   134M|		return type;
 1031|  26.0k|	switch (type) {
 1032|      7|	case FILE_BESHORT:
  ------------------
  |  |  260|      7|#define				FILE_BESHORT		7
  ------------------
  |  Branch (1032:2): [True: 7, False: 26.0k]
  ------------------
 1033|      7|		return FILE_LESHORT;
  ------------------
  |  |  263|      7|#define				FILE_LESHORT		10
  ------------------
 1034|  7.05k|	case FILE_BELONG:
  ------------------
  |  |  261|  7.05k|#define				FILE_BELONG		8
  ------------------
  |  Branch (1034:2): [True: 7.05k, False: 19.0k]
  ------------------
 1035|  7.05k|		return FILE_LELONG;
  ------------------
  |  |  264|  7.05k|#define				FILE_LELONG		11
  ------------------
 1036|    106|	case FILE_BEDATE:
  ------------------
  |  |  262|    106|#define				FILE_BEDATE		9
  ------------------
  |  Branch (1036:2): [True: 106, False: 25.9k]
  ------------------
 1037|    106|		return FILE_LEDATE;
  ------------------
  |  |  265|    106|#define				FILE_LEDATE		12
  ------------------
 1038|      0|	case FILE_BELDATE:
  ------------------
  |  |  268|      0|#define				FILE_BELDATE		15
  ------------------
  |  Branch (1038:2): [True: 0, False: 26.0k]
  ------------------
 1039|      0|		return FILE_LELDATE;
  ------------------
  |  |  269|      0|#define				FILE_LELDATE		16
  ------------------
 1040|      0|	case FILE_BEQUAD:
  ------------------
  |  |  279|      0|#define				FILE_BEQUAD		26
  ------------------
  |  Branch (1040:2): [True: 0, False: 26.0k]
  ------------------
 1041|      0|		return FILE_LEQUAD;
  ------------------
  |  |  278|      0|#define				FILE_LEQUAD		25
  ------------------
 1042|  1.01k|	case FILE_BEQDATE:
  ------------------
  |  |  282|  1.01k|#define				FILE_BEQDATE		29
  ------------------
  |  Branch (1042:2): [True: 1.01k, False: 25.0k]
  ------------------
 1043|  1.01k|		return FILE_LEQDATE;
  ------------------
  |  |  281|  1.01k|#define				FILE_LEQDATE		28
  ------------------
 1044|      0|	case FILE_BEQLDATE:
  ------------------
  |  |  285|      0|#define				FILE_BEQLDATE		32
  ------------------
  |  Branch (1044:2): [True: 0, False: 26.0k]
  ------------------
 1045|      0|		return FILE_LEQLDATE;
  ------------------
  |  |  284|      0|#define				FILE_LEQLDATE		31
  ------------------
 1046|      0|	case FILE_BEQWDATE:
  ------------------
  |  |  297|      0|#define				FILE_BEQWDATE		44
  ------------------
  |  Branch (1046:2): [True: 0, False: 26.0k]
  ------------------
 1047|      0|		return FILE_LEQWDATE;
  ------------------
  |  |  296|      0|#define				FILE_LEQWDATE		43
  ------------------
 1048|  6.31k|	case FILE_LESHORT:
  ------------------
  |  |  263|  6.31k|#define				FILE_LESHORT		10
  ------------------
  |  Branch (1048:2): [True: 6.31k, False: 19.7k]
  ------------------
 1049|  6.31k|		return FILE_BESHORT;
  ------------------
  |  |  260|  6.31k|#define				FILE_BESHORT		7
  ------------------
 1050|  5.11k|	case FILE_LELONG:
  ------------------
  |  |  264|  5.11k|#define				FILE_LELONG		11
  ------------------
  |  Branch (1050:2): [True: 5.11k, False: 20.9k]
  ------------------
 1051|  5.11k|		return FILE_BELONG;
  ------------------
  |  |  261|  5.11k|#define				FILE_BELONG		8
  ------------------
 1052|     72|	case FILE_LEDATE:
  ------------------
  |  |  265|     72|#define				FILE_LEDATE		12
  ------------------
  |  Branch (1052:2): [True: 72, False: 26.0k]
  ------------------
 1053|     72|		return FILE_BEDATE;
  ------------------
  |  |  262|     72|#define				FILE_BEDATE		9
  ------------------
 1054|      0|	case FILE_LELDATE:
  ------------------
  |  |  269|      0|#define				FILE_LELDATE		16
  ------------------
  |  Branch (1054:2): [True: 0, False: 26.0k]
  ------------------
 1055|      0|		return FILE_BELDATE;
  ------------------
  |  |  268|      0|#define				FILE_BELDATE		15
  ------------------
 1056|  1.31k|	case FILE_LEQUAD:
  ------------------
  |  |  278|  1.31k|#define				FILE_LEQUAD		25
  ------------------
  |  Branch (1056:2): [True: 1.31k, False: 24.7k]
  ------------------
 1057|  1.31k|		return FILE_BEQUAD;
  ------------------
  |  |  279|  1.31k|#define				FILE_BEQUAD		26
  ------------------
 1058|      0|	case FILE_LEQDATE:
  ------------------
  |  |  281|      0|#define				FILE_LEQDATE		28
  ------------------
  |  Branch (1058:2): [True: 0, False: 26.0k]
  ------------------
 1059|      0|		return FILE_BEQDATE;
  ------------------
  |  |  282|      0|#define				FILE_BEQDATE		29
  ------------------
 1060|    327|	case FILE_LEQLDATE:
  ------------------
  |  |  284|    327|#define				FILE_LEQLDATE		31
  ------------------
  |  Branch (1060:2): [True: 327, False: 25.7k]
  ------------------
 1061|    327|		return FILE_BEQLDATE;
  ------------------
  |  |  285|    327|#define				FILE_BEQLDATE		32
  ------------------
 1062|      0|	case FILE_LEQWDATE:
  ------------------
  |  |  296|      0|#define				FILE_LEQWDATE		43
  ------------------
  |  Branch (1062:2): [True: 0, False: 26.0k]
  ------------------
 1063|      0|		return FILE_BEQWDATE;
  ------------------
  |  |  297|      0|#define				FILE_BEQWDATE		44
  ------------------
 1064|      0|	case FILE_BEFLOAT:
  ------------------
  |  |  287|      0|#define				FILE_BEFLOAT		34
  ------------------
  |  Branch (1064:2): [True: 0, False: 26.0k]
  ------------------
 1065|      0|		return FILE_LEFLOAT;
  ------------------
  |  |  288|      0|#define				FILE_LEFLOAT		35
  ------------------
 1066|      0|	case FILE_LEFLOAT:
  ------------------
  |  |  288|      0|#define				FILE_LEFLOAT		35
  ------------------
  |  Branch (1066:2): [True: 0, False: 26.0k]
  ------------------
 1067|      0|		return FILE_BEFLOAT;
  ------------------
  |  |  287|      0|#define				FILE_BEFLOAT		34
  ------------------
 1068|      0|	case FILE_BEDOUBLE:
  ------------------
  |  |  290|      0|#define				FILE_BEDOUBLE		37
  ------------------
  |  Branch (1068:2): [True: 0, False: 26.0k]
  ------------------
 1069|      0|		return FILE_LEDOUBLE;
  ------------------
  |  |  291|      0|#define				FILE_LEDOUBLE		38
  ------------------
 1070|      0|	case FILE_LEDOUBLE:
  ------------------
  |  |  291|      0|#define				FILE_LEDOUBLE		38
  ------------------
  |  Branch (1070:2): [True: 0, False: 26.0k]
  ------------------
 1071|      0|		return FILE_BEDOUBLE;
  ------------------
  |  |  290|      0|#define				FILE_BEDOUBLE		37
  ------------------
 1072|      0|	case FILE_BEMSDOSDATE:
  ------------------
  |  |  310|      0|#define				FILE_BEMSDOSDATE	57
  ------------------
  |  Branch (1072:2): [True: 0, False: 26.0k]
  ------------------
 1073|      0|		return FILE_LEMSDOSDATE;
  ------------------
  |  |  309|      0|#define				FILE_LEMSDOSDATE	56
  ------------------
 1074|      0|	case FILE_LEMSDOSDATE:
  ------------------
  |  |  309|      0|#define				FILE_LEMSDOSDATE	56
  ------------------
  |  Branch (1074:2): [True: 0, False: 26.0k]
  ------------------
 1075|      0|		return FILE_BEMSDOSDATE;
  ------------------
  |  |  310|      0|#define				FILE_BEMSDOSDATE	57
  ------------------
 1076|      0|	case FILE_BEMSDOSTIME:
  ------------------
  |  |  313|      0|#define				FILE_BEMSDOSTIME	60
  ------------------
  |  Branch (1076:2): [True: 0, False: 26.0k]
  ------------------
 1077|      0|		return FILE_LEMSDOSTIME;
  ------------------
  |  |  312|      0|#define				FILE_LEMSDOSTIME	59
  ------------------
 1078|      0|	case FILE_LEMSDOSTIME:
  ------------------
  |  |  312|      0|#define				FILE_LEMSDOSTIME	59
  ------------------
  |  Branch (1078:2): [True: 0, False: 26.0k]
  ------------------
 1079|      0|		return FILE_BEMSDOSTIME;
  ------------------
  |  |  313|      0|#define				FILE_BEMSDOSTIME	60
  ------------------
 1080|  4.76k|	default:
  ------------------
  |  Branch (1080:2): [True: 4.76k, False: 21.3k]
  ------------------
 1081|  4.76k|		return type;
 1082|  26.0k|	}
 1083|  26.0k|}
softmagic.c:do_ops:
 1518|   689k|{
 1519|   689k|	intmax_t offset;
 1520|       |	// On purpose not INTMAX_MAX
 1521|   689k|	if (lhs >= UINT_MAX || lhs <= INT_MIN ||
  ------------------
  |  Branch (1521:6): [True: 10.2k, False: 679k]
  |  Branch (1521:25): [True: 522, False: 679k]
  ------------------
 1522|   679k|	    off >= UINT_MAX || off <= INT_MIN) {
  ------------------
  |  Branch (1522:6): [True: 305, False: 678k]
  |  Branch (1522:25): [True: 0, False: 678k]
  ------------------
 1523|  11.0k|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  11.0k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1523:7): [True: 0, False: 11.0k]
  ------------------
 1524|      0|			fprintf(stderr, "lhs/off overflow %jd %jd\n", lhs, off);
 1525|  11.0k|		return 1;
 1526|  11.0k|	}
 1527|       |	   
 1528|   678k|	if (off) {
  ------------------
  |  Branch (1528:6): [True: 67.1k, False: 611k]
  ------------------
 1529|  67.1k|		switch (m->in_op & FILE_OPS_MASK) {
  ------------------
  |  |  360|  67.1k|#define				FILE_OPS_MASK	0x07 /* mask for above ops */
  ------------------
  |  Branch (1529:11): [True: 67.1k, False: 0]
  ------------------
 1530|     89|		case FILE_OPAND:
  ------------------
  |  |  352|     89|#define				FILE_OPAND	0
  ------------------
  |  Branch (1530:3): [True: 89, False: 67.0k]
  ------------------
 1531|     89|			offset = lhs & off;
 1532|     89|			break;
 1533|      0|		case FILE_OPOR:
  ------------------
  |  |  353|      0|#define				FILE_OPOR	1
  ------------------
  |  Branch (1533:3): [True: 0, False: 67.1k]
  ------------------
 1534|      0|			offset = lhs | off;
 1535|      0|			break;
 1536|      0|		case FILE_OPXOR:
  ------------------
  |  |  354|      0|#define				FILE_OPXOR	2
  ------------------
  |  Branch (1536:3): [True: 0, False: 67.1k]
  ------------------
 1537|      0|			offset = lhs ^ off;
 1538|      0|			break;
 1539|  58.5k|		case FILE_OPADD:
  ------------------
  |  |  355|  58.5k|#define				FILE_OPADD	3
  ------------------
  |  Branch (1539:3): [True: 58.5k, False: 8.57k]
  ------------------
 1540|  58.5k|			offset = lhs + off;
 1541|  58.5k|			break;
 1542|  1.33k|		case FILE_OPMINUS:
  ------------------
  |  |  356|  1.33k|#define				FILE_OPMINUS	4
  ------------------
  |  Branch (1542:3): [True: 1.33k, False: 65.8k]
  ------------------
 1543|  1.33k|			offset = lhs - off;
 1544|  1.33k|			break;
 1545|  7.11k|		case FILE_OPMULTIPLY:
  ------------------
  |  |  357|  7.11k|#define				FILE_OPMULTIPLY	5
  ------------------
  |  Branch (1545:3): [True: 7.11k, False: 60.0k]
  ------------------
 1546|  7.11k|			offset = lhs * off;
 1547|  7.11k|			break;
 1548|     36|		case FILE_OPDIVIDE:
  ------------------
  |  |  358|     36|#define				FILE_OPDIVIDE	6
  ------------------
  |  Branch (1548:3): [True: 36, False: 67.1k]
  ------------------
 1549|     36|			offset = lhs / off;
 1550|     36|			break;
 1551|      0|		case FILE_OPMODULO:
  ------------------
  |  |  359|      0|#define				FILE_OPMODULO	7
  ------------------
  |  Branch (1551:3): [True: 0, False: 67.1k]
  ------------------
 1552|      0|			offset = lhs % off;
 1553|      0|			break;
 1554|  67.1k|		}
 1555|  67.1k|	} else
 1556|   611k|		offset = lhs;
 1557|   678k|	if (m->in_op & FILE_OPINVERSE)
  ------------------
  |  |  364|   678k|#define				FILE_OPINVERSE	0x40
  ------------------
  |  Branch (1557:6): [True: 0, False: 678k]
  ------------------
 1558|      0|		offset = ~offset;
 1559|   678k|	if (offset >= UINT_MAX) {
  ------------------
  |  Branch (1559:6): [True: 515, False: 678k]
  ------------------
 1560|    515|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|    515|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1560:7): [True: 0, False: 515]
  ------------------
 1561|      0|			fprintf(stderr, "offset overflow %jd\n", offset);
 1562|    515|		return 1;
 1563|    515|	}
 1564|   678k|	*rv = CAST(uint32_t, offset);
  ------------------
  |  |  460|   678k|#define CAST(T, b)	((T)(b))
  ------------------
 1565|   678k|	return 0;
 1566|   678k|}
softmagic.c:cvt_id3:
 1016|     95|{
 1017|     95|	v = ((((v >>  0) & 0x7f) <<  0) |
 1018|     95|	     (((v >>  8) & 0x7f) <<  7) |
 1019|     95|	     (((v >> 16) & 0x7f) << 14) |
 1020|     95|	     (((v >> 24) & 0x7f) << 21));
 1021|     95|	if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|     95|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1021:6): [True: 0, False: 95]
  ------------------
 1022|      0|		fprintf(stderr, "id3 offs=%u\n", v);
 1023|     95|	return v;
 1024|     95|}
softmagic.c:file_fmtcheck:
  172|   131k|{
  173|   131k|	const char *ptr;
  174|       |
  175|   131k|	if (strchr(desc, '%') == NULL)
  ------------------
  |  Branch (175:6): [True: 69.3k, False: 62.3k]
  ------------------
  176|  69.3k|		return desc;
  177|       |
  178|  62.3k|	ptr = fmtcheck(desc, def);
  179|  62.3k|	if (ptr == def)
  ------------------
  |  Branch (179:6): [True: 0, False: 62.3k]
  ------------------
  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|  62.3k|	return ptr;
  184|   131k|}
softmagic.c:save_cont:
 1628|  48.9k|{
 1629|  48.9k|	size_t len;
 1630|  48.9k|	*c = ms->c;
 1631|  48.9k|	len = c->len * sizeof(*c->li);
 1632|  48.9k|	ms->c.li = CAST(struct level_info *, malloc(len));
  ------------------
  |  |  460|  48.9k|#define CAST(T, b)	((T)(b))
  ------------------
 1633|  48.9k|	if (ms->c.li == NULL) {
  ------------------
  |  Branch (1633:6): [True: 0, False: 48.9k]
  ------------------
 1634|      0|		ms->c = *c;
 1635|      0|		return -1;
 1636|      0|	}
 1637|  48.9k|	memcpy(ms->c.li, c->li, len);
 1638|  48.9k|	return 0;
 1639|  48.9k|}
softmagic.c:restore_cont:
 1643|  48.9k|{
 1644|  48.9k|	free(ms->c.li);
 1645|  48.9k|	ms->c = *c;
 1646|  48.9k|}
softmagic.c:mconvert:
 1205|   133M|{
 1206|   133M|	union VALUETYPE *p = &ms->ms_value;
 1207|       |
 1208|   133M|	switch (cvt_flip(m->type, flip)) {
 1209|  2.24M|	case FILE_BYTE:
  ------------------
  |  |  254|  2.24M|#define 			FILE_BYTE		1
  ------------------
  |  Branch (1209:2): [True: 2.24M, False: 131M]
  ------------------
 1210|  2.24M|		if (cvt_8(p, m) == -1)
  ------------------
  |  Branch (1210:7): [True: 0, False: 2.24M]
  ------------------
 1211|      0|			goto out;
 1212|  2.24M|		return 1;
 1213|  2.37M|	case FILE_SHORT:
  ------------------
  |  |  255|  2.37M|#define				FILE_SHORT		2
  ------------------
  |  Branch (1213:2): [True: 2.37M, False: 131M]
  ------------------
 1214|  2.37M|	case FILE_MSDOSDATE:
  ------------------
  |  |  308|  2.37M|#define				FILE_MSDOSDATE		55
  ------------------
  |  Branch (1214:2): [True: 0, False: 133M]
  ------------------
 1215|  2.37M|	case FILE_MSDOSTIME:
  ------------------
  |  |  311|  2.37M|#define				FILE_MSDOSTIME		58
  ------------------
  |  Branch (1215:2): [True: 0, False: 133M]
  ------------------
 1216|  2.37M|		if (cvt_16(p, m) == -1)
  ------------------
  |  Branch (1216:7): [True: 0, False: 2.37M]
  ------------------
 1217|      0|			goto out;
 1218|  2.37M|		return 1;
 1219|  2.05M|	case FILE_LONG:
  ------------------
  |  |  257|  2.05M|#define				FILE_LONG		4
  ------------------
  |  Branch (1219:2): [True: 2.05M, False: 131M]
  ------------------
 1220|  2.05M|	case FILE_DATE:
  ------------------
  |  |  259|  2.05M|#define				FILE_DATE		6
  ------------------
  |  Branch (1220:2): [True: 0, False: 133M]
  ------------------
 1221|  2.05M|	case FILE_LDATE:
  ------------------
  |  |  267|  2.05M|#define				FILE_LDATE		14
  ------------------
  |  Branch (1221:2): [True: 0, False: 133M]
  ------------------
 1222|  2.05M|		if (cvt_32(p, m) == -1)
  ------------------
  |  Branch (1222:7): [True: 0, False: 2.05M]
  ------------------
 1223|      0|			goto out;
 1224|  2.05M|		return 1;
 1225|  87.4k|	case FILE_QUAD:
  ------------------
  |  |  277|  87.4k|#define				FILE_QUAD		24
  ------------------
  |  Branch (1225:2): [True: 87.4k, False: 133M]
  ------------------
 1226|  87.4k|	case FILE_QDATE:
  ------------------
  |  |  280|  87.4k|#define				FILE_QDATE		27
  ------------------
  |  Branch (1226:2): [True: 0, False: 133M]
  ------------------
 1227|  87.4k|	case FILE_QLDATE:
  ------------------
  |  |  283|  87.4k|#define				FILE_QLDATE		30
  ------------------
  |  Branch (1227:2): [True: 0, False: 133M]
  ------------------
 1228|  87.6k|	case FILE_QWDATE:
  ------------------
  |  |  295|  87.6k|#define				FILE_QWDATE		42
  ------------------
  |  Branch (1228:2): [True: 212, False: 133M]
  ------------------
 1229|  93.1k|	case FILE_OFFSET:
  ------------------
  |  |  305|  93.1k|#define				FILE_OFFSET		52
  ------------------
  |  Branch (1229:2): [True: 5.52k, False: 133M]
  ------------------
 1230|  93.1k|		if (cvt_64(p, m) == -1)
  ------------------
  |  Branch (1230:7): [True: 0, False: 93.1k]
  ------------------
 1231|      0|			goto out;
 1232|  93.1k|		return 1;
 1233|  85.0M|	case FILE_STRING:
  ------------------
  |  |  258|  85.0M|#define				FILE_STRING		5
  ------------------
  |  Branch (1233:2): [True: 85.0M, False: 48.3M]
  ------------------
 1234|  85.0M|	case FILE_BESTRING16:
  ------------------
  |  |  271|  85.0M|#define				FILE_BESTRING16		18
  ------------------
  |  Branch (1234:2): [True: 159, False: 133M]
  ------------------
 1235|  85.1M|	case FILE_LESTRING16:
  ------------------
  |  |  272|  85.1M|#define				FILE_LESTRING16		19
  ------------------
  |  Branch (1235:2): [True: 87.7k, False: 133M]
  ------------------
 1236|  85.1M|	case FILE_OCTAL: {
  ------------------
  |  |  314|  85.1M|#define				FILE_OCTAL		61
  ------------------
  |  Branch (1236:2): [True: 0, False: 133M]
  ------------------
 1237|       |		/* Null terminate and eat *trailing* return */
 1238|  85.1M|		p->s[sizeof(p->s) - 1] = '\0';
 1239|  85.1M|		return 1;
 1240|  85.1M|	}
 1241|  38.0k|	case FILE_PSTRING: {
  ------------------
  |  |  266|  38.0k|#define				FILE_PSTRING		13
  ------------------
  |  Branch (1241:2): [True: 38.0k, False: 133M]
  ------------------
 1242|  38.0k|		char *ptr1, *ptr2;
 1243|  38.0k|		size_t len, sz = file_pstring_length_size(ms, m);
 1244|  38.0k|		if (sz == FILE_BADSIZE)
  ------------------
  |  |  183|  38.0k|#define FILE_BADSIZE CAST(size_t, ~0ul)
  |  |  ------------------
  |  |  |  |  460|  38.0k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (1244:7): [True: 0, False: 38.0k]
  ------------------
 1245|      0|			return 0;
 1246|  38.0k|		ptr1 = p->s;
 1247|  38.0k|		ptr2 = ptr1 + sz;
 1248|  38.0k|		len = file_pstring_get_length(ms, m, ptr1);
 1249|  38.0k|		if (len == FILE_BADSIZE)
  ------------------
  |  |  183|  38.0k|#define FILE_BADSIZE CAST(size_t, ~0ul)
  |  |  ------------------
  |  |  |  |  460|  38.0k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (1249:7): [True: 83, False: 37.9k]
  ------------------
 1250|     83|			return 0;
 1251|  37.9k|		sz = sizeof(p->s) - sz; /* maximum length of string */
 1252|  37.9k|		if (len >= sz) {
  ------------------
  |  Branch (1252:7): [True: 6.22k, False: 31.7k]
  ------------------
 1253|       |			/*
 1254|       |			 * The size of the pascal string length (sz)
 1255|       |			 * is 1, 2, or 4. We need at least 1 byte for NUL
 1256|       |			 * termination, but we've already truncated the
 1257|       |			 * string by p->s, so we need to deduct sz.
 1258|       |			 * Because we can use one of the bytes of the length
 1259|       |			 * after we shifted as NUL termination.
 1260|       |			 */
 1261|  6.22k|			len = sz;
 1262|  6.22k|		}
 1263|  2.94M|		while (len--)
  ------------------
  |  Branch (1263:10): [True: 2.90M, False: 37.9k]
  ------------------
 1264|  2.90M|			*ptr1++ = *ptr2++;
 1265|  37.9k|		*ptr1 = '\0';
 1266|  37.9k|		return 1;
 1267|  38.0k|	}
 1268|  5.56M|	case FILE_BESHORT:
  ------------------
  |  |  260|  5.56M|#define				FILE_BESHORT		7
  ------------------
  |  Branch (1268:2): [True: 5.56M, False: 127M]
  ------------------
 1269|  5.56M|	case FILE_BEMSDOSDATE:
  ------------------
  |  |  310|  5.56M|#define				FILE_BEMSDOSDATE	57
  ------------------
  |  Branch (1269:2): [True: 0, False: 133M]
  ------------------
 1270|  5.56M|	case FILE_BEMSDOSTIME:
  ------------------
  |  |  313|  5.56M|#define				FILE_BEMSDOSTIME	60
  ------------------
  |  Branch (1270:2): [True: 0, False: 133M]
  ------------------
 1271|  5.56M|		p->h = CAST(short, BE16(p->hs));
  ------------------
  |  |  460|  5.56M|#define CAST(T, b)	((T)(b))
  ------------------
 1272|  5.56M|		if (cvt_16(p, m) == -1)
  ------------------
  |  Branch (1272:7): [True: 0, False: 5.56M]
  ------------------
 1273|      0|			goto out;
 1274|  5.56M|		return 1;
 1275|  17.1M|	case FILE_BELONG:
  ------------------
  |  |  261|  17.1M|#define				FILE_BELONG		8
  ------------------
  |  Branch (1275:2): [True: 17.1M, False: 116M]
  ------------------
 1276|  17.1M|	case FILE_BEDATE:
  ------------------
  |  |  262|  17.1M|#define				FILE_BEDATE		9
  ------------------
  |  Branch (1276:2): [True: 606, False: 133M]
  ------------------
 1277|  17.1M|	case FILE_BELDATE:
  ------------------
  |  |  268|  17.1M|#define				FILE_BELDATE		15
  ------------------
  |  Branch (1277:2): [True: 422, False: 133M]
  ------------------
 1278|  17.1M|		p->l = CAST(int32_t, BE32(p->hl));
  ------------------
  |  |  460|  17.1M|#define CAST(T, b)	((T)(b))
  ------------------
 1279|  17.1M|		if (cvt_32(p, m) == -1)
  ------------------
  |  Branch (1279:7): [True: 0, False: 17.1M]
  ------------------
 1280|      0|			goto out;
 1281|  17.1M|		return 1;
 1282|  1.39M|	case FILE_BEQUAD:
  ------------------
  |  |  279|  1.39M|#define				FILE_BEQUAD		26
  ------------------
  |  Branch (1282:2): [True: 1.39M, False: 132M]
  ------------------
 1283|  1.39M|	case FILE_BEQDATE:
  ------------------
  |  |  282|  1.39M|#define				FILE_BEQDATE		29
  ------------------
  |  Branch (1283:2): [True: 536, False: 133M]
  ------------------
 1284|  1.39M|	case FILE_BEQLDATE:
  ------------------
  |  |  285|  1.39M|#define				FILE_BEQLDATE		32
  ------------------
  |  Branch (1284:2): [True: 611, False: 133M]
  ------------------
 1285|  1.39M|	case FILE_BEQWDATE:
  ------------------
  |  |  297|  1.39M|#define				FILE_BEQWDATE		44
  ------------------
  |  Branch (1285:2): [True: 0, False: 133M]
  ------------------
 1286|  1.39M|		p->q = CAST(uint64_t, BE64(p->hq));
  ------------------
  |  |  460|  1.39M|#define CAST(T, b)	((T)(b))
  ------------------
 1287|  1.39M|		if (cvt_64(p, m) == -1)
  ------------------
  |  Branch (1287:7): [True: 0, False: 1.39M]
  ------------------
 1288|      0|			goto out;
 1289|  1.39M|		return 1;
 1290|  5.18M|	case FILE_LESHORT:
  ------------------
  |  |  263|  5.18M|#define				FILE_LESHORT		10
  ------------------
  |  Branch (1290:2): [True: 5.18M, False: 128M]
  ------------------
 1291|  5.18M|	case FILE_LEMSDOSDATE:
  ------------------
  |  |  309|  5.18M|#define				FILE_LEMSDOSDATE	56
  ------------------
  |  Branch (1291:2): [True: 322, False: 133M]
  ------------------
 1292|  5.18M|	case FILE_LEMSDOSTIME:
  ------------------
  |  |  312|  5.18M|#define				FILE_LEMSDOSTIME	59
  ------------------
  |  Branch (1292:2): [True: 322, False: 133M]
  ------------------
 1293|  5.18M|		p->h = CAST(short, LE16(p->hs));
  ------------------
  |  |  460|  5.18M|#define CAST(T, b)	((T)(b))
  ------------------
 1294|  5.18M|		if (cvt_16(p, m) == -1)
  ------------------
  |  Branch (1294:7): [True: 0, False: 5.18M]
  ------------------
 1295|      0|			goto out;
 1296|  5.18M|		return 1;
 1297|  8.74M|	case FILE_LELONG:
  ------------------
  |  |  264|  8.74M|#define				FILE_LELONG		11
  ------------------
  |  Branch (1297:2): [True: 8.74M, False: 124M]
  ------------------
 1298|  8.74M|	case FILE_LEDATE:
  ------------------
  |  |  265|  8.74M|#define				FILE_LEDATE		12
  ------------------
  |  Branch (1298:2): [True: 254, False: 133M]
  ------------------
 1299|  8.74M|	case FILE_LELDATE:
  ------------------
  |  |  269|  8.74M|#define				FILE_LELDATE		16
  ------------------
  |  Branch (1299:2): [True: 84, False: 133M]
  ------------------
 1300|  8.74M|		p->l = CAST(int32_t, LE32(p->hl));
  ------------------
  |  |  460|  8.74M|#define CAST(T, b)	((T)(b))
  ------------------
 1301|  8.74M|		if (cvt_32(p, m) == -1)
  ------------------
  |  Branch (1301:7): [True: 0, False: 8.74M]
  ------------------
 1302|      0|			goto out;
 1303|  8.74M|		return 1;
 1304|  1.17M|	case FILE_LEQUAD:
  ------------------
  |  |  278|  1.17M|#define				FILE_LEQUAD		25
  ------------------
  |  Branch (1304:2): [True: 1.17M, False: 132M]
  ------------------
 1305|  1.17M|	case FILE_LEQDATE:
  ------------------
  |  |  281|  1.17M|#define				FILE_LEQDATE		28
  ------------------
  |  Branch (1305:2): [True: 1.05k, False: 133M]
  ------------------
 1306|  1.17M|	case FILE_LEQLDATE:
  ------------------
  |  |  284|  1.17M|#define				FILE_LEQLDATE		31
  ------------------
  |  Branch (1306:2): [True: 103, False: 133M]
  ------------------
 1307|  1.17M|	case FILE_LEQWDATE:
  ------------------
  |  |  296|  1.17M|#define				FILE_LEQWDATE		43
  ------------------
  |  Branch (1307:2): [True: 2.52k, False: 133M]
  ------------------
 1308|  1.17M|		p->q = CAST(uint64_t, LE64(p->hq));
  ------------------
  |  |  460|  1.17M|#define CAST(T, b)	((T)(b))
  ------------------
 1309|  1.17M|		if (cvt_64(p, m) == -1)
  ------------------
  |  Branch (1309:7): [True: 0, False: 1.17M]
  ------------------
 1310|      0|			goto out;
 1311|  1.17M|		return 1;
 1312|     39|	case FILE_MELONG:
  ------------------
  |  |  276|     39|#define				FILE_MELONG		23
  ------------------
  |  Branch (1312:2): [True: 39, False: 133M]
  ------------------
 1313|    182|	case FILE_MEDATE:
  ------------------
  |  |  274|    182|#define				FILE_MEDATE		21
  ------------------
  |  Branch (1313:2): [True: 143, False: 133M]
  ------------------
 1314|    182|	case FILE_MELDATE:
  ------------------
  |  |  275|    182|#define				FILE_MELDATE		22
  ------------------
  |  Branch (1314:2): [True: 0, False: 133M]
  ------------------
 1315|    182|		p->l = CAST(int32_t, ME32(p->hl));
  ------------------
  |  |  460|    182|#define CAST(T, b)	((T)(b))
  ------------------
 1316|    182|		if (cvt_32(p, m) == -1)
  ------------------
  |  Branch (1316:7): [True: 0, False: 182]
  ------------------
 1317|      0|			goto out;
 1318|    182|		return 1;
 1319|      0|	case FILE_FLOAT:
  ------------------
  |  |  286|      0|#define				FILE_FLOAT		33
  ------------------
  |  Branch (1319:2): [True: 0, False: 133M]
  ------------------
 1320|      0|		if (cvt_float(p, m) == -1)
  ------------------
  |  Branch (1320:7): [True: 0, False: 0]
  ------------------
 1321|      0|			goto out;
 1322|      0|		return 1;
 1323|      0|	case FILE_BEFLOAT:
  ------------------
  |  |  287|      0|#define				FILE_BEFLOAT		34
  ------------------
  |  Branch (1323:2): [True: 0, False: 133M]
  ------------------
 1324|      0|		p->l = BE32(p->hl);
  ------------------
  |  |   95|      0|#define BE32(p) ( \
  |  |   96|      0|    (CAST(uint32_t, (p)[0])<<24)| \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   97|      0|    (CAST(uint32_t, (p)[1])<<16)| \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   98|      0|    (CAST(uint32_t, (p)[2])<<8)| \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   99|      0|    (CAST(uint32_t, (p)[3])))
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1325|      0|		if (cvt_float(p, m) == -1)
  ------------------
  |  Branch (1325:7): [True: 0, False: 0]
  ------------------
 1326|      0|			goto out;
 1327|      0|		return 1;
 1328|  8.27k|	case FILE_LEFLOAT:
  ------------------
  |  |  288|  8.27k|#define				FILE_LEFLOAT		35
  ------------------
  |  Branch (1328:2): [True: 8.27k, False: 133M]
  ------------------
 1329|  8.27k|		p->l = LE32(p->hl);
  ------------------
  |  |   90|  8.27k|#define LE32(p) ( \
  |  |   91|  8.27k|    (CAST(uint32_t, (p)[3])<<24)| \
  |  |  ------------------
  |  |  |  |  460|  8.27k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   92|  8.27k|    (CAST(uint32_t, (p)[2])<<16)| \
  |  |  ------------------
  |  |  |  |  460|  8.27k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   93|  8.27k|    (CAST(uint32_t, (p)[1])<<8)| \
  |  |  ------------------
  |  |  |  |  460|  8.27k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   94|  8.27k|    (CAST(uint32_t, (p)[0])))
  |  |  ------------------
  |  |  |  |  460|  8.27k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1330|  8.27k|		if (cvt_float(p, m) == -1)
  ------------------
  |  Branch (1330:7): [True: 0, False: 8.27k]
  ------------------
 1331|      0|			goto out;
 1332|  8.27k|		return 1;
 1333|      0|	case FILE_DOUBLE:
  ------------------
  |  |  289|      0|#define				FILE_DOUBLE		36
  ------------------
  |  Branch (1333:2): [True: 0, False: 133M]
  ------------------
 1334|      0|		if (cvt_double(p, m) == -1)
  ------------------
  |  Branch (1334:7): [True: 0, False: 0]
  ------------------
 1335|      0|			goto out;
 1336|      0|		return 1;
 1337|    170|	case FILE_BEDOUBLE:
  ------------------
  |  |  290|    170|#define				FILE_BEDOUBLE		37
  ------------------
  |  Branch (1337:2): [True: 170, False: 133M]
  ------------------
 1338|    170|		p->q = BE64(p->hq);
  ------------------
  |  |   72|    170|#define BE64(p) ( \
  |  |   73|    170|    (CAST(uint64_t, (p)[0])<<56)| \
  |  |  ------------------
  |  |  |  |  460|    170|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   74|    170|    (CAST(uint64_t, (p)[1])<<48)| \
  |  |  ------------------
  |  |  |  |  460|    170|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   75|    170|    (CAST(uint64_t, (p)[2])<<40)| \
  |  |  ------------------
  |  |  |  |  460|    170|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   76|    170|    (CAST(uint64_t, (p)[3])<<32)| \
  |  |  ------------------
  |  |  |  |  460|    170|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   77|    170|    (CAST(uint64_t, (p)[4])<<24)| \
  |  |  ------------------
  |  |  |  |  460|    170|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   78|    170|    (CAST(uint64_t, (p)[5])<<16)| \
  |  |  ------------------
  |  |  |  |  460|    170|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   79|    170|    (CAST(uint64_t, (p)[6])<<8)| \
  |  |  ------------------
  |  |  |  |  460|    170|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   80|    170|    (CAST(uint64_t, (p)[7])))
  |  |  ------------------
  |  |  |  |  460|    170|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1339|    170|		if (cvt_double(p, m) == -1)
  ------------------
  |  Branch (1339:7): [True: 0, False: 170]
  ------------------
 1340|      0|			goto out;
 1341|    170|		return 1;
 1342|  2.38k|	case FILE_LEDOUBLE:
  ------------------
  |  |  291|  2.38k|#define				FILE_LEDOUBLE		38
  ------------------
  |  Branch (1342:2): [True: 2.38k, False: 133M]
  ------------------
 1343|  2.38k|		p->q = LE64(p->hq);
  ------------------
  |  |   81|  2.38k|#define LE64(p) ( \
  |  |   82|  2.38k|    (CAST(uint64_t, (p)[7])<<56)| \
  |  |  ------------------
  |  |  |  |  460|  2.38k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   83|  2.38k|    (CAST(uint64_t, (p)[6])<<48)| \
  |  |  ------------------
  |  |  |  |  460|  2.38k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   84|  2.38k|    (CAST(uint64_t, (p)[5])<<40)| \
  |  |  ------------------
  |  |  |  |  460|  2.38k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   85|  2.38k|    (CAST(uint64_t, (p)[4])<<32)| \
  |  |  ------------------
  |  |  |  |  460|  2.38k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   86|  2.38k|    (CAST(uint64_t, (p)[3])<<24)| \
  |  |  ------------------
  |  |  |  |  460|  2.38k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   87|  2.38k|    (CAST(uint64_t, (p)[2])<<16)| \
  |  |  ------------------
  |  |  |  |  460|  2.38k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   88|  2.38k|    (CAST(uint64_t, (p)[1])<<8)| \
  |  |  ------------------
  |  |  |  |  460|  2.38k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   89|  2.38k|    (CAST(uint64_t, (p)[0])))
  |  |  ------------------
  |  |  |  |  460|  2.38k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1344|  2.38k|		if (cvt_double(p, m) == -1)
  ------------------
  |  Branch (1344:7): [True: 0, False: 2.38k]
  ------------------
 1345|      0|			goto out;
 1346|  2.38k|		return 1;
 1347|   559k|	case FILE_REGEX:
  ------------------
  |  |  270|   559k|#define				FILE_REGEX		17
  ------------------
  |  Branch (1347:2): [True: 559k, False: 132M]
  ------------------
 1348|  1.43M|	case FILE_SEARCH:
  ------------------
  |  |  273|  1.43M|#define				FILE_SEARCH		20
  ------------------
  |  Branch (1348:2): [True: 877k, False: 132M]
  ------------------
 1349|  1.44M|	case FILE_DEFAULT:
  ------------------
  |  |  256|  1.44M|#define				FILE_DEFAULT		3
  ------------------
  |  Branch (1349:2): [True: 8.72k, False: 133M]
  ------------------
 1350|  1.44M|	case FILE_CLEAR:
  ------------------
  |  |  300|  1.44M|#define				FILE_CLEAR		47
  ------------------
  |  Branch (1350:2): [True: 1.76k, False: 133M]
  ------------------
 1351|  1.44M|	case FILE_NAME:
  ------------------
  |  |  298|  1.44M|#define				FILE_NAME		45
  ------------------
  |  Branch (1351:2): [True: 0, False: 133M]
  ------------------
 1352|  1.44M|	case FILE_USE:
  ------------------
  |  |  299|  1.44M|#define				FILE_USE		46
  ------------------
  |  Branch (1352:2): [True: 0, False: 133M]
  ------------------
 1353|  1.96M|	case FILE_DER:
  ------------------
  |  |  301|  1.96M|#define				FILE_DER		48
  ------------------
  |  Branch (1353:2): [True: 518k, False: 132M]
  ------------------
 1354|  2.27M|	case FILE_GUID:
  ------------------
  |  |  302|  2.27M|#define				FILE_GUID		49
  ------------------
  |  Branch (1354:2): [True: 310k, False: 133M]
  ------------------
 1355|  2.27M|	case FILE_LEGUID:
  ------------------
  |  |  303|  2.27M|#define				FILE_LEGUID		50
  ------------------
  |  Branch (1355:2): [True: 0, False: 133M]
  ------------------
 1356|  2.27M|	case FILE_BEGUID:
  ------------------
  |  |  304|  2.27M|#define				FILE_BEGUID		51
  ------------------
  |  Branch (1356:2): [True: 50, False: 133M]
  ------------------
 1357|  2.27M|		return 1;
 1358|      0|	default:
  ------------------
  |  Branch (1358:2): [True: 0, False: 133M]
  ------------------
 1359|      0|		file_magerror(ms, "invalid type %d in mconvert()", m->type);
 1360|      0|		return 0;
 1361|   133M|	}
 1362|      0|out:
 1363|      0|	file_magerror(ms, "zerodivide/overflow/underflow in mconvert()");
 1364|      0|	return 0;
 1365|   133M|}
softmagic.c:cvt_8:
 1139|  2.24M|{
 1140|  2.24M|	DO_CVT(m, b, 8);
  ------------------
  |  | 1131|  2.24M|	if ((m)->flag & UNSIGNED) { \
  |  |  ------------------
  |  |  |  |  237|  2.24M|#define UNSIGNED	0x08	/* comparison is unsigned */
  |  |  ------------------
  |  |  |  Branch (1131:6): [True: 1.03M, False: 1.20M]
  |  |  ------------------
  |  | 1132|  1.03M|		DO_CVT1(fld, uint##size##_t, size, 0); \
  |  |  ------------------
  |  |  |  | 1094|  1.03M|	if (m->num_mask) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  388|  1.03M|#define num_mask _u._mask
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1094:6): [True: 148k, False: 891k]
  |  |  |  |  ------------------
  |  |  |  | 1095|  1.03M|		switch (m->mask_op & FILE_OPS_MASK) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|   148k|#define				FILE_OPS_MASK	0x07 /* mask for above ops */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:11): [True: 148k, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1096|   130k|		case FILE_OPAND: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|   130k|#define				FILE_OPAND	0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1096:3): [True: 130k, False: 17.9k]
  |  |  |  |  ------------------
  |  |  |  | 1097|   130k|			p->fld &= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|   130k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1098|   130k|			break; \
  |  |  |  | 1099|      0|		case FILE_OPOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  353|      0|#define				FILE_OPOR	1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1099:3): [True: 0, False: 148k]
  |  |  |  |  ------------------
  |  |  |  | 1100|      0|			p->fld |= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1101|      0|			break; \
  |  |  |  | 1102|      0|		case FILE_OPXOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  354|      0|#define				FILE_OPXOR	2
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:3): [True: 0, False: 148k]
  |  |  |  |  ------------------
  |  |  |  | 1103|      0|			p->fld ^= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1104|      0|			break; \
  |  |  |  | 1105|      0|		case FILE_OPADD: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  355|      0|#define				FILE_OPADD	3
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1105:3): [True: 0, False: 148k]
  |  |  |  |  ------------------
  |  |  |  | 1106|      0|			p->fld += CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1107|      0|			break; \
  |  |  |  | 1108|  17.5k|		case FILE_OPMINUS: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  356|  17.5k|#define				FILE_OPMINUS	4
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1108:3): [True: 17.5k, False: 130k]
  |  |  |  |  ------------------
  |  |  |  | 1109|  17.5k|			p->fld -= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  17.5k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1110|  17.5k|			break; \
  |  |  |  | 1111|      0|		case FILE_OPMULTIPLY: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  357|      0|#define				FILE_OPMULTIPLY	5
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1111:3): [True: 0, False: 148k]
  |  |  |  |  ------------------
  |  |  |  | 1112|      0|			p->fld *= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1113|      0|			break; \
  |  |  |  | 1114|    196|		case FILE_OPDIVIDE: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  358|    196|#define				FILE_OPDIVIDE	6
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1114:3): [True: 196, False: 147k]
  |  |  |  |  ------------------
  |  |  |  | 1115|    196|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|    196|	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    196|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1087:6): [Folded, False: 196]
  |  |  |  |  |  |  |  Branch (1087:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1087:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1088|    196|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    196|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|    196|		return -1; \
  |  |  |  |  |  | 1090|    196|	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    196|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1090:6): [Folded, False: 196]
  |  |  |  |  |  |  |  Branch (1090:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1090:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1091|    196|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    196|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1091:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1092|    196|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1116|    196|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    196|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1116:8): [True: 0, False: 196]
  |  |  |  |  ------------------
  |  |  |  | 1117|    196|				return -1; \
  |  |  |  | 1118|    196|			p->fld /= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    196|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1119|    196|			break; \
  |  |  |  | 1120|    196|		case FILE_OPMODULO: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|    195|#define				FILE_OPMODULO	7
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:3): [True: 195, False: 147k]
  |  |  |  |  ------------------
  |  |  |  | 1121|    195|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|    195|	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    195|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1087:6): [Folded, False: 195]
  |  |  |  |  |  |  |  Branch (1087:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1087:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1088|    195|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    195|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|    195|		return -1; \
  |  |  |  |  |  | 1090|    195|	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    195|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1090:6): [Folded, False: 195]
  |  |  |  |  |  |  |  Branch (1090:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1090:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1091|    195|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    195|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1091:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1092|    195|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1122|    195|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    195|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:8): [True: 0, False: 195]
  |  |  |  |  ------------------
  |  |  |  | 1123|    195|				return -1; \
  |  |  |  | 1124|    195|			p->fld %= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    195|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1125|    195|			break; \
  |  |  |  | 1126|   148k|		} \
  |  |  |  | 1127|  1.03M|	if (m->mask_op & FILE_OPINVERSE) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  364|  1.03M|#define				FILE_OPINVERSE	0x40
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1127:6): [True: 0, False: 1.03M]
  |  |  |  |  ------------------
  |  |  |  | 1128|  1.03M|		p->fld = ~p->fld \
  |  |  ------------------
  |  | 1133|  1.20M|	} else { \
  |  | 1134|  1.20M|		DO_CVT1(s##fld, int##size##_t, size, 1); \
  |  |  ------------------
  |  |  |  | 1094|  1.20M|	if (m->num_mask) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  388|  1.20M|#define num_mask _u._mask
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1094:6): [True: 59.5k, False: 1.15M]
  |  |  |  |  ------------------
  |  |  |  | 1095|  1.20M|		switch (m->mask_op & FILE_OPS_MASK) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|  59.5k|#define				FILE_OPS_MASK	0x07 /* mask for above ops */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:11): [True: 59.5k, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1096|  48.3k|		case FILE_OPAND: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|  48.3k|#define				FILE_OPAND	0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1096:3): [True: 48.3k, False: 11.1k]
  |  |  |  |  ------------------
  |  |  |  | 1097|  48.3k|			p->fld &= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  48.3k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1098|  48.3k|			break; \
  |  |  |  | 1099|      0|		case FILE_OPOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  353|      0|#define				FILE_OPOR	1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1099:3): [True: 0, False: 59.5k]
  |  |  |  |  ------------------
  |  |  |  | 1100|      0|			p->fld |= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1101|      0|			break; \
  |  |  |  | 1102|      0|		case FILE_OPXOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  354|      0|#define				FILE_OPXOR	2
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:3): [True: 0, False: 59.5k]
  |  |  |  |  ------------------
  |  |  |  | 1103|      0|			p->fld ^= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1104|      0|			break; \
  |  |  |  | 1105|      0|		case FILE_OPADD: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  355|      0|#define				FILE_OPADD	3
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1105:3): [True: 0, False: 59.5k]
  |  |  |  |  ------------------
  |  |  |  | 1106|      0|			p->fld += CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1107|      0|			break; \
  |  |  |  | 1108|  11.1k|		case FILE_OPMINUS: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  356|  11.1k|#define				FILE_OPMINUS	4
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1108:3): [True: 11.1k, False: 48.4k]
  |  |  |  |  ------------------
  |  |  |  | 1109|  11.1k|			p->fld -= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  11.1k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1110|  11.1k|			break; \
  |  |  |  | 1111|      0|		case FILE_OPMULTIPLY: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  357|      0|#define				FILE_OPMULTIPLY	5
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1111:3): [True: 0, False: 59.5k]
  |  |  |  |  ------------------
  |  |  |  | 1112|      0|			p->fld *= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1113|      0|			break; \
  |  |  |  | 1114|     71|		case FILE_OPDIVIDE: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  358|     71|#define				FILE_OPDIVIDE	6
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1114:3): [True: 71, False: 59.5k]
  |  |  |  |  ------------------
  |  |  |  | 1115|     71|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|     71|	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|     71|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1087:6): [Folded, False: 71]
  |  |  |  |  |  |  |  Branch (1087:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1087:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1088|     71|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|     71|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|     71|		return -1; \
  |  |  |  |  |  | 1090|     71|	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|     71|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1090:6): [Folded, False: 71]
  |  |  |  |  |  |  |  Branch (1090:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1090:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1091|     71|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|     71|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1091:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1092|     71|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1116|     71|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|     71|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1116:8): [True: 0, False: 71]
  |  |  |  |  ------------------
  |  |  |  | 1117|     71|				return -1; \
  |  |  |  | 1118|     71|			p->fld /= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|     71|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1119|     71|			break; \
  |  |  |  | 1120|     71|		case FILE_OPMODULO: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|      0|#define				FILE_OPMODULO	7
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:3): [True: 0, False: 59.5k]
  |  |  |  |  ------------------
  |  |  |  | 1121|      0|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|      0|	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1087:6): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1087:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1087:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1088|      0|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|      0|		return -1; \
  |  |  |  |  |  | 1090|      0|	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1090:6): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1090:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1090:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1091|      0|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1091:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1092|      0|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1122|      0|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:8): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1123|      0|				return -1; \
  |  |  |  | 1124|      0|			p->fld %= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1125|      0|			break; \
  |  |  |  | 1126|  59.5k|		} \
  |  |  |  | 1127|  1.20M|	if (m->mask_op & FILE_OPINVERSE) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  364|  1.20M|#define				FILE_OPINVERSE	0x40
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1127:6): [True: 0, False: 1.20M]
  |  |  |  |  ------------------
  |  |  |  | 1128|  1.20M|		p->fld = ~p->fld \
  |  |  ------------------
  |  | 1135|  1.20M|	}
  ------------------
 1141|  2.24M|	return 0;
 1142|  2.24M|}
softmagic.c:cvt_16:
 1146|  13.1M|{
 1147|  13.1M|	DO_CVT(m, h, 16);
  ------------------
  |  | 1131|  13.1M|	if ((m)->flag & UNSIGNED) { \
  |  |  ------------------
  |  |  |  |  237|  13.1M|#define UNSIGNED	0x08	/* comparison is unsigned */
  |  |  ------------------
  |  |  |  Branch (1131:6): [True: 1.66M, False: 11.4M]
  |  |  ------------------
  |  | 1132|  1.66M|		DO_CVT1(fld, uint##size##_t, size, 0); \
  |  |  ------------------
  |  |  |  | 1094|  1.66M|	if (m->num_mask) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  388|  1.66M|#define num_mask _u._mask
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1094:6): [True: 168k, False: 1.49M]
  |  |  |  |  ------------------
  |  |  |  | 1095|  1.66M|		switch (m->mask_op & FILE_OPS_MASK) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|   168k|#define				FILE_OPS_MASK	0x07 /* mask for above ops */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:11): [True: 168k, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1096|   166k|		case FILE_OPAND: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|   166k|#define				FILE_OPAND	0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1096:3): [True: 166k, False: 1.46k]
  |  |  |  |  ------------------
  |  |  |  | 1097|   166k|			p->fld &= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|   166k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1098|   166k|			break; \
  |  |  |  | 1099|      0|		case FILE_OPOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  353|      0|#define				FILE_OPOR	1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1099:3): [True: 0, False: 168k]
  |  |  |  |  ------------------
  |  |  |  | 1100|      0|			p->fld |= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1101|      0|			break; \
  |  |  |  | 1102|      0|		case FILE_OPXOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  354|      0|#define				FILE_OPXOR	2
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:3): [True: 0, False: 168k]
  |  |  |  |  ------------------
  |  |  |  | 1103|      0|			p->fld ^= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1104|      0|			break; \
  |  |  |  | 1105|     86|		case FILE_OPADD: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  355|     86|#define				FILE_OPADD	3
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1105:3): [True: 86, False: 168k]
  |  |  |  |  ------------------
  |  |  |  | 1106|     86|			p->fld += CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|     86|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1107|     86|			break; \
  |  |  |  | 1108|    159|		case FILE_OPMINUS: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  356|    159|#define				FILE_OPMINUS	4
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1108:3): [True: 159, False: 168k]
  |  |  |  |  ------------------
  |  |  |  | 1109|    159|			p->fld -= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    159|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1110|    159|			break; \
  |  |  |  | 1111|     74|		case FILE_OPMULTIPLY: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  357|     74|#define				FILE_OPMULTIPLY	5
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1111:3): [True: 74, False: 168k]
  |  |  |  |  ------------------
  |  |  |  | 1112|     74|			p->fld *= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|     74|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1113|     74|			break; \
  |  |  |  | 1114|    995|		case FILE_OPDIVIDE: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  358|    995|#define				FILE_OPDIVIDE	6
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1114:3): [True: 995, False: 167k]
  |  |  |  |  ------------------
  |  |  |  | 1115|    995|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|    995|	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    995|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1087:6): [Folded, False: 995]
  |  |  |  |  |  |  |  Branch (1087:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1087:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1088|    995|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    995|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|    995|		return -1; \
  |  |  |  |  |  | 1090|    995|	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    995|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1090:6): [Folded, False: 995]
  |  |  |  |  |  |  |  Branch (1090:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1090:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1091|    995|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    995|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1091:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1092|    995|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1116|    995|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    995|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1116:8): [True: 0, False: 995]
  |  |  |  |  ------------------
  |  |  |  | 1117|    995|				return -1; \
  |  |  |  | 1118|    995|			p->fld /= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    995|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1119|    995|			break; \
  |  |  |  | 1120|    995|		case FILE_OPMODULO: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|    146|#define				FILE_OPMODULO	7
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:3): [True: 146, False: 168k]
  |  |  |  |  ------------------
  |  |  |  | 1121|    146|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|    146|	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    146|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1087:6): [Folded, False: 146]
  |  |  |  |  |  |  |  Branch (1087:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1087:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1088|    146|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    146|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|    146|		return -1; \
  |  |  |  |  |  | 1090|    146|	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    146|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1090:6): [Folded, False: 146]
  |  |  |  |  |  |  |  Branch (1090:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1090:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1091|    146|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    146|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1091:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1092|    146|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1122|    146|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    146|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:8): [True: 0, False: 146]
  |  |  |  |  ------------------
  |  |  |  | 1123|    146|				return -1; \
  |  |  |  | 1124|    146|			p->fld %= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    146|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1125|    146|			break; \
  |  |  |  | 1126|   168k|		} \
  |  |  |  | 1127|  1.66M|	if (m->mask_op & FILE_OPINVERSE) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  364|  1.66M|#define				FILE_OPINVERSE	0x40
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1127:6): [True: 0, False: 1.66M]
  |  |  |  |  ------------------
  |  |  |  | 1128|  1.66M|		p->fld = ~p->fld \
  |  |  ------------------
  |  | 1133|  11.4M|	} else { \
  |  | 1134|  11.4M|		DO_CVT1(s##fld, int##size##_t, size, 1); \
  |  |  ------------------
  |  |  |  | 1094|  11.4M|	if (m->num_mask) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  388|  11.4M|#define num_mask _u._mask
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1094:6): [True: 595k, False: 10.8M]
  |  |  |  |  ------------------
  |  |  |  | 1095|  11.4M|		switch (m->mask_op & FILE_OPS_MASK) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|   595k|#define				FILE_OPS_MASK	0x07 /* mask for above ops */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:11): [True: 595k, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1096|   566k|		case FILE_OPAND: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|   566k|#define				FILE_OPAND	0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1096:3): [True: 566k, False: 29.3k]
  |  |  |  |  ------------------
  |  |  |  | 1097|   566k|			p->fld &= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|   566k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1098|   566k|			break; \
  |  |  |  | 1099|      0|		case FILE_OPOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  353|      0|#define				FILE_OPOR	1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1099:3): [True: 0, False: 595k]
  |  |  |  |  ------------------
  |  |  |  | 1100|      0|			p->fld |= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1101|      0|			break; \
  |  |  |  | 1102|      0|		case FILE_OPXOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  354|      0|#define				FILE_OPXOR	2
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:3): [True: 0, False: 595k]
  |  |  |  |  ------------------
  |  |  |  | 1103|      0|			p->fld ^= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1104|      0|			break; \
  |  |  |  | 1105|     93|		case FILE_OPADD: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  355|     93|#define				FILE_OPADD	3
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1105:3): [True: 93, False: 595k]
  |  |  |  |  ------------------
  |  |  |  | 1106|     93|			p->fld += CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|     93|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1107|     93|			break; \
  |  |  |  | 1108|      0|		case FILE_OPMINUS: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  356|      0|#define				FILE_OPMINUS	4
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1108:3): [True: 0, False: 595k]
  |  |  |  |  ------------------
  |  |  |  | 1109|      0|			p->fld -= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1110|      0|			break; \
  |  |  |  | 1111|      0|		case FILE_OPMULTIPLY: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  357|      0|#define				FILE_OPMULTIPLY	5
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1111:3): [True: 0, False: 595k]
  |  |  |  |  ------------------
  |  |  |  | 1112|      0|			p->fld *= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1113|      0|			break; \
  |  |  |  | 1114|     66|		case FILE_OPDIVIDE: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  358|     66|#define				FILE_OPDIVIDE	6
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1114:3): [True: 66, False: 595k]
  |  |  |  |  ------------------
  |  |  |  | 1115|     66|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|     66|	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|     66|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1087:6): [Folded, False: 66]
  |  |  |  |  |  |  |  Branch (1087:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1087:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1088|     66|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|     66|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|     66|		return -1; \
  |  |  |  |  |  | 1090|     66|	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|     66|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1090:6): [Folded, False: 66]
  |  |  |  |  |  |  |  Branch (1090:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1090:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1091|     66|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|     66|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1091:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1092|     66|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1116|     66|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|     66|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1116:8): [True: 0, False: 66]
  |  |  |  |  ------------------
  |  |  |  | 1117|     66|				return -1; \
  |  |  |  | 1118|     66|			p->fld /= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|     66|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1119|     66|			break; \
  |  |  |  | 1120|  29.1k|		case FILE_OPMODULO: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|  29.1k|#define				FILE_OPMODULO	7
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:3): [True: 29.1k, False: 566k]
  |  |  |  |  ------------------
  |  |  |  | 1121|  29.1k|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|  29.1k|	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|  29.1k|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1087:6): [Folded, False: 29.1k]
  |  |  |  |  |  |  |  Branch (1087:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1087:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1088|  29.1k|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|  29.1k|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|  29.1k|		return -1; \
  |  |  |  |  |  | 1090|  29.1k|	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|  29.1k|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1090:6): [Folded, False: 29.1k]
  |  |  |  |  |  |  |  Branch (1090:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1090:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1091|  29.1k|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|  29.1k|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1091:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1092|  29.1k|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1122|  29.1k|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  29.1k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:8): [True: 0, False: 29.1k]
  |  |  |  |  ------------------
  |  |  |  | 1123|  29.1k|				return -1; \
  |  |  |  | 1124|  29.1k|			p->fld %= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  29.1k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1125|  29.1k|			break; \
  |  |  |  | 1126|   595k|		} \
  |  |  |  | 1127|  11.4M|	if (m->mask_op & FILE_OPINVERSE) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  364|  11.4M|#define				FILE_OPINVERSE	0x40
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1127:6): [True: 0, False: 11.4M]
  |  |  |  |  ------------------
  |  |  |  | 1128|  11.4M|		p->fld = ~p->fld \
  |  |  ------------------
  |  | 1135|  11.4M|	}
  ------------------
 1148|  13.1M|	return 0;
 1149|  13.1M|}
softmagic.c:cvt_32:
 1153|  27.9M|{
 1154|  27.9M|	DO_CVT(m, l, 32);
  ------------------
  |  | 1131|  27.9M|	if ((m)->flag & UNSIGNED) { \
  |  |  ------------------
  |  |  |  |  237|  27.9M|#define UNSIGNED	0x08	/* comparison is unsigned */
  |  |  ------------------
  |  |  |  Branch (1131:6): [True: 4.15M, False: 23.7M]
  |  |  ------------------
  |  | 1132|  4.15M|		DO_CVT1(fld, uint##size##_t, size, 0); \
  |  |  ------------------
  |  |  |  | 1094|  4.15M|	if (m->num_mask) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  388|  4.15M|#define num_mask _u._mask
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1094:6): [True: 628k, False: 3.53M]
  |  |  |  |  ------------------
  |  |  |  | 1095|  4.15M|		switch (m->mask_op & FILE_OPS_MASK) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|   628k|#define				FILE_OPS_MASK	0x07 /* mask for above ops */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:11): [True: 628k, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1096|   627k|		case FILE_OPAND: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|   627k|#define				FILE_OPAND	0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1096:3): [True: 627k, False: 1.12k]
  |  |  |  |  ------------------
  |  |  |  | 1097|   627k|			p->fld &= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|   627k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1098|   627k|			break; \
  |  |  |  | 1099|      0|		case FILE_OPOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  353|      0|#define				FILE_OPOR	1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1099:3): [True: 0, False: 628k]
  |  |  |  |  ------------------
  |  |  |  | 1100|      0|			p->fld |= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1101|      0|			break; \
  |  |  |  | 1102|    115|		case FILE_OPXOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  354|    115|#define				FILE_OPXOR	2
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:3): [True: 115, False: 628k]
  |  |  |  |  ------------------
  |  |  |  | 1103|    115|			p->fld ^= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    115|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1104|    115|			break; \
  |  |  |  | 1105|    244|		case FILE_OPADD: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  355|    244|#define				FILE_OPADD	3
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1105:3): [True: 244, False: 628k]
  |  |  |  |  ------------------
  |  |  |  | 1106|    244|			p->fld += CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    244|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1107|    244|			break; \
  |  |  |  | 1108|      0|		case FILE_OPMINUS: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  356|      0|#define				FILE_OPMINUS	4
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1108:3): [True: 0, False: 628k]
  |  |  |  |  ------------------
  |  |  |  | 1109|      0|			p->fld -= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1110|      0|			break; \
  |  |  |  | 1111|      0|		case FILE_OPMULTIPLY: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  357|      0|#define				FILE_OPMULTIPLY	5
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1111:3): [True: 0, False: 628k]
  |  |  |  |  ------------------
  |  |  |  | 1112|      0|			p->fld *= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1113|      0|			break; \
  |  |  |  | 1114|    516|		case FILE_OPDIVIDE: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  358|    516|#define				FILE_OPDIVIDE	6
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1114:3): [True: 516, False: 628k]
  |  |  |  |  ------------------
  |  |  |  | 1115|    516|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|    516|	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    516|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1087:6): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1087:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1087:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1088|    516|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    516|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|    516|		return -1; \
  |  |  |  |  |  | 1090|    516|	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    516|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1090:6): [Folded, False: 516]
  |  |  |  |  |  |  |  Branch (1090:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1090:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1091|    516|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    516|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1091:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1092|    516|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1116|    516|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    516|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1116:8): [True: 0, False: 516]
  |  |  |  |  ------------------
  |  |  |  | 1117|    516|				return -1; \
  |  |  |  | 1118|    516|			p->fld /= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    516|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1119|    516|			break; \
  |  |  |  | 1120|    516|		case FILE_OPMODULO: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|    249|#define				FILE_OPMODULO	7
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:3): [True: 249, False: 628k]
  |  |  |  |  ------------------
  |  |  |  | 1121|    249|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|    249|	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    249|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1087:6): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1087:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1087:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1088|    249|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    249|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|    249|		return -1; \
  |  |  |  |  |  | 1090|    249|	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    249|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1090:6): [Folded, False: 249]
  |  |  |  |  |  |  |  Branch (1090:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1090:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1091|    249|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    249|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1091:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1092|    249|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1122|    249|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    249|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:8): [True: 0, False: 249]
  |  |  |  |  ------------------
  |  |  |  | 1123|    249|				return -1; \
  |  |  |  | 1124|    249|			p->fld %= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    249|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1125|    249|			break; \
  |  |  |  | 1126|   628k|		} \
  |  |  |  | 1127|  4.15M|	if (m->mask_op & FILE_OPINVERSE) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  364|  4.15M|#define				FILE_OPINVERSE	0x40
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1127:6): [True: 0, False: 4.15M]
  |  |  |  |  ------------------
  |  |  |  | 1128|  4.15M|		p->fld = ~p->fld \
  |  |  ------------------
  |  | 1133|  23.7M|	} else { \
  |  | 1134|  23.7M|		DO_CVT1(s##fld, int##size##_t, size, 1); \
  |  |  ------------------
  |  |  |  | 1094|  23.7M|	if (m->num_mask) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  388|  23.7M|#define num_mask _u._mask
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1094:6): [True: 4.09M, False: 19.6M]
  |  |  |  |  ------------------
  |  |  |  | 1095|  23.7M|		switch (m->mask_op & FILE_OPS_MASK) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|  4.09M|#define				FILE_OPS_MASK	0x07 /* mask for above ops */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:11): [True: 4.09M, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1096|  4.09M|		case FILE_OPAND: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|  4.09M|#define				FILE_OPAND	0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1096:3): [True: 4.09M, False: 802]
  |  |  |  |  ------------------
  |  |  |  | 1097|  4.09M|			p->fld &= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  4.09M|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1098|  4.09M|			break; \
  |  |  |  | 1099|      0|		case FILE_OPOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  353|      0|#define				FILE_OPOR	1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1099:3): [True: 0, False: 4.09M]
  |  |  |  |  ------------------
  |  |  |  | 1100|      0|			p->fld |= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1101|      0|			break; \
  |  |  |  | 1102|      0|		case FILE_OPXOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  354|      0|#define				FILE_OPXOR	2
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:3): [True: 0, False: 4.09M]
  |  |  |  |  ------------------
  |  |  |  | 1103|      0|			p->fld ^= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1104|      0|			break; \
  |  |  |  | 1105|     84|		case FILE_OPADD: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  355|     84|#define				FILE_OPADD	3
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1105:3): [True: 84, False: 4.09M]
  |  |  |  |  ------------------
  |  |  |  | 1106|     84|			p->fld += CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|     84|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1107|     84|			break; \
  |  |  |  | 1108|    523|		case FILE_OPMINUS: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  356|    523|#define				FILE_OPMINUS	4
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1108:3): [True: 523, False: 4.09M]
  |  |  |  |  ------------------
  |  |  |  | 1109|    523|			p->fld -= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    523|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1110|    523|			break; \
  |  |  |  | 1111|      0|		case FILE_OPMULTIPLY: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  357|      0|#define				FILE_OPMULTIPLY	5
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1111:3): [True: 0, False: 4.09M]
  |  |  |  |  ------------------
  |  |  |  | 1112|      0|			p->fld *= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1113|      0|			break; \
  |  |  |  | 1114|      0|		case FILE_OPDIVIDE: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  358|      0|#define				FILE_OPDIVIDE	6
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1114:3): [True: 0, False: 4.09M]
  |  |  |  |  ------------------
  |  |  |  | 1115|      0|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|      0|	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1087:6): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1087:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1087:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1088|      0|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|      0|		return -1; \
  |  |  |  |  |  | 1090|      0|	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1090:6): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1090:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1090:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1091|      0|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1091:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1092|      0|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1116|      0|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1116:8): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1117|      0|				return -1; \
  |  |  |  | 1118|      0|			p->fld /= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1119|      0|			break; \
  |  |  |  | 1120|    195|		case FILE_OPMODULO: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|    195|#define				FILE_OPMODULO	7
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:3): [True: 195, False: 4.09M]
  |  |  |  |  ------------------
  |  |  |  | 1121|    195|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|    195|	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    195|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    390|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1087:6): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1087:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1087:28): [True: 76, False: 119]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1088|    195|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|     76|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    271|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:9): [True: 0, False: 76]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|    195|		return -1; \
  |  |  |  |  |  | 1090|    195|	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    195|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1090:6): [Folded, False: 195]
  |  |  |  |  |  |  |  Branch (1090:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1090:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1091|    195|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    195|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1091:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1092|    195|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1122|    195|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    195|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:8): [True: 0, False: 195]
  |  |  |  |  ------------------
  |  |  |  | 1123|    195|				return -1; \
  |  |  |  | 1124|    195|			p->fld %= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    195|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1125|    195|			break; \
  |  |  |  | 1126|  4.09M|		} \
  |  |  |  | 1127|  23.7M|	if (m->mask_op & FILE_OPINVERSE) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  364|  23.7M|#define				FILE_OPINVERSE	0x40
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1127:6): [True: 0, False: 23.7M]
  |  |  |  |  ------------------
  |  |  |  | 1128|  23.7M|		p->fld = ~p->fld \
  |  |  ------------------
  |  | 1135|  23.7M|	}
  ------------------
 1155|  27.9M|	return 0;
 1156|  27.9M|}
softmagic.c:cvt_64:
 1160|  2.66M|{
 1161|  2.66M|	DO_CVT(m, q, 64);
  ------------------
  |  | 1131|  2.66M|	if ((m)->flag & UNSIGNED) { \
  |  |  ------------------
  |  |  |  |  237|  2.66M|#define UNSIGNED	0x08	/* comparison is unsigned */
  |  |  ------------------
  |  |  |  Branch (1131:6): [True: 1.00M, False: 1.66M]
  |  |  ------------------
  |  | 1132|  1.00M|		DO_CVT1(fld, uint##size##_t, size, 0); \
  |  |  ------------------
  |  |  |  | 1094|  1.00M|	if (m->num_mask) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  388|  1.00M|#define num_mask _u._mask
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1094:6): [True: 304k, False: 699k]
  |  |  |  |  ------------------
  |  |  |  | 1095|  1.00M|		switch (m->mask_op & FILE_OPS_MASK) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|   304k|#define				FILE_OPS_MASK	0x07 /* mask for above ops */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:11): [True: 304k, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1096|   304k|		case FILE_OPAND: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|   304k|#define				FILE_OPAND	0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1096:3): [True: 304k, False: 106]
  |  |  |  |  ------------------
  |  |  |  | 1097|   304k|			p->fld &= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|   304k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1098|   304k|			break; \
  |  |  |  | 1099|      0|		case FILE_OPOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  353|      0|#define				FILE_OPOR	1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1099:3): [True: 0, False: 304k]
  |  |  |  |  ------------------
  |  |  |  | 1100|      0|			p->fld |= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1101|      0|			break; \
  |  |  |  | 1102|      0|		case FILE_OPXOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  354|      0|#define				FILE_OPXOR	2
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:3): [True: 0, False: 304k]
  |  |  |  |  ------------------
  |  |  |  | 1103|      0|			p->fld ^= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1104|      0|			break; \
  |  |  |  | 1105|     72|		case FILE_OPADD: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  355|     72|#define				FILE_OPADD	3
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1105:3): [True: 72, False: 304k]
  |  |  |  |  ------------------
  |  |  |  | 1106|     72|			p->fld += CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|     72|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1107|     72|			break; \
  |  |  |  | 1108|      0|		case FILE_OPMINUS: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  356|      0|#define				FILE_OPMINUS	4
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1108:3): [True: 0, False: 304k]
  |  |  |  |  ------------------
  |  |  |  | 1109|      0|			p->fld -= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1110|      0|			break; \
  |  |  |  | 1111|      0|		case FILE_OPMULTIPLY: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  357|      0|#define				FILE_OPMULTIPLY	5
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1111:3): [True: 0, False: 304k]
  |  |  |  |  ------------------
  |  |  |  | 1112|      0|			p->fld *= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1113|      0|			break; \
  |  |  |  | 1114|     34|		case FILE_OPDIVIDE: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  358|     34|#define				FILE_OPDIVIDE	6
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1114:3): [True: 34, False: 304k]
  |  |  |  |  ------------------
  |  |  |  | 1115|     34|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|     34|	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|     34|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1087:6): [Folded, False: 34]
  |  |  |  |  |  |  |  Branch (1087:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1087:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1088|     34|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|     34|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|     34|		return -1; \
  |  |  |  |  |  | 1090|     34|	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|     34|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1090:6): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1090:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1090:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1091|     34|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|     34|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1091:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1092|     34|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1116|     34|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|     34|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1116:8): [True: 0, False: 34]
  |  |  |  |  ------------------
  |  |  |  | 1117|     34|				return -1; \
  |  |  |  | 1118|     34|			p->fld /= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|     34|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1119|     34|			break; \
  |  |  |  | 1120|     34|		case FILE_OPMODULO: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|      0|#define				FILE_OPMODULO	7
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:3): [True: 0, False: 304k]
  |  |  |  |  ------------------
  |  |  |  | 1121|      0|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|      0|	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1087:6): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1087:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1087:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1088|      0|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|      0|		return -1; \
  |  |  |  |  |  | 1090|      0|	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1090:6): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1090:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1090:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1091|      0|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1091:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1092|      0|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1122|      0|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:8): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1123|      0|				return -1; \
  |  |  |  | 1124|      0|			p->fld %= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1125|      0|			break; \
  |  |  |  | 1126|   304k|		} \
  |  |  |  | 1127|  1.00M|	if (m->mask_op & FILE_OPINVERSE) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  364|  1.00M|#define				FILE_OPINVERSE	0x40
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1127:6): [True: 0, False: 1.00M]
  |  |  |  |  ------------------
  |  |  |  | 1128|  1.00M|		p->fld = ~p->fld \
  |  |  ------------------
  |  | 1133|  1.66M|	} else { \
  |  | 1134|  1.66M|		DO_CVT1(s##fld, int##size##_t, size, 1); \
  |  |  ------------------
  |  |  |  | 1094|  1.66M|	if (m->num_mask) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  388|  1.66M|#define num_mask _u._mask
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1094:6): [True: 45.8k, False: 1.61M]
  |  |  |  |  ------------------
  |  |  |  | 1095|  1.66M|		switch (m->mask_op & FILE_OPS_MASK) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|  45.8k|#define				FILE_OPS_MASK	0x07 /* mask for above ops */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:11): [True: 45.8k, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1096|  43.4k|		case FILE_OPAND: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|  43.4k|#define				FILE_OPAND	0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1096:3): [True: 43.4k, False: 2.36k]
  |  |  |  |  ------------------
  |  |  |  | 1097|  43.4k|			p->fld &= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  43.4k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1098|  43.4k|			break; \
  |  |  |  | 1099|      0|		case FILE_OPOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  353|      0|#define				FILE_OPOR	1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1099:3): [True: 0, False: 45.8k]
  |  |  |  |  ------------------
  |  |  |  | 1100|      0|			p->fld |= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1101|      0|			break; \
  |  |  |  | 1102|      0|		case FILE_OPXOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  354|      0|#define				FILE_OPXOR	2
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:3): [True: 0, False: 45.8k]
  |  |  |  |  ------------------
  |  |  |  | 1103|      0|			p->fld ^= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1104|      0|			break; \
  |  |  |  | 1105|      0|		case FILE_OPADD: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  355|      0|#define				FILE_OPADD	3
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1105:3): [True: 0, False: 45.8k]
  |  |  |  |  ------------------
  |  |  |  | 1106|      0|			p->fld += CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1107|      0|			break; \
  |  |  |  | 1108|      0|		case FILE_OPMINUS: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  356|      0|#define				FILE_OPMINUS	4
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1108:3): [True: 0, False: 45.8k]
  |  |  |  |  ------------------
  |  |  |  | 1109|      0|			p->fld -= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1110|      0|			break; \
  |  |  |  | 1111|      0|		case FILE_OPMULTIPLY: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  357|      0|#define				FILE_OPMULTIPLY	5
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1111:3): [True: 0, False: 45.8k]
  |  |  |  |  ------------------
  |  |  |  | 1112|      0|			p->fld *= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1113|      0|			break; \
  |  |  |  | 1114|    284|		case FILE_OPDIVIDE: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  358|    284|#define				FILE_OPDIVIDE	6
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1114:3): [True: 284, False: 45.5k]
  |  |  |  |  ------------------
  |  |  |  | 1115|    284|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|    284|	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    284|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1087:6): [Folded, False: 284]
  |  |  |  |  |  |  |  Branch (1087:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1087:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1088|    284|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    284|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|    284|		return -1; \
  |  |  |  |  |  | 1090|    284|	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    284|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    568|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1090:6): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1090:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1090:28): [True: 34, False: 250]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1091|    284|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|     34|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    318|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1091:9): [True: 0, False: 34]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1092|    284|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1116|    284|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    284|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1116:8): [True: 0, False: 284]
  |  |  |  |  ------------------
  |  |  |  | 1117|    284|				return -1; \
  |  |  |  | 1118|    284|			p->fld /= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    284|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1119|    284|			break; \
  |  |  |  | 1120|  2.08k|		case FILE_OPMODULO: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|  2.08k|#define				FILE_OPMODULO	7
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:3): [True: 2.08k, False: 43.7k]
  |  |  |  |  ------------------
  |  |  |  | 1121|  2.08k|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|  2.08k|	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|  2.08k|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1087:6): [Folded, False: 2.08k]
  |  |  |  |  |  |  |  Branch (1087:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1087:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1088|  2.08k|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|  2.08k|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|  2.08k|		return -1; \
  |  |  |  |  |  | 1090|  2.08k|	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|  2.08k|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|  4.16k|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1090:6): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1090:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1090:28): [True: 0, False: 2.08k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1091|  2.08k|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|  2.08k|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1091:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1092|  2.08k|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1122|  2.08k|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  2.08k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:8): [True: 0, False: 2.08k]
  |  |  |  |  ------------------
  |  |  |  | 1123|  2.08k|				return -1; \
  |  |  |  | 1124|  2.08k|			p->fld %= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  2.08k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1125|  2.08k|			break; \
  |  |  |  | 1126|  45.8k|		} \
  |  |  |  | 1127|  1.66M|	if (m->mask_op & FILE_OPINVERSE) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  364|  1.66M|#define				FILE_OPINVERSE	0x40
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1127:6): [True: 0, False: 1.66M]
  |  |  |  |  ------------------
  |  |  |  | 1128|  1.66M|		p->fld = ~p->fld \
  |  |  ------------------
  |  | 1135|  1.66M|	}
  ------------------
 1162|  2.66M|	return 0;
 1163|  2.66M|}
softmagic.c:cvt_float:
 1186|  8.27k|{
 1187|  8.27k|	DO_CVT2(f, float);
  ------------------
  |  | 1166|  8.27k|	if (m->num_mask) \
  |  |  ------------------
  |  |  |  |  388|  8.27k|#define num_mask _u._mask
  |  |  ------------------
  |  |  |  Branch (1166:6): [True: 0, False: 8.27k]
  |  |  ------------------
  |  | 1167|  8.27k|		switch (m->mask_op & FILE_OPS_MASK) { \
  |  |  ------------------
  |  |  |  |  360|      0|#define				FILE_OPS_MASK	0x07 /* mask for above ops */
  |  |  ------------------
  |  |  |  Branch (1167:11): [True: 0, False: 0]
  |  |  ------------------
  |  | 1168|      0|		case FILE_OPADD: \
  |  |  ------------------
  |  |  |  |  355|      0|#define				FILE_OPADD	3
  |  |  ------------------
  |  |  |  Branch (1168:3): [True: 0, False: 0]
  |  |  ------------------
  |  | 1169|      0|			p->fld += CAST(type, m->num_mask); \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  | 1170|      0|			break; \
  |  | 1171|      0|		case FILE_OPMINUS: \
  |  |  ------------------
  |  |  |  |  356|      0|#define				FILE_OPMINUS	4
  |  |  ------------------
  |  |  |  Branch (1171:3): [True: 0, False: 0]
  |  |  ------------------
  |  | 1172|      0|			p->fld -= CAST(type, m->num_mask); \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  | 1173|      0|			break; \
  |  | 1174|      0|		case FILE_OPMULTIPLY: \
  |  |  ------------------
  |  |  |  |  357|      0|#define				FILE_OPMULTIPLY	5
  |  |  ------------------
  |  |  |  Branch (1174:3): [True: 0, False: 0]
  |  |  ------------------
  |  | 1175|      0|			p->fld *= CAST(type, m->num_mask); \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  | 1176|      0|			break; \
  |  | 1177|      0|		case FILE_OPDIVIDE: \
  |  |  ------------------
  |  |  |  |  358|      0|#define				FILE_OPDIVIDE	6
  |  |  ------------------
  |  |  |  Branch (1177:3): [True: 0, False: 0]
  |  |  ------------------
  |  | 1178|      0|			if (CAST(type, m->num_mask) == 0) \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  |  Branch (1178:8): [True: 0, False: 0]
  |  |  ------------------
  |  | 1179|      0|				return -1; \
  |  | 1180|      0|			p->fld /= CAST(type, m->num_mask); \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  | 1181|      0|			break; \
  |  | 1182|      0|		} \
  ------------------
 1188|  8.27k|	return 0;
 1189|  8.27k|}
softmagic.c:cvt_double:
 1193|  2.55k|{
 1194|  2.55k|	DO_CVT2(d, double);
  ------------------
  |  | 1166|  2.55k|	if (m->num_mask) \
  |  |  ------------------
  |  |  |  |  388|  2.55k|#define num_mask _u._mask
  |  |  ------------------
  |  |  |  Branch (1166:6): [True: 0, False: 2.55k]
  |  |  ------------------
  |  | 1167|  2.55k|		switch (m->mask_op & FILE_OPS_MASK) { \
  |  |  ------------------
  |  |  |  |  360|      0|#define				FILE_OPS_MASK	0x07 /* mask for above ops */
  |  |  ------------------
  |  |  |  Branch (1167:11): [True: 0, False: 0]
  |  |  ------------------
  |  | 1168|      0|		case FILE_OPADD: \
  |  |  ------------------
  |  |  |  |  355|      0|#define				FILE_OPADD	3
  |  |  ------------------
  |  |  |  Branch (1168:3): [True: 0, False: 0]
  |  |  ------------------
  |  | 1169|      0|			p->fld += CAST(type, m->num_mask); \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  | 1170|      0|			break; \
  |  | 1171|      0|		case FILE_OPMINUS: \
  |  |  ------------------
  |  |  |  |  356|      0|#define				FILE_OPMINUS	4
  |  |  ------------------
  |  |  |  Branch (1171:3): [True: 0, False: 0]
  |  |  ------------------
  |  | 1172|      0|			p->fld -= CAST(type, m->num_mask); \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  | 1173|      0|			break; \
  |  | 1174|      0|		case FILE_OPMULTIPLY: \
  |  |  ------------------
  |  |  |  |  357|      0|#define				FILE_OPMULTIPLY	5
  |  |  ------------------
  |  |  |  Branch (1174:3): [True: 0, False: 0]
  |  |  ------------------
  |  | 1175|      0|			p->fld *= CAST(type, m->num_mask); \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  | 1176|      0|			break; \
  |  | 1177|      0|		case FILE_OPDIVIDE: \
  |  |  ------------------
  |  |  |  |  358|      0|#define				FILE_OPDIVIDE	6
  |  |  ------------------
  |  |  |  Branch (1177:3): [True: 0, False: 0]
  |  |  ------------------
  |  | 1178|      0|			if (CAST(type, m->num_mask) == 0) \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  |  Branch (1178:8): [True: 0, False: 0]
  |  |  ------------------
  |  | 1179|      0|				return -1; \
  |  | 1180|      0|			p->fld /= CAST(type, m->num_mask); \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  | 1181|      0|			break; \
  |  | 1182|      0|		} \
  ------------------
 1195|  2.55k|	return 0;
 1196|  2.55k|}
softmagic.c:magiccheck:
 2169|   133M|{
 2170|   133M|	uint64_t l = m->value.q;
 2171|   133M|	uint64_t v;
 2172|   133M|	float fl, fv;
 2173|   133M|	double dl, dv;
 2174|   133M|	int matched;
 2175|   133M|	union VALUETYPE *p = &ms->ms_value;
 2176|       |
 2177|   133M|	switch (m->type) {
 2178|  2.24M|	case FILE_BYTE:
  ------------------
  |  |  254|  2.24M|#define 			FILE_BYTE		1
  ------------------
  |  Branch (2178:2): [True: 2.24M, False: 131M]
  ------------------
 2179|  2.24M|		v = p->b;
 2180|  2.24M|		break;
 2181|       |
 2182|  2.37M|	case FILE_SHORT:
  ------------------
  |  |  255|  2.37M|#define				FILE_SHORT		2
  ------------------
  |  Branch (2182:2): [True: 2.37M, False: 131M]
  ------------------
 2183|  7.93M|	case FILE_BESHORT:
  ------------------
  |  |  260|  7.93M|#define				FILE_BESHORT		7
  ------------------
  |  Branch (2183:2): [True: 5.56M, False: 127M]
  ------------------
 2184|  13.1M|	case FILE_LESHORT:
  ------------------
  |  |  263|  13.1M|#define				FILE_LESHORT		10
  ------------------
  |  Branch (2184:2): [True: 5.19M, False: 128M]
  ------------------
 2185|  13.1M|	case FILE_MSDOSDATE:
  ------------------
  |  |  308|  13.1M|#define				FILE_MSDOSDATE		55
  ------------------
  |  Branch (2185:2): [True: 0, False: 133M]
  ------------------
 2186|  13.1M|	case FILE_LEMSDOSDATE:
  ------------------
  |  |  309|  13.1M|#define				FILE_LEMSDOSDATE	56
  ------------------
  |  Branch (2186:2): [True: 322, False: 133M]
  ------------------
 2187|  13.1M|	case FILE_BEMSDOSDATE:
  ------------------
  |  |  310|  13.1M|#define				FILE_BEMSDOSDATE	57
  ------------------
  |  Branch (2187:2): [True: 0, False: 133M]
  ------------------
 2188|  13.1M|	case FILE_MSDOSTIME:
  ------------------
  |  |  311|  13.1M|#define				FILE_MSDOSTIME		58
  ------------------
  |  Branch (2188:2): [True: 0, False: 133M]
  ------------------
 2189|  13.1M|	case FILE_LEMSDOSTIME:
  ------------------
  |  |  312|  13.1M|#define				FILE_LEMSDOSTIME	59
  ------------------
  |  Branch (2189:2): [True: 322, False: 133M]
  ------------------
 2190|  13.1M|	case FILE_BEMSDOSTIME:
  ------------------
  |  |  313|  13.1M|#define				FILE_BEMSDOSTIME	60
  ------------------
  |  Branch (2190:2): [True: 0, False: 133M]
  ------------------
 2191|  13.1M|		v = p->h;
 2192|  13.1M|		break;
 2193|       |
 2194|  2.05M|	case FILE_LONG:
  ------------------
  |  |  257|  2.05M|#define				FILE_LONG		4
  ------------------
  |  Branch (2194:2): [True: 2.05M, False: 131M]
  ------------------
 2195|  19.1M|	case FILE_BELONG:
  ------------------
  |  |  261|  19.1M|#define				FILE_BELONG		8
  ------------------
  |  Branch (2195:2): [True: 17.1M, False: 116M]
  ------------------
 2196|  27.9M|	case FILE_LELONG:
  ------------------
  |  |  264|  27.9M|#define				FILE_LELONG		11
  ------------------
  |  Branch (2196:2): [True: 8.74M, False: 124M]
  ------------------
 2197|  27.9M|	case FILE_MELONG:
  ------------------
  |  |  276|  27.9M|#define				FILE_MELONG		23
  ------------------
  |  Branch (2197:2): [True: 39, False: 133M]
  ------------------
 2198|  27.9M|	case FILE_DATE:
  ------------------
  |  |  259|  27.9M|#define				FILE_DATE		6
  ------------------
  |  Branch (2198:2): [True: 0, False: 133M]
  ------------------
 2199|  27.9M|	case FILE_BEDATE:
  ------------------
  |  |  262|  27.9M|#define				FILE_BEDATE		9
  ------------------
  |  Branch (2199:2): [True: 640, False: 133M]
  ------------------
 2200|  27.9M|	case FILE_LEDATE:
  ------------------
  |  |  265|  27.9M|#define				FILE_LEDATE		12
  ------------------
  |  Branch (2200:2): [True: 220, False: 133M]
  ------------------
 2201|  27.9M|	case FILE_MEDATE:
  ------------------
  |  |  274|  27.9M|#define				FILE_MEDATE		21
  ------------------
  |  Branch (2201:2): [True: 143, False: 133M]
  ------------------
 2202|  27.9M|	case FILE_LDATE:
  ------------------
  |  |  267|  27.9M|#define				FILE_LDATE		14
  ------------------
  |  Branch (2202:2): [True: 0, False: 133M]
  ------------------
 2203|  27.9M|	case FILE_BELDATE:
  ------------------
  |  |  268|  27.9M|#define				FILE_BELDATE		15
  ------------------
  |  Branch (2203:2): [True: 422, False: 133M]
  ------------------
 2204|  27.9M|	case FILE_LELDATE:
  ------------------
  |  |  269|  27.9M|#define				FILE_LELDATE		16
  ------------------
  |  Branch (2204:2): [True: 84, False: 133M]
  ------------------
 2205|  27.9M|	case FILE_MELDATE:
  ------------------
  |  |  275|  27.9M|#define				FILE_MELDATE		22
  ------------------
  |  Branch (2205:2): [True: 0, False: 133M]
  ------------------
 2206|  27.9M|		v = p->l;
 2207|  27.9M|		break;
 2208|       |
 2209|  87.4k|	case FILE_QUAD:
  ------------------
  |  |  277|  87.4k|#define				FILE_QUAD		24
  ------------------
  |  Branch (2209:2): [True: 87.4k, False: 133M]
  ------------------
 2210|  1.25M|	case FILE_LEQUAD:
  ------------------
  |  |  278|  1.25M|#define				FILE_LEQUAD		25
  ------------------
  |  Branch (2210:2): [True: 1.17M, False: 132M]
  ------------------
 2211|  2.65M|	case FILE_BEQUAD:
  ------------------
  |  |  279|  2.65M|#define				FILE_BEQUAD		26
  ------------------
  |  Branch (2211:2): [True: 1.39M, False: 132M]
  ------------------
 2212|  2.65M|	case FILE_QDATE:
  ------------------
  |  |  280|  2.65M|#define				FILE_QDATE		27
  ------------------
  |  Branch (2212:2): [True: 0, False: 133M]
  ------------------
 2213|  2.65M|	case FILE_BEQDATE:
  ------------------
  |  |  282|  2.65M|#define				FILE_BEQDATE		29
  ------------------
  |  Branch (2213:2): [True: 1.54k, False: 133M]
  ------------------
 2214|  2.65M|	case FILE_LEQDATE:
  ------------------
  |  |  281|  2.65M|#define				FILE_LEQDATE		28
  ------------------
  |  Branch (2214:2): [True: 46, False: 133M]
  ------------------
 2215|  2.65M|	case FILE_QLDATE:
  ------------------
  |  |  283|  2.65M|#define				FILE_QLDATE		30
  ------------------
  |  Branch (2215:2): [True: 0, False: 133M]
  ------------------
 2216|  2.65M|	case FILE_BEQLDATE:
  ------------------
  |  |  285|  2.65M|#define				FILE_BEQLDATE		32
  ------------------
  |  Branch (2216:2): [True: 284, False: 133M]
  ------------------
 2217|  2.65M|	case FILE_LEQLDATE:
  ------------------
  |  |  284|  2.65M|#define				FILE_LEQLDATE		31
  ------------------
  |  Branch (2217:2): [True: 430, False: 133M]
  ------------------
 2218|  2.65M|	case FILE_QWDATE:
  ------------------
  |  |  295|  2.65M|#define				FILE_QWDATE		42
  ------------------
  |  Branch (2218:2): [True: 212, False: 133M]
  ------------------
 2219|  2.65M|	case FILE_BEQWDATE:
  ------------------
  |  |  297|  2.65M|#define				FILE_BEQWDATE		44
  ------------------
  |  Branch (2219:2): [True: 0, False: 133M]
  ------------------
 2220|  2.65M|	case FILE_LEQWDATE:
  ------------------
  |  |  296|  2.65M|#define				FILE_LEQWDATE		43
  ------------------
  |  Branch (2220:2): [True: 2.52k, False: 133M]
  ------------------
 2221|  2.66M|	case FILE_OFFSET:
  ------------------
  |  |  305|  2.66M|#define				FILE_OFFSET		52
  ------------------
  |  Branch (2221:2): [True: 5.52k, False: 133M]
  ------------------
 2222|  2.66M|		v = p->q;
 2223|  2.66M|		break;
 2224|       |
 2225|      0|	case FILE_FLOAT:
  ------------------
  |  |  286|      0|#define				FILE_FLOAT		33
  ------------------
  |  Branch (2225:2): [True: 0, False: 133M]
  ------------------
 2226|      0|	case FILE_BEFLOAT:
  ------------------
  |  |  287|      0|#define				FILE_BEFLOAT		34
  ------------------
  |  Branch (2226:2): [True: 0, False: 133M]
  ------------------
 2227|  8.27k|	case FILE_LEFLOAT:
  ------------------
  |  |  288|  8.27k|#define				FILE_LEFLOAT		35
  ------------------
  |  Branch (2227:2): [True: 8.27k, False: 133M]
  ------------------
 2228|  8.27k|		fl = m->value.f;
 2229|  8.27k|		fv = p->f;
 2230|  8.27k|		switch (m->reln) {
 2231|  1.47k|		case 'x':
  ------------------
  |  Branch (2231:3): [True: 1.47k, False: 6.80k]
  ------------------
 2232|  1.47k|			matched = 1;
 2233|  1.47k|			break;
 2234|       |
 2235|      0|		case '!':
  ------------------
  |  Branch (2235:3): [True: 0, False: 8.27k]
  ------------------
 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.27k]
  ------------------
 2240|      0|			matched = isunordered(fl, fv) ? 0 : fv == fl;
  ------------------
  |  Branch (2240:14): [True: 0, False: 0]
  ------------------
 2241|      0|			break;
 2242|       |
 2243|  6.80k|		case '>':
  ------------------
  |  Branch (2243:3): [True: 6.80k, False: 1.47k]
  ------------------
 2244|  6.80k|			matched = isgreater(fv, fl);
 2245|  6.80k|			break;
 2246|       |
 2247|      0|		case '<':
  ------------------
  |  Branch (2247:3): [True: 0, False: 8.27k]
  ------------------
 2248|      0|			matched = isless(fv, fl);
 2249|      0|			break;
 2250|       |
 2251|      0|		default:
  ------------------
  |  Branch (2251:3): [True: 0, False: 8.27k]
  ------------------
 2252|      0|			file_magerror(ms, "cannot happen with float: "
 2253|      0|			    "invalid relation `%c'", m->reln);
 2254|      0|			return -1;
 2255|  8.27k|		}
 2256|  8.27k|		return matched;
 2257|       |
 2258|      0|	case FILE_DOUBLE:
  ------------------
  |  |  289|      0|#define				FILE_DOUBLE		36
  ------------------
  |  Branch (2258:2): [True: 0, False: 133M]
  ------------------
 2259|    170|	case FILE_BEDOUBLE:
  ------------------
  |  |  290|    170|#define				FILE_BEDOUBLE		37
  ------------------
  |  Branch (2259:2): [True: 170, False: 133M]
  ------------------
 2260|  2.55k|	case FILE_LEDOUBLE:
  ------------------
  |  |  291|  2.55k|#define				FILE_LEDOUBLE		38
  ------------------
  |  Branch (2260:2): [True: 2.38k, False: 133M]
  ------------------
 2261|  2.55k|		dl = m->value.d;
 2262|  2.55k|		dv = p->d;
 2263|  2.55k|		switch (m->reln) {
 2264|  2.27k|		case 'x':
  ------------------
  |  Branch (2264:3): [True: 2.27k, False: 282]
  ------------------
 2265|  2.27k|			matched = 1;
 2266|  2.27k|			break;
 2267|       |
 2268|      0|		case '!':
  ------------------
  |  Branch (2268:3): [True: 0, False: 2.55k]
  ------------------
 2269|      0|			matched = isunordered(dv, dl) ? 1 : dv != dl;
  ------------------
  |  Branch (2269:14): [True: 0, False: 0]
  ------------------
 2270|      0|			break;
 2271|       |
 2272|    282|		case '=':
  ------------------
  |  Branch (2272:3): [True: 282, False: 2.27k]
  ------------------
 2273|    282|			matched = isunordered(dv, dl) ? 0 : dv == dl;
  ------------------
  |  Branch (2273:14): [True: 73, False: 209]
  ------------------
 2274|    282|			break;
 2275|       |
 2276|      0|		case '>':
  ------------------
  |  Branch (2276:3): [True: 0, False: 2.55k]
  ------------------
 2277|      0|			matched = isgreater(dv, dl);
 2278|      0|			break;
 2279|       |
 2280|      0|		case '<':
  ------------------
  |  Branch (2280:3): [True: 0, False: 2.55k]
  ------------------
 2281|      0|			matched = isless(dv, dl);
 2282|      0|			break;
 2283|       |
 2284|      0|		default:
  ------------------
  |  Branch (2284:3): [True: 0, False: 2.55k]
  ------------------
 2285|      0|			file_magerror(ms, "cannot happen with double: "
 2286|      0|			    "invalid relation `%c'", m->reln);
 2287|      0|			return -1;
 2288|  2.55k|		}
 2289|  2.55k|		return matched;
 2290|       |
 2291|  8.72k|	case FILE_DEFAULT:
  ------------------
  |  |  256|  8.72k|#define				FILE_DEFAULT		3
  ------------------
  |  Branch (2291:2): [True: 8.72k, False: 133M]
  ------------------
 2292|  10.4k|	case FILE_CLEAR:
  ------------------
  |  |  300|  10.4k|#define				FILE_CLEAR		47
  ------------------
  |  Branch (2292:2): [True: 1.76k, False: 133M]
  ------------------
 2293|  10.4k|		l = 0;
 2294|  10.4k|		v = 0;
 2295|  10.4k|		break;
 2296|       |
 2297|  85.0M|	case FILE_STRING:
  ------------------
  |  |  258|  85.0M|#define				FILE_STRING		5
  ------------------
  |  Branch (2297:2): [True: 85.0M, False: 48.4M]
  ------------------
 2298|  85.1M|	case FILE_PSTRING:
  ------------------
  |  |  266|  85.1M|#define				FILE_PSTRING		13
  ------------------
  |  Branch (2298:2): [True: 37.9k, False: 133M]
  ------------------
 2299|  85.1M|	case FILE_OCTAL:
  ------------------
  |  |  314|  85.1M|#define				FILE_OCTAL		61
  ------------------
  |  Branch (2299:2): [True: 0, False: 133M]
  ------------------
 2300|  85.1M|		l = 0;
 2301|  85.1M|		v = file_strncmp(m->value.s, p->s, CAST(size_t, m->vallen),
  ------------------
  |  |  460|  85.1M|#define CAST(T, b)	((T)(b))
  ------------------
 2302|  85.1M|		    sizeof(p->s), m->str_flags);
  ------------------
  |  |  390|  85.1M|#define str_flags _u._s._flags
  ------------------
 2303|  85.1M|		break;
 2304|       |
 2305|    159|	case FILE_BESTRING16:
  ------------------
  |  |  271|    159|#define				FILE_BESTRING16		18
  ------------------
  |  Branch (2305:2): [True: 159, False: 133M]
  ------------------
 2306|  87.8k|	case FILE_LESTRING16:
  ------------------
  |  |  272|  87.8k|#define				FILE_LESTRING16		19
  ------------------
  |  Branch (2306:2): [True: 87.7k, False: 133M]
  ------------------
 2307|  87.8k|		l = 0;
 2308|  87.8k|		v = file_strncmp16(m->value.s, p->s, CAST(size_t, m->vallen),
  ------------------
  |  |  460|  87.8k|#define CAST(T, b)	((T)(b))
  ------------------
 2309|  87.8k|		    sizeof(p->s), m->str_flags);
  ------------------
  |  |  390|  87.8k|#define str_flags _u._s._flags
  ------------------
 2310|  87.8k|		break;
 2311|       |
 2312|   877k|	case FILE_SEARCH: { /* search ms->search.s for the string m->value.s */
  ------------------
  |  |  273|   877k|#define				FILE_SEARCH		20
  ------------------
  |  Branch (2312:2): [True: 877k, False: 132M]
  ------------------
 2313|   877k|		size_t slen;
 2314|   877k|		size_t idx;
 2315|       |
 2316|   877k|		if (ms->search.s == NULL)
  ------------------
  |  Branch (2316:7): [True: 0, False: 877k]
  ------------------
 2317|      0|			return 0;
 2318|       |
 2319|   877k|		slen = MIN(m->vallen, sizeof(m->value.s));
  ------------------
  |  Branch (2319:10): [True: 877k, False: 0]
  ------------------
 2320|   877k|		l = 0;
 2321|   877k|		v = 0;
 2322|   877k|		if ((ms->flags & MAGIC_DEBUG) != 0) {
  ------------------
  |  |   33|   877k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2322:7): [True: 0, False: 877k]
  ------------------
 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|   877k|#ifdef HAVE_MEMMEM
 2333|   877k|		if (slen > 0 && m->str_flags == 0) {
  ------------------
  |  |  390|   877k|#define str_flags _u._s._flags
  ------------------
  |  Branch (2333:7): [True: 877k, False: 0]
  |  Branch (2333:19): [True: 391k, False: 486k]
  ------------------
 2334|   391k|			const char *found;
 2335|   391k|			idx = m->str_range + slen;
  ------------------
  |  |  389|   391k|#define str_range _u._s._count
  ------------------
 2336|   391k|			if (m->str_range == 0 || ms->search.s_len < idx)
  ------------------
  |  |  389|   391k|#define str_range _u._s._count
  ------------------
  |  Branch (2336:8): [True: 4.36k, False: 387k]
  |  Branch (2336:29): [True: 101k, False: 285k]
  ------------------
 2337|   105k|				idx = ms->search.s_len;
 2338|   391k|			found = CAST(const char *, memmem(ms->search.s, idx,
  ------------------
  |  |  460|   391k|#define CAST(T, b)	((T)(b))
  ------------------
 2339|   391k|			    m->value.s, slen));
 2340|   391k|			if ((ms->flags & MAGIC_DEBUG) != 0) {
  ------------------
  |  |   33|   391k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2340:8): [True: 0, False: 391k]
  ------------------
 2341|      0|				fprintf(stderr, "] %sfound\n",
 2342|      0|				    found ? "" : "not ");
  ------------------
  |  Branch (2342:9): [True: 0, False: 0]
  ------------------
 2343|      0|			}
 2344|   391k|			if (!found) {
  ------------------
  |  Branch (2344:8): [True: 388k, False: 3.00k]
  ------------------
 2345|   388k|				v = 1;
 2346|   388k|				break;
 2347|   388k|			}
 2348|  3.00k|			idx = found - ms->search.s;
 2349|  3.00k|			ms->search.offset += idx;
 2350|  3.00k|			ms->search.rm_len = ms->search.s_len - idx;
 2351|  3.00k|			break;
 2352|   391k|		}
 2353|   486k|#endif
 2354|       |
 2355|  2.48G|		for (idx = 0; m->str_range == 0 || idx < m->str_range; idx++) {
  ------------------
  |  |  389|  2.48G|#define str_range _u._s._count
  ------------------
              		for (idx = 0; m->str_range == 0 || idx < m->str_range; idx++) {
  ------------------
  |  |  389|  2.48G|#define str_range _u._s._count
  ------------------
  |  Branch (2355:17): [True: 0, False: 2.48G]
  |  Branch (2355:38): [True: 2.48G, False: 312k]
  ------------------
 2356|  2.48G|			if (slen + idx > ms->search.s_len) {
  ------------------
  |  Branch (2356:8): [True: 153k, False: 2.48G]
  ------------------
 2357|   153k|				v = 1;
 2358|   153k|				break;
 2359|   153k|			}
 2360|       |
 2361|  2.48G|			v = file_strncmp(m->value.s, ms->search.s + idx, slen,
 2362|  2.48G|			    ms->search.s_len - idx, m->str_flags);
  ------------------
  |  |  390|  2.48G|#define str_flags _u._s._flags
  ------------------
 2363|  2.48G|			if (v == 0) {	/* found match */
  ------------------
  |  Branch (2363:8): [True: 20.6k, False: 2.48G]
  ------------------
 2364|  20.6k|				ms->search.offset += idx;
 2365|  20.6k|				ms->search.rm_len = ms->search.s_len - idx;
 2366|  20.6k|				break;
 2367|  20.6k|			}
 2368|  2.48G|		}
 2369|   486k|		if ((ms->flags & MAGIC_DEBUG) != 0) {
  ------------------
  |  |   33|   486k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2369:7): [True: 0, False: 486k]
  ------------------
 2370|      0|			fprintf(stderr, "] %sfound\n", v == 0 ? "" : "not ");
  ------------------
  |  Branch (2370:35): [True: 0, False: 0]
  ------------------
 2371|      0|		}
 2372|   486k|		break;
 2373|   877k|	}
 2374|   559k|	case FILE_REGEX: {
  ------------------
  |  |  270|   559k|#define				FILE_REGEX		17
  ------------------
  |  Branch (2374:2): [True: 559k, False: 133M]
  ------------------
 2375|   559k|		int rc;
 2376|   559k|		file_regex_t *rx = *m_cache;
 2377|   559k|		const char *search;
 2378|   559k|		regmatch_t pmatch;
 2379|   559k|		size_t slen = ms->search.s_len;
 2380|   559k|		char *copy;
 2381|       |
 2382|   559k|		if (ms->search.s == NULL)
  ------------------
  |  Branch (2382:7): [True: 70, False: 559k]
  ------------------
 2383|     70|			return 0;
 2384|       |
 2385|   559k|		if (rx == NULL) {
  ------------------
  |  Branch (2385:7): [True: 173, False: 559k]
  ------------------
 2386|    173|			rx = *m_cache = alloc_regex(ms, m);
 2387|    173|			if (rx == NULL)
  ------------------
  |  Branch (2387:8): [True: 0, False: 173]
  ------------------
 2388|      0|				return -1;
 2389|    173|		}
 2390|   559k|		l = 0;
 2391|   559k|		if (slen != 0) {
  ------------------
  |  Branch (2391:7): [True: 557k, False: 1.96k]
  ------------------
 2392|   557k|		    copy = CAST(char *, malloc(slen));
  ------------------
  |  |  460|   557k|#define CAST(T, b)	((T)(b))
  ------------------
 2393|   557k|		    if (copy == NULL)  {
  ------------------
  |  Branch (2393:11): [True: 0, False: 557k]
  ------------------
 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|   557k|		    memcpy(copy, ms->search.s, slen);
 2400|   557k|		    copy[--slen] = '\0';
 2401|   557k|		    search = copy;
 2402|   557k|		} else {
 2403|  1.96k|		    search = CCAST(char *, "");
  ------------------
  |  |  462|  1.96k|#define CCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 2404|  1.96k|		    copy = NULL;
 2405|  1.96k|		}
 2406|   559k|		rc = file_regexec(ms, rx, RCAST(const char *, search),
  ------------------
  |  |  461|   559k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 2407|   559k|		    1, &pmatch, 0);
 2408|   559k|		free(copy);
 2409|   559k|		switch (rc) {
 2410|  3.75k|		case 0:
  ------------------
  |  Branch (2410:3): [True: 3.75k, False: 555k]
  ------------------
 2411|       |			/* Sanity check */
 2412|  3.75k|			if (pmatch.rm_so < 0 || pmatch.rm_eo < 0 ||
  ------------------
  |  Branch (2412:8): [True: 0, False: 3.75k]
  |  Branch (2412:28): [True: 0, False: 3.75k]
  ------------------
 2413|  3.75k|			    pmatch.rm_eo < pmatch.rm_so ||
  ------------------
  |  Branch (2413:8): [True: 0, False: 3.75k]
  ------------------
 2414|  3.75k|			    CAST(size_t, pmatch.rm_eo) > slen) {
  ------------------
  |  |  460|  3.75k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (2414:8): [True: 0, False: 3.75k]
  ------------------
 2415|      0|				v = 1;
 2416|      0|				break;
 2417|      0|			}
 2418|       |
 2419|  3.75k|			ms->search.s += CAST(int, pmatch.rm_so);
  ------------------
  |  |  460|  3.75k|#define CAST(T, b)	((T)(b))
  ------------------
 2420|  3.75k|			ms->search.offset += CAST(size_t, pmatch.rm_so);
  ------------------
  |  |  460|  3.75k|#define CAST(T, b)	((T)(b))
  ------------------
 2421|  3.75k|			ms->search.rm_len = CAST(size_t,
  ------------------
  |  |  460|  3.75k|#define CAST(T, b)	((T)(b))
  ------------------
 2422|  3.75k|			    pmatch.rm_eo - pmatch.rm_so);
 2423|  3.75k|			v = 0;
 2424|  3.75k|			break;
 2425|       |
 2426|   555k|		case REG_NOMATCH:
  ------------------
  |  Branch (2426:3): [True: 555k, False: 3.75k]
  ------------------
 2427|   555k|			v = 1;
 2428|   555k|			break;
 2429|       |
 2430|      0|		default:
  ------------------
  |  Branch (2430:3): [True: 0, False: 559k]
  ------------------
 2431|      0|			return -1;
 2432|   559k|		}
 2433|   559k|		break;
 2434|   559k|	}
 2435|   559k|	case FILE_USE:
  ------------------
  |  |  299|  36.9k|#define				FILE_USE		46
  ------------------
  |  Branch (2435:2): [True: 36.9k, False: 133M]
  ------------------
 2436|  36.9k|		return ms->ms_value.q != 0;
 2437|  48.9k|	case FILE_NAME:
  ------------------
  |  |  298|  48.9k|#define				FILE_NAME		45
  ------------------
  |  Branch (2437:2): [True: 48.9k, False: 133M]
  ------------------
 2438|  64.2k|	case FILE_INDIRECT:
  ------------------
  |  |  294|  64.2k|#define				FILE_INDIRECT		41
  ------------------
  |  Branch (2438:2): [True: 15.3k, False: 133M]
  ------------------
 2439|  64.2k|		return 1;
 2440|   518k|	case FILE_DER:
  ------------------
  |  |  301|   518k|#define				FILE_DER		48
  ------------------
  |  Branch (2440:2): [True: 518k, False: 133M]
  ------------------
 2441|   518k|		matched = der_cmp(ms, m);
 2442|   518k|		if (matched == -1) {
  ------------------
  |  Branch (2442:7): [True: 182k, False: 336k]
  ------------------
 2443|   182k|			if ((ms->flags & MAGIC_DEBUG) != 0) {
  ------------------
  |  |   33|   182k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2443:8): [True: 0, False: 182k]
  ------------------
 2444|      0|				(void) fprintf(stderr,
 2445|      0|				    "EOF comparing DER entries\n");
 2446|      0|			}
 2447|   182k|			return 0;
 2448|   182k|		}
 2449|   336k|		return matched;
 2450|     50|	case FILE_BEGUID:
  ------------------
  |  |  304|     50|#define				FILE_BEGUID		51
  ------------------
  |  Branch (2450:2): [True: 50, False: 133M]
  ------------------
 2451|     50|	case FILE_LEGUID:
  ------------------
  |  |  303|     50|#define				FILE_LEGUID		50
  ------------------
  |  Branch (2451:2): [True: 0, False: 133M]
  ------------------
 2452|   310k|	case FILE_GUID:
  ------------------
  |  |  302|   310k|#define				FILE_GUID		49
  ------------------
  |  Branch (2452:2): [True: 310k, False: 133M]
  ------------------
 2453|   310k|		l = 0;
 2454|   310k|		v = memcmp(m->value.guid, p->guid, sizeof(p->guid));
 2455|   310k|		break;
 2456|      0|	default:
  ------------------
  |  Branch (2456:2): [True: 0, False: 133M]
  ------------------
 2457|      0|		file_magerror(ms, "invalid type %d in magiccheck()", m->type);
 2458|      0|		return -1;
 2459|   133M|	}
 2460|       |
 2461|   132M|	v = file_signextend(ms, m, v);
 2462|       |
 2463|   132M|	switch (m->reln) {
 2464|  90.9k|	case 'x':
  ------------------
  |  Branch (2464:2): [True: 90.9k, False: 132M]
  ------------------
 2465|  90.9k|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  90.9k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2465:7): [True: 0, False: 90.9k]
  ------------------
 2466|      0|			(void) fprintf(stderr, "%" INT64_T_FORMAT
 2467|      0|			    "u == *any* = 1", CAST(unsigned long long, v));
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2468|  90.9k|		matched = 1;
 2469|  90.9k|		break;
 2470|       |
 2471|  64.4k|	case '!':
  ------------------
  |  Branch (2471:2): [True: 64.4k, False: 132M]
  ------------------
 2472|  64.4k|		matched = v != l;
 2473|  64.4k|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  64.4k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2473:7): [True: 0, False: 64.4k]
  ------------------
 2474|      0|			(void) fprintf(stderr, "%" INT64_T_FORMAT "u != %"
 2475|      0|			    INT64_T_FORMAT "u = %d",
 2476|      0|			    CAST(unsigned long long, v),
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2477|      0|			    CAST(unsigned long long, l), matched);
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2478|  64.4k|		break;
 2479|       |
 2480|   132M|	case '=':
  ------------------
  |  Branch (2480:2): [True: 132M, False: 929k]
  ------------------
 2481|   132M|		matched = v == l;
 2482|   132M|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|   132M|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2482:7): [True: 0, False: 132M]
  ------------------
 2483|      0|			(void) fprintf(stderr, "%" INT64_T_FORMAT "u == %"
 2484|      0|			    INT64_T_FORMAT "u = %d",
 2485|      0|			    CAST(unsigned long long, v),
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2486|      0|			    CAST(unsigned long long, l), matched);
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2487|   132M|		break;
 2488|       |
 2489|   282k|	case '>':
  ------------------
  |  Branch (2489:2): [True: 282k, False: 132M]
  ------------------
 2490|   282k|		if (m->flag & UNSIGNED) {
  ------------------
  |  |  237|   282k|#define UNSIGNED	0x08	/* comparison is unsigned */
  ------------------
  |  Branch (2490:7): [True: 205k, False: 76.7k]
  ------------------
 2491|   205k|			matched = v > l;
 2492|   205k|			if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|   205k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2492:8): [True: 0, False: 205k]
  ------------------
 2493|      0|				(void) fprintf(stderr, "%" INT64_T_FORMAT
 2494|      0|				    "u > %" INT64_T_FORMAT "u = %d",
 2495|      0|				    CAST(unsigned long long, v),
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2496|      0|				    CAST(unsigned long long, l), matched);
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2497|   205k|		}
 2498|  76.7k|		else {
 2499|  76.7k|			matched = CAST(int64_t, v) > CAST(int64_t, l);
  ------------------
  |  |  460|  76.7k|#define CAST(T, b)	((T)(b))
  ------------------
              			matched = CAST(int64_t, v) > CAST(int64_t, l);
  ------------------
  |  |  460|  76.7k|#define CAST(T, b)	((T)(b))
  ------------------
 2500|  76.7k|			if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  76.7k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2500:8): [True: 0, False: 76.7k]
  ------------------
 2501|      0|				(void) fprintf(stderr, "%" INT64_T_FORMAT
 2502|      0|				    "d > %" INT64_T_FORMAT "d = %d",
 2503|      0|				    CAST(long long, v),
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2504|      0|				    CAST(long long, l), matched);
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2505|  76.7k|		}
 2506|   282k|		break;
 2507|       |
 2508|   446k|	case '<':
  ------------------
  |  Branch (2508:2): [True: 446k, False: 132M]
  ------------------
 2509|   446k|		if (m->flag & UNSIGNED) {
  ------------------
  |  |  237|   446k|#define UNSIGNED	0x08	/* comparison is unsigned */
  ------------------
  |  Branch (2509:7): [True: 372k, False: 73.9k]
  ------------------
 2510|   372k|			matched = v < l;
 2511|   372k|			if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|   372k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2511:8): [True: 0, False: 372k]
  ------------------
 2512|      0|				(void) fprintf(stderr, "%" INT64_T_FORMAT
 2513|      0|				    "u < %" INT64_T_FORMAT "u = %d",
 2514|      0|				    CAST(unsigned long long, v),
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2515|      0|				    CAST(unsigned long long, l), matched);
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2516|   372k|		}
 2517|  73.9k|		else {
 2518|  73.9k|			matched = CAST(int64_t, v) < CAST(int64_t, l);
  ------------------
  |  |  460|  73.9k|#define CAST(T, b)	((T)(b))
  ------------------
              			matched = CAST(int64_t, v) < CAST(int64_t, l);
  ------------------
  |  |  460|  73.9k|#define CAST(T, b)	((T)(b))
  ------------------
 2519|  73.9k|			if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  73.9k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2519:8): [True: 0, False: 73.9k]
  ------------------
 2520|      0|				(void) fprintf(stderr, "%" INT64_T_FORMAT
 2521|      0|				    "d < %" INT64_T_FORMAT "d = %d",
 2522|      0|				     CAST(long long, v),
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2523|      0|				     CAST(long long, l), matched);
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2524|  73.9k|		}
 2525|   446k|		break;
 2526|       |
 2527|  44.1k|	case '&':
  ------------------
  |  Branch (2527:2): [True: 44.1k, False: 132M]
  ------------------
 2528|  44.1k|		matched = (v & l) == l;
 2529|  44.1k|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  44.1k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2529:7): [True: 0, False: 44.1k]
  ------------------
 2530|      0|			(void) fprintf(stderr, "((%" INT64_T_FORMAT "x & %"
 2531|      0|			    INT64_T_FORMAT "x) == %" INT64_T_FORMAT
 2532|      0|			    "x) = %d", CAST(unsigned long long, v),
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2533|      0|			    CAST(unsigned long long, l),
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2534|      0|			    CAST(unsigned long long, l),
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2535|      0|			    matched);
 2536|  44.1k|		break;
 2537|       |
 2538|    990|	case '^':
  ------------------
  |  Branch (2538:2): [True: 990, False: 132M]
  ------------------
 2539|    990|		matched = (v & l) != l;
 2540|    990|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|    990|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2540:7): [True: 0, False: 990]
  ------------------
 2541|      0|			(void) fprintf(stderr, "((%" INT64_T_FORMAT "x & %"
 2542|      0|			    INT64_T_FORMAT "x) != %" INT64_T_FORMAT
 2543|      0|			    "x) = %d", CAST(unsigned long long, v),
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2544|      0|			    CAST(unsigned long long, l),
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2545|      0|			    CAST(unsigned long long, l), matched);
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2546|    990|		break;
 2547|       |
 2548|      0|	default:
  ------------------
  |  Branch (2548:2): [True: 0, False: 132M]
  ------------------
 2549|      0|		file_magerror(ms, "cannot happen: invalid relation `%c'",
 2550|      0|		    m->reln);
 2551|      0|		return -1;
 2552|   132M|	}
 2553|   132M|	if ((ms->flags & MAGIC_DEBUG) != 0) {
  ------------------
  |  |   33|   132M|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2553:6): [True: 0, False: 132M]
  ------------------
 2554|      0|		(void) fprintf(stderr, " strength=%zu\n",
 2555|      0|		    file_magic_strength(m, 1));
 2556|      0|	}
 2557|       |
 2558|   132M|	return matched;
 2559|   132M|}
softmagic.c:file_strncmp:
 2058|  2.57G|{
 2059|       |	/*
 2060|       |	 * Convert the source args to unsigned here so that (1) the
 2061|       |	 * compare will be unsigned as it is in strncmp() and (2) so
 2062|       |	 * the ctype functions will work correctly without extra
 2063|       |	 * casting.
 2064|       |	 */
 2065|  2.57G|	const unsigned char *a = RCAST(const unsigned char *, s1);
  ------------------
  |  |  461|  2.57G|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 2066|  2.57G|	const unsigned char *b = RCAST(const unsigned char *, s2);
  ------------------
  |  |  461|  2.57G|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 2067|  2.57G|	uint32_t ws = flags & (STRING_COMPACT_WHITESPACE |
  ------------------
  |  |  404|  2.57G|#define STRING_COMPACT_WHITESPACE		BIT(0)
  |  |  ------------------
  |  |  |  |  403|  2.57G|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
 2068|  2.57G|	    STRING_COMPACT_OPTIONAL_WHITESPACE);
  ------------------
  |  |  405|  2.57G|#define STRING_COMPACT_OPTIONAL_WHITESPACE	BIT(1)
  |  |  ------------------
  |  |  |  |  403|  2.57G|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
 2069|  2.57G|	const unsigned char *be = b + maxlen;
 2070|  2.57G|	const unsigned char *eb = ws ? be : b + len;
  ------------------
  |  Branch (2070:28): [True: 117M, False: 2.45G]
  ------------------
 2071|  2.57G|	uint64_t v;
 2072|       |
 2073|       |	/*
 2074|       |	 * What we want here is v = strncmp(s1, s2, len),
 2075|       |	 * but ignoring any nulls.
 2076|       |	 */
 2077|  2.57G|	v = 0;
 2078|  2.57G|	len++;
 2079|  2.57G|	if (0L == flags) { /* normal string: do it fast */
  ------------------
  |  Branch (2079:6): [True: 80.7M, False: 2.49G]
  ------------------
 2080|  83.0M|		while (--len > 0)
  ------------------
  |  Branch (2080:10): [True: 83.0M, False: 28.6k]
  ------------------
 2081|  83.0M|			if ((v = *b++ - *a++) != '\0')
  ------------------
  |  Branch (2081:8): [True: 80.6M, False: 2.32M]
  ------------------
 2082|  80.6M|				break;
 2083|  80.7M|	}
 2084|  2.49G|	else { /* combine the others */
 2085|  2.49G|		while (--len > 0) {
  ------------------
  |  Branch (2085:10): [True: 2.49G, False: 59.8k]
  ------------------
 2086|  2.49G|			if (b >= eb) {
  ------------------
  |  Branch (2086:8): [True: 197k, False: 2.49G]
  ------------------
 2087|   197k|				v = 1;
 2088|   197k|				break;
 2089|   197k|			}
 2090|  2.49G|			if ((flags & STRING_IGNORE_LOWERCASE) &&
  ------------------
  |  |  406|  2.49G|#define STRING_IGNORE_LOWERCASE			BIT(2)
  |  |  ------------------
  |  |  |  |  403|  2.49G|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (2090:8): [True: 119M, False: 2.38G]
  ------------------
 2091|  2.49G|			    islower(*a)) {
  ------------------
  |  Branch (2091:8): [True: 5.96M, False: 113M]
  ------------------
 2092|  5.96M|				if ((v = tolower(*b++) - *a++) != '\0')
  ------------------
  |  Branch (2092:9): [True: 5.94M, False: 18.8k]
  |  Branch (2092:14): [True: 0, False: 0]
  |  Branch (2092:14): [Folded, False: 0]
  |  Branch (2092:14): [Folded, False: 5.96M]
  ------------------
 2093|  5.94M|					break;
 2094|  5.96M|			}
 2095|  2.49G|			else if ((flags & STRING_IGNORE_UPPERCASE) &&
  ------------------
  |  |  407|  2.49G|#define STRING_IGNORE_UPPERCASE			BIT(3)
  |  |  ------------------
  |  |  |  |  403|  2.49G|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (2095:13): [True: 15.3k, False: 2.49G]
  ------------------
 2096|  2.49G|			    isupper(*a)) {
  ------------------
  |  Branch (2096:8): [True: 14.6k, False: 634]
  ------------------
 2097|  14.6k|				if ((v = toupper(*b++) - *a++) != '\0')
  ------------------
  |  Branch (2097:9): [True: 14.5k, False: 155]
  |  Branch (2097:14): [True: 0, False: 0]
  |  Branch (2097:14): [Folded, False: 0]
  |  Branch (2097:14): [Folded, False: 14.6k]
  ------------------
 2098|  14.5k|					break;
 2099|  14.6k|			}
 2100|  2.49G|			else if ((flags & STRING_COMPACT_WHITESPACE) &&
  ------------------
  |  |  404|  2.49G|#define STRING_COMPACT_WHITESPACE		BIT(0)
  |  |  ------------------
  |  |  |  |  403|  2.49G|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (2100:13): [True: 101M, False: 2.39G]
  ------------------
 2101|  2.49G|			    isspace(*a)) {
  ------------------
  |  Branch (2101:8): [True: 1.74M, False: 99.2M]
  ------------------
 2102|  1.74M|				a++;
 2103|  1.74M|				if (isspace(*b)) {
  ------------------
  |  Branch (2103:9): [True: 278k, False: 1.46M]
  ------------------
 2104|   278k|					b++;
 2105|   278k|					if (!isspace(*a))
  ------------------
  |  Branch (2105:10): [True: 278k, False: 0]
  ------------------
 2106|  8.57G|						while (b < eb && isspace(*b))
  ------------------
  |  Branch (2106:14): [True: 8.57G, False: 197k]
  |  Branch (2106:24): [True: 8.57G, False: 81.2k]
  ------------------
 2107|  8.57G|							b++;
 2108|   278k|				}
 2109|  1.46M|				else {
 2110|  1.46M|					v = 1;
 2111|  1.46M|					break;
 2112|  1.46M|				}
 2113|  1.74M|			}
 2114|  2.49G|			else if ((flags & STRING_COMPACT_OPTIONAL_WHITESPACE) &&
  ------------------
  |  |  405|  2.49G|#define STRING_COMPACT_OPTIONAL_WHITESPACE	BIT(1)
  |  |  ------------------
  |  |  |  |  403|  2.49G|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (2114:13): [True: 16.2M, False: 2.47G]
  ------------------
 2115|  2.49G|			    isspace(*a)) {
  ------------------
  |  Branch (2115:8): [True: 2.25k, False: 16.2M]
  ------------------
 2116|  2.25k|				a++;
 2117|   429k|				while (b < eb && isspace(*b))
  ------------------
  |  Branch (2117:12): [True: 429k, False: 48]
  |  Branch (2117:22): [True: 427k, False: 2.21k]
  ------------------
 2118|   427k|					b++;
 2119|  2.25k|			}
 2120|  2.49G|			else {
 2121|  2.49G|				if ((v = *b++ - *a++) != '\0')
  ------------------
  |  Branch (2121:9): [True: 2.48G, False: 6.11M]
  ------------------
 2122|  2.48G|					break;
 2123|  2.49G|			}
 2124|  2.49G|		}
 2125|  2.49G|		if (len == 0 && v == 0 && (flags & STRING_FULL_WORD)) {
  ------------------
  |  |  422|  59.8k|#define	STRING_FULL_WORD			BIT(14)
  |  |  ------------------
  |  |  |  |  403|  59.8k|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (2125:7): [True: 59.8k, False: 2.49G]
  |  Branch (2125:19): [True: 59.8k, False: 0]
  |  Branch (2125:29): [True: 127, False: 59.6k]
  ------------------
 2126|    127|			if (b < be && *b && !isspace(*b))
  ------------------
  |  Branch (2126:8): [True: 127, False: 0]
  |  Branch (2126:18): [True: 93, False: 34]
  |  Branch (2126:24): [True: 43, False: 50]
  ------------------
 2127|     43|				v = 1;
 2128|    127|		}
 2129|  2.49G|	}
 2130|  2.57G|	return v;
 2131|  2.57G|}
softmagic.c:file_strncmp16:
 2136|  87.8k|{
 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|  87.8k|	flags = 0;
 2143|  87.8k|	return file_strncmp(a, b, len, maxlen, flags);
 2144|  87.8k|}
softmagic.c:alloc_regex:
 2148|    173|{
 2149|    173|	int rc;
 2150|    173|	file_regex_t *rx = CAST(file_regex_t *, malloc(sizeof(*rx)));
  ------------------
  |  |  460|    173|#define CAST(T, b)	((T)(b))
  ------------------
 2151|       |
 2152|    173|	if (rx == NULL) {
  ------------------
  |  Branch (2152:6): [True: 0, False: 173]
  ------------------
 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|    173|	rc = file_regcomp(ms, rx, m->value.s, REG_EXTENDED | REG_NEWLINE |
 2159|    173|	    REGEX_ICASE(m));
  ------------------
  |  |  440|    173|#define	REGEX_ICASE(m) (((m)->str_flags & STRING_IGNORE_CASE) ? REG_ICASE : 0)
  |  |  ------------------
  |  |  |  |  390|    173|#define str_flags _u._s._flags
  |  |  ------------------
  |  |               #define	REGEX_ICASE(m) (((m)->str_flags & STRING_IGNORE_CASE) ? REG_ICASE : 0)
  |  |  ------------------
  |  |  |  |  439|    173|#define STRING_IGNORE_CASE		(STRING_IGNORE_LOWERCASE|STRING_IGNORE_UPPERCASE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|    173|#define STRING_IGNORE_LOWERCASE			BIT(2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  403|    173|#define BIT(A)   (1 << (A))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define STRING_IGNORE_CASE		(STRING_IGNORE_LOWERCASE|STRING_IGNORE_UPPERCASE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  407|    173|#define STRING_IGNORE_UPPERCASE			BIT(3)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  403|    173|#define BIT(A)   (1 << (A))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (440:25): [True: 20, False: 153]
  |  |  ------------------
  ------------------
 2160|    173|	if (rc == 0)
  ------------------
  |  Branch (2160:6): [True: 173, False: 0]
  ------------------
 2161|    173|		return rx;
 2162|       |
 2163|      0|	free(rx);
 2164|       |	return NULL;
 2165|    173|}
softmagic.c:handle_annotation:
 2563|   921k|{
 2564|   921k|	if ((ms->flags & MAGIC_APPLE) && m->apple[0]) {
  ------------------
  |  |   45|   921k|#define	MAGIC_APPLE		0x0000800 /* Return the Apple creator/type */
  ------------------
  |  Branch (2564:6): [True: 0, False: 921k]
  |  Branch (2564:35): [True: 0, False: 0]
  ------------------
 2565|      0|		if (!firstline && !(ms->flags & MAGIC_CONTINUE))
  ------------------
  |  |   38|      0|#define	MAGIC_CONTINUE		0x0000020 /* Return all matches */
  ------------------
  |  Branch (2565:7): [True: 0, False: 0]
  |  Branch (2565:21): [True: 0, False: 0]
  ------------------
 2566|      0|			return 1;
 2567|      0|		if (print_sep(ms, firstline) == -1)
  ------------------
  |  Branch (2567:7): [True: 0, False: 0]
  ------------------
 2568|      0|			return -1;
 2569|      0|		if (file_printf(ms, "%.8s", m->apple) == -1)
  ------------------
  |  Branch (2569:7): [True: 0, False: 0]
  ------------------
 2570|      0|			return -1;
 2571|      0|		return 1;
 2572|      0|	}
 2573|   921k|	if ((ms->flags & MAGIC_EXTENSION) && m->ext[0]) {
  ------------------
  |  |   46|   921k|#define	MAGIC_EXTENSION		0x1000000 /* Return a /-separated list of
  ------------------
  |  Branch (2573:6): [True: 0, False: 921k]
  |  Branch (2573:39): [True: 0, False: 0]
  ------------------
 2574|      0|		if (!firstline && !(ms->flags & MAGIC_CONTINUE))
  ------------------
  |  |   38|      0|#define	MAGIC_CONTINUE		0x0000020 /* Return all matches */
  ------------------
  |  Branch (2574:7): [True: 0, False: 0]
  |  Branch (2574:21): [True: 0, False: 0]
  ------------------
 2575|      0|			return 1;
 2576|      0|		if (print_sep(ms, firstline) == -1)
  ------------------
  |  Branch (2576:7): [True: 0, False: 0]
  ------------------
 2577|      0|			return -1;
 2578|      0|		if (file_printf(ms, "%s", m->ext) == -1)
  ------------------
  |  Branch (2578:7): [True: 0, False: 0]
  ------------------
 2579|      0|			return -1;
 2580|      0|		return 1;
 2581|      0|	}
 2582|   921k|	if ((ms->flags & MAGIC_MIME_TYPE) && m->mimetype[0]) {
  ------------------
  |  |   37|   921k|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  ------------------
  |  Branch (2582:6): [True: 0, False: 921k]
  |  Branch (2582:39): [True: 0, False: 0]
  ------------------
 2583|      0|		char buf[1024];
 2584|      0|		const char *p;
 2585|      0|		if (!firstline && !(ms->flags & MAGIC_CONTINUE))
  ------------------
  |  |   38|      0|#define	MAGIC_CONTINUE		0x0000020 /* Return all matches */
  ------------------
  |  Branch (2585:7): [True: 0, False: 0]
  |  Branch (2585:21): [True: 0, False: 0]
  ------------------
 2586|      0|			return 1;
 2587|      0|		if (print_sep(ms, firstline) == -1)
  ------------------
  |  Branch (2587:7): [True: 0, False: 0]
  ------------------
 2588|      0|			return -1;
 2589|      0|		if (varexpand(ms, buf, sizeof(buf), m->mimetype) == -1)
  ------------------
  |  Branch (2589:7): [True: 0, False: 0]
  ------------------
 2590|      0|			p = m->mimetype;
 2591|      0|		else
 2592|      0|			p = buf;
 2593|      0|		if (file_printf(ms, "%s", p) == -1)
  ------------------
  |  Branch (2593:7): [True: 0, False: 0]
  ------------------
 2594|      0|			return -1;
 2595|      0|		return 1;
 2596|      0|	}
 2597|   921k|	return 0;
 2598|   921k|}
softmagic.c:varexpand:
  549|   119k|{
  550|   119k|	const char *ptr, *sptr, *e, *t, *ee, *et;
  551|   119k|	size_t l;
  552|       |
  553|   119k|	for (sptr = str; (ptr = strstr(sptr, "${")) != NULL;) {
  ------------------
  |  Branch (553:19): [True: 48, False: 119k]
  ------------------
  554|     48|		l = CAST(size_t, ptr - sptr);
  ------------------
  |  |  460|     48|#define CAST(T, b)	((T)(b))
  ------------------
  555|     48|		if (l >= len)
  ------------------
  |  Branch (555:7): [True: 0, False: 48]
  ------------------
  556|      0|			return -1;
  557|     48|		memcpy(buf, sptr, l);
  558|     48|		buf += l;
  559|     48|		len -= l;
  560|     48|		ptr += 2;
  561|     48|		if (!*ptr || ptr[1] != '?')
  ------------------
  |  Branch (561:7): [True: 0, False: 48]
  |  Branch (561:16): [True: 0, False: 48]
  ------------------
  562|      0|			return -1;
  563|    720|		for (et = t = ptr + 2; *et && *et != ':'; et++)
  ------------------
  |  Branch (563:26): [True: 720, False: 0]
  |  Branch (563:33): [True: 672, False: 48]
  ------------------
  564|    672|			continue;
  565|     48|		if (*et != ':')
  ------------------
  |  Branch (565:7): [True: 0, False: 48]
  ------------------
  566|      0|			return -1;
  567|    672|		for (ee = e = et + 1; *ee && *ee != '}'; ee++)
  ------------------
  |  Branch (567:25): [True: 672, False: 0]
  |  Branch (567:32): [True: 624, False: 48]
  ------------------
  568|    624|			continue;
  569|     48|		if (*ee != '}')
  ------------------
  |  Branch (569:7): [True: 0, False: 48]
  ------------------
  570|      0|			return -1;
  571|     48|		switch (*ptr) {
  572|     48|		case 'x':
  ------------------
  |  Branch (572:3): [True: 48, False: 0]
  ------------------
  573|     48|			if (ms->mode & 0111) {
  ------------------
  |  Branch (573:8): [True: 0, False: 48]
  ------------------
  574|      0|				ptr = t;
  575|      0|				l = et - t;
  576|     48|			} else {
  577|     48|				ptr = e;
  578|     48|				l = ee - e;
  579|     48|			}
  580|     48|			break;
  581|      0|		default:
  ------------------
  |  Branch (581:3): [True: 0, False: 48]
  ------------------
  582|      0|			return -1;
  583|     48|		}
  584|     48|		if (l >= len)
  ------------------
  |  Branch (584:7): [True: 0, False: 48]
  ------------------
  585|      0|			return -1;
  586|     48|		memcpy(buf, ptr, l);
  587|     48|		buf += l;
  588|     48|		len -= l;
  589|     48|		sptr = ee + 1;
  590|     48|	}
  591|       |
  592|   119k|	l = strlen(sptr);
  593|   119k|	if (l >= len)
  ------------------
  |  Branch (593:6): [True: 0, False: 119k]
  ------------------
  594|      0|		return -1;
  595|       |
  596|   119k|	memcpy(buf, sptr, l);
  597|   119k|	buf[l] = '\0';
  598|   119k|	return 0;
  599|   119k|}
softmagic.c:print_sep:
 2602|  30.3k|{
 2603|  30.3k|	if (firstline)
  ------------------
  |  Branch (2603:6): [True: 8.44k, False: 21.8k]
  ------------------
 2604|  8.44k|		return 0;
 2605|       |	/*
 2606|       |	 * we found another match
 2607|       |	 * put a newline and '-' to do some simple formatting
 2608|       |	 */
 2609|  21.8k|	return file_separator(ms);
 2610|  30.3k|}
softmagic.c:mprint:
  604|   119k|{
  605|   119k|	uint64_t v;
  606|   119k|	float vf;
  607|   119k|	double vd;
  608|   119k| 	char buf[128], tbuf[26], sbuf[512], ebuf[512];
  609|   119k|	const char *desc;
  610|   119k|	union VALUETYPE *p = &ms->ms_value;
  611|       |
  612|   119k|	if (varexpand(ms, ebuf, sizeof(ebuf), m->desc) == -1)
  ------------------
  |  Branch (612:6): [True: 0, False: 119k]
  ------------------
  613|      0|		desc = m->desc;
  614|   119k|	else
  615|   119k|		desc = ebuf;
  616|       |
  617|   119k|#define	PRINTER(value, format, stype, utype)	\
  618|   119k|	v = file_signextend(ms, m, CAST(uint64_t, value)); \
  619|   119k|	switch (check_fmt(ms, desc)) { \
  620|   119k|	case -1: \
  621|   119k|		return -1; \
  622|   119k|	case 1: \
  623|   119k|		if (m->flag & UNSIGNED) { \
  624|   119k|			(void)snprintf(buf, sizeof(buf), "%" format "u", \
  625|   119k|			    CAST(utype, v)); \
  626|   119k|		} else { \
  627|   119k|			(void)snprintf(buf, sizeof(buf), "%" format "d", \
  628|   119k|			    CAST(stype, v)); \
  629|   119k|		} \
  630|   119k|		if (file_printf(ms, F(ms, desc, "%s"), buf) == -1) \
  631|   119k|			return -1; \
  632|   119k|		break; \
  633|   119k|	default: \
  634|   119k|		if (m->flag & UNSIGNED) { \
  635|   119k|		       if (file_printf(ms, F(ms, desc, "%" format "u"), \
  636|   119k|			   CAST(utype, v)) == -1) \
  637|   119k|			   return -1; \
  638|   119k|		} else { \
  639|   119k|		       if (file_printf(ms, F(ms, desc, "%" format "d"), \
  640|   119k|			   CAST(stype, v)) == -1) \
  641|   119k|			   return -1; \
  642|   119k|		} \
  643|   119k|		break; \
  644|   119k|	} \
  645|   119k|	break
  646|       |
  647|   119k|  	switch (m->type) {
  648|  13.6k|  	case FILE_BYTE:
  ------------------
  |  |  254|  13.6k|#define 			FILE_BYTE		1
  ------------------
  |  Branch (648:4): [True: 13.6k, False: 105k]
  ------------------
  649|  13.6k|		PRINTER(p->b, "", int8_t, uint8_t);
  ------------------
  |  |  618|  13.6k|	v = file_signextend(ms, m, CAST(uint64_t, value)); \
  |  |  ------------------
  |  |  |  |  460|  13.6k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  619|  13.6k|	switch (check_fmt(ms, desc)) { \
  |  |  620|      0|	case -1: \
  |  |  ------------------
  |  |  |  Branch (620:2): [True: 0, False: 13.6k]
  |  |  ------------------
  |  |  621|      0|		return -1; \
  |  |  622|      0|	case 1: \
  |  |  ------------------
  |  |  |  Branch (622:2): [True: 0, False: 13.6k]
  |  |  ------------------
  |  |  623|      0|		if (m->flag & UNSIGNED) { \
  |  |  ------------------
  |  |  |  |  237|      0|#define UNSIGNED	0x08	/* comparison is unsigned */
  |  |  ------------------
  |  |  |  Branch (623:7): [True: 0, False: 0]
  |  |  ------------------
  |  |  624|      0|			(void)snprintf(buf, sizeof(buf), "%" format "u", \
  |  |  625|      0|			    CAST(utype, v)); \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  626|      0|		} else { \
  |  |  627|      0|			(void)snprintf(buf, sizeof(buf), "%" format "d", \
  |  |  628|      0|			    CAST(stype, v)); \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  629|      0|		} \
  |  |  630|      0|		if (file_printf(ms, F(ms, desc, "%s"), buf) == -1) \
  |  |  ------------------
  |  |  |  |  167|      0|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  Branch (630:7): [True: 0, False: 0]
  |  |  ------------------
  |  |  631|      0|			return -1; \
  |  |  632|      0|		break; \
  |  |  633|  13.6k|	default: \
  |  |  ------------------
  |  |  |  Branch (633:2): [True: 13.6k, False: 0]
  |  |  ------------------
  |  |  634|  13.6k|		if (m->flag & UNSIGNED) { \
  |  |  ------------------
  |  |  |  |  237|  13.6k|#define UNSIGNED	0x08	/* comparison is unsigned */
  |  |  ------------------
  |  |  |  Branch (634:7): [True: 6.79k, False: 6.85k]
  |  |  ------------------
  |  |  635|  6.79k|		       if (file_printf(ms, F(ms, desc, "%" format "u"), \
  |  |  ------------------
  |  |  |  |  167|  6.79k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  Branch (635:14): [True: 0, False: 6.79k]
  |  |  ------------------
  |  |  636|  6.79k|			   CAST(utype, v)) == -1) \
  |  |  ------------------
  |  |  |  |  460|  6.79k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  637|  6.79k|			   return -1; \
  |  |  638|  6.85k|		} else { \
  |  |  639|  6.85k|		       if (file_printf(ms, F(ms, desc, "%" format "d"), \
  |  |  ------------------
  |  |  |  |  167|  6.85k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  Branch (639:14): [True: 0, False: 6.85k]
  |  |  ------------------
  |  |  640|  6.85k|			   CAST(stype, v)) == -1) \
  |  |  ------------------
  |  |  |  |  460|  6.85k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  641|  6.85k|			   return -1; \
  |  |  642|  6.85k|		} \
  |  |  643|  13.6k|		break; \
  |  |  644|  13.6k|	} \
  |  |  645|  13.6k|	break
  ------------------
  650|       |
  651|  13.6k|  	case FILE_SHORT:
  ------------------
  |  |  255|  1.91k|#define				FILE_SHORT		2
  ------------------
  |  Branch (651:4): [True: 1.91k, False: 117k]
  ------------------
  652|  11.7k|  	case FILE_BESHORT:
  ------------------
  |  |  260|  11.7k|#define				FILE_BESHORT		7
  ------------------
  |  Branch (652:4): [True: 9.84k, False: 109k]
  ------------------
  653|  25.4k|  	case FILE_LESHORT:
  ------------------
  |  |  263|  25.4k|#define				FILE_LESHORT		10
  ------------------
  |  Branch (653:4): [True: 13.7k, False: 105k]
  ------------------
  654|  25.4k|		PRINTER(p->h, "", int16_t, uint16_t);
  ------------------
  |  |  618|  25.4k|	v = file_signextend(ms, m, CAST(uint64_t, value)); \
  |  |  ------------------
  |  |  |  |  460|  25.4k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  619|  25.4k|	switch (check_fmt(ms, desc)) { \
  |  |  620|      0|	case -1: \
  |  |  ------------------
  |  |  |  Branch (620:2): [True: 0, False: 25.4k]
  |  |  ------------------
  |  |  621|      0|		return -1; \
  |  |  622|      0|	case 1: \
  |  |  ------------------
  |  |  |  Branch (622:2): [True: 0, False: 25.4k]
  |  |  ------------------
  |  |  623|      0|		if (m->flag & UNSIGNED) { \
  |  |  ------------------
  |  |  |  |  237|      0|#define UNSIGNED	0x08	/* comparison is unsigned */
  |  |  ------------------
  |  |  |  Branch (623:7): [True: 0, False: 0]
  |  |  ------------------
  |  |  624|      0|			(void)snprintf(buf, sizeof(buf), "%" format "u", \
  |  |  625|      0|			    CAST(utype, v)); \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  626|      0|		} else { \
  |  |  627|      0|			(void)snprintf(buf, sizeof(buf), "%" format "d", \
  |  |  628|      0|			    CAST(stype, v)); \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  629|      0|		} \
  |  |  630|      0|		if (file_printf(ms, F(ms, desc, "%s"), buf) == -1) \
  |  |  ------------------
  |  |  |  |  167|      0|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  Branch (630:7): [True: 0, False: 0]
  |  |  ------------------
  |  |  631|      0|			return -1; \
  |  |  632|      0|		break; \
  |  |  633|  25.4k|	default: \
  |  |  ------------------
  |  |  |  Branch (633:2): [True: 25.4k, False: 0]
  |  |  ------------------
  |  |  634|  25.4k|		if (m->flag & UNSIGNED) { \
  |  |  ------------------
  |  |  |  |  237|  25.4k|#define UNSIGNED	0x08	/* comparison is unsigned */
  |  |  ------------------
  |  |  |  Branch (634:7): [True: 15.7k, False: 9.76k]
  |  |  ------------------
  |  |  635|  15.7k|		       if (file_printf(ms, F(ms, desc, "%" format "u"), \
  |  |  ------------------
  |  |  |  |  167|  15.7k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  Branch (635:14): [True: 0, False: 15.7k]
  |  |  ------------------
  |  |  636|  15.7k|			   CAST(utype, v)) == -1) \
  |  |  ------------------
  |  |  |  |  460|  15.7k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  637|  15.7k|			   return -1; \
  |  |  638|  15.7k|		} else { \
  |  |  639|  9.76k|		       if (file_printf(ms, F(ms, desc, "%" format "d"), \
  |  |  ------------------
  |  |  |  |  167|  9.76k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  Branch (639:14): [True: 0, False: 9.76k]
  |  |  ------------------
  |  |  640|  9.76k|			   CAST(stype, v)) == -1) \
  |  |  ------------------
  |  |  |  |  460|  9.76k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  641|  9.76k|			   return -1; \
  |  |  642|  9.76k|		} \
  |  |  643|  25.4k|		break; \
  |  |  644|  25.4k|	} \
  |  |  645|  25.4k|	break
  ------------------
  655|       |
  656|  25.4k|  	case FILE_LONG:
  ------------------
  |  |  257|    760|#define				FILE_LONG		4
  ------------------
  |  Branch (656:4): [True: 760, False: 118k]
  ------------------
  657|  9.88k|  	case FILE_BELONG:
  ------------------
  |  |  261|  9.88k|#define				FILE_BELONG		8
  ------------------
  |  Branch (657:4): [True: 9.12k, False: 110k]
  ------------------
  658|  35.7k|  	case FILE_LELONG:
  ------------------
  |  |  264|  35.7k|#define				FILE_LELONG		11
  ------------------
  |  Branch (658:4): [True: 25.8k, False: 93.4k]
  ------------------
  659|  35.8k|  	case FILE_MELONG:
  ------------------
  |  |  276|  35.8k|#define				FILE_MELONG		23
  ------------------
  |  Branch (659:4): [True: 39, False: 119k]
  ------------------
  660|  35.8k|		PRINTER(p->l, "", int32_t, uint32_t);
  ------------------
  |  |  618|  35.8k|	v = file_signextend(ms, m, CAST(uint64_t, value)); \
  |  |  ------------------
  |  |  |  |  460|  35.8k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  619|  35.8k|	switch (check_fmt(ms, desc)) { \
  |  |  620|      0|	case -1: \
  |  |  ------------------
  |  |  |  Branch (620:2): [True: 0, False: 35.8k]
  |  |  ------------------
  |  |  621|      0|		return -1; \
  |  |  622|      0|	case 1: \
  |  |  ------------------
  |  |  |  Branch (622:2): [True: 0, False: 35.8k]
  |  |  ------------------
  |  |  623|      0|		if (m->flag & UNSIGNED) { \
  |  |  ------------------
  |  |  |  |  237|      0|#define UNSIGNED	0x08	/* comparison is unsigned */
  |  |  ------------------
  |  |  |  Branch (623:7): [True: 0, False: 0]
  |  |  ------------------
  |  |  624|      0|			(void)snprintf(buf, sizeof(buf), "%" format "u", \
  |  |  625|      0|			    CAST(utype, v)); \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  626|      0|		} else { \
  |  |  627|      0|			(void)snprintf(buf, sizeof(buf), "%" format "d", \
  |  |  628|      0|			    CAST(stype, v)); \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  629|      0|		} \
  |  |  630|      0|		if (file_printf(ms, F(ms, desc, "%s"), buf) == -1) \
  |  |  ------------------
  |  |  |  |  167|      0|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  Branch (630:7): [True: 0, False: 0]
  |  |  ------------------
  |  |  631|      0|			return -1; \
  |  |  632|      0|		break; \
  |  |  633|  35.8k|	default: \
  |  |  ------------------
  |  |  |  Branch (633:2): [True: 35.8k, False: 0]
  |  |  ------------------
  |  |  634|  35.8k|		if (m->flag & UNSIGNED) { \
  |  |  ------------------
  |  |  |  |  237|  35.8k|#define UNSIGNED	0x08	/* comparison is unsigned */
  |  |  ------------------
  |  |  |  Branch (634:7): [True: 7.95k, False: 27.8k]
  |  |  ------------------
  |  |  635|  7.95k|		       if (file_printf(ms, F(ms, desc, "%" format "u"), \
  |  |  ------------------
  |  |  |  |  167|  7.95k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  Branch (635:14): [True: 0, False: 7.95k]
  |  |  ------------------
  |  |  636|  7.95k|			   CAST(utype, v)) == -1) \
  |  |  ------------------
  |  |  |  |  460|  7.95k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  637|  7.95k|			   return -1; \
  |  |  638|  27.8k|		} else { \
  |  |  639|  27.8k|		       if (file_printf(ms, F(ms, desc, "%" format "d"), \
  |  |  ------------------
  |  |  |  |  167|  27.8k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  Branch (639:14): [True: 0, False: 27.8k]
  |  |  ------------------
  |  |  640|  27.8k|			   CAST(stype, v)) == -1) \
  |  |  ------------------
  |  |  |  |  460|  27.8k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  641|  27.8k|			   return -1; \
  |  |  642|  27.8k|		} \
  |  |  643|  35.8k|		break; \
  |  |  644|  35.8k|	} \
  |  |  645|  35.8k|	break
  ------------------
  661|       |
  662|  35.8k|  	case FILE_QUAD:
  ------------------
  |  |  277|    416|#define				FILE_QUAD		24
  ------------------
  |  Branch (662:4): [True: 416, False: 118k]
  ------------------
  663|  1.63k|  	case FILE_BEQUAD:
  ------------------
  |  |  279|  1.63k|#define				FILE_BEQUAD		26
  ------------------
  |  Branch (663:4): [True: 1.21k, False: 118k]
  ------------------
  664|  3.87k|  	case FILE_LEQUAD:
  ------------------
  |  |  278|  3.87k|#define				FILE_LEQUAD		25
  ------------------
  |  Branch (664:4): [True: 2.24k, False: 117k]
  ------------------
  665|  3.97k|	case FILE_OFFSET:
  ------------------
  |  |  305|  3.97k|#define				FILE_OFFSET		52
  ------------------
  |  Branch (665:2): [True: 95, False: 119k]
  ------------------
  666|  3.97k|		PRINTER(p->q, INT64_T_FORMAT, long long, unsigned long long);
  ------------------
  |  |  618|  3.97k|	v = file_signextend(ms, m, CAST(uint64_t, value)); \
  |  |  ------------------
  |  |  |  |  460|  3.97k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  619|  3.97k|	switch (check_fmt(ms, desc)) { \
  |  |  620|      0|	case -1: \
  |  |  ------------------
  |  |  |  Branch (620:2): [True: 0, False: 3.97k]
  |  |  ------------------
  |  |  621|      0|		return -1; \
  |  |  622|      0|	case 1: \
  |  |  ------------------
  |  |  |  Branch (622:2): [True: 0, False: 3.97k]
  |  |  ------------------
  |  |  623|      0|		if (m->flag & UNSIGNED) { \
  |  |  ------------------
  |  |  |  |  237|      0|#define UNSIGNED	0x08	/* comparison is unsigned */
  |  |  ------------------
  |  |  |  Branch (623:7): [True: 0, False: 0]
  |  |  ------------------
  |  |  624|      0|			(void)snprintf(buf, sizeof(buf), "%" format "u", \
  |  |  625|      0|			    CAST(utype, v)); \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  626|      0|		} else { \
  |  |  627|      0|			(void)snprintf(buf, sizeof(buf), "%" format "d", \
  |  |  628|      0|			    CAST(stype, v)); \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  629|      0|		} \
  |  |  630|      0|		if (file_printf(ms, F(ms, desc, "%s"), buf) == -1) \
  |  |  ------------------
  |  |  |  |  167|      0|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  Branch (630:7): [True: 0, False: 0]
  |  |  ------------------
  |  |  631|      0|			return -1; \
  |  |  632|      0|		break; \
  |  |  633|  3.97k|	default: \
  |  |  ------------------
  |  |  |  Branch (633:2): [True: 3.97k, False: 0]
  |  |  ------------------
  |  |  634|  3.97k|		if (m->flag & UNSIGNED) { \
  |  |  ------------------
  |  |  |  |  237|  3.97k|#define UNSIGNED	0x08	/* comparison is unsigned */
  |  |  ------------------
  |  |  |  Branch (634:7): [True: 1.34k, False: 2.62k]
  |  |  ------------------
  |  |  635|  1.34k|		       if (file_printf(ms, F(ms, desc, "%" format "u"), \
  |  |  ------------------
  |  |  |  |  167|  1.34k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  Branch (635:14): [True: 0, False: 1.34k]
  |  |  ------------------
  |  |  636|  1.34k|			   CAST(utype, v)) == -1) \
  |  |  ------------------
  |  |  |  |  460|  1.34k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  637|  1.34k|			   return -1; \
  |  |  638|  2.62k|		} else { \
  |  |  639|  2.62k|		       if (file_printf(ms, F(ms, desc, "%" format "d"), \
  |  |  ------------------
  |  |  |  |  167|  2.62k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  Branch (639:14): [True: 0, False: 2.62k]
  |  |  ------------------
  |  |  640|  2.62k|			   CAST(stype, v)) == -1) \
  |  |  ------------------
  |  |  |  |  460|  2.62k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  641|  2.62k|			   return -1; \
  |  |  642|  2.62k|		} \
  |  |  643|  3.97k|		break; \
  |  |  644|  3.97k|	} \
  |  |  645|  3.97k|	break
  ------------------
  667|       |
  668|  20.7k|  	case FILE_STRING:
  ------------------
  |  |  258|  20.7k|#define				FILE_STRING		5
  ------------------
  |  Branch (668:4): [True: 20.7k, False: 98.5k]
  ------------------
  669|  23.6k|  	case FILE_PSTRING:
  ------------------
  |  |  266|  23.6k|#define				FILE_PSTRING		13
  ------------------
  |  Branch (669:4): [True: 2.85k, False: 116k]
  ------------------
  670|  23.7k|  	case FILE_BESTRING16:
  ------------------
  |  |  271|  23.7k|#define				FILE_BESTRING16		18
  ------------------
  |  Branch (670:4): [True: 159, False: 119k]
  ------------------
  671|  24.4k|  	case FILE_LESTRING16:
  ------------------
  |  |  272|  24.4k|#define				FILE_LESTRING16		19
  ------------------
  |  Branch (671:4): [True: 648, False: 118k]
  ------------------
  672|  24.4k|		if (m->reln == '=' || m->reln == '!') {
  ------------------
  |  Branch (672:7): [True: 10.7k, False: 13.6k]
  |  Branch (672:25): [True: 269, False: 13.3k]
  ------------------
  673|  11.0k|			if (file_printf(ms, F(ms, desc, "%s"),
  ------------------
  |  |  167|  11.0k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (673:8): [True: 0, False: 11.0k]
  ------------------
  674|  11.0k|			    file_printable(ms, sbuf, sizeof(sbuf), m->value.s,
  675|  11.0k|			    sizeof(m->value.s))) == -1)
  676|      0|				return -1;
  677|  11.0k|		}
  678|  13.3k|		else {
  679|  13.3k|			char *str = p->s;
  680|       |
  681|       |			/* compute t before we mangle the string? */
  682|       |
  683|  13.3k|			if (*m->value.s == '\0')
  ------------------
  |  Branch (683:8): [True: 11.9k, False: 1.40k]
  ------------------
  684|  11.9k|				str[strcspn(str, "\r\n")] = '\0';
  685|       |
  686|  13.3k|			if (m->str_flags & STRING_TRIM)
  ------------------
  |  |  390|  13.3k|#define str_flags _u._s._flags
  ------------------
              			if (m->str_flags & STRING_TRIM)
  ------------------
  |  |  421|  13.3k|#define	STRING_TRIM				BIT(13)
  |  |  ------------------
  |  |  |  |  403|  13.3k|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (686:8): [True: 330, False: 13.0k]
  ------------------
  687|    330|				str = file_strtrim(str);
  688|       |
  689|  13.3k|			if (file_printf(ms, F(ms, desc, "%s"),
  ------------------
  |  |  167|  13.3k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (689:8): [True: 0, False: 13.3k]
  ------------------
  690|  13.3k|			    file_printable(ms, sbuf, sizeof(sbuf), str,
  691|  13.3k|				sizeof(p->s) - (str - p->s))) == -1)
  692|      0|				return -1;
  693|       |
  694|  13.3k|			if (m->type == FILE_PSTRING) {
  ------------------
  |  |  266|  13.3k|#define				FILE_PSTRING		13
  ------------------
  |  Branch (694:8): [True: 2.74k, False: 10.6k]
  ------------------
  695|  2.74k|				size_t l = file_pstring_length_size(ms, m);
  696|  2.74k|				if (l == FILE_BADSIZE)
  ------------------
  |  |  183|  2.74k|#define FILE_BADSIZE CAST(size_t, ~0ul)
  |  |  ------------------
  |  |  |  |  460|  2.74k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (696:9): [True: 0, False: 2.74k]
  ------------------
  697|      0|					return -1;
  698|  2.74k|			}
  699|  13.3k|		}
  700|  24.4k|		break;
  701|       |
  702|  24.4k|	case FILE_DATE:
  ------------------
  |  |  259|      0|#define				FILE_DATE		6
  ------------------
  |  Branch (702:2): [True: 0, False: 119k]
  ------------------
  703|    542|	case FILE_BEDATE:
  ------------------
  |  |  262|    542|#define				FILE_BEDATE		9
  ------------------
  |  Branch (703:2): [True: 542, False: 118k]
  ------------------
  704|    677|	case FILE_LEDATE:
  ------------------
  |  |  265|    677|#define				FILE_LEDATE		12
  ------------------
  |  Branch (704:2): [True: 135, False: 119k]
  ------------------
  705|    820|	case FILE_MEDATE:
  ------------------
  |  |  274|    820|#define				FILE_MEDATE		21
  ------------------
  |  Branch (705:2): [True: 143, False: 119k]
  ------------------
  706|    820|		if (file_printf(ms, F(ms, desc, "%s"),
  ------------------
  |  |  167|    820|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (706:7): [True: 0, False: 820]
  ------------------
  707|    820|		    file_fmtdatetime(tbuf, sizeof(tbuf), p->l, 0)) == -1)
  708|      0|			return -1;
  709|    820|		break;
  710|       |
  711|    820|	case FILE_LDATE:
  ------------------
  |  |  267|      0|#define				FILE_LDATE		14
  ------------------
  |  Branch (711:2): [True: 0, False: 119k]
  ------------------
  712|    373|	case FILE_BELDATE:
  ------------------
  |  |  268|    373|#define				FILE_BELDATE		15
  ------------------
  |  Branch (712:2): [True: 373, False: 118k]
  ------------------
  713|    457|	case FILE_LELDATE:
  ------------------
  |  |  269|    457|#define				FILE_LELDATE		16
  ------------------
  |  Branch (713:2): [True: 84, False: 119k]
  ------------------
  714|    457|	case FILE_MELDATE:
  ------------------
  |  |  275|    457|#define				FILE_MELDATE		22
  ------------------
  |  Branch (714:2): [True: 0, False: 119k]
  ------------------
  715|    457|		if (file_printf(ms, F(ms, desc, "%s"),
  ------------------
  |  |  167|    457|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (715:7): [True: 0, False: 457]
  ------------------
  716|    457|		    file_fmtdatetime(tbuf, sizeof(tbuf), p->l, FILE_T_LOCAL))
  ------------------
  |  |  548|    457|#define FILE_T_LOCAL	1
  ------------------
  717|    457|			== -1)
  718|      0|			return -1;
  719|    457|		break;
  720|       |
  721|    457|	case FILE_QDATE:
  ------------------
  |  |  280|      0|#define				FILE_QDATE		27
  ------------------
  |  Branch (721:2): [True: 0, False: 119k]
  ------------------
  722|  1.54k|	case FILE_BEQDATE:
  ------------------
  |  |  282|  1.54k|#define				FILE_BEQDATE		29
  ------------------
  |  Branch (722:2): [True: 1.54k, False: 117k]
  ------------------
  723|  1.59k|	case FILE_LEQDATE:
  ------------------
  |  |  281|  1.59k|#define				FILE_LEQDATE		28
  ------------------
  |  Branch (723:2): [True: 46, False: 119k]
  ------------------
  724|  1.59k|		if (file_printf(ms, F(ms, desc, "%s"),
  ------------------
  |  |  167|  1.59k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (724:7): [True: 0, False: 1.59k]
  ------------------
  725|  1.59k|		    file_fmtdatetime(tbuf, sizeof(tbuf), p->q, 0)) == -1)
  726|      0|			return -1;
  727|  1.59k|		break;
  728|       |
  729|  1.59k|	case FILE_QLDATE:
  ------------------
  |  |  283|      0|#define				FILE_QLDATE		30
  ------------------
  |  Branch (729:2): [True: 0, False: 119k]
  ------------------
  730|    284|	case FILE_BEQLDATE:
  ------------------
  |  |  285|    284|#define				FILE_BEQLDATE		32
  ------------------
  |  Branch (730:2): [True: 284, False: 119k]
  ------------------
  731|    714|	case FILE_LEQLDATE:
  ------------------
  |  |  284|    714|#define				FILE_LEQLDATE		31
  ------------------
  |  Branch (731:2): [True: 430, False: 118k]
  ------------------
  732|    714|		if (file_printf(ms, F(ms, desc, "%s"),
  ------------------
  |  |  167|    714|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (732:7): [True: 0, False: 714]
  ------------------
  733|    714|		    file_fmtdatetime(tbuf, sizeof(tbuf), p->q, FILE_T_LOCAL)) == -1)
  ------------------
  |  |  548|    714|#define FILE_T_LOCAL	1
  ------------------
  734|      0|			return -1;
  735|    714|		break;
  736|       |
  737|    714|	case FILE_QWDATE:
  ------------------
  |  |  295|    212|#define				FILE_QWDATE		42
  ------------------
  |  Branch (737:2): [True: 212, False: 119k]
  ------------------
  738|    212|	case FILE_BEQWDATE:
  ------------------
  |  |  297|    212|#define				FILE_BEQWDATE		44
  ------------------
  |  Branch (738:2): [True: 0, False: 119k]
  ------------------
  739|  2.25k|	case FILE_LEQWDATE:
  ------------------
  |  |  296|  2.25k|#define				FILE_LEQWDATE		43
  ------------------
  |  Branch (739:2): [True: 2.04k, False: 117k]
  ------------------
  740|  2.25k|		if (file_printf(ms, F(ms, desc, "%s"),
  ------------------
  |  |  167|  2.25k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (740:7): [True: 0, False: 2.25k]
  ------------------
  741|  2.25k|		    file_fmtdatetime(tbuf, sizeof(tbuf), p->q, FILE_T_WINDOWS))
  ------------------
  |  |  549|  2.25k|#define FILE_T_WINDOWS	2
  ------------------
  742|  2.25k|		    == -1)
  743|      0|			return -1;
  744|  2.25k|		break;
  745|       |
  746|  2.25k|	case FILE_FLOAT:
  ------------------
  |  |  286|      0|#define				FILE_FLOAT		33
  ------------------
  |  Branch (746:2): [True: 0, False: 119k]
  ------------------
  747|      0|	case FILE_BEFLOAT:
  ------------------
  |  |  287|      0|#define				FILE_BEFLOAT		34
  ------------------
  |  Branch (747:2): [True: 0, False: 119k]
  ------------------
  748|  1.96k|	case FILE_LEFLOAT:
  ------------------
  |  |  288|  1.96k|#define				FILE_LEFLOAT		35
  ------------------
  |  Branch (748:2): [True: 1.96k, False: 117k]
  ------------------
  749|  1.96k|		vf = p->f;
  750|  1.96k|		switch (check_fmt(ms, desc)) {
  751|      0|		case -1:
  ------------------
  |  Branch (751:3): [True: 0, False: 1.96k]
  ------------------
  752|      0|			return -1;
  753|      0|		case 1:
  ------------------
  |  Branch (753:3): [True: 0, False: 1.96k]
  ------------------
  754|      0|			(void)snprintf(buf, sizeof(buf), "%g", vf);
  755|      0|			if (file_printf(ms, F(ms, desc, "%s"), buf) == -1)
  ------------------
  |  |  167|      0|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (755:8): [True: 0, False: 0]
  ------------------
  756|      0|				return -1;
  757|      0|			break;
  758|  1.96k|		default:
  ------------------
  |  Branch (758:3): [True: 1.96k, False: 0]
  ------------------
  759|  1.96k|			if (file_printf(ms, F(ms, desc, "%g"), vf) == -1)
  ------------------
  |  |  167|  1.96k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (759:8): [True: 0, False: 1.96k]
  ------------------
  760|      0|				return -1;
  761|  1.96k|			break;
  762|  1.96k|		}
  763|  1.96k|  		break;
  764|       |
  765|  1.96k|	case FILE_DOUBLE:
  ------------------
  |  |  289|      0|#define				FILE_DOUBLE		36
  ------------------
  |  Branch (765:2): [True: 0, False: 119k]
  ------------------
  766|      0|	case FILE_BEDOUBLE:
  ------------------
  |  |  290|      0|#define				FILE_BEDOUBLE		37
  ------------------
  |  Branch (766:2): [True: 0, False: 119k]
  ------------------
  767|  2.27k|	case FILE_LEDOUBLE:
  ------------------
  |  |  291|  2.27k|#define				FILE_LEDOUBLE		38
  ------------------
  |  Branch (767:2): [True: 2.27k, False: 117k]
  ------------------
  768|  2.27k|		vd = p->d;
  769|  2.27k|		switch (check_fmt(ms, desc)) {
  770|      0|		case -1:
  ------------------
  |  Branch (770:3): [True: 0, False: 2.27k]
  ------------------
  771|      0|			return -1;
  772|      0|		case 1:
  ------------------
  |  Branch (772:3): [True: 0, False: 2.27k]
  ------------------
  773|      0|			(void)snprintf(buf, sizeof(buf), "%g", vd);
  774|      0|			if (file_printf(ms, F(ms, desc, "%s"), buf) == -1)
  ------------------
  |  |  167|      0|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (774:8): [True: 0, False: 0]
  ------------------
  775|      0|				return -1;
  776|      0|			break;
  777|  2.27k|		default:
  ------------------
  |  Branch (777:3): [True: 2.27k, False: 0]
  ------------------
  778|  2.27k|			if (file_printf(ms, F(ms, desc, "%g"), vd) == -1)
  ------------------
  |  |  167|  2.27k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (778:8): [True: 0, False: 2.27k]
  ------------------
  779|      0|				return -1;
  780|  2.27k|			break;
  781|  2.27k|		}
  782|  2.27k|  		break;
  783|       |
  784|  2.27k|	case FILE_SEARCH:
  ------------------
  |  |  273|    468|#define				FILE_SEARCH		20
  ------------------
  |  Branch (784:2): [True: 468, False: 118k]
  ------------------
  785|  1.26k|	case FILE_REGEX: {
  ------------------
  |  |  270|  1.26k|#define				FILE_REGEX		17
  ------------------
  |  Branch (785:2): [True: 793, False: 118k]
  ------------------
  786|  1.26k|		char *cp, *scp;
  787|  1.26k|		int rval;
  788|       |
  789|  1.26k|		if (ms->search.s == NULL)
  ------------------
  |  Branch (789:7): [True: 0, False: 1.26k]
  ------------------
  790|      0|			break;
  791|       |
  792|  1.26k|		cp = strndup(RCAST(const char *, ms->search.s),
  ------------------
  |  |  461|  1.26k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
  793|  1.26k|		    ms->search.rm_len);
  794|  1.26k|		if (cp == NULL) {
  ------------------
  |  Branch (794:7): [True: 0, False: 1.26k]
  ------------------
  795|      0|			file_oomem(ms, ms->search.rm_len);
  796|      0|			return -1;
  797|      0|		}
  798|  1.26k|		scp = (m->str_flags & STRING_TRIM) ? file_strtrim(cp) : cp;
  ------------------
  |  |  390|  1.26k|#define str_flags _u._s._flags
  ------------------
              		scp = (m->str_flags & STRING_TRIM) ? file_strtrim(cp) : cp;
  ------------------
  |  |  421|  1.26k|#define	STRING_TRIM				BIT(13)
  |  |  ------------------
  |  |  |  |  403|  1.26k|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (798:9): [True: 70, False: 1.19k]
  ------------------
  799|       |
  800|  1.26k|		rval = file_printf(ms, F(ms, desc, "%s"), file_printable(ms,
  ------------------
  |  |  167|  1.26k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  801|  1.26k|		    sbuf, sizeof(sbuf), scp, ms->search.rm_len));
  802|  1.26k|		free(cp);
  803|       |
  804|  1.26k|		if (rval == -1)
  ------------------
  |  Branch (804:7): [True: 0, False: 1.26k]
  ------------------
  805|      0|			return -1;
  806|  1.26k|		break;
  807|  1.26k|	}
  808|       |
  809|  1.95k|	case FILE_DEFAULT:
  ------------------
  |  |  256|  1.95k|#define				FILE_DEFAULT		3
  ------------------
  |  Branch (809:2): [True: 1.95k, False: 117k]
  ------------------
  810|  2.23k|	case FILE_CLEAR:
  ------------------
  |  |  300|  2.23k|#define				FILE_CLEAR		47
  ------------------
  |  Branch (810:2): [True: 284, False: 119k]
  ------------------
  811|  2.23k|	  	if (file_printf(ms, "%s", m->desc) == -1)
  ------------------
  |  Branch (811:9): [True: 0, False: 2.23k]
  ------------------
  812|      0|			return -1;
  813|  2.23k|		break;
  814|       |
  815|  2.23k|	case FILE_INDIRECT:
  ------------------
  |  |  294|    243|#define				FILE_INDIRECT		41
  ------------------
  |  Branch (815:2): [True: 243, False: 119k]
  ------------------
  816|    278|	case FILE_USE:
  ------------------
  |  |  299|    278|#define				FILE_USE		46
  ------------------
  |  Branch (816:2): [True: 35, False: 119k]
  ------------------
  817|    960|	case FILE_NAME:
  ------------------
  |  |  298|    960|#define				FILE_NAME		45
  ------------------
  |  Branch (817:2): [True: 682, False: 118k]
  ------------------
  818|    960|		break;
  819|    539|	case FILE_DER:
  ------------------
  |  |  301|    539|#define				FILE_DER		48
  ------------------
  |  Branch (819:2): [True: 539, False: 118k]
  ------------------
  820|    539|		if (file_printf(ms, F(ms, desc, "%s"),
  ------------------
  |  |  167|    539|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (820:7): [True: 0, False: 539]
  ------------------
  821|    539|		    file_printable(ms, sbuf, sizeof(sbuf), ms->ms_value.s,
  822|    539|			sizeof(ms->ms_value.s))) == -1)
  823|      0|			return -1;
  824|    539|		break;
  825|    539|	case FILE_GUID:
  ------------------
  |  |  302|    218|#define				FILE_GUID		49
  ------------------
  |  Branch (825:2): [True: 218, False: 119k]
  ------------------
  826|    218|	case FILE_LEGUID:
  ------------------
  |  |  303|    218|#define				FILE_LEGUID		50
  ------------------
  |  Branch (826:2): [True: 0, False: 119k]
  ------------------
  827|    218|		(void) file_print_leguid(buf, sizeof(buf), ms->ms_value.guid);
  828|    218|		if (file_printf(ms, F(ms, desc, "%s"), buf) == -1)
  ------------------
  |  |  167|    218|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (828:7): [True: 0, False: 218]
  ------------------
  829|      0|			return -1;
  830|    218|		break;
  831|    218|	case FILE_BEGUID:
  ------------------
  |  |  304|     50|#define				FILE_BEGUID		51
  ------------------
  |  Branch (831:2): [True: 50, False: 119k]
  ------------------
  832|     50|		(void) file_print_beguid(buf, sizeof(buf), ms->ms_value.guid);
  833|     50|		if (file_printf(ms, F(ms, desc, "%s"), buf) == -1)
  ------------------
  |  |  167|     50|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (833:7): [True: 0, False: 50]
  ------------------
  834|      0|			return -1;
  835|     50|		break;
  836|     50|	case FILE_MSDOSDATE:
  ------------------
  |  |  308|      0|#define				FILE_MSDOSDATE		55
  ------------------
  |  Branch (836:2): [True: 0, False: 119k]
  ------------------
  837|      0|	case FILE_BEMSDOSDATE:
  ------------------
  |  |  310|      0|#define				FILE_BEMSDOSDATE	57
  ------------------
  |  Branch (837:2): [True: 0, False: 119k]
  ------------------
  838|    322|	case FILE_LEMSDOSDATE:
  ------------------
  |  |  309|    322|#define				FILE_LEMSDOSDATE	56
  ------------------
  |  Branch (838:2): [True: 322, False: 119k]
  ------------------
  839|    322|		if (file_printf(ms, F(ms, desc, "%s"),
  ------------------
  |  |  167|    322|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (839:7): [True: 0, False: 322]
  ------------------
  840|    322|		    file_fmtdate(tbuf, sizeof(tbuf), p->h)) == -1)
  841|      0|			return -1;
  842|    322|		break;
  843|    322|	case FILE_MSDOSTIME:
  ------------------
  |  |  311|      0|#define				FILE_MSDOSTIME		58
  ------------------
  |  Branch (843:2): [True: 0, False: 119k]
  ------------------
  844|      0|	case FILE_BEMSDOSTIME:
  ------------------
  |  |  313|      0|#define				FILE_BEMSDOSTIME	60
  ------------------
  |  Branch (844:2): [True: 0, False: 119k]
  ------------------
  845|    322|	case FILE_LEMSDOSTIME:
  ------------------
  |  |  312|    322|#define				FILE_LEMSDOSTIME	59
  ------------------
  |  Branch (845:2): [True: 322, False: 119k]
  ------------------
  846|    322|		if (file_printf(ms, F(ms, desc, "%s"),
  ------------------
  |  |  167|    322|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (846:7): [True: 0, False: 322]
  ------------------
  847|    322|		    file_fmttime(tbuf, sizeof(tbuf), p->h)) == -1)
  848|      0|			return -1;
  849|    322|		break;
  850|    322|	case FILE_OCTAL:
  ------------------
  |  |  314|      0|#define				FILE_OCTAL		61
  ------------------
  |  Branch (850:2): [True: 0, False: 119k]
  ------------------
  851|      0|		file_fmtnum(buf, sizeof(buf), m->value.s, 8);
  852|      0|		if (file_printf(ms, F(ms, desc, "%s"), buf) == -1)
  ------------------
  |  |  167|      0|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (852:7): [True: 0, False: 0]
  ------------------
  853|      0|			return -1;
  854|      0|		break;
  855|      0|	default:
  ------------------
  |  Branch (855:2): [True: 0, False: 119k]
  ------------------
  856|      0|		file_magerror(ms, "invalid m->type (%d) in mprint()", m->type);
  857|      0|		return -1;
  858|   119k|	}
  859|   119k|	return 0;
  860|   119k|}
softmagic.c:check_fmt:
  509|  83.1k|{
  510|  83.1k|	file_regex_t rx;
  511|  83.1k|	int rc;
  512|  83.1k|        const char* pat = "%[-0-9\\.]*s";
  513|       |
  514|  83.1k|	if (strchr(fmt, '%') == NULL)
  ------------------
  |  Branch (514:6): [True: 39.6k, False: 43.4k]
  ------------------
  515|  39.6k|		return 0;
  516|       |
  517|  43.4k|	rc = file_regcomp(ms, &rx, pat, REG_EXTENDED|REG_NOSUB);
  518|  43.4k|	if (rc != 0)
  ------------------
  |  Branch (518:6): [True: 0, False: 43.4k]
  ------------------
  519|      0|		return -1;
  520|  43.4k|	rc = !file_regexec(ms, &rx, fmt, 0, 0, 0);
  521|  43.4k|	file_regfree(&rx);
  522|  43.4k|	return rc;
  523|  43.4k|}
softmagic.c:moffset:
  865|   921k|{
  866|   921k|	int32_t o;
  867|   921k|	size_t vlen;
  868|       |
  869|   921k|  	switch (m->type) {
  870|   284k|  	case FILE_BYTE:
  ------------------
  |  |  254|   284k|#define 			FILE_BYTE		1
  ------------------
  |  Branch (870:4): [True: 284k, False: 636k]
  ------------------
  871|   284k|		o = CAST(int32_t, (ms->offset + sizeof(char)));
  ------------------
  |  |  460|   284k|#define CAST(T, b)	((T)(b))
  ------------------
  872|   284k|		break;
  873|       |
  874|  27.2k|  	case FILE_SHORT:
  ------------------
  |  |  255|  27.2k|#define				FILE_SHORT		2
  ------------------
  |  Branch (874:4): [True: 27.2k, False: 894k]
  ------------------
  875|  79.5k|  	case FILE_BESHORT:
  ------------------
  |  |  260|  79.5k|#define				FILE_BESHORT		7
  ------------------
  |  Branch (875:4): [True: 52.2k, False: 869k]
  ------------------
  876|   147k|  	case FILE_LESHORT:
  ------------------
  |  |  263|   147k|#define				FILE_LESHORT		10
  ------------------
  |  Branch (876:4): [True: 68.1k, False: 853k]
  ------------------
  877|   147k|	case FILE_MSDOSDATE:
  ------------------
  |  |  308|   147k|#define				FILE_MSDOSDATE		55
  ------------------
  |  Branch (877:2): [True: 0, False: 921k]
  ------------------
  878|   148k|	case FILE_LEMSDOSDATE:
  ------------------
  |  |  309|   148k|#define				FILE_LEMSDOSDATE	56
  ------------------
  |  Branch (878:2): [True: 322, False: 921k]
  ------------------
  879|   148k|	case FILE_BEMSDOSDATE:
  ------------------
  |  |  310|   148k|#define				FILE_BEMSDOSDATE	57
  ------------------
  |  Branch (879:2): [True: 0, False: 921k]
  ------------------
  880|   148k|	case FILE_MSDOSTIME:
  ------------------
  |  |  311|   148k|#define				FILE_MSDOSTIME		58
  ------------------
  |  Branch (880:2): [True: 0, False: 921k]
  ------------------
  881|   148k|	case FILE_LEMSDOSTIME:
  ------------------
  |  |  312|   148k|#define				FILE_LEMSDOSTIME	59
  ------------------
  |  Branch (881:2): [True: 322, False: 921k]
  ------------------
  882|   148k|	case FILE_BEMSDOSTIME:
  ------------------
  |  |  313|   148k|#define				FILE_BEMSDOSTIME	60
  ------------------
  |  Branch (882:2): [True: 0, False: 921k]
  ------------------
  883|   148k|		o = CAST(int32_t, (ms->offset + sizeof(short)));
  ------------------
  |  |  460|   148k|#define CAST(T, b)	((T)(b))
  ------------------
  884|   148k|		break;
  885|       |
  886|  12.4k|  	case FILE_LONG:
  ------------------
  |  |  257|  12.4k|#define				FILE_LONG		4
  ------------------
  |  Branch (886:4): [True: 12.4k, False: 909k]
  ------------------
  887|   106k|  	case FILE_BELONG:
  ------------------
  |  |  261|   106k|#define				FILE_BELONG		8
  ------------------
  |  Branch (887:4): [True: 94.3k, False: 827k]
  ------------------
  888|   208k|  	case FILE_LELONG:
  ------------------
  |  |  264|   208k|#define				FILE_LELONG		11
  ------------------
  |  Branch (888:4): [True: 101k, False: 820k]
  ------------------
  889|   208k|  	case FILE_MELONG:
  ------------------
  |  |  276|   208k|#define				FILE_MELONG		23
  ------------------
  |  Branch (889:4): [True: 39, False: 921k]
  ------------------
  890|   208k|		o = CAST(int32_t, (ms->offset + sizeof(int32_t)));
  ------------------
  |  |  460|   208k|#define CAST(T, b)	((T)(b))
  ------------------
  891|   208k|		break;
  892|       |
  893|  29.7k|  	case FILE_QUAD:
  ------------------
  |  |  277|  29.7k|#define				FILE_QUAD		24
  ------------------
  |  Branch (893:4): [True: 29.7k, False: 891k]
  ------------------
  894|  35.8k|  	case FILE_BEQUAD:
  ------------------
  |  |  279|  35.8k|#define				FILE_BEQUAD		26
  ------------------
  |  Branch (894:4): [True: 6.11k, False: 915k]
  ------------------
  895|  38.5k|  	case FILE_LEQUAD:
  ------------------
  |  |  278|  38.5k|#define				FILE_LEQUAD		25
  ------------------
  |  Branch (895:4): [True: 2.72k, False: 918k]
  ------------------
  896|  38.5k|		o = CAST(int32_t, (ms->offset + sizeof(int64_t)));
  ------------------
  |  |  460|  38.5k|#define CAST(T, b)	((T)(b))
  ------------------
  897|  38.5k|		break;
  898|       |
  899|  78.3k|  	case FILE_STRING:
  ------------------
  |  |  258|  78.3k|#define				FILE_STRING		5
  ------------------
  |  Branch (899:4): [True: 78.3k, False: 843k]
  ------------------
  900|  81.1k|  	case FILE_PSTRING:
  ------------------
  |  |  266|  81.1k|#define				FILE_PSTRING		13
  ------------------
  |  Branch (900:4): [True: 2.87k, False: 918k]
  ------------------
  901|  81.3k|  	case FILE_BESTRING16:
  ------------------
  |  |  271|  81.3k|#define				FILE_BESTRING16		18
  ------------------
  |  Branch (901:4): [True: 159, False: 921k]
  ------------------
  902|  81.9k|  	case FILE_LESTRING16:
  ------------------
  |  |  272|  81.9k|#define				FILE_LESTRING16		19
  ------------------
  |  Branch (902:4): [True: 648, False: 921k]
  ------------------
  903|  81.9k|	case FILE_OCTAL:
  ------------------
  |  |  314|  81.9k|#define				FILE_OCTAL		61
  ------------------
  |  Branch (903:2): [True: 0, False: 921k]
  ------------------
  904|  81.9k|		if (m->reln == '=' || m->reln == '!') {
  ------------------
  |  Branch (904:7): [True: 28.7k, False: 53.2k]
  |  Branch (904:25): [True: 963, False: 52.3k]
  ------------------
  905|  29.6k|			o = ms->offset + m->vallen;
  906|  52.3k|		} else {
  907|  52.3k|			union VALUETYPE *p = &ms->ms_value;
  908|       |
  909|  52.3k|			if (*m->value.s == '\0')
  ------------------
  |  Branch (909:8): [True: 41.3k, False: 10.9k]
  ------------------
  910|  41.3k|				p->s[strcspn(p->s, "\r\n")] = '\0';
  911|  52.3k|			o = CAST(uint32_t, (ms->offset + strlen(p->s)));
  ------------------
  |  |  460|  52.3k|#define CAST(T, b)	((T)(b))
  ------------------
  912|  52.3k|			if (m->type == FILE_PSTRING) {
  ------------------
  |  |  266|  52.3k|#define				FILE_PSTRING		13
  ------------------
  |  Branch (912:8): [True: 2.75k, False: 49.5k]
  ------------------
  913|  2.75k|				size_t l = file_pstring_length_size(ms, m);
  914|  2.75k|				if (l == FILE_BADSIZE)
  ------------------
  |  |  183|  2.75k|#define FILE_BADSIZE CAST(size_t, ~0ul)
  |  |  ------------------
  |  |  |  |  460|  2.75k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (914:9): [True: 0, False: 2.75k]
  ------------------
  915|      0|					return -1;
  916|  2.75k|				o += CAST(uint32_t, l);
  ------------------
  |  |  460|  2.75k|#define CAST(T, b)	((T)(b))
  ------------------
  917|  2.75k|			}
  918|  52.3k|		}
  919|  81.9k|		break;
  920|       |
  921|  81.9k|	case FILE_DATE:
  ------------------
  |  |  259|      0|#define				FILE_DATE		6
  ------------------
  |  Branch (921:2): [True: 0, False: 921k]
  ------------------
  922|    542|	case FILE_BEDATE:
  ------------------
  |  |  262|    542|#define				FILE_BEDATE		9
  ------------------
  |  Branch (922:2): [True: 542, False: 921k]
  ------------------
  923|    677|	case FILE_LEDATE:
  ------------------
  |  |  265|    677|#define				FILE_LEDATE		12
  ------------------
  |  Branch (923:2): [True: 135, False: 921k]
  ------------------
  924|    820|	case FILE_MEDATE:
  ------------------
  |  |  274|    820|#define				FILE_MEDATE		21
  ------------------
  |  Branch (924:2): [True: 143, False: 921k]
  ------------------
  925|    820|		o = CAST(int32_t, (ms->offset + sizeof(uint32_t)));
  ------------------
  |  |  460|    820|#define CAST(T, b)	((T)(b))
  ------------------
  926|    820|		break;
  927|       |
  928|      0|	case FILE_LDATE:
  ------------------
  |  |  267|      0|#define				FILE_LDATE		14
  ------------------
  |  Branch (928:2): [True: 0, False: 921k]
  ------------------
  929|    373|	case FILE_BELDATE:
  ------------------
  |  |  268|    373|#define				FILE_BELDATE		15
  ------------------
  |  Branch (929:2): [True: 373, False: 921k]
  ------------------
  930|    457|	case FILE_LELDATE:
  ------------------
  |  |  269|    457|#define				FILE_LELDATE		16
  ------------------
  |  Branch (930:2): [True: 84, False: 921k]
  ------------------
  931|    457|	case FILE_MELDATE:
  ------------------
  |  |  275|    457|#define				FILE_MELDATE		22
  ------------------
  |  Branch (931:2): [True: 0, False: 921k]
  ------------------
  932|    457|		o = CAST(int32_t, (ms->offset + sizeof(uint32_t)));
  ------------------
  |  |  460|    457|#define CAST(T, b)	((T)(b))
  ------------------
  933|    457|		break;
  934|       |
  935|      0|	case FILE_QDATE:
  ------------------
  |  |  280|      0|#define				FILE_QDATE		27
  ------------------
  |  Branch (935:2): [True: 0, False: 921k]
  ------------------
  936|  1.54k|	case FILE_BEQDATE:
  ------------------
  |  |  282|  1.54k|#define				FILE_BEQDATE		29
  ------------------
  |  Branch (936:2): [True: 1.54k, False: 920k]
  ------------------
  937|  1.59k|	case FILE_LEQDATE:
  ------------------
  |  |  281|  1.59k|#define				FILE_LEQDATE		28
  ------------------
  |  Branch (937:2): [True: 46, False: 921k]
  ------------------
  938|  1.59k|		o = CAST(int32_t, (ms->offset + sizeof(uint64_t)));
  ------------------
  |  |  460|  1.59k|#define CAST(T, b)	((T)(b))
  ------------------
  939|  1.59k|		break;
  940|       |
  941|      0|	case FILE_QLDATE:
  ------------------
  |  |  283|      0|#define				FILE_QLDATE		30
  ------------------
  |  Branch (941:2): [True: 0, False: 921k]
  ------------------
  942|    284|	case FILE_BEQLDATE:
  ------------------
  |  |  285|    284|#define				FILE_BEQLDATE		32
  ------------------
  |  Branch (942:2): [True: 284, False: 921k]
  ------------------
  943|    714|	case FILE_LEQLDATE:
  ------------------
  |  |  284|    714|#define				FILE_LEQLDATE		31
  ------------------
  |  Branch (943:2): [True: 430, False: 921k]
  ------------------
  944|    714|		o = CAST(int32_t, (ms->offset + sizeof(uint64_t)));
  ------------------
  |  |  460|    714|#define CAST(T, b)	((T)(b))
  ------------------
  945|    714|		break;
  946|       |
  947|      0|  	case FILE_FLOAT:
  ------------------
  |  |  286|      0|#define				FILE_FLOAT		33
  ------------------
  |  Branch (947:4): [True: 0, False: 921k]
  ------------------
  948|      0|  	case FILE_BEFLOAT:
  ------------------
  |  |  287|      0|#define				FILE_BEFLOAT		34
  ------------------
  |  Branch (948:4): [True: 0, False: 921k]
  ------------------
  949|  1.96k|  	case FILE_LEFLOAT:
  ------------------
  |  |  288|  1.96k|#define				FILE_LEFLOAT		35
  ------------------
  |  Branch (949:4): [True: 1.96k, False: 919k]
  ------------------
  950|  1.96k|		o = CAST(int32_t, (ms->offset + sizeof(float)));
  ------------------
  |  |  460|  1.96k|#define CAST(T, b)	((T)(b))
  ------------------
  951|  1.96k|		break;
  952|       |
  953|      0|  	case FILE_DOUBLE:
  ------------------
  |  |  289|      0|#define				FILE_DOUBLE		36
  ------------------
  |  Branch (953:4): [True: 0, False: 921k]
  ------------------
  954|      0|  	case FILE_BEDOUBLE:
  ------------------
  |  |  290|      0|#define				FILE_BEDOUBLE		37
  ------------------
  |  Branch (954:4): [True: 0, False: 921k]
  ------------------
  955|  2.27k|  	case FILE_LEDOUBLE:
  ------------------
  |  |  291|  2.27k|#define				FILE_LEDOUBLE		38
  ------------------
  |  Branch (955:4): [True: 2.27k, False: 919k]
  ------------------
  956|  2.27k|		o = CAST(int32_t, (ms->offset + sizeof(double)));
  ------------------
  |  |  460|  2.27k|#define CAST(T, b)	((T)(b))
  ------------------
  957|  2.27k|		break;
  958|       |
  959|  1.64k|	case FILE_REGEX:
  ------------------
  |  |  270|  1.64k|#define				FILE_REGEX		17
  ------------------
  |  Branch (959:2): [True: 1.64k, False: 920k]
  ------------------
  960|       |		/* Why is regex and search different? */
  961|  1.64k|		vlen = (m->str_flags & REGEX_OFFSET_START) == 0 ?
  ------------------
  |  |  390|  1.64k|#define str_flags _u._s._flags
  ------------------
              		vlen = (m->str_flags & REGEX_OFFSET_START) == 0 ?
  ------------------
  |  |  408|  1.64k|#define REGEX_OFFSET_START			BIT(4)
  |  |  ------------------
  |  |  |  |  403|  1.64k|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (961:10): [True: 1.55k, False: 94]
  ------------------
  962|  1.55k|		    ms->search.rm_len : 0;
  963|  1.64k|		o = CAST(int32_t, ms->search.offset + vlen - offset);
  ------------------
  |  |  460|  1.64k|#define CAST(T, b)	((T)(b))
  ------------------
  964|  1.64k|		break;
  965|       |
  966|  28.2k|	case FILE_SEARCH:
  ------------------
  |  |  273|  28.2k|#define				FILE_SEARCH		20
  ------------------
  |  Branch (966:2): [True: 28.2k, False: 893k]
  ------------------
  967|  28.2k|		vlen = (m->str_flags & REGEX_OFFSET_START) == 0 ? m->vallen : 0;
  ------------------
  |  |  390|  28.2k|#define str_flags _u._s._flags
  ------------------
              		vlen = (m->str_flags & REGEX_OFFSET_START) == 0 ? m->vallen : 0;
  ------------------
  |  |  408|  28.2k|#define REGEX_OFFSET_START			BIT(4)
  |  |  ------------------
  |  |  |  |  403|  28.2k|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (967:10): [True: 28.1k, False: 73]
  ------------------
  968|  28.2k|		o = CAST(int32_t, ms->search.offset + vlen - offset);
  ------------------
  |  |  460|  28.2k|#define CAST(T, b)	((T)(b))
  ------------------
  969|  28.2k|		break;
  970|       |
  971|  1.76k|	case FILE_CLEAR:
  ------------------
  |  |  300|  1.76k|#define				FILE_CLEAR		47
  ------------------
  |  Branch (971:2): [True: 1.76k, False: 919k]
  ------------------
  972|  8.94k|	case FILE_DEFAULT:
  ------------------
  |  |  256|  8.94k|#define				FILE_DEFAULT		3
  ------------------
  |  Branch (972:2): [True: 7.17k, False: 914k]
  ------------------
  973|  24.3k|	case FILE_INDIRECT:
  ------------------
  |  |  294|  24.3k|#define				FILE_INDIRECT		41
  ------------------
  |  Branch (973:2): [True: 15.3k, False: 906k]
  ------------------
  974|  24.5k|	case FILE_OFFSET:
  ------------------
  |  |  305|  24.5k|#define				FILE_OFFSET		52
  ------------------
  |  Branch (974:2): [True: 228, False: 921k]
  ------------------
  975|  41.8k|	case FILE_USE:
  ------------------
  |  |  299|  41.8k|#define				FILE_USE		46
  ------------------
  |  Branch (975:2): [True: 17.2k, False: 904k]
  ------------------
  976|  41.8k|		o = ms->offset;
  977|  41.8k|		break;
  978|       |
  979|  28.6k|	case FILE_DER:
  ------------------
  |  |  301|  28.6k|#define				FILE_DER		48
  ------------------
  |  Branch (979:2): [True: 28.6k, False: 893k]
  ------------------
  980|  28.6k|		o = der_offs(ms, m, nbytes);
  981|  28.6k|		if (o == -1 || CAST(size_t, o) > nbytes) {
  ------------------
  |  |  460|  28.6k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (981:7): [True: 0, False: 28.6k]
  |  Branch (981:18): [True: 0, False: 28.6k]
  ------------------
  982|      0|			if ((ms->flags & MAGIC_DEBUG) != 0) {
  ------------------
  |  |   33|      0|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (982:8): [True: 0, False: 0]
  ------------------
  983|      0|				(void)fprintf(stderr,
  984|      0|				    "Bad DER offset %d nbytes=%"
  985|      0|				    SIZE_T_FORMAT "u", o, nbytes);
  986|      0|			}
  987|      0|			*op = 0;
  988|      0|			return 0;
  989|      0|		}
  990|  28.6k|		break;
  991|       |
  992|  28.6k|	case FILE_BEGUID:
  ------------------
  |  |  304|     50|#define				FILE_BEGUID		51
  ------------------
  |  Branch (992:2): [True: 50, False: 921k]
  ------------------
  993|     50|	case FILE_LEGUID:
  ------------------
  |  |  303|     50|#define				FILE_LEGUID		50
  ------------------
  |  Branch (993:2): [True: 0, False: 921k]
  ------------------
  994|    268|	case FILE_GUID:
  ------------------
  |  |  302|    268|#define				FILE_GUID		49
  ------------------
  |  Branch (994:2): [True: 218, False: 921k]
  ------------------
  995|    268|		o = CAST(int32_t, (ms->offset + 2 * sizeof(uint64_t)));
  ------------------
  |  |  460|    268|#define CAST(T, b)	((T)(b))
  ------------------
  996|    268|		break;
  997|       |
  998|  51.1k|	default:
  ------------------
  |  Branch (998:2): [True: 51.1k, False: 870k]
  ------------------
  999|  51.1k|		o = 0;
 1000|  51.1k|		break;
 1001|   921k|	}
 1002|       |
 1003|   921k|	if (CAST(size_t, o) > nbytes) {
  ------------------
  |  |  460|   921k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (1003:6): [True: 25.9k, False: 895k]
  ------------------
 1004|       |#if 0
 1005|       |		file_error(ms, 0, "Offset out of range %" SIZE_T_FORMAT
 1006|       |		    "u > %" SIZE_T_FORMAT "u", (size_t)o, nbytes);
 1007|       |#endif
 1008|  25.9k|		return -1;
 1009|  25.9k|	}
 1010|   895k|	*op = o;
 1011|   895k|	return 1;
 1012|   921k|}

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

