archive_acl_clear:
  129|   371k|{
  130|   371k|	struct archive_acl_entry *ap;
  131|       |
  132|   372k|	while (acl->acl_head != NULL) {
  ------------------
  |  Branch (132:9): [True: 917, False: 371k]
  ------------------
  133|    917|		ap = acl->acl_head->next;
  134|    917|		archive_mstring_clean(&acl->acl_head->name);
  135|    917|		free(acl->acl_head);
  136|    917|		acl->acl_head = ap;
  137|    917|	}
  138|   371k|	free(acl->acl_text_w);
  139|   371k|	acl->acl_text_w = NULL;
  140|   371k|	free(acl->acl_text);
  141|   371k|	acl->acl_text = NULL;
  142|       |	acl->acl_p = NULL;
  143|   371k|	acl->acl_types = 0;
  144|   371k|	acl->acl_state = 0; /* Not counting. */
  145|   371k|}
archive_acl_count:
  380|    116|{
  381|    116|	int count;
  382|    116|	struct archive_acl_entry *ap;
  383|       |
  384|    116|	count = 0;
  385|    116|	ap = acl->acl_head;
  386|  1.03k|	while (ap != NULL) {
  ------------------
  |  Branch (386:9): [True: 917, False: 116]
  ------------------
  387|    917|		if ((ap->type & want_type) != 0)
  ------------------
  |  Branch (387:7): [True: 917, False: 0]
  ------------------
  388|    917|			count++;
  389|    917|		ap = ap->next;
  390|    917|	}
  391|       |
  392|    116|	if (count > 0 && ((want_type & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0))
  ------------------
  |  |  534|     64|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  ------------------
  |  Branch (392:6): [True: 64, False: 52]
  |  Branch (392:19): [True: 47, False: 17]
  ------------------
  393|     47|		count += 3;
  394|    116|	return (count);
  395|    116|}
archive_acl_reset:
  413|    116|{
  414|    116|	int count, cutoff;
  415|       |
  416|    116|	count = archive_acl_count(acl, want_type);
  417|       |
  418|       |	/*
  419|       |	 * If the only entries are the three standard ones,
  420|       |	 * then don't return any ACL data.  (In this case,
  421|       |	 * client can just use chmod(2) to set permissions.)
  422|       |	 */
  423|    116|	if ((want_type & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0)
  ------------------
  |  |  534|    116|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  ------------------
  |  Branch (423:6): [True: 47, False: 69]
  ------------------
  424|     47|		cutoff = 3;
  425|     69|	else
  426|     69|		cutoff = 0;
  427|       |
  428|    116|	if (count > cutoff)
  ------------------
  |  Branch (428:6): [True: 64, False: 52]
  ------------------
  429|     64|		acl->acl_state = ARCHIVE_ENTRY_ACL_USER_OBJ;
  ------------------
  |  |  549|     64|#define	ARCHIVE_ENTRY_ACL_USER_OBJ 	10002	/* User who owns the file. */
  ------------------
  430|     52|	else
  431|     52|		acl->acl_state = 0;
  432|    116|	acl->acl_p = acl->acl_head;
  433|    116|	return (count);
  434|    116|}
archive_acl_from_text_l:
 1506|    116|{
 1507|    116|	return archive_acl_from_text_nl(acl, text, strlen(text), want_type, sc);
 1508|    116|}
archive_acl_from_text_nl:
 1513|    116|{
 1514|    116|	struct {
 1515|    116|		const char *start;
 1516|    116|		const char *end;
 1517|    116|	} field[6], name;
 1518|       |
 1519|    116|	const char *s, *st;
 1520|    116|	int numfields, fields, n, r, sol, ret;
 1521|    116|	int type, types, tag, permset, id;
 1522|    116|	size_t len;
 1523|    116|	char sep;
 1524|       |
 1525|    116|	switch (want_type) {
 1526|      0|	case ARCHIVE_ENTRY_ACL_TYPE_POSIX1E:
  ------------------
  |  |  540|      0|#define	ARCHIVE_ENTRY_ACL_TYPE_POSIX1E	(ARCHIVE_ENTRY_ACL_TYPE_ACCESS \
  |  |  ------------------
  |  |  |  |  534|      0|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  |  |  ------------------
  |  |  541|      0|	    | ARCHIVE_ENTRY_ACL_TYPE_DEFAULT)
  |  |  ------------------
  |  |  |  |  535|      0|#define	ARCHIVE_ENTRY_ACL_TYPE_DEFAULT	0x00000200  /* POSIX.1e only */
  |  |  ------------------
  ------------------
  |  Branch (1526:2): [True: 0, False: 116]
  ------------------
 1527|      0|		want_type = ARCHIVE_ENTRY_ACL_TYPE_ACCESS;
  ------------------
  |  |  534|      0|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  ------------------
 1528|      0|		__LA_FALLTHROUGH;
 1529|     89|	case ARCHIVE_ENTRY_ACL_TYPE_ACCESS:
  ------------------
  |  |  534|     89|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  ------------------
  |  Branch (1529:2): [True: 89, False: 27]
  ------------------
 1530|     89|	case ARCHIVE_ENTRY_ACL_TYPE_DEFAULT:
  ------------------
  |  |  535|     89|#define	ARCHIVE_ENTRY_ACL_TYPE_DEFAULT	0x00000200  /* POSIX.1e only */
  ------------------
  |  Branch (1530:2): [True: 0, False: 116]
  ------------------
 1531|     89|		numfields = 5;
 1532|     89|		break;
 1533|     27|	case ARCHIVE_ENTRY_ACL_TYPE_NFS4:
  ------------------
  |  |  542|     27|#define	ARCHIVE_ENTRY_ACL_TYPE_NFS4	(ARCHIVE_ENTRY_ACL_TYPE_ALLOW \
  |  |  ------------------
  |  |  |  |  536|     27|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  |  |  ------------------
  |  |  543|     27|	    | ARCHIVE_ENTRY_ACL_TYPE_DENY \
  |  |  ------------------
  |  |  |  |  537|     27|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  |  |  ------------------
  |  |  544|     27|	    | ARCHIVE_ENTRY_ACL_TYPE_AUDIT \
  |  |  ------------------
  |  |  |  |  538|     27|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  |  |  ------------------
  |  |  545|     27|	    | ARCHIVE_ENTRY_ACL_TYPE_ALARM)
  |  |  ------------------
  |  |  |  |  539|     27|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  |  |  ------------------
  ------------------
  |  Branch (1533:2): [True: 27, False: 89]
  ------------------
 1534|     27|		numfields = 6;
 1535|     27|		break;
 1536|      0|	default:
  ------------------
  |  Branch (1536:2): [True: 0, False: 116]
  ------------------
 1537|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1538|    116|	}
 1539|       |
 1540|    116|	ret = ARCHIVE_OK;
  ------------------
  |  |  233|    116|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1541|    116|	types = 0;
 1542|       |
 1543|  20.1k|	while (text != NULL && length > 0 && *text != '\0') {
  ------------------
  |  Branch (1543:9): [True: 20.1k, False: 0]
  |  Branch (1543:25): [True: 20.0k, False: 116]
  |  Branch (1543:39): [True: 20.0k, False: 0]
  ------------------
 1544|       |		/*
 1545|       |		 * Parse the fields out of the next entry,
 1546|       |		 * advance 'text' to start of next entry.
 1547|       |		 */
 1548|  20.0k|		fields = 0;
 1549|  36.8k|		do {
 1550|  36.8k|			const char *start, *end;
 1551|  36.8k|			next_field(&text, &length, &start, &end, &sep);
 1552|  36.8k|			if (fields < numfields) {
  ------------------
  |  Branch (1552:8): [True: 35.6k, False: 1.19k]
  ------------------
 1553|  35.6k|				field[fields].start = start;
 1554|  35.6k|				field[fields].end = end;
 1555|  35.6k|			}
 1556|  36.8k|			++fields;
 1557|  36.8k|		} while (sep == ':');
  ------------------
  |  Branch (1557:12): [True: 16.8k, False: 20.0k]
  ------------------
 1558|       |
 1559|       |		/* Set remaining fields to blank. */
 1560|  88.6k|		for (n = fields; n < numfields; ++n)
  ------------------
  |  Branch (1560:20): [True: 68.5k, False: 20.0k]
  ------------------
 1561|  68.5k|			field[n].start = field[n].end = NULL;
 1562|       |
 1563|  20.0k|		if (field[0].start == NULL || field[0].end == NULL) {
  ------------------
  |  Branch (1563:7): [True: 0, False: 20.0k]
  |  Branch (1563:33): [True: 0, False: 20.0k]
  ------------------
 1564|       |			/* This should never happen */
 1565|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1566|      0|		}
 1567|       |
 1568|  20.0k|		if (*(field[0].start) == '#') {
  ------------------
  |  Branch (1568:7): [True: 321, False: 19.6k]
  ------------------
 1569|       |			/* Comment, skip entry */
 1570|    321|			continue;
 1571|    321|		}
 1572|       |
 1573|  19.6k|		n = 0;
 1574|  19.6k|		sol = 0;
 1575|  19.6k|		id = -1;
 1576|  19.6k|		permset = 0;
 1577|  19.6k|		name.start = name.end = NULL;
 1578|       |
 1579|  19.6k|		if (want_type != ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
  ------------------
  |  |  542|  19.6k|#define	ARCHIVE_ENTRY_ACL_TYPE_NFS4	(ARCHIVE_ENTRY_ACL_TYPE_ALLOW \
  |  |  ------------------
  |  |  |  |  536|  19.6k|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  |  |  ------------------
  |  |  543|  19.6k|	    | ARCHIVE_ENTRY_ACL_TYPE_DENY \
  |  |  ------------------
  |  |  |  |  537|  19.6k|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  |  |  ------------------
  |  |  544|  19.6k|	    | ARCHIVE_ENTRY_ACL_TYPE_AUDIT \
  |  |  ------------------
  |  |  |  |  538|  19.6k|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  |  |  ------------------
  |  |  545|  19.6k|	    | ARCHIVE_ENTRY_ACL_TYPE_ALARM)
  |  |  ------------------
  |  |  |  |  539|  19.6k|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  |  |  ------------------
  ------------------
  |  Branch (1579:7): [True: 15.7k, False: 3.93k]
  ------------------
 1580|       |			/* POSIX.1e ACLs */
 1581|       |			/*
 1582|       |			 * Default keyword "default:user::rwx"
 1583|       |			 * if found, we have one more field
 1584|       |			 *
 1585|       |			 * We also support old Solaris extension:
 1586|       |			 * "defaultuser::rwx" is the default ACL corresponding
 1587|       |			 * to "user::rwx", etc. valid only for first field
 1588|       |			 */
 1589|  15.7k|			s = field[0].start;
 1590|  15.7k|			len = field[0].end - field[0].start;
 1591|  15.7k|			if (*s == 'd' && (len == 1 || (len >= 7
  ------------------
  |  Branch (1591:8): [True: 1.85k, False: 13.9k]
  |  Branch (1591:22): [True: 1.26k, False: 589]
  |  Branch (1591:35): [True: 103, False: 486]
  ------------------
 1592|  1.36k|			    && memcmp((s + 1), "efault", 6) == 0))) {
  ------------------
  |  Branch (1592:11): [True: 94, False: 9]
  ------------------
 1593|  1.36k|				type = ARCHIVE_ENTRY_ACL_TYPE_DEFAULT;
  ------------------
  |  |  535|  1.36k|#define	ARCHIVE_ENTRY_ACL_TYPE_DEFAULT	0x00000200  /* POSIX.1e only */
  ------------------
 1594|  1.36k|				if (len > 7)
  ------------------
  |  Branch (1594:9): [True: 92, False: 1.26k]
  ------------------
 1595|     92|					field[0].start += 7;
 1596|  1.26k|				else
 1597|  1.26k|					n = 1;
 1598|  1.36k|			} else
 1599|  14.4k|				type = want_type;
 1600|       |
 1601|       |			/* Check for a numeric ID in field n+1 or n+3. */
 1602|  15.7k|			if (isint(field[n + 1].start, field[n + 1].end,
  ------------------
  |  Branch (1602:8): [True: 3, False: 15.7k]
  ------------------
 1603|  15.7k|			    &id) < 0) {
 1604|      3|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|      3|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1605|      3|				continue;
 1606|      3|			}
 1607|       |			/* Field n+3 is optional. */
 1608|  15.7k|			if (id == -1 && fields > (n + 3) &&
  ------------------
  |  Branch (1608:8): [True: 15.6k, False: 142]
  |  Branch (1608:20): [True: 1.87k, False: 13.7k]
  ------------------
 1609|  1.87k|			    isint(field[n + 3].start, field[n + 3].end,
  ------------------
  |  Branch (1609:8): [True: 11, False: 1.86k]
  ------------------
 1610|  1.87k|			    &id) < 0) {
 1611|     11|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|     11|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1612|     11|				continue;
 1613|     11|			}
 1614|       |
 1615|  15.7k|			tag = 0;
 1616|  15.7k|			s = field[n].start;
 1617|  15.7k|			len = field[n].end - field[n].start;
 1618|       |
 1619|  15.7k|			if (len == 0) {
  ------------------
  |  Branch (1619:8): [True: 1.86k, False: 13.8k]
  ------------------
 1620|  1.86k|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|  1.86k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1621|  1.86k|				continue;
 1622|  1.86k|			}
 1623|       |
 1624|  13.8k|			st = s + 1; 
 1625|       |
 1626|  13.8k|			switch (*s) {
 1627|  1.20k|			case 'u':
  ------------------
  |  Branch (1627:4): [True: 1.20k, False: 12.6k]
  ------------------
 1628|  1.20k|				if (len == 1 || (len == 4
  ------------------
  |  Branch (1628:9): [True: 767, False: 442]
  |  Branch (1628:22): [True: 14, False: 428]
  ------------------
 1629|     14|				    && memcmp(st, "ser", 3) == 0))
  ------------------
  |  Branch (1629:12): [True: 1, False: 13]
  ------------------
 1630|    768|					tag = ARCHIVE_ENTRY_ACL_USER_OBJ;
  ------------------
  |  |  549|    768|#define	ARCHIVE_ENTRY_ACL_USER_OBJ 	10002	/* User who owns the file. */
  ------------------
 1631|  1.20k|				break;
 1632|  2.17k|			case 'g':
  ------------------
  |  Branch (1632:4): [True: 2.17k, False: 11.7k]
  ------------------
 1633|  2.17k|				if (len == 1 || (len == 5
  ------------------
  |  Branch (1633:9): [True: 1.44k, False: 737]
  |  Branch (1633:22): [True: 383, False: 354]
  ------------------
 1634|    383|				    && memcmp(st, "roup", 4) == 0))
  ------------------
  |  Branch (1634:12): [True: 268, False: 115]
  ------------------
 1635|  1.71k|					tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ;
  ------------------
  |  |  551|  1.71k|#define	ARCHIVE_ENTRY_ACL_GROUP_OBJ	10004	/* Group who owns the file. */
  ------------------
 1636|  2.17k|				break;
 1637|  1.04k|			case 'o':
  ------------------
  |  Branch (1637:4): [True: 1.04k, False: 12.8k]
  ------------------
 1638|  1.04k|				if (len == 1 || (len == 5
  ------------------
  |  Branch (1638:9): [True: 622, False: 422]
  |  Branch (1638:22): [True: 376, False: 46]
  ------------------
 1639|    376|				    && memcmp(st, "ther", 4) == 0))
  ------------------
  |  Branch (1639:12): [True: 350, False: 26]
  ------------------
 1640|    972|					tag = ARCHIVE_ENTRY_ACL_OTHER;
  ------------------
  |  |  553|    972|#define	ARCHIVE_ENTRY_ACL_OTHER		10006	/* Public (POSIX.1e only) */
  ------------------
 1641|  1.04k|				break;
 1642|    711|			case 'm':
  ------------------
  |  Branch (1642:4): [True: 711, False: 13.1k]
  ------------------
 1643|    711|				if (len == 1 || (len == 4
  ------------------
  |  Branch (1643:9): [True: 463, False: 248]
  |  Branch (1643:22): [True: 219, False: 29]
  ------------------
 1644|    219|				    && memcmp(st, "ask", 3) == 0))
  ------------------
  |  Branch (1644:12): [True: 0, False: 219]
  ------------------
 1645|    463|					tag = ARCHIVE_ENTRY_ACL_MASK;
  ------------------
  |  |  552|    463|#define	ARCHIVE_ENTRY_ACL_MASK		10005	/* Modify group access (POSIX.1e only) */
  ------------------
 1646|    711|				break;
 1647|  8.74k|			default:
  ------------------
  |  Branch (1647:4): [True: 8.74k, False: 5.14k]
  ------------------
 1648|  8.74k|					break;
 1649|  13.8k|			}
 1650|       |
 1651|  13.8k|			switch (tag) {
 1652|    972|			case ARCHIVE_ENTRY_ACL_OTHER:
  ------------------
  |  |  553|    972|#define	ARCHIVE_ENTRY_ACL_OTHER		10006	/* Public (POSIX.1e only) */
  ------------------
  |  Branch (1652:4): [True: 972, False: 12.9k]
  ------------------
 1653|  1.43k|			case ARCHIVE_ENTRY_ACL_MASK:
  ------------------
  |  |  552|  1.43k|#define	ARCHIVE_ENTRY_ACL_MASK		10005	/* Modify group access (POSIX.1e only) */
  ------------------
  |  Branch (1653:4): [True: 463, False: 13.4k]
  ------------------
 1654|  1.43k|				if (fields == (n + 2)
  ------------------
  |  Branch (1654:9): [True: 722, False: 713]
  ------------------
 1655|    722|				    && field[n + 1].start < field[n + 1].end
  ------------------
  |  Branch (1655:12): [True: 722, False: 0]
  ------------------
 1656|    722|				    && ismode(field[n + 1].start,
  ------------------
  |  Branch (1656:12): [True: 288, False: 434]
  ------------------
 1657|    722|				    field[n + 1].end, &permset)) {
 1658|       |					/* This is Solaris-style "other:rwx" */
 1659|    288|					sol = 1;
 1660|  1.14k|				} else if (fields == (n + 3) &&
  ------------------
  |  Branch (1660:16): [True: 40, False: 1.10k]
  ------------------
 1661|     40|				    field[n + 1].start < field[n + 1].end) {
  ------------------
  |  Branch (1661:9): [True: 36, False: 4]
  ------------------
 1662|       |					/* Invalid mask or other field */
 1663|     36|					ret = ARCHIVE_WARN;
  ------------------
  |  |  235|     36|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1664|     36|					continue;
 1665|     36|				}
 1666|  1.39k|				break;
 1667|  1.39k|			case ARCHIVE_ENTRY_ACL_USER_OBJ:
  ------------------
  |  |  549|    768|#define	ARCHIVE_ENTRY_ACL_USER_OBJ 	10002	/* User who owns the file. */
  ------------------
  |  Branch (1667:4): [True: 768, False: 13.1k]
  ------------------
 1668|  2.47k|			case ARCHIVE_ENTRY_ACL_GROUP_OBJ:
  ------------------
  |  |  551|  2.47k|#define	ARCHIVE_ENTRY_ACL_GROUP_OBJ	10004	/* Group who owns the file. */
  ------------------
  |  Branch (1668:4): [True: 1.71k, False: 12.1k]
  ------------------
 1669|  2.47k|				if (id != -1 ||
  ------------------
  |  Branch (1669:9): [True: 704, False: 1.77k]
  ------------------
 1670|  2.20k|				    field[n + 1].start < field[n + 1].end) {
  ------------------
  |  Branch (1670:9): [True: 1.50k, False: 271]
  ------------------
 1671|  2.20k|					name = field[n + 1];
 1672|  2.20k|					if (tag == ARCHIVE_ENTRY_ACL_USER_OBJ)
  ------------------
  |  |  549|  2.20k|#define	ARCHIVE_ENTRY_ACL_USER_OBJ 	10002	/* User who owns the file. */
  ------------------
  |  Branch (1672:10): [True: 767, False: 1.44k]
  ------------------
 1673|    767|						tag = ARCHIVE_ENTRY_ACL_USER;
  ------------------
  |  |  548|    767|#define	ARCHIVE_ENTRY_ACL_USER		10001	/* Specified user. */
  ------------------
 1674|  1.44k|					else
 1675|  1.44k|						tag = ARCHIVE_ENTRY_ACL_GROUP;
  ------------------
  |  |  550|  1.44k|#define	ARCHIVE_ENTRY_ACL_GROUP		10003	/* Specified group. */
  ------------------
 1676|  2.20k|				}
 1677|  2.47k|				break;
 1678|  9.97k|			default:
  ------------------
  |  Branch (1678:4): [True: 9.97k, False: 3.91k]
  ------------------
 1679|       |				/* Invalid tag, skip entry */
 1680|  9.97k|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|  9.97k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1681|  9.97k|				continue;
 1682|  13.8k|			}
 1683|       |
 1684|       |			/*
 1685|       |			 * Without "default:" we expect mode in field 3
 1686|       |			 * Exception: Solaris other and mask fields
 1687|       |			 */
 1688|  3.87k|			if (permset == 0 && !ismode(field[n + 2 - sol].start,
  ------------------
  |  Branch (1688:8): [True: 3.61k, False: 261]
  |  Branch (1688:24): [True: 1.90k, False: 1.70k]
  ------------------
 1689|  3.61k|			    field[n + 2 - sol].end, &permset)) {
 1690|       |				/* Invalid mode, skip entry */
 1691|  1.90k|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|  1.90k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1692|  1.90k|				continue;
 1693|  1.90k|			}
 1694|  3.93k|		} else {
 1695|       |			/* NFS4 ACLs */
 1696|  3.93k|			s = field[0].start;
 1697|  3.93k|			len = field[0].end - field[0].start;
 1698|  3.93k|			tag = 0;
 1699|       |
 1700|  3.93k|			switch (len) {
 1701|    256|			case 4:
  ------------------
  |  Branch (1701:4): [True: 256, False: 3.67k]
  ------------------
 1702|    256|				if (memcmp(s, "user", 4) == 0)
  ------------------
  |  Branch (1702:9): [True: 0, False: 256]
  ------------------
 1703|      0|					tag = ARCHIVE_ENTRY_ACL_USER;
  ------------------
  |  |  548|      0|#define	ARCHIVE_ENTRY_ACL_USER		10001	/* Specified user. */
  ------------------
 1704|    256|				break;
 1705|    490|			case 5:
  ------------------
  |  Branch (1705:4): [True: 490, False: 3.44k]
  ------------------
 1706|    490|				if (memcmp(s, "group", 5) == 0)
  ------------------
  |  Branch (1706:9): [True: 175, False: 315]
  ------------------
 1707|    175|					tag = ARCHIVE_ENTRY_ACL_GROUP;
  ------------------
  |  |  550|    175|#define	ARCHIVE_ENTRY_ACL_GROUP		10003	/* Specified group. */
  ------------------
 1708|    490|				break;
 1709|    612|			case 6:
  ------------------
  |  Branch (1709:4): [True: 612, False: 3.32k]
  ------------------
 1710|    612|				if (memcmp(s, "owner@", 6) == 0)
  ------------------
  |  Branch (1710:9): [True: 55, False: 557]
  ------------------
 1711|     55|					tag = ARCHIVE_ENTRY_ACL_USER_OBJ;
  ------------------
  |  |  549|     55|#define	ARCHIVE_ENTRY_ACL_USER_OBJ 	10002	/* User who owns the file. */
  ------------------
 1712|    557|				else if (memcmp(s, "group@", 6) == 0)
  ------------------
  |  Branch (1712:14): [True: 300, False: 257]
  ------------------
 1713|    300|					tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ;
  ------------------
  |  |  551|    300|#define	ARCHIVE_ENTRY_ACL_GROUP_OBJ	10004	/* Group who owns the file. */
  ------------------
 1714|    612|				break;
 1715|    419|			case 9:
  ------------------
  |  Branch (1715:4): [True: 419, False: 3.51k]
  ------------------
 1716|    419|				if (memcmp(s, "everyone@", 9) == 0)
  ------------------
  |  Branch (1716:9): [True: 44, False: 375]
  ------------------
 1717|     44|					tag = ARCHIVE_ENTRY_ACL_EVERYONE;
  ------------------
  |  |  554|     44|#define	ARCHIVE_ENTRY_ACL_EVERYONE	10107   /* Everyone (NFS4 only) */
  ------------------
 1718|    419|				break;
 1719|  2.15k|			default:
  ------------------
  |  Branch (1719:4): [True: 2.15k, False: 1.77k]
  ------------------
 1720|  2.15k|				break;
 1721|  3.93k|			}
 1722|       |
 1723|  3.93k|			if (tag == 0) {
  ------------------
  |  Branch (1723:8): [True: 3.36k, False: 574]
  ------------------
 1724|       |				/* Invalid tag, skip entry */
 1725|  3.36k|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|  3.36k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1726|  3.36k|				continue;
 1727|  3.36k|			} else if (tag == ARCHIVE_ENTRY_ACL_USER ||
  ------------------
  |  |  548|  1.14k|#define	ARCHIVE_ENTRY_ACL_USER		10001	/* Specified user. */
  ------------------
  |  Branch (1727:15): [True: 0, False: 574]
  ------------------
 1728|    574|			    tag == ARCHIVE_ENTRY_ACL_GROUP) {
  ------------------
  |  |  550|    574|#define	ARCHIVE_ENTRY_ACL_GROUP		10003	/* Specified group. */
  ------------------
  |  Branch (1728:8): [True: 175, False: 399]
  ------------------
 1729|    175|				n = 1;
 1730|    175|				name = field[1];
 1731|    175|				if (isint(name.start, name.end, &id) < 0) {
  ------------------
  |  Branch (1731:9): [True: 0, False: 175]
  ------------------
 1732|      0|					ret = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1733|      0|					continue;
 1734|      0|				}
 1735|    175|			} else
 1736|    399|				n = 0;
 1737|       |
 1738|    574|			if (!is_nfs4_perms(field[1 + n].start,
  ------------------
  |  Branch (1738:8): [True: 46, False: 528]
  ------------------
 1739|    574|			    field[1 + n].end, &permset)) {
 1740|       |				/* Invalid NFSv4 perms, skip entry */
 1741|     46|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|     46|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1742|     46|				continue;
 1743|     46|			}
 1744|    528|			if (!is_nfs4_flags(field[2 + n].start,
  ------------------
  |  Branch (1744:8): [True: 209, False: 319]
  ------------------
 1745|    528|			    field[2 + n].end, &permset)) {
 1746|       |				/* Invalid NFSv4 flags, skip entry */
 1747|    209|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|    209|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1748|    209|				continue;
 1749|    209|			}
 1750|    319|			s = field[3 + n].start;
 1751|    319|			len = field[3 + n].end - field[3 + n].start;
 1752|    319|			type = 0;
 1753|    319|			if (len == 4) {
  ------------------
  |  Branch (1753:8): [True: 134, False: 185]
  ------------------
 1754|    134|				if (memcmp(s, "deny", 4) == 0)
  ------------------
  |  Branch (1754:9): [True: 60, False: 74]
  ------------------
 1755|     60|					type = ARCHIVE_ENTRY_ACL_TYPE_DENY;
  ------------------
  |  |  537|     60|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  ------------------
 1756|    185|			} else if (len == 5) {
  ------------------
  |  Branch (1756:15): [True: 105, False: 80]
  ------------------
 1757|    105|				if (memcmp(s, "allow", 5) == 0)
  ------------------
  |  Branch (1757:9): [True: 76, False: 29]
  ------------------
 1758|     76|					type = ARCHIVE_ENTRY_ACL_TYPE_ALLOW;
  ------------------
  |  |  536|     76|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  ------------------
 1759|     29|				else if (memcmp(s, "audit", 5) == 0)
  ------------------
  |  Branch (1759:14): [True: 21, False: 8]
  ------------------
 1760|     21|					type = ARCHIVE_ENTRY_ACL_TYPE_AUDIT;
  ------------------
  |  |  538|     21|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  ------------------
 1761|      8|				else if (memcmp(s, "alarm", 5) == 0)
  ------------------
  |  Branch (1761:14): [True: 0, False: 8]
  ------------------
 1762|      0|					type = ARCHIVE_ENTRY_ACL_TYPE_ALARM;
  ------------------
  |  |  539|      0|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  ------------------
 1763|    105|			}
 1764|    319|			if (type == 0) {
  ------------------
  |  Branch (1764:8): [True: 162, False: 157]
  ------------------
 1765|       |				/* Invalid entry type, skip entry */
 1766|    162|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|    162|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1767|    162|				continue;
 1768|    162|			}
 1769|    157|			if (isint(field[4 + n].start, field[4 + n].end,
  ------------------
  |  Branch (1769:8): [True: 0, False: 157]
  ------------------
 1770|    157|			    &id) < 0) {
 1771|      0|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1772|      0|				continue;
 1773|      0|			}
 1774|    157|		}
 1775|       |
 1776|       |		/* Add entry to the internal list. */
 1777|  2.12k|		r = archive_acl_add_entry_len_l(acl, type, permset,
 1778|  2.12k|		    tag, id, name.start, name.end - name.start, sc);
 1779|  2.12k|		if (r < ARCHIVE_WARN)
  ------------------
  |  |  235|  2.12k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (1779:7): [True: 0, False: 2.12k]
  ------------------
 1780|      0|			return (r);
 1781|  2.12k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  2.12k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1781:7): [True: 1.16k, False: 958]
  ------------------
 1782|  1.16k|			ret = ARCHIVE_WARN;
  ------------------
  |  |  235|  1.16k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1783|  2.12k|		types |= type;
 1784|  2.12k|	}
 1785|       |
 1786|       |	/* Reset ACL */
 1787|    116|	archive_acl_reset(acl, types);
 1788|       |
 1789|    116|	return (ret);
 1790|    116|}
archive_acl.c:acl_special:
  240|  2.12k|{
  241|  2.12k|	if (type == ARCHIVE_ENTRY_ACL_TYPE_ACCESS
  ------------------
  |  |  534|  4.25k|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  ------------------
  |  Branch (241:6): [True: 1.80k, False: 324]
  ------------------
  242|  1.80k|	    && ((permset & ~007) == 0)) {
  ------------------
  |  Branch (242:9): [True: 1.80k, False: 0]
  ------------------
  243|  1.80k|		switch (tag) {
  ------------------
  |  Branch (243:11): [True: 367, False: 1.43k]
  ------------------
  244|      0|		case ARCHIVE_ENTRY_ACL_USER_OBJ:
  ------------------
  |  |  549|      0|#define	ARCHIVE_ENTRY_ACL_USER_OBJ 	10002	/* User who owns the file. */
  ------------------
  |  Branch (244:3): [True: 0, False: 1.80k]
  ------------------
  245|      0|			acl->mode &= ~0700;
  246|      0|			acl->mode |= (permset & 7) << 6;
  247|      0|			return (0);
  248|     12|		case ARCHIVE_ENTRY_ACL_GROUP_OBJ:
  ------------------
  |  |  551|     12|#define	ARCHIVE_ENTRY_ACL_GROUP_OBJ	10004	/* Group who owns the file. */
  ------------------
  |  Branch (248:3): [True: 12, False: 1.78k]
  ------------------
  249|     12|			acl->mode &= ~0070;
  250|     12|			acl->mode |= (permset & 7) << 3;
  251|     12|			return (0);
  252|    355|		case ARCHIVE_ENTRY_ACL_OTHER:
  ------------------
  |  |  553|    355|#define	ARCHIVE_ENTRY_ACL_OTHER		10006	/* Public (POSIX.1e only) */
  ------------------
  |  Branch (252:3): [True: 355, False: 1.44k]
  ------------------
  253|    355|			acl->mode &= ~0007;
  254|    355|			acl->mode |= permset & 7;
  255|    355|			return (0);
  256|  1.80k|		}
  257|  1.80k|	}
  258|  1.75k|	return (1);
  259|  2.12k|}
archive_acl.c:acl_new_entry:
  268|  1.75k|{
  269|  1.75k|	struct archive_acl_entry *ap, *aq;
  270|       |
  271|       |	/* Reject an invalid type */
  272|  1.75k|	switch (type) {
  273|  1.43k|	case ARCHIVE_ENTRY_ACL_TYPE_ACCESS:
  ------------------
  |  |  534|  1.43k|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  ------------------
  |  Branch (273:2): [True: 1.43k, False: 324]
  ------------------
  274|  1.60k|	case ARCHIVE_ENTRY_ACL_TYPE_DEFAULT:
  ------------------
  |  |  535|  1.60k|#define	ARCHIVE_ENTRY_ACL_TYPE_DEFAULT	0x00000200  /* POSIX.1e only */
  ------------------
  |  Branch (274:2): [True: 167, False: 1.59k]
  ------------------
  275|  1.67k|	case ARCHIVE_ENTRY_ACL_TYPE_ALLOW:
  ------------------
  |  |  536|  1.67k|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  ------------------
  |  Branch (275:2): [True: 76, False: 1.68k]
  ------------------
  276|  1.73k|	case ARCHIVE_ENTRY_ACL_TYPE_DENY:
  ------------------
  |  |  537|  1.73k|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  ------------------
  |  Branch (276:2): [True: 60, False: 1.69k]
  ------------------
  277|  1.75k|	case ARCHIVE_ENTRY_ACL_TYPE_AUDIT:
  ------------------
  |  |  538|  1.75k|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  ------------------
  |  Branch (277:2): [True: 21, False: 1.73k]
  ------------------
  278|  1.75k|	case ARCHIVE_ENTRY_ACL_TYPE_ALARM:
  ------------------
  |  |  539|  1.75k|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  ------------------
  |  Branch (278:2): [True: 0, False: 1.75k]
  ------------------
  279|  1.75k|		break;
  280|      0|	default:
  ------------------
  |  Branch (280:2): [True: 0, False: 1.75k]
  ------------------
  281|      0|		return (NULL);
  282|  1.75k|	}
  283|       |
  284|       |	/* Type argument must be a valid NFS4 or POSIX.1e type.
  285|       |	 * The type must agree with anything already set and
  286|       |	 * the permset must be compatible. */
  287|  1.75k|	if (type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
  ------------------
  |  |  542|  1.75k|#define	ARCHIVE_ENTRY_ACL_TYPE_NFS4	(ARCHIVE_ENTRY_ACL_TYPE_ALLOW \
  |  |  ------------------
  |  |  |  |  536|  1.75k|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  |  |  ------------------
  |  |  543|  1.75k|	    | ARCHIVE_ENTRY_ACL_TYPE_DENY \
  |  |  ------------------
  |  |  |  |  537|  1.75k|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  |  |  ------------------
  |  |  544|  1.75k|	    | ARCHIVE_ENTRY_ACL_TYPE_AUDIT \
  |  |  ------------------
  |  |  |  |  538|  1.75k|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  |  |  ------------------
  |  |  545|  1.75k|	    | ARCHIVE_ENTRY_ACL_TYPE_ALARM)
  |  |  ------------------
  |  |  |  |  539|  1.75k|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  |  |  ------------------
  ------------------
  |  Branch (287:6): [True: 157, False: 1.60k]
  ------------------
  288|    157|		if (acl->acl_types & ~ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
  ------------------
  |  |  542|    157|#define	ARCHIVE_ENTRY_ACL_TYPE_NFS4	(ARCHIVE_ENTRY_ACL_TYPE_ALLOW \
  |  |  ------------------
  |  |  |  |  536|    157|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  |  |  ------------------
  |  |  543|    157|	    | ARCHIVE_ENTRY_ACL_TYPE_DENY \
  |  |  ------------------
  |  |  |  |  537|    157|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  |  |  ------------------
  |  |  544|    157|	    | ARCHIVE_ENTRY_ACL_TYPE_AUDIT \
  |  |  ------------------
  |  |  |  |  538|    157|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  |  |  ------------------
  |  |  545|    157|	    | ARCHIVE_ENTRY_ACL_TYPE_ALARM)
  |  |  ------------------
  |  |  |  |  539|    157|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  |  |  ------------------
  ------------------
  |  Branch (288:7): [True: 0, False: 157]
  ------------------
  289|      0|			return (NULL);
  290|      0|		}
  291|    157|		if (permset &
  ------------------
  |  Branch (291:7): [True: 0, False: 157]
  ------------------
  292|    157|		    ~(ARCHIVE_ENTRY_ACL_PERMS_NFS4
  ------------------
  |  |  495|    157|	(ARCHIVE_ENTRY_ACL_EXECUTE			\
  |  |  ------------------
  |  |  |  |  469|    157|#define	ARCHIVE_ENTRY_ACL_EXECUTE             0x00000001
  |  |  ------------------
  |  |  496|    157|	    | ARCHIVE_ENTRY_ACL_READ_DATA		\
  |  |  ------------------
  |  |  |  |  472|    157|#define	ARCHIVE_ENTRY_ACL_READ_DATA           0x00000008
  |  |  ------------------
  |  |  497|    157|	    | ARCHIVE_ENTRY_ACL_LIST_DIRECTORY 		\
  |  |  ------------------
  |  |  |  |  473|    157|#define	ARCHIVE_ENTRY_ACL_LIST_DIRECTORY      0x00000008
  |  |  ------------------
  |  |  498|    157|	    | ARCHIVE_ENTRY_ACL_WRITE_DATA		\
  |  |  ------------------
  |  |  |  |  474|    157|#define	ARCHIVE_ENTRY_ACL_WRITE_DATA          0x00000010
  |  |  ------------------
  |  |  499|    157|	    | ARCHIVE_ENTRY_ACL_ADD_FILE		\
  |  |  ------------------
  |  |  |  |  475|    157|#define	ARCHIVE_ENTRY_ACL_ADD_FILE            0x00000010
  |  |  ------------------
  |  |  500|    157|	    | ARCHIVE_ENTRY_ACL_APPEND_DATA		\
  |  |  ------------------
  |  |  |  |  476|    157|#define	ARCHIVE_ENTRY_ACL_APPEND_DATA         0x00000020
  |  |  ------------------
  |  |  501|    157|	    | ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY	\
  |  |  ------------------
  |  |  |  |  477|    157|#define	ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY    0x00000020
  |  |  ------------------
  |  |  502|    157|	    | ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS	\
  |  |  ------------------
  |  |  |  |  478|    157|#define	ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS    0x00000040
  |  |  ------------------
  |  |  503|    157|	    | ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS	\
  |  |  ------------------
  |  |  |  |  479|    157|#define	ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS   0x00000080
  |  |  ------------------
  |  |  504|    157|	    | ARCHIVE_ENTRY_ACL_DELETE_CHILD		\
  |  |  ------------------
  |  |  |  |  480|    157|#define	ARCHIVE_ENTRY_ACL_DELETE_CHILD        0x00000100
  |  |  ------------------
  |  |  505|    157|	    | ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES		\
  |  |  ------------------
  |  |  |  |  481|    157|#define	ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES     0x00000200
  |  |  ------------------
  |  |  506|    157|	    | ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES	\
  |  |  ------------------
  |  |  |  |  482|    157|#define	ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES    0x00000400
  |  |  ------------------
  |  |  507|    157|	    | ARCHIVE_ENTRY_ACL_DELETE			\
  |  |  ------------------
  |  |  |  |  483|    157|#define	ARCHIVE_ENTRY_ACL_DELETE              0x00000800
  |  |  ------------------
  |  |  508|    157|	    | ARCHIVE_ENTRY_ACL_READ_ACL		\
  |  |  ------------------
  |  |  |  |  484|    157|#define	ARCHIVE_ENTRY_ACL_READ_ACL            0x00001000
  |  |  ------------------
  |  |  509|    157|	    | ARCHIVE_ENTRY_ACL_WRITE_ACL		\
  |  |  ------------------
  |  |  |  |  485|    157|#define	ARCHIVE_ENTRY_ACL_WRITE_ACL           0x00002000
  |  |  ------------------
  |  |  510|    157|	    | ARCHIVE_ENTRY_ACL_WRITE_OWNER		\
  |  |  ------------------
  |  |  |  |  486|    157|#define	ARCHIVE_ENTRY_ACL_WRITE_OWNER         0x00004000
  |  |  ------------------
  |  |  511|    157|	    | ARCHIVE_ENTRY_ACL_SYNCHRONIZE)
  |  |  ------------------
  |  |  |  |  487|    157|#define	ARCHIVE_ENTRY_ACL_SYNCHRONIZE         0x00008000
  |  |  ------------------
  ------------------
  293|    157|			| ARCHIVE_ENTRY_ACL_INHERITANCE_NFS4)) {
  ------------------
  |  |  525|    157|	(ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT			\
  |  |  ------------------
  |  |  |  |  517|    157|#define	ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT                0x02000000
  |  |  ------------------
  |  |  526|    157|	    | ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT		\
  |  |  ------------------
  |  |  |  |  518|    157|#define	ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT           0x04000000
  |  |  ------------------
  |  |  527|    157|	    | ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT	\
  |  |  ------------------
  |  |  |  |  519|    157|#define	ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT        0x08000000
  |  |  ------------------
  |  |  528|    157|	    | ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY		\
  |  |  ------------------
  |  |  |  |  520|    157|#define	ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY                0x10000000
  |  |  ------------------
  |  |  529|    157|	    | ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS		\
  |  |  ------------------
  |  |  |  |  521|    157|#define	ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS           0x20000000
  |  |  ------------------
  |  |  530|    157|	    | ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS		\
  |  |  ------------------
  |  |  |  |  522|    157|#define	ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS               0x40000000
  |  |  ------------------
  |  |  531|    157|	    | ARCHIVE_ENTRY_ACL_ENTRY_INHERITED)
  |  |  ------------------
  |  |  |  |  516|    157|#define	ARCHIVE_ENTRY_ACL_ENTRY_INHERITED                   0x01000000
  |  |  ------------------
  ------------------
  294|      0|			return (NULL);
  295|      0|		}
  296|  1.60k|	} else	if (type & ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) {
  ------------------
  |  |  540|  1.60k|#define	ARCHIVE_ENTRY_ACL_TYPE_POSIX1E	(ARCHIVE_ENTRY_ACL_TYPE_ACCESS \
  |  |  ------------------
  |  |  |  |  534|  1.60k|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  |  |  ------------------
  |  |  541|  1.60k|	    | ARCHIVE_ENTRY_ACL_TYPE_DEFAULT)
  |  |  ------------------
  |  |  |  |  535|  1.60k|#define	ARCHIVE_ENTRY_ACL_TYPE_DEFAULT	0x00000200  /* POSIX.1e only */
  |  |  ------------------
  ------------------
  |  Branch (296:13): [True: 1.60k, False: 0]
  ------------------
  297|  1.60k|		if (acl->acl_types & ~ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) {
  ------------------
  |  |  540|  1.60k|#define	ARCHIVE_ENTRY_ACL_TYPE_POSIX1E	(ARCHIVE_ENTRY_ACL_TYPE_ACCESS \
  |  |  ------------------
  |  |  |  |  534|  1.60k|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  |  |  ------------------
  |  |  541|  1.60k|	    | ARCHIVE_ENTRY_ACL_TYPE_DEFAULT)
  |  |  ------------------
  |  |  |  |  535|  1.60k|#define	ARCHIVE_ENTRY_ACL_TYPE_DEFAULT	0x00000200  /* POSIX.1e only */
  |  |  ------------------
  ------------------
  |  Branch (297:7): [True: 0, False: 1.60k]
  ------------------
  298|      0|			return (NULL);
  299|      0|		}
  300|  1.60k|		if (permset & ~ARCHIVE_ENTRY_ACL_PERMS_POSIX1E) {
  ------------------
  |  |  490|  1.60k|	(ARCHIVE_ENTRY_ACL_EXECUTE			\
  |  |  ------------------
  |  |  |  |  469|  1.60k|#define	ARCHIVE_ENTRY_ACL_EXECUTE             0x00000001
  |  |  ------------------
  |  |  491|  1.60k|	    | ARCHIVE_ENTRY_ACL_WRITE			\
  |  |  ------------------
  |  |  |  |  470|  1.60k|#define	ARCHIVE_ENTRY_ACL_WRITE               0x00000002
  |  |  ------------------
  |  |  492|  1.60k|	    | ARCHIVE_ENTRY_ACL_READ)
  |  |  ------------------
  |  |  |  |  471|  1.60k|#define	ARCHIVE_ENTRY_ACL_READ                0x00000004
  |  |  ------------------
  ------------------
  |  Branch (300:7): [True: 0, False: 1.60k]
  ------------------
  301|      0|			return (NULL);
  302|      0|		}
  303|  1.60k|	} else {
  304|      0|		return (NULL);
  305|      0|	}
  306|       |
  307|       |	/* Verify the tag is valid and compatible with NFS4 or POSIX.1e. */
  308|  1.75k|	switch (tag) {
  309|    300|	case ARCHIVE_ENTRY_ACL_USER:
  ------------------
  |  |  548|    300|#define	ARCHIVE_ENTRY_ACL_USER		10001	/* Specified user. */
  ------------------
  |  Branch (309:2): [True: 300, False: 1.45k]
  ------------------
  310|    321|	case ARCHIVE_ENTRY_ACL_USER_OBJ:
  ------------------
  |  |  549|    321|#define	ARCHIVE_ENTRY_ACL_USER_OBJ 	10002	/* User who owns the file. */
  ------------------
  |  Branch (310:2): [True: 21, False: 1.73k]
  ------------------
  311|  1.48k|	case ARCHIVE_ENTRY_ACL_GROUP:
  ------------------
  |  |  550|  1.48k|#define	ARCHIVE_ENTRY_ACL_GROUP		10003	/* Specified group. */
  ------------------
  |  Branch (311:2): [True: 1.16k, False: 591]
  ------------------
  312|  1.56k|	case ARCHIVE_ENTRY_ACL_GROUP_OBJ:
  ------------------
  |  |  551|  1.56k|#define	ARCHIVE_ENTRY_ACL_GROUP_OBJ	10004	/* Group who owns the file. */
  ------------------
  |  Branch (312:2): [True: 76, False: 1.68k]
  ------------------
  313|       |		/* Tags valid in both NFS4 and POSIX.1e */
  314|  1.56k|		break;
  315|    118|	case ARCHIVE_ENTRY_ACL_MASK:
  ------------------
  |  |  552|    118|#define	ARCHIVE_ENTRY_ACL_MASK		10005	/* Modify group access (POSIX.1e only) */
  ------------------
  |  Branch (315:2): [True: 118, False: 1.64k]
  ------------------
  316|    194|	case ARCHIVE_ENTRY_ACL_OTHER:
  ------------------
  |  |  553|    194|#define	ARCHIVE_ENTRY_ACL_OTHER		10006	/* Public (POSIX.1e only) */
  ------------------
  |  Branch (316:2): [True: 76, False: 1.68k]
  ------------------
  317|       |		/* Tags valid only in POSIX.1e. */
  318|    194|		if (type & ~ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) {
  ------------------
  |  |  540|    194|#define	ARCHIVE_ENTRY_ACL_TYPE_POSIX1E	(ARCHIVE_ENTRY_ACL_TYPE_ACCESS \
  |  |  ------------------
  |  |  |  |  534|    194|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  |  |  ------------------
  |  |  541|    194|	    | ARCHIVE_ENTRY_ACL_TYPE_DEFAULT)
  |  |  ------------------
  |  |  |  |  535|    194|#define	ARCHIVE_ENTRY_ACL_TYPE_DEFAULT	0x00000200  /* POSIX.1e only */
  |  |  ------------------
  ------------------
  |  Branch (318:7): [True: 0, False: 194]
  ------------------
  319|      0|			return (NULL);
  320|      0|		}
  321|    194|		break;
  322|    194|	case ARCHIVE_ENTRY_ACL_EVERYONE:
  ------------------
  |  |  554|      0|#define	ARCHIVE_ENTRY_ACL_EVERYONE	10107   /* Everyone (NFS4 only) */
  ------------------
  |  Branch (322:2): [True: 0, False: 1.75k]
  ------------------
  323|       |		/* Tags valid only in NFS4. */
  324|      0|		if (type & ~ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
  ------------------
  |  |  542|      0|#define	ARCHIVE_ENTRY_ACL_TYPE_NFS4	(ARCHIVE_ENTRY_ACL_TYPE_ALLOW \
  |  |  ------------------
  |  |  |  |  536|      0|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  |  |  ------------------
  |  |  543|      0|	    | ARCHIVE_ENTRY_ACL_TYPE_DENY \
  |  |  ------------------
  |  |  |  |  537|      0|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  |  |  ------------------
  |  |  544|      0|	    | ARCHIVE_ENTRY_ACL_TYPE_AUDIT \
  |  |  ------------------
  |  |  |  |  538|      0|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  |  |  ------------------
  |  |  545|      0|	    | ARCHIVE_ENTRY_ACL_TYPE_ALARM)
  |  |  ------------------
  |  |  |  |  539|      0|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  |  |  ------------------
  ------------------
  |  Branch (324:7): [True: 0, False: 0]
  ------------------
  325|      0|			return (NULL);
  326|      0|		}
  327|      0|		break;
  328|      0|	default:
  ------------------
  |  Branch (328:2): [True: 0, False: 1.75k]
  ------------------
  329|       |		/* No other values are valid. */
  330|      0|		return (NULL);
  331|  1.75k|	}
  332|       |
  333|  1.75k|	free(acl->acl_text_w);
  334|  1.75k|	acl->acl_text_w = NULL;
  335|  1.75k|	free(acl->acl_text);
  336|  1.75k|	acl->acl_text = NULL;
  337|       |
  338|       |	/*
  339|       |	 * If there's a matching entry already in the list, overwrite it.
  340|       |	 * NFSv4 entries may be repeated and are not overwritten.
  341|       |	 *
  342|       |	 * TODO: compare names of no id is provided (needs more rework)
  343|       |	 */
  344|  1.75k|	ap = acl->acl_head;
  345|  1.75k|	aq = NULL;
  346|  16.8k|	while (ap != NULL) {
  ------------------
  |  Branch (346:9): [True: 15.8k, False: 917]
  ------------------
  347|  15.8k|		if (((type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) == 0) &&
  ------------------
  |  |  542|  15.8k|#define	ARCHIVE_ENTRY_ACL_TYPE_NFS4	(ARCHIVE_ENTRY_ACL_TYPE_ALLOW \
  |  |  ------------------
  |  |  |  |  536|  15.8k|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  |  |  ------------------
  |  |  543|  15.8k|	    | ARCHIVE_ENTRY_ACL_TYPE_DENY \
  |  |  ------------------
  |  |  |  |  537|  15.8k|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  |  |  ------------------
  |  |  544|  15.8k|	    | ARCHIVE_ENTRY_ACL_TYPE_AUDIT \
  |  |  ------------------
  |  |  |  |  538|  15.8k|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  |  |  ------------------
  |  |  545|  15.8k|	    | ARCHIVE_ENTRY_ACL_TYPE_ALARM)
  |  |  ------------------
  |  |  |  |  539|  15.8k|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  |  |  ------------------
  ------------------
  |  Branch (347:7): [True: 14.5k, False: 1.33k]
  ------------------
  348|  14.5k|		    ap->type == type && ap->tag == tag && ap->id == id) {
  ------------------
  |  Branch (348:7): [True: 12.4k, False: 2.05k]
  |  Branch (348:27): [True: 10.4k, False: 2.09k]
  |  Branch (348:45): [True: 9.21k, False: 1.19k]
  ------------------
  349|  9.21k|			if (id != -1 || (tag != ARCHIVE_ENTRY_ACL_USER &&
  ------------------
  |  |  548|  17.0k|#define	ARCHIVE_ENTRY_ACL_USER		10001	/* Specified user. */
  ------------------
  |  Branch (349:8): [True: 676, False: 8.53k]
  |  Branch (349:21): [True: 6.11k, False: 2.42k]
  ------------------
  350|  6.11k|			    tag != ARCHIVE_ENTRY_ACL_GROUP)) {
  ------------------
  |  |  550|  6.11k|#define	ARCHIVE_ENTRY_ACL_GROUP		10003	/* Specified group. */
  ------------------
  |  Branch (350:8): [True: 165, False: 5.95k]
  ------------------
  351|    841|				ap->permset = permset;
  352|    841|				return (ap);
  353|    841|			}
  354|  9.21k|		}
  355|  15.0k|		aq = ap;
  356|  15.0k|		ap = ap->next;
  357|  15.0k|	}
  358|       |
  359|       |	/* Add a new entry to the end of the list. */
  360|    917|	ap = calloc(1, sizeof(*ap));
  361|    917|	if (ap == NULL)
  ------------------
  |  Branch (361:6): [True: 0, False: 917]
  ------------------
  362|      0|		return (NULL);
  363|    917|	if (aq == NULL)
  ------------------
  |  Branch (363:6): [True: 64, False: 853]
  ------------------
  364|     64|		acl->acl_head = ap;
  365|    853|	else
  366|    853|		aq->next = ap;
  367|    917|	ap->type = type;
  368|    917|	ap->tag = tag;
  369|    917|	ap->id = id;
  370|    917|	ap->permset = permset;
  371|    917|	acl->acl_types |= type;
  372|    917|	return (ap);
  373|    917|}
archive_acl.c:archive_acl_add_entry_len_l:
  209|  2.12k|{
  210|  2.12k|	struct archive_acl_entry *ap;
  211|  2.12k|	int r;
  212|       |
  213|  2.12k|	if (acl_special(acl, type, permset, tag) == 0)
  ------------------
  |  Branch (213:6): [True: 367, False: 1.75k]
  ------------------
  214|    367|		return ARCHIVE_OK;
  ------------------
  |  |  233|    367|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  215|  1.75k|	ap = acl_new_entry(acl, type, permset, tag, id);
  216|  1.75k|	if (ap == NULL) {
  ------------------
  |  Branch (216:6): [True: 0, False: 1.75k]
  ------------------
  217|       |		/* XXX Error XXX */
  218|      0|		return ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  219|      0|	}
  220|  1.75k|	if (name != NULL  &&  *name != '\0' && len > 0) {
  ------------------
  |  Branch (220:6): [True: 1.46k, False: 291]
  |  Branch (220:24): [True: 1.46k, False: 0]
  |  Branch (220:41): [True: 1.40k, False: 60]
  ------------------
  221|  1.40k|		r = archive_mstring_copy_mbs_len_l(&ap->name, name, len, sc);
  222|  1.40k|	} else {
  223|    351|		r = 0;
  224|    351|		archive_mstring_clean(&ap->name);
  225|    351|	}
  226|  1.75k|	if (r == 0)
  ------------------
  |  Branch (226:6): [True: 591, False: 1.16k]
  ------------------
  227|    591|		return (ARCHIVE_OK);
  ------------------
  |  |  233|    591|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  228|  1.16k|	else if (errno == ENOMEM)
  ------------------
  |  Branch (228:11): [True: 0, False: 1.16k]
  ------------------
  229|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  230|  1.16k|	else
  231|  1.16k|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|  1.16k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  232|  1.75k|}
archive_acl.c:isint:
 1799|  17.9k|{
 1800|  17.9k|	int n = 0;
 1801|  17.9k|	if (start >= end)
  ------------------
  |  Branch (1801:6): [True: 11.7k, False: 6.18k]
  ------------------
 1802|  11.7k|		return (0);
 1803|  8.12k|	while (start < end) {
  ------------------
  |  Branch (1803:9): [True: 7.16k, False: 958]
  ------------------
 1804|  7.16k|		if (*start < '0' || *start > '9')
  ------------------
  |  Branch (1804:7): [True: 3.99k, False: 3.16k]
  |  Branch (1804:23): [True: 1.21k, False: 1.95k]
  ------------------
 1805|  5.21k|			return (0);
 1806|  1.95k|		if (n > (INT_MAX / 10) ||
  ------------------
  |  Branch (1806:7): [True: 6, False: 1.94k]
  ------------------
 1807|  1.94k|		    (n == INT_MAX / 10 && (*start - '0') >= INT_MAX % 10)) {
  ------------------
  |  Branch (1807:8): [True: 8, False: 1.94k]
  |  Branch (1807:29): [True: 8, False: 0]
  ------------------
 1808|     14|			return (-1);
 1809|  1.94k|		} else {
 1810|  1.94k|			n *= 10;
 1811|  1.94k|			n += *start - '0';
 1812|  1.94k|		}
 1813|  1.94k|		start++;
 1814|  1.94k|	}
 1815|    958|	*result = n;
 1816|    958|	return (1);
 1817|  6.18k|}
archive_acl.c:ismode:
 1826|  4.33k|{
 1827|  4.33k|	const char *p;
 1828|       |
 1829|  4.33k|	if (start >= end)
  ------------------
  |  Branch (1829:6): [True: 1.56k, False: 2.77k]
  ------------------
 1830|  1.56k|		return (0);
 1831|  2.77k|	p = start;
 1832|  2.77k|	*permset = 0;
 1833|  7.90k|	while (p < end) {
  ------------------
  |  Branch (1833:9): [True: 5.91k, False: 1.99k]
  ------------------
 1834|  5.91k|		switch (*p++) {
 1835|  1.45k|		case 'r': case 'R':
  ------------------
  |  Branch (1835:3): [True: 1.24k, False: 4.67k]
  |  Branch (1835:13): [True: 214, False: 5.69k]
  ------------------
 1836|  1.45k|			*permset |= ARCHIVE_ENTRY_ACL_READ;
  ------------------
  |  |  471|  1.45k|#define	ARCHIVE_ENTRY_ACL_READ                0x00000004
  ------------------
 1837|  1.45k|			break;
 1838|      0|		case 'w': case 'W':
  ------------------
  |  Branch (1838:3): [True: 0, False: 5.91k]
  |  Branch (1838:13): [True: 0, False: 5.91k]
  ------------------
 1839|      0|			*permset |= ARCHIVE_ENTRY_ACL_WRITE;
  ------------------
  |  |  470|      0|#define	ARCHIVE_ENTRY_ACL_WRITE               0x00000002
  ------------------
 1840|      0|			break;
 1841|      0|		case 'x': case 'X':
  ------------------
  |  Branch (1841:3): [True: 0, False: 5.91k]
  |  Branch (1841:13): [True: 0, False: 5.91k]
  ------------------
 1842|      0|			*permset |= ARCHIVE_ENTRY_ACL_EXECUTE;
  ------------------
  |  |  469|      0|#define	ARCHIVE_ENTRY_ACL_EXECUTE             0x00000001
  ------------------
 1843|      0|			break;
 1844|  3.67k|		case '-':
  ------------------
  |  Branch (1844:3): [True: 3.67k, False: 2.23k]
  ------------------
 1845|  3.67k|			break;
 1846|    780|		default:
  ------------------
  |  Branch (1846:3): [True: 780, False: 5.13k]
  ------------------
 1847|    780|			return (0);
 1848|  5.91k|		}
 1849|  5.91k|	}
 1850|  1.99k|	return (1);
 1851|  2.77k|}
archive_acl.c:is_nfs4_perms:
 1860|    574|{
 1861|    574|	const char *p = start;
 1862|       |
 1863|    785|	while (p < end) {
  ------------------
  |  Branch (1863:9): [True: 257, False: 528]
  ------------------
 1864|    257|		switch (*p++) {
 1865|      0|		case 'r':
  ------------------
  |  Branch (1865:3): [True: 0, False: 257]
  ------------------
 1866|      0|			*permset |= ARCHIVE_ENTRY_ACL_READ_DATA;
  ------------------
  |  |  472|      0|#define	ARCHIVE_ENTRY_ACL_READ_DATA           0x00000008
  ------------------
 1867|      0|			break;
 1868|      0|		case 'w':
  ------------------
  |  Branch (1868:3): [True: 0, False: 257]
  ------------------
 1869|      0|			*permset |= ARCHIVE_ENTRY_ACL_WRITE_DATA;
  ------------------
  |  |  474|      0|#define	ARCHIVE_ENTRY_ACL_WRITE_DATA          0x00000010
  ------------------
 1870|      0|			break;
 1871|      0|		case 'x':
  ------------------
  |  Branch (1871:3): [True: 0, False: 257]
  ------------------
 1872|      0|			*permset |= ARCHIVE_ENTRY_ACL_EXECUTE;
  ------------------
  |  |  469|      0|#define	ARCHIVE_ENTRY_ACL_EXECUTE             0x00000001
  ------------------
 1873|      0|			break;
 1874|      6|		case 'p':
  ------------------
  |  Branch (1874:3): [True: 6, False: 251]
  ------------------
 1875|      6|			*permset |= ARCHIVE_ENTRY_ACL_APPEND_DATA;
  ------------------
  |  |  476|      6|#define	ARCHIVE_ENTRY_ACL_APPEND_DATA         0x00000020
  ------------------
 1876|      6|			break;
 1877|      0|		case 'D':
  ------------------
  |  Branch (1877:3): [True: 0, False: 257]
  ------------------
 1878|      0|			*permset |= ARCHIVE_ENTRY_ACL_DELETE_CHILD;
  ------------------
  |  |  480|      0|#define	ARCHIVE_ENTRY_ACL_DELETE_CHILD        0x00000100
  ------------------
 1879|      0|			break;
 1880|      0|		case 'd':
  ------------------
  |  Branch (1880:3): [True: 0, False: 257]
  ------------------
 1881|      0|			*permset |= ARCHIVE_ENTRY_ACL_DELETE;
  ------------------
  |  |  483|      0|#define	ARCHIVE_ENTRY_ACL_DELETE              0x00000800
  ------------------
 1882|      0|			break;
 1883|    173|		case 'a':
  ------------------
  |  Branch (1883:3): [True: 173, False: 84]
  ------------------
 1884|    173|			*permset |= ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES;
  ------------------
  |  |  481|    173|#define	ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES     0x00000200
  ------------------
 1885|    173|			break;
 1886|      0|		case 'A':
  ------------------
  |  Branch (1886:3): [True: 0, False: 257]
  ------------------
 1887|      0|			*permset |= ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES;
  ------------------
  |  |  482|      0|#define	ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES    0x00000400
  ------------------
 1888|      0|			break;
 1889|      0|		case 'R':
  ------------------
  |  Branch (1889:3): [True: 0, False: 257]
  ------------------
 1890|      0|			*permset |= ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS;
  ------------------
  |  |  478|      0|#define	ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS    0x00000040
  ------------------
 1891|      0|			break;
 1892|      0|		case 'W':
  ------------------
  |  Branch (1892:3): [True: 0, False: 257]
  ------------------
 1893|      0|			*permset |= ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS;
  ------------------
  |  |  479|      0|#define	ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS   0x00000080
  ------------------
 1894|      0|			break;
 1895|      0|		case 'c':
  ------------------
  |  Branch (1895:3): [True: 0, False: 257]
  ------------------
 1896|      0|			*permset |= ARCHIVE_ENTRY_ACL_READ_ACL;
  ------------------
  |  |  484|      0|#define	ARCHIVE_ENTRY_ACL_READ_ACL            0x00001000
  ------------------
 1897|      0|			break;
 1898|     12|		case 'C':
  ------------------
  |  Branch (1898:3): [True: 12, False: 245]
  ------------------
 1899|     12|			*permset |= ARCHIVE_ENTRY_ACL_WRITE_ACL;
  ------------------
  |  |  485|     12|#define	ARCHIVE_ENTRY_ACL_WRITE_ACL           0x00002000
  ------------------
 1900|     12|			break;
 1901|      6|		case 'o':
  ------------------
  |  Branch (1901:3): [True: 6, False: 251]
  ------------------
 1902|      6|			*permset |= ARCHIVE_ENTRY_ACL_WRITE_OWNER;
  ------------------
  |  |  486|      6|#define	ARCHIVE_ENTRY_ACL_WRITE_OWNER         0x00004000
  ------------------
 1903|      6|			break;
 1904|      0|		case 's':
  ------------------
  |  Branch (1904:3): [True: 0, False: 257]
  ------------------
 1905|      0|			*permset |= ARCHIVE_ENTRY_ACL_SYNCHRONIZE;
  ------------------
  |  |  487|      0|#define	ARCHIVE_ENTRY_ACL_SYNCHRONIZE         0x00008000
  ------------------
 1906|      0|			break;
 1907|     14|		case '-':
  ------------------
  |  Branch (1907:3): [True: 14, False: 243]
  ------------------
 1908|     14|			break;
 1909|     46|		default:
  ------------------
  |  Branch (1909:3): [True: 46, False: 211]
  ------------------
 1910|     46|			return(0);
 1911|    257|		}
 1912|    257|	}
 1913|    528|	return (1);
 1914|    574|}
archive_acl.c:is_nfs4_flags:
 1923|    528|{
 1924|    528|	const char *p = start;
 1925|       |
 1926|    888|	while (p < end) {
  ------------------
  |  Branch (1926:9): [True: 569, False: 319]
  ------------------
 1927|    569|		switch(*p++) {
 1928|     42|		case 'f':
  ------------------
  |  Branch (1928:3): [True: 42, False: 527]
  ------------------
 1929|     42|			*permset |= ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT;
  ------------------
  |  |  517|     42|#define	ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT                0x02000000
  ------------------
 1930|     42|			break;
 1931|     12|		case 'd':
  ------------------
  |  Branch (1931:3): [True: 12, False: 557]
  ------------------
 1932|     12|			*permset |= ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT;
  ------------------
  |  |  518|     12|#define	ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT           0x04000000
  ------------------
 1933|     12|			break;
 1934|    189|		case 'i':
  ------------------
  |  Branch (1934:3): [True: 189, False: 380]
  ------------------
 1935|    189|			*permset |= ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY;
  ------------------
  |  |  520|    189|#define	ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY                0x10000000
  ------------------
 1936|    189|			break;
 1937|      7|		case 'n':
  ------------------
  |  Branch (1937:3): [True: 7, False: 562]
  ------------------
 1938|      7|			*permset |=
 1939|      7|			    ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT;
  ------------------
  |  |  519|      7|#define	ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT        0x08000000
  ------------------
 1940|      7|			break;
 1941|     51|		case 'S':
  ------------------
  |  Branch (1941:3): [True: 51, False: 518]
  ------------------
 1942|     51|			*permset |= ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS;
  ------------------
  |  |  521|     51|#define	ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS           0x20000000
  ------------------
 1943|     51|			break;
 1944|      8|		case 'F':
  ------------------
  |  Branch (1944:3): [True: 8, False: 561]
  ------------------
 1945|      8|			*permset |= ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS;
  ------------------
  |  |  522|      8|#define	ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS               0x40000000
  ------------------
 1946|      8|			break;
 1947|     38|		case 'I':
  ------------------
  |  Branch (1947:3): [True: 38, False: 531]
  ------------------
 1948|     38|			*permset |= ARCHIVE_ENTRY_ACL_ENTRY_INHERITED;
  ------------------
  |  |  516|     38|#define	ARCHIVE_ENTRY_ACL_ENTRY_INHERITED                   0x01000000
  ------------------
 1949|     38|			break;
 1950|     13|		case '-':
  ------------------
  |  Branch (1950:3): [True: 13, False: 556]
  ------------------
 1951|     13|			break;
 1952|    209|		default:
  ------------------
  |  Branch (1952:3): [True: 209, False: 360]
  ------------------
 1953|    209|			return (0);
 1954|    569|		}
 1955|    569|	}
 1956|    319|	return (1);
 1957|    528|}
archive_acl.c:next_field:
 1970|  36.8k|{
 1971|       |	/* Skip leading whitespace to find start of field. */
 1972|  81.7k|	while (*l > 0 && (**p == ' ' || **p == '\t' || **p == '\n')) {
  ------------------
  |  Branch (1972:9): [True: 81.6k, False: 18]
  |  Branch (1972:20): [True: 351, False: 81.3k]
  |  Branch (1972:34): [True: 631, False: 80.7k]
  |  Branch (1972:49): [True: 43.8k, False: 36.8k]
  ------------------
 1973|  44.8k|		(*p)++;
 1974|  44.8k|		(*l)--;
 1975|  44.8k|	}
 1976|  36.8k|	*start = *p;
 1977|       |
 1978|       |	/* Locate end of field, trim trailing whitespace if necessary */
 1979|   170k|	while (*l > 0 && **p != ' ' && **p != '\t' && **p != '\n' && **p != ',' && **p != ':' && **p != '#') {
  ------------------
  |  Branch (1979:9): [True: 170k, False: 95]
  |  Branch (1979:19): [True: 168k, False: 1.80k]
  |  Branch (1979:33): [True: 168k, False: 356]
  |  Branch (1979:48): [True: 150k, False: 17.6k]
  |  Branch (1979:63): [True: 149k, False: 443]
  |  Branch (1979:77): [True: 134k, False: 15.9k]
  |  Branch (1979:91): [True: 133k, False: 505]
  ------------------
 1980|   133k|		(*p)++;
 1981|   133k|		(*l)--;
 1982|   133k|	}
 1983|  36.8k|	*end = *p;
 1984|       |
 1985|       |	/* Scan for the separator. */
 1986|  62.4k|	while (*l > 0 && **p != ',' && **p != ':' && **p != '\n' && **p != '#') {
  ------------------
  |  Branch (1986:9): [True: 62.3k, False: 102]
  |  Branch (1986:19): [True: 61.6k, False: 678]
  |  Branch (1986:33): [True: 44.8k, False: 16.8k]
  |  Branch (1986:47): [True: 26.0k, False: 18.7k]
  |  Branch (1986:62): [True: 25.5k, False: 505]
  ------------------
 1987|  25.5k|		(*p)++;
 1988|  25.5k|		(*l)--;
 1989|  25.5k|	}
 1990|  36.8k|	if (*l > 0)
  ------------------
  |  Branch (1990:6): [True: 36.7k, False: 102]
  ------------------
 1991|  36.7k|		*sep = **p;
 1992|    102|	else
 1993|    102|		*sep = '\0';
 1994|       |
 1995|       |	/* Handle in-field comments */
 1996|  36.8k|	if (*sep == '#') {
  ------------------
  |  Branch (1996:6): [True: 505, False: 36.3k]
  ------------------
 1997|  11.0k|		while (*l > 0 && **p != ',' && **p != '\n') {
  ------------------
  |  Branch (1997:10): [True: 11.0k, False: 10]
  |  Branch (1997:20): [True: 10.9k, False: 79]
  |  Branch (1997:34): [True: 10.5k, False: 416]
  ------------------
 1998|  10.5k|			(*p)++;
 1999|  10.5k|			(*l)--;
 2000|  10.5k|		}
 2001|    505|		if (*l > 0)
  ------------------
  |  Branch (2001:7): [True: 495, False: 10]
  ------------------
 2002|    495|			*sep = **p;
 2003|     10|		else
 2004|     10|			*sep = '\0';
 2005|    505|	}
 2006|       |
 2007|       |	/* Skip separator. */
 2008|  36.8k|	if (*l > 0) {
  ------------------
  |  Branch (2008:6): [True: 36.7k, False: 112]
  ------------------
 2009|  36.7k|		(*p)++;
 2010|  36.7k|		(*l)--;
 2011|  36.7k|	}
 2012|  36.8k|}

archive_blake2sp_ref.c:store32:
   93|   230k|{
   94|       |#if defined(NATIVE_LITTLE_ENDIAN)
   95|       |  memcpy(dst, &w, sizeof w);
   96|       |#else
   97|   230k|  uint8_t *p = ( uint8_t * )dst;
   98|   230k|  p[0] = (uint8_t)(w >>  0);
   99|   230k|  p[1] = (uint8_t)(w >>  8);
  100|   230k|  p[2] = (uint8_t)(w >> 16);
  101|   230k|  p[3] = (uint8_t)(w >> 24);
  102|   230k|#endif
  103|   230k|}
archive_blake2sp_ref.c:store16:
   82|   115k|{
   83|       |#if defined(NATIVE_LITTLE_ENDIAN)
   84|       |  memcpy(dst, &w, sizeof w);
   85|       |#else
   86|   115k|  uint8_t *p = ( uint8_t * )dst;
   87|   115k|  *p++ = ( uint8_t )w; w >>= 8;
   88|   115k|  *p++ = ( uint8_t )w;
   89|   115k|#endif
   90|   115k|}
archive_blake2s_ref.c:load32:
   35|   972k|{
   36|       |#if defined(NATIVE_LITTLE_ENDIAN)
   37|       |  uint32_t w;
   38|       |  memcpy(&w, src, sizeof w);
   39|       |  return w;
   40|       |#else
   41|   972k|  const uint8_t *p = ( const uint8_t * )src;
   42|   972k|  return (( uint32_t )( p[0] ) <<  0) |
   43|   972k|         (( uint32_t )( p[1] ) <<  8) |
   44|   972k|         (( uint32_t )( p[2] ) << 16) |
   45|   972k|         (( uint32_t )( p[3] ) << 24) ;
   46|   972k|#endif
   47|   972k|}
archive_blake2s_ref.c:store32:
   93|    720|{
   94|       |#if defined(NATIVE_LITTLE_ENDIAN)
   95|       |  memcpy(dst, &w, sizeof w);
   96|       |#else
   97|    720|  uint8_t *p = ( uint8_t * )dst;
   98|    720|  p[0] = (uint8_t)(w >>  0);
   99|    720|  p[1] = (uint8_t)(w >>  8);
  100|    720|  p[2] = (uint8_t)(w >> 16);
  101|    720|  p[3] = (uint8_t)(w >> 24);
  102|    720|#endif
  103|    720|}
archive_blake2s_ref.c:secure_zero_memory:
  156|     90|{
  157|     90|  static void *(__LA_LIBC_CC *const volatile memset_v)(void *, int, size_t) = &memset;
  158|     90|  memset_v(v, 0, n);
  159|     90|}
archive_blake2s_ref.c:rotr32:
  145|  1.02M|{
  146|  1.02M|  return ( w >> c ) | ( w << ( 32 - c ) );
  147|  1.02M|}

blake2s_init_param:
   79|   115k|{
   80|   115k|  const unsigned char *p = ( const unsigned char * )( P );
   81|   115k|  size_t i;
   82|       |
   83|   115k|  blake2s_init0( S );
   84|       |
   85|       |  /* IV XOR ParamBlock */
   86|  1.03M|  for( i = 0; i < 8; ++i )
  ------------------
  |  Branch (86:15): [True: 921k, False: 115k]
  ------------------
   87|   921k|    S->h[i] ^= load32( &p[i * 4] );
   88|       |
   89|   115k|  S->outlen = P->digest_length;
   90|   115k|  return 0;
   91|   115k|}
blake2s_update:
  217|  3.28k|{
  218|  3.28k|  const unsigned char * in = (const unsigned char *)pin;
  219|  3.28k|  if( inlen > 0 )
  ------------------
  |  Branch (219:7): [True: 3.28k, False: 0]
  ------------------
  220|  3.28k|  {
  221|  3.28k|    size_t left = S->buflen;
  222|  3.28k|    size_t fill = BLAKE2S_BLOCKBYTES - left;
  223|  3.28k|    if( inlen > fill )
  ------------------
  |  Branch (223:9): [True: 3.10k, False: 187]
  ------------------
  224|  3.10k|    {
  225|  3.10k|      S->buflen = 0;
  226|  3.10k|      memcpy( S->buf + left, in, fill ); /* Fill buffer */
  227|  3.10k|      blake2s_increment_counter( S, BLAKE2S_BLOCKBYTES );
  228|  3.10k|      blake2s_compress( S, S->buf ); /* Compress */
  229|  3.10k|      in += fill; inlen -= fill;
  230|  3.10k|      while(inlen > BLAKE2S_BLOCKBYTES) {
  ------------------
  |  Branch (230:13): [True: 0, False: 3.10k]
  ------------------
  231|      0|        blake2s_increment_counter(S, BLAKE2S_BLOCKBYTES);
  232|      0|        blake2s_compress( S, in );
  233|      0|        in += BLAKE2S_BLOCKBYTES;
  234|      0|        inlen -= BLAKE2S_BLOCKBYTES;
  235|      0|      }
  236|  3.10k|    }
  237|  3.28k|    memcpy( S->buf + S->buflen, in, inlen );
  238|  3.28k|    S->buflen += inlen;
  239|  3.28k|  }
  240|  3.28k|  return 0;
  241|  3.28k|}
blake2s_final:
  244|     90|{
  245|     90|  uint8_t buffer[BLAKE2S_OUTBYTES] = {0};
  246|     90|  size_t i;
  247|       |
  248|     90|  if( out == NULL || outlen < S->outlen )
  ------------------
  |  Branch (248:7): [True: 0, False: 90]
  |  Branch (248:22): [True: 0, False: 90]
  ------------------
  249|      0|    return -1;
  250|       |
  251|     90|  if( blake2s_is_lastblock( S ) )
  ------------------
  |  Branch (251:7): [True: 0, False: 90]
  ------------------
  252|      0|    return -1;
  253|       |
  254|     90|  blake2s_increment_counter( S, ( uint32_t )S->buflen );
  255|     90|  blake2s_set_lastblock( S );
  256|     90|  memset( S->buf + S->buflen, 0, BLAKE2S_BLOCKBYTES - S->buflen ); /* Padding */
  257|     90|  blake2s_compress( S, S->buf );
  258|       |
  259|    810|  for( i = 0; i < 8; ++i ) /* Output full hash to temp buffer */
  ------------------
  |  Branch (259:15): [True: 720, False: 90]
  ------------------
  260|    720|    store32( buffer + sizeof( S->h[i] ) * i, S->h[i] );
  261|       |
  262|     90|  memcpy( out, buffer, outlen );
  263|     90|  secure_zero_memory(buffer, sizeof(buffer));
  264|     90|  return 0;
  265|     90|}
archive_blake2s_ref.c:blake2s_init0:
   70|   115k|{
   71|   115k|  size_t i;
   72|   115k|  memset( S, 0, sizeof( blake2s_state ) );
   73|       |
   74|  1.03M|  for( i = 0; i < 8; ++i ) S->h[i] = blake2s_IV[i];
  ------------------
  |  Branch (74:15): [True: 921k, False: 115k]
  ------------------
   75|   115k|}
archive_blake2s_ref.c:blake2s_increment_counter:
   64|  3.19k|{
   65|  3.19k|  S->t[0] += inc;
   66|  3.19k|  S->t[1] += ( S->t[0] < inc );
   67|  3.19k|}
archive_blake2s_ref.c:blake2s_compress:
  175|  3.19k|{
  176|  3.19k|  uint32_t m[16];
  177|  3.19k|  uint32_t v[16];
  178|  3.19k|  size_t i;
  179|       |
  180|  54.2k|  for( i = 0; i < 16; ++i ) {
  ------------------
  |  Branch (180:15): [True: 51.0k, False: 3.19k]
  ------------------
  181|  51.0k|    m[i] = load32( in + i * sizeof( m[i] ) );
  182|  51.0k|  }
  183|       |
  184|  28.7k|  for( i = 0; i < 8; ++i ) {
  ------------------
  |  Branch (184:15): [True: 25.5k, False: 3.19k]
  ------------------
  185|  25.5k|    v[i] = S->h[i];
  186|  25.5k|  }
  187|       |
  188|  3.19k|  v[ 8] = blake2s_IV[0];
  189|  3.19k|  v[ 9] = blake2s_IV[1];
  190|  3.19k|  v[10] = blake2s_IV[2];
  191|  3.19k|  v[11] = blake2s_IV[3];
  192|  3.19k|  v[12] = S->t[0] ^ blake2s_IV[4];
  193|  3.19k|  v[13] = S->t[1] ^ blake2s_IV[5];
  194|  3.19k|  v[14] = S->f[0] ^ blake2s_IV[6];
  195|  3.19k|  v[15] = S->f[1] ^ blake2s_IV[7];
  196|       |
  197|  3.19k|  ROUND( 0 );
  ------------------
  |  |  163|  3.19k|  do {                              \
  |  |  164|  3.19k|    G(r,0,v[ 0],v[ 4],v[ 8],v[12]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  165|  3.19k|    G(r,1,v[ 1],v[ 5],v[ 9],v[13]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  166|  3.19k|    G(r,2,v[ 2],v[ 6],v[10],v[14]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  167|  3.19k|    G(r,3,v[ 3],v[ 7],v[11],v[15]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  168|  3.19k|    G(r,4,v[ 0],v[ 5],v[10],v[15]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  169|  3.19k|    G(r,5,v[ 1],v[ 6],v[11],v[12]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  170|  3.19k|    G(r,6,v[ 2],v[ 7],v[ 8],v[13]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  171|  3.19k|    G(r,7,v[ 3],v[ 4],v[ 9],v[14]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  172|  3.19k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (172:11): [Folded, False: 3.19k]
  |  |  ------------------
  ------------------
  198|  3.19k|  ROUND( 1 );
  ------------------
  |  |  163|  3.19k|  do {                              \
  |  |  164|  3.19k|    G(r,0,v[ 0],v[ 4],v[ 8],v[12]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  165|  3.19k|    G(r,1,v[ 1],v[ 5],v[ 9],v[13]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  166|  3.19k|    G(r,2,v[ 2],v[ 6],v[10],v[14]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  167|  3.19k|    G(r,3,v[ 3],v[ 7],v[11],v[15]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  168|  3.19k|    G(r,4,v[ 0],v[ 5],v[10],v[15]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  169|  3.19k|    G(r,5,v[ 1],v[ 6],v[11],v[12]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  170|  3.19k|    G(r,6,v[ 2],v[ 7],v[ 8],v[13]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  171|  3.19k|    G(r,7,v[ 3],v[ 4],v[ 9],v[14]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  172|  3.19k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (172:11): [Folded, False: 3.19k]
  |  |  ------------------
  ------------------
  199|  3.19k|  ROUND( 2 );
  ------------------
  |  |  163|  3.19k|  do {                              \
  |  |  164|  3.19k|    G(r,0,v[ 0],v[ 4],v[ 8],v[12]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  165|  3.19k|    G(r,1,v[ 1],v[ 5],v[ 9],v[13]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  166|  3.19k|    G(r,2,v[ 2],v[ 6],v[10],v[14]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  167|  3.19k|    G(r,3,v[ 3],v[ 7],v[11],v[15]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  168|  3.19k|    G(r,4,v[ 0],v[ 5],v[10],v[15]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  169|  3.19k|    G(r,5,v[ 1],v[ 6],v[11],v[12]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  170|  3.19k|    G(r,6,v[ 2],v[ 7],v[ 8],v[13]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  171|  3.19k|    G(r,7,v[ 3],v[ 4],v[ 9],v[14]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  172|  3.19k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (172:11): [Folded, False: 3.19k]
  |  |  ------------------
  ------------------
  200|  3.19k|  ROUND( 3 );
  ------------------
  |  |  163|  3.19k|  do {                              \
  |  |  164|  3.19k|    G(r,0,v[ 0],v[ 4],v[ 8],v[12]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  165|  3.19k|    G(r,1,v[ 1],v[ 5],v[ 9],v[13]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  166|  3.19k|    G(r,2,v[ 2],v[ 6],v[10],v[14]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  167|  3.19k|    G(r,3,v[ 3],v[ 7],v[11],v[15]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  168|  3.19k|    G(r,4,v[ 0],v[ 5],v[10],v[15]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  169|  3.19k|    G(r,5,v[ 1],v[ 6],v[11],v[12]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  170|  3.19k|    G(r,6,v[ 2],v[ 7],v[ 8],v[13]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  171|  3.19k|    G(r,7,v[ 3],v[ 4],v[ 9],v[14]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  172|  3.19k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (172:11): [Folded, False: 3.19k]
  |  |  ------------------
  ------------------
  201|  3.19k|  ROUND( 4 );
  ------------------
  |  |  163|  3.19k|  do {                              \
  |  |  164|  3.19k|    G(r,0,v[ 0],v[ 4],v[ 8],v[12]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  165|  3.19k|    G(r,1,v[ 1],v[ 5],v[ 9],v[13]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  166|  3.19k|    G(r,2,v[ 2],v[ 6],v[10],v[14]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  167|  3.19k|    G(r,3,v[ 3],v[ 7],v[11],v[15]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  168|  3.19k|    G(r,4,v[ 0],v[ 5],v[10],v[15]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  169|  3.19k|    G(r,5,v[ 1],v[ 6],v[11],v[12]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  170|  3.19k|    G(r,6,v[ 2],v[ 7],v[ 8],v[13]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  171|  3.19k|    G(r,7,v[ 3],v[ 4],v[ 9],v[14]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  172|  3.19k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (172:11): [Folded, False: 3.19k]
  |  |  ------------------
  ------------------
  202|  3.19k|  ROUND( 5 );
  ------------------
  |  |  163|  3.19k|  do {                              \
  |  |  164|  3.19k|    G(r,0,v[ 0],v[ 4],v[ 8],v[12]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  165|  3.19k|    G(r,1,v[ 1],v[ 5],v[ 9],v[13]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  166|  3.19k|    G(r,2,v[ 2],v[ 6],v[10],v[14]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  167|  3.19k|    G(r,3,v[ 3],v[ 7],v[11],v[15]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  168|  3.19k|    G(r,4,v[ 0],v[ 5],v[10],v[15]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  169|  3.19k|    G(r,5,v[ 1],v[ 6],v[11],v[12]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  170|  3.19k|    G(r,6,v[ 2],v[ 7],v[ 8],v[13]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  171|  3.19k|    G(r,7,v[ 3],v[ 4],v[ 9],v[14]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  172|  3.19k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (172:11): [Folded, False: 3.19k]
  |  |  ------------------
  ------------------
  203|  3.19k|  ROUND( 6 );
  ------------------
  |  |  163|  3.19k|  do {                              \
  |  |  164|  3.19k|    G(r,0,v[ 0],v[ 4],v[ 8],v[12]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  165|  3.19k|    G(r,1,v[ 1],v[ 5],v[ 9],v[13]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  166|  3.19k|    G(r,2,v[ 2],v[ 6],v[10],v[14]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  167|  3.19k|    G(r,3,v[ 3],v[ 7],v[11],v[15]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  168|  3.19k|    G(r,4,v[ 0],v[ 5],v[10],v[15]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  169|  3.19k|    G(r,5,v[ 1],v[ 6],v[11],v[12]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  170|  3.19k|    G(r,6,v[ 2],v[ 7],v[ 8],v[13]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  171|  3.19k|    G(r,7,v[ 3],v[ 4],v[ 9],v[14]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  172|  3.19k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (172:11): [Folded, False: 3.19k]
  |  |  ------------------
  ------------------
  204|  3.19k|  ROUND( 7 );
  ------------------
  |  |  163|  3.19k|  do {                              \
  |  |  164|  3.19k|    G(r,0,v[ 0],v[ 4],v[ 8],v[12]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  165|  3.19k|    G(r,1,v[ 1],v[ 5],v[ 9],v[13]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  166|  3.19k|    G(r,2,v[ 2],v[ 6],v[10],v[14]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  167|  3.19k|    G(r,3,v[ 3],v[ 7],v[11],v[15]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  168|  3.19k|    G(r,4,v[ 0],v[ 5],v[10],v[15]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  169|  3.19k|    G(r,5,v[ 1],v[ 6],v[11],v[12]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  170|  3.19k|    G(r,6,v[ 2],v[ 7],v[ 8],v[13]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  171|  3.19k|    G(r,7,v[ 3],v[ 4],v[ 9],v[14]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  172|  3.19k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (172:11): [Folded, False: 3.19k]
  |  |  ------------------
  ------------------
  205|  3.19k|  ROUND( 8 );
  ------------------
  |  |  163|  3.19k|  do {                              \
  |  |  164|  3.19k|    G(r,0,v[ 0],v[ 4],v[ 8],v[12]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  165|  3.19k|    G(r,1,v[ 1],v[ 5],v[ 9],v[13]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  166|  3.19k|    G(r,2,v[ 2],v[ 6],v[10],v[14]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  167|  3.19k|    G(r,3,v[ 3],v[ 7],v[11],v[15]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  168|  3.19k|    G(r,4,v[ 0],v[ 5],v[10],v[15]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  169|  3.19k|    G(r,5,v[ 1],v[ 6],v[11],v[12]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  170|  3.19k|    G(r,6,v[ 2],v[ 7],v[ 8],v[13]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  171|  3.19k|    G(r,7,v[ 3],v[ 4],v[ 9],v[14]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  172|  3.19k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (172:11): [Folded, False: 3.19k]
  |  |  ------------------
  ------------------
  206|  3.19k|  ROUND( 9 );
  ------------------
  |  |  163|  3.19k|  do {                              \
  |  |  164|  3.19k|    G(r,0,v[ 0],v[ 4],v[ 8],v[12]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  165|  3.19k|    G(r,1,v[ 1],v[ 5],v[ 9],v[13]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  166|  3.19k|    G(r,2,v[ 2],v[ 6],v[10],v[14]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  167|  3.19k|    G(r,3,v[ 3],v[ 7],v[11],v[15]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  168|  3.19k|    G(r,4,v[ 0],v[ 5],v[10],v[15]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  169|  3.19k|    G(r,5,v[ 1],v[ 6],v[11],v[12]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  170|  3.19k|    G(r,6,v[ 2],v[ 7],v[ 8],v[13]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  171|  3.19k|    G(r,7,v[ 3],v[ 4],v[ 9],v[14]); \
  |  |  ------------------
  |  |  |  |  151|  3.19k|  do {                                      \
  |  |  |  |  152|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+0]]; \
  |  |  |  |  153|  3.19k|    d = rotr32(d ^ a, 16);                  \
  |  |  |  |  154|  3.19k|    c = c + d;                              \
  |  |  |  |  155|  3.19k|    b = rotr32(b ^ c, 12);                  \
  |  |  |  |  156|  3.19k|    a = a + b + m[blake2s_sigma[r][2*i+1]]; \
  |  |  |  |  157|  3.19k|    d = rotr32(d ^ a, 8);                   \
  |  |  |  |  158|  3.19k|    c = c + d;                              \
  |  |  |  |  159|  3.19k|    b = rotr32(b ^ c, 7);                   \
  |  |  |  |  160|  3.19k|  } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:11): [Folded, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  172|  3.19k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (172:11): [Folded, False: 3.19k]
  |  |  ------------------
  ------------------
  207|       |
  208|  28.7k|  for( i = 0; i < 8; ++i ) {
  ------------------
  |  Branch (208:15): [True: 25.5k, False: 3.19k]
  ------------------
  209|  25.5k|    S->h[i] = S->h[i] ^ v[i] ^ v[i + 8];
  210|  25.5k|  }
  211|  3.19k|}
archive_blake2s_ref.c:blake2s_is_lastblock:
   52|     90|{
   53|     90|  return S->f[0] != 0;
   54|     90|}
archive_blake2s_ref.c:blake2s_set_lastblock:
   57|     90|{
   58|     90|  if( S->last_node ) blake2s_set_lastnode( S );
  ------------------
  |  Branch (58:7): [True: 20, False: 70]
  ------------------
   59|       |
   60|     90|  S->f[0] = (uint32_t)-1;
   61|     90|}
archive_blake2s_ref.c:blake2s_set_lastnode:
   46|     20|{
   47|     20|  S->f[1] = (uint32_t)-1;
   48|     20|}

blake2sp_init:
   81|  12.8k|{
   82|  12.8k|  size_t i;
   83|       |
   84|  12.8k|  if( !outlen || outlen > BLAKE2S_OUTBYTES ) return -1;
  ------------------
  |  Branch (84:7): [True: 0, False: 12.8k]
  |  Branch (84:18): [True: 0, False: 12.8k]
  ------------------
   85|       |
   86|  12.8k|  memset( S->buf, 0, sizeof( S->buf ) );
   87|  12.8k|  S->buflen = 0;
   88|  12.8k|  S->outlen = outlen;
   89|       |
   90|  12.8k|  if( blake2sp_init_root( S->R, outlen, 0 ) < 0 )
  ------------------
  |  Branch (90:7): [True: 0, False: 12.8k]
  ------------------
   91|      0|    return -1;
   92|       |
   93|   115k|  for( i = 0; i < PARALLELISM_DEGREE; ++i )
  ------------------
  |  |   29|   115k|#define PARALLELISM_DEGREE 8
  ------------------
  |  Branch (93:15): [True: 102k, False: 12.8k]
  ------------------
   94|   102k|    if( blake2sp_init_leaf( S->S[i], outlen, 0, (uint32_t)i ) < 0 ) return -1;
  ------------------
  |  Branch (94:9): [True: 0, False: 102k]
  ------------------
   95|       |
   96|  12.8k|  S->R->last_node = 1;
   97|  12.8k|  S->S[PARALLELISM_DEGREE - 1]->last_node = 1;
  ------------------
  |  |   29|  12.8k|#define PARALLELISM_DEGREE 8
  ------------------
   98|  12.8k|  return 0;
   99|  12.8k|}
blake2sp_update:
  136|  2.65k|{
  137|  2.65k|  const unsigned char * in = (const unsigned char *)pin;
  138|  2.65k|  size_t left = S->buflen;
  139|  2.65k|  size_t fill = sizeof( S->buf ) - left;
  140|  2.65k|  size_t i;
  141|       |
  142|  2.65k|  if( left && inlen >= fill )
  ------------------
  |  Branch (142:7): [True: 2.62k, False: 30]
  |  Branch (142:15): [True: 386, False: 2.24k]
  ------------------
  143|    386|  {
  144|    386|    memcpy( S->buf + left, in, fill );
  145|       |
  146|  3.47k|    for( i = 0; i < PARALLELISM_DEGREE; ++i )
  ------------------
  |  |   29|  3.47k|#define PARALLELISM_DEGREE 8
  ------------------
  |  Branch (146:17): [True: 3.08k, False: 386]
  ------------------
  147|  3.08k|      blake2s_update( S->S[i], S->buf + i * BLAKE2S_BLOCKBYTES, BLAKE2S_BLOCKBYTES );
  148|       |
  149|    386|    in += fill;
  150|    386|    inlen -= fill;
  151|    386|    left = 0;
  152|    386|  }
  153|       |
  154|       |#if defined(_OPENMP)
  155|       |  #pragma omp parallel shared(S), num_threads(PARALLELISM_DEGREE)
  156|       |#else
  157|  23.9k|  for( i = 0; i < PARALLELISM_DEGREE; ++i )
  ------------------
  |  |   29|  23.9k|#define PARALLELISM_DEGREE 8
  ------------------
  |  Branch (157:15): [True: 21.2k, False: 2.65k]
  ------------------
  158|  21.2k|#endif
  159|  21.2k|  {
  160|       |#if defined(_OPENMP)
  161|       |    size_t      i = omp_get_thread_num();
  162|       |#endif
  163|  21.2k|    size_t inlen__ = inlen;
  164|  21.2k|    const unsigned char *in__ = ( const unsigned char * )in;
  165|  21.2k|    in__ += i * BLAKE2S_BLOCKBYTES;
  166|       |
  167|  21.3k|    while( inlen__ >= PARALLELISM_DEGREE * BLAKE2S_BLOCKBYTES )
  ------------------
  |  |   29|  21.3k|#define PARALLELISM_DEGREE 8
  ------------------
  |  Branch (167:12): [True: 80, False: 21.2k]
  ------------------
  168|     80|    {
  169|     80|      blake2s_update( S->S[i], in__, BLAKE2S_BLOCKBYTES );
  170|     80|      in__ += PARALLELISM_DEGREE * BLAKE2S_BLOCKBYTES;
  ------------------
  |  |   29|     80|#define PARALLELISM_DEGREE 8
  ------------------
  171|     80|      inlen__ -= PARALLELISM_DEGREE * BLAKE2S_BLOCKBYTES;
  ------------------
  |  |   29|     80|#define PARALLELISM_DEGREE 8
  ------------------
  172|     80|    }
  173|  21.2k|  }
  174|       |
  175|  2.65k|  in += inlen - inlen % ( PARALLELISM_DEGREE * BLAKE2S_BLOCKBYTES );
  ------------------
  |  |   29|  2.65k|#define PARALLELISM_DEGREE 8
  ------------------
  176|  2.65k|  inlen %= PARALLELISM_DEGREE * BLAKE2S_BLOCKBYTES;
  ------------------
  |  |   29|  2.65k|#define PARALLELISM_DEGREE 8
  ------------------
  177|       |
  178|  2.65k|  if( inlen > 0 )
  ------------------
  |  Branch (178:7): [True: 2.64k, False: 12]
  ------------------
  179|  2.64k|    memcpy( S->buf + left, in, inlen );
  180|       |
  181|  2.65k|  S->buflen = left + inlen;
  182|  2.65k|  return 0;
  183|  2.65k|}
blake2sp_final:
  187|     10|{
  188|     10|  uint8_t hash[PARALLELISM_DEGREE][BLAKE2S_OUTBYTES];
  189|     10|  size_t i;
  190|       |
  191|     10|  if(out == NULL || outlen < S->outlen) {
  ------------------
  |  Branch (191:6): [True: 0, False: 10]
  |  Branch (191:21): [True: 0, False: 10]
  ------------------
  192|      0|    return -1;
  193|      0|  }
  194|       |
  195|     90|  for( i = 0; i < PARALLELISM_DEGREE; ++i )
  ------------------
  |  |   29|     90|#define PARALLELISM_DEGREE 8
  ------------------
  |  Branch (195:15): [True: 80, False: 10]
  ------------------
  196|     80|  {
  197|     80|    if( S->buflen > i * BLAKE2S_BLOCKBYTES )
  ------------------
  |  Branch (197:9): [True: 39, False: 41]
  ------------------
  198|     39|    {
  199|     39|      size_t left = S->buflen - i * BLAKE2S_BLOCKBYTES;
  200|       |
  201|     39|      if( left > BLAKE2S_BLOCKBYTES ) left = BLAKE2S_BLOCKBYTES;
  ------------------
  |  Branch (201:11): [True: 29, False: 10]
  ------------------
  202|       |
  203|     39|      blake2s_update( S->S[i], S->buf + i * BLAKE2S_BLOCKBYTES, left );
  204|     39|    }
  205|       |
  206|     80|    blake2s_final( S->S[i], hash[i], BLAKE2S_OUTBYTES );
  207|     80|  }
  208|       |
  209|     90|  for( i = 0; i < PARALLELISM_DEGREE; ++i )
  ------------------
  |  |   29|     90|#define PARALLELISM_DEGREE 8
  ------------------
  |  Branch (209:15): [True: 80, False: 10]
  ------------------
  210|     80|    blake2s_update( S->R, hash[i], BLAKE2S_OUTBYTES );
  211|       |
  212|     10|  return blake2s_final( S->R, out, S->outlen );
  213|     10|}
archive_blake2sp_ref.c:blake2sp_init_root:
   63|  12.8k|{
   64|  12.8k|  blake2s_param P[1];
   65|  12.8k|  P->digest_length = (uint8_t)outlen;
   66|  12.8k|  P->key_length = (uint8_t)keylen;
   67|  12.8k|  P->fanout = PARALLELISM_DEGREE;
  ------------------
  |  |   29|  12.8k|#define PARALLELISM_DEGREE 8
  ------------------
   68|  12.8k|  P->depth = 2;
   69|  12.8k|  store32( &P->leaf_length, 0 );
   70|  12.8k|  store32( &P->node_offset, 0 );
   71|  12.8k|  store16( &P->xof_length, 0 );
   72|  12.8k|  P->node_depth = 1;
   73|  12.8k|  P->inner_length = BLAKE2S_OUTBYTES;
   74|  12.8k|  memset( P->salt, 0, sizeof( P->salt ) );
   75|  12.8k|  memset( P->personal, 0, sizeof( P->personal ) );
   76|  12.8k|  return blake2s_init_param( S, P );
   77|  12.8k|}
archive_blake2sp_ref.c:blake2sp_init_leaf:
   46|   102k|{
   47|   102k|  blake2s_param P[1];
   48|   102k|  P->digest_length = (uint8_t)outlen;
   49|   102k|  P->key_length = (uint8_t)keylen;
   50|   102k|  P->fanout = PARALLELISM_DEGREE;
  ------------------
  |  |   29|   102k|#define PARALLELISM_DEGREE 8
  ------------------
   51|   102k|  P->depth = 2;
   52|   102k|  store32( &P->leaf_length, 0 );
   53|   102k|  store32( &P->node_offset, offset );
   54|   102k|  store16( &P->xof_length, 0 );
   55|   102k|  P->node_depth = 0;
   56|   102k|  P->inner_length = BLAKE2S_OUTBYTES;
   57|   102k|  memset( P->salt, 0, sizeof( P->salt ) );
   58|   102k|  memset( P->personal, 0, sizeof( P->personal ) );
   59|   102k|  return blake2sp_init_leaf_param( S, P );
   60|   102k|}
archive_blake2sp_ref.c:blake2sp_init_leaf_param:
   39|   102k|{
   40|   102k|  int err = blake2s_init_param(S, P);
   41|   102k|  S->outlen = P->inner_length;
   42|   102k|  return err;
   43|   102k|}

__archive_check_magic:
  136|   705k|{
  137|   705k|	char states1[64];
  138|   705k|	char states2[64];
  139|   705k|	const char *handle_type;
  140|       |
  141|       |	/*
  142|       |	 * If this isn't some form of archive handle,
  143|       |	 * then the library user has screwed up so bad that
  144|       |	 * we don't even have a reliable way to report an error.
  145|       |	 */
  146|   705k|	handle_type = archive_handle_type_name(a->magic);
  147|       |
  148|   705k|	if (!handle_type) {
  ------------------
  |  Branch (148:6): [True: 0, False: 705k]
  ------------------
  149|      0|		errmsg("PROGRAMMER ERROR: Function ");
  150|      0|		errmsg(function);
  151|      0|		errmsg(" invoked with invalid archive handle\n");
  152|      0|		diediedie();
  153|      0|	}
  154|       |
  155|   705k|	if (a->magic != magic) {
  ------------------
  |  Branch (155:6): [True: 0, False: 705k]
  ------------------
  156|      0|		archive_set_error(a, -1,
  157|      0|		    "PROGRAMMER ERROR: Function '%s' invoked"
  158|      0|		    " on '%s' archive object, which is not supported",
  159|      0|		    function,
  160|      0|		    handle_type);
  161|      0|		a->state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   69|      0|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  162|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  163|      0|	}
  164|       |
  165|   705k|	if ((a->state & state) == 0) {
  ------------------
  |  Branch (165:6): [True: 2.45k, False: 702k]
  ------------------
  166|       |		/* If we're already FATAL, don't overwrite the error. */
  167|  2.45k|		if (a->state != ARCHIVE_STATE_FATAL) {
  ------------------
  |  |   69|  2.45k|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  |  Branch (167:7): [True: 360, False: 2.09k]
  ------------------
  168|    360|			write_all_states(states1, a->state);
  169|    360|			write_all_states(states2, state);
  170|    360|			archive_set_error(a, -1,
  171|    360|			    "INTERNAL ERROR: Function '%s' invoked with"
  172|    360|			    " archive structure in state '%s',"
  173|    360|			    " should be in state '%s'",
  174|    360|			    function,
  175|    360|			    states1,
  176|    360|			    states2);
  177|    360|		}
  178|  2.45k|		a->state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   69|  2.45k|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  179|  2.45k|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|  2.45k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  180|  2.45k|	}
  181|   702k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|   702k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  182|   705k|}
archive_check_magic.c:archive_handle_type_name:
   97|   705k|{
   98|   705k|	switch (m) {
   99|      0|	case ARCHIVE_WRITE_MAGIC:	return ("archive_write");
  ------------------
  |  |   58|      0|#define	ARCHIVE_WRITE_MAGIC	(0xb0c5c0deU)
  ------------------
  |  Branch (99:2): [True: 0, False: 705k]
  ------------------
  100|   705k|	case ARCHIVE_READ_MAGIC:	return ("archive_read");
  ------------------
  |  |   59|   705k|#define	ARCHIVE_READ_MAGIC	(0xdeb0c5U)
  ------------------
  |  Branch (100:2): [True: 705k, False: 0]
  ------------------
  101|      0|	case ARCHIVE_WRITE_DISK_MAGIC:	return ("archive_write_disk");
  ------------------
  |  |   60|      0|#define	ARCHIVE_WRITE_DISK_MAGIC (0xc001b0c5U)
  ------------------
  |  Branch (101:2): [True: 0, False: 705k]
  ------------------
  102|      0|	case ARCHIVE_READ_DISK_MAGIC:	return ("archive_read_disk");
  ------------------
  |  |   61|      0|#define	ARCHIVE_READ_DISK_MAGIC (0xbadb0c5U)
  ------------------
  |  Branch (102:2): [True: 0, False: 705k]
  ------------------
  103|      0|	case ARCHIVE_MATCH_MAGIC:	return ("archive_match");
  ------------------
  |  |   62|      0|#define	ARCHIVE_MATCH_MAGIC	(0xcad11c9U)
  ------------------
  |  Branch (103:2): [True: 0, False: 705k]
  ------------------
  104|      0|	default:			return NULL;
  ------------------
  |  Branch (104:2): [True: 0, False: 705k]
  ------------------
  105|   705k|	}
  106|   705k|}
archive_check_magic.c:write_all_states:
  110|    720|{
  111|    720|	unsigned int lowbit;
  112|       |
  113|    720|	*buff = '\0';
  114|       |
  115|       |	/* A trick for computing the lowest set bit. */
  116|  1.44k|	while ((lowbit = states & (1 + ~states)) != 0) {
  ------------------
  |  Branch (116:9): [True: 720, False: 720]
  ------------------
  117|    720|		states &= ~lowbit;		/* Clear the low bit. */
  118|    720|		strcat(buff, state_name(lowbit));
  119|    720|		if (states != 0)
  ------------------
  |  Branch (119:7): [True: 0, False: 720]
  ------------------
  120|      0|			strcat(buff, "/");
  121|    720|	}
  122|    720|}
archive_check_magic.c:state_name:
   83|    720|{
   84|    720|	switch (s) {
   85|      0|	case ARCHIVE_STATE_NEW:		return ("new");
  ------------------
  |  |   64|      0|#define	ARCHIVE_STATE_NEW	1U
  ------------------
  |  Branch (85:2): [True: 0, False: 720]
  ------------------
   86|     10|	case ARCHIVE_STATE_HEADER:	return ("header");
  ------------------
  |  |   65|     10|#define	ARCHIVE_STATE_HEADER	2U
  ------------------
  |  Branch (86:2): [True: 10, False: 710]
  ------------------
   87|    360|	case ARCHIVE_STATE_DATA:	return ("data");
  ------------------
  |  |   66|    360|#define	ARCHIVE_STATE_DATA	4U
  ------------------
  |  Branch (87:2): [True: 360, False: 360]
  ------------------
   88|    350|	case ARCHIVE_STATE_EOF:		return ("eof");
  ------------------
  |  |   67|    350|#define	ARCHIVE_STATE_EOF	0x10U
  ------------------
  |  Branch (88:2): [True: 350, False: 370]
  ------------------
   89|      0|	case ARCHIVE_STATE_CLOSED:	return ("closed");
  ------------------
  |  |   68|      0|#define	ARCHIVE_STATE_CLOSED	0x20U
  ------------------
  |  Branch (89:2): [True: 0, False: 720]
  ------------------
   90|      0|	case ARCHIVE_STATE_FATAL:	return ("fatal");
  ------------------
  |  |   69|      0|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  |  Branch (90:2): [True: 0, False: 720]
  ------------------
   91|      0|	default:			return ("??");
  ------------------
  |  Branch (91:2): [True: 0, False: 720]
  ------------------
   92|    720|	}
   93|    720|}

archive_cryptor.c:pbkdf2_sha1:
  133|  3.37k|    size_t derived_key_len) {
  134|       |
  135|  3.37k|	PKCS5_PBKDF2_HMAC_SHA1(pw, pw_len, salt, salt_len, rounds,
  136|  3.37k|	    derived_key_len, derived_key);
  137|  3.37k|	return 0;
  138|  3.37k|}
archive_cryptor.c:aes_ctr_init:
  389|  2.96k|{
  390|  2.96k|	if ((ctx->ctx = EVP_CIPHER_CTX_new()) == NULL)
  ------------------
  |  Branch (390:6): [True: 0, False: 2.96k]
  ------------------
  391|      0|		return -1;
  392|       |
  393|  2.96k|	switch (key_len) {
  394|     71|	case 16: ctx->type = EVP_aes_128_ecb(); break;
  ------------------
  |  Branch (394:2): [True: 71, False: 2.89k]
  ------------------
  395|  2.89k|	case 24: ctx->type = EVP_aes_192_ecb(); break;
  ------------------
  |  Branch (395:2): [True: 2.89k, False: 71]
  ------------------
  396|      0|	case 32: ctx->type = EVP_aes_256_ecb(); break;
  ------------------
  |  Branch (396:2): [True: 0, False: 2.96k]
  ------------------
  397|      0|	default: ctx->type = NULL; return -1;
  ------------------
  |  Branch (397:2): [True: 0, False: 2.96k]
  ------------------
  398|  2.96k|	}
  399|       |
  400|  2.96k|	ctx->key_len = key_len;
  401|  2.96k|	memcpy(ctx->key, key, key_len);
  402|  2.96k|	memset(ctx->nonce, 0, sizeof(ctx->nonce));
  403|  2.96k|	ctx->encr_pos = AES_BLOCK_SIZE;
  ------------------
  |  |  136|  2.96k|#define AES_BLOCK_SIZE	16
  ------------------
  404|  2.96k|	return 0;
  405|  2.96k|}
archive_cryptor.c:aes_ctr_update:
  491|  2.89k|{
  492|  2.89k|	uint8_t *const ebuf = ctx->encr_buf;
  493|  2.89k|	size_t pos = ctx->encr_pos;
  494|  2.89k|	size_t max = (in_len < *out_len)? in_len: *out_len;
  ------------------
  |  Branch (494:15): [True: 0, False: 2.89k]
  ------------------
  495|  2.89k|	size_t i;
  496|       |
  497|  22.6k|	for (i = 0; i < max; ) {
  ------------------
  |  Branch (497:14): [True: 20.1k, False: 2.58k]
  ------------------
  498|  20.1k|		if (pos == AES_BLOCK_SIZE) {
  ------------------
  |  |  136|  20.1k|#define AES_BLOCK_SIZE	16
  ------------------
  |  Branch (498:7): [True: 2.89k, False: 17.2k]
  ------------------
  499|  2.89k|			aes_ctr_increase_counter(ctx);
  500|  2.89k|			if (aes_ctr_encrypt_counter(ctx) != 0)
  ------------------
  |  Branch (500:8): [True: 0, False: 2.89k]
  ------------------
  501|      0|				return -1;
  502|  8.56M|			while (max -i >= AES_BLOCK_SIZE) {
  ------------------
  |  |  136|  8.56M|#define AES_BLOCK_SIZE	16
  ------------------
  |  Branch (502:11): [True: 8.56M, False: 2.89k]
  ------------------
  503|   145M|				for (pos = 0; pos < AES_BLOCK_SIZE; pos++)
  ------------------
  |  |  136|   145M|#define AES_BLOCK_SIZE	16
  ------------------
  |  Branch (503:19): [True: 137M, False: 8.56M]
  ------------------
  504|   137M|					out[i+pos] = in[i+pos] ^ ebuf[pos];
  505|  8.56M|				i += AES_BLOCK_SIZE;
  ------------------
  |  |  136|  8.56M|#define AES_BLOCK_SIZE	16
  ------------------
  506|  8.56M|				aes_ctr_increase_counter(ctx);
  507|  8.56M|				if (aes_ctr_encrypt_counter(ctx) != 0)
  ------------------
  |  Branch (507:9): [True: 0, False: 8.56M]
  ------------------
  508|      0|					return -1;
  509|  8.56M|			}
  510|  2.89k|			pos = 0;
  511|  2.89k|			if (i >= max)
  ------------------
  |  Branch (511:8): [True: 315, False: 2.58k]
  ------------------
  512|    315|				break;
  513|  2.89k|		}
  514|  19.8k|		out[i] = in[i] ^ ebuf[pos++];
  515|  19.8k|		i++;
  516|  19.8k|	}
  517|  2.89k|	ctx->encr_pos = pos;
  518|  2.89k|	*out_len = i;
  519|       |
  520|  2.89k|	return 0;
  521|  2.89k|}
archive_cryptor.c:aes_ctr_increase_counter:
  478|  8.56M|{
  479|  8.56M|	uint8_t *const nonce = ctx->nonce;
  480|  8.56M|	int j;
  481|       |
  482|  8.59M|	for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (482:14): [True: 8.59M, False: 0]
  ------------------
  483|  8.59M|		if (++nonce[j])
  ------------------
  |  Branch (483:7): [True: 8.56M, False: 32.4k]
  ------------------
  484|  8.56M|			break;
  485|  8.59M|	}
  486|  8.56M|}
archive_cryptor.c:aes_ctr_encrypt_counter:
  409|  8.56M|{
  410|  8.56M|	int outl = 0;
  411|  8.56M|	int r;
  412|       |
  413|  8.56M|	r = EVP_EncryptInit_ex(ctx->ctx, ctx->type, NULL, ctx->key, NULL);
  414|  8.56M|	if (r == 0)
  ------------------
  |  Branch (414:6): [True: 0, False: 8.56M]
  ------------------
  415|      0|		return -1;
  416|  8.56M|	r = EVP_EncryptUpdate(ctx->ctx, ctx->encr_buf, &outl, ctx->nonce,
  417|  8.56M|	    AES_BLOCK_SIZE);
  ------------------
  |  |  136|  8.56M|#define AES_BLOCK_SIZE	16
  ------------------
  418|  8.56M|	if (r == 0 || outl != AES_BLOCK_SIZE)
  ------------------
  |  |  136|  8.56M|#define AES_BLOCK_SIZE	16
  ------------------
  |  Branch (418:6): [True: 0, False: 8.56M]
  |  Branch (418:16): [True: 0, False: 8.56M]
  ------------------
  419|      0|		return -1;
  420|  8.56M|	return 0;
  421|  8.56M|}
archive_cryptor.c:aes_ctr_release:
  425|  2.96k|{
  426|  2.96k|	EVP_CIPHER_CTX_free(ctx->ctx);
  427|  2.96k|	OPENSSL_cleanse(ctx->key, ctx->key_len);
  428|  2.96k|	OPENSSL_cleanse(ctx->nonce, sizeof(ctx->nonce));
  429|  2.96k|	return 0;
  430|  2.96k|}

archive_digest.c:__archive_md5init:
  282|      6|{
  283|      6|  if ((*ctx = EVP_MD_CTX_new()) == NULL)
  ------------------
  |  Branch (283:7): [True: 0, False: 6]
  ------------------
  284|      0|	return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  285|      6|  if (!EVP_DigestInit(*ctx, EVP_md5()))
  ------------------
  |  Branch (285:7): [True: 0, False: 6]
  ------------------
  286|      0|	return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  287|      6|  return (ARCHIVE_OK);
  ------------------
  |  |  233|      6|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  288|      6|}
archive_digest.c:__archive_md5update:
  293|    320|{
  294|    320|  EVP_DigestUpdate(*ctx, indata, insize);
  295|    320|  return (ARCHIVE_OK);
  ------------------
  |  |  233|    320|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  296|    320|}
archive_digest.c:__archive_md5final:
  300|      6|{
  301|       |  /* HACK: archive_write_set_format_xar.c is finalizing empty contexts, so
  302|       |   * this is meant to cope with that. Real fix is probably to fix
  303|       |   * archive_write_set_format_xar.c
  304|       |   */
  305|      6|  if (*ctx) {
  ------------------
  |  Branch (305:7): [True: 6, False: 0]
  ------------------
  306|      6|    EVP_DigestFinal(*ctx, md, NULL);
  307|      6|    EVP_MD_CTX_free(*ctx);
  308|      6|    *ctx = NULL;
  309|      6|  }
  310|      6|  return (ARCHIVE_OK);
  ------------------
  |  |  233|      6|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  311|      6|}
archive_digest.c:__archive_sha1init:
  689|     96|{
  690|     96|  if ((*ctx = EVP_MD_CTX_new()) == NULL)
  ------------------
  |  Branch (690:7): [True: 0, False: 96]
  ------------------
  691|      0|	return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  692|     96|  if (!EVP_DigestInit(*ctx, EVP_sha1()))
  ------------------
  |  Branch (692:7): [True: 0, False: 96]
  ------------------
  693|      0|	return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  694|     96|  return (ARCHIVE_OK);
  ------------------
  |  |  233|     96|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  695|     96|}
archive_digest.c:__archive_sha1update:
  700|  2.04k|{
  701|  2.04k|  EVP_DigestUpdate(*ctx, indata, insize);
  702|  2.04k|  return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.04k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  703|  2.04k|}
archive_digest.c:__archive_sha1final:
  707|     96|{
  708|       |  /* HACK: archive_write_set_format_xar.c is finalizing empty contexts, so
  709|       |   * this is meant to cope with that. Real fix is probably to fix
  710|       |   * archive_write_set_format_xar.c
  711|       |   */
  712|     96|  if (*ctx) {
  ------------------
  |  Branch (712:7): [True: 96, False: 0]
  ------------------
  713|     96|    EVP_DigestFinal(*ctx, md, NULL);
  714|     96|    EVP_MD_CTX_free(*ctx);
  715|     96|    *ctx = NULL;
  716|     96|  }
  717|     96|  return (ARCHIVE_OK);
  ------------------
  |  |  233|     96|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  718|     96|}

archive_read_support_filter_gzip.c:archive_le32dec:
  113|    161|{
  114|    161|	unsigned char const *p = (unsigned char const *)pp;
  115|       |
  116|       |	/* Store into unsigned temporaries before left shifting, to avoid
  117|       |	promotion to signed int and then left shifting into the sign bit,
  118|       |	which is undefined behaviour. */
  119|    161|	unsigned int p3 = p[3];
  120|    161|	unsigned int p2 = p[2];
  121|    161|	unsigned int p1 = p[1];
  122|    161|	unsigned int p0 = p[0];
  123|       |
  124|    161|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  125|    161|}
archive_read_support_filter_lz4.c:archive_le32dec:
  113|  6.44k|{
  114|  6.44k|	unsigned char const *p = (unsigned char const *)pp;
  115|       |
  116|       |	/* Store into unsigned temporaries before left shifting, to avoid
  117|       |	promotion to signed int and then left shifting into the sign bit,
  118|       |	which is undefined behaviour. */
  119|  6.44k|	unsigned int p3 = p[3];
  120|  6.44k|	unsigned int p2 = p[2];
  121|  6.44k|	unsigned int p1 = p[1];
  122|  6.44k|	unsigned int p0 = p[0];
  123|       |
  124|  6.44k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  125|  6.44k|}
archive_read_support_filter_rpm.c:archive_be32dec:
   75|    158|{
   76|    158|	unsigned char const *p = (unsigned char const *)pp;
   77|       |
   78|       |	/* Store into unsigned temporaries before left shifting, to avoid
   79|       |	promotion to signed int and then left shifting into the sign bit,
   80|       |	which is undefined behaviour. */
   81|    158|	unsigned int p3 = p[3];
   82|    158|	unsigned int p2 = p[2];
   83|    158|	unsigned int p1 = p[1];
   84|    158|	unsigned int p0 = p[0];
   85|       |
   86|    158|	return ((p0 << 24) | (p1 << 16) | (p2 << 8) | p3);
   87|    158|}
archive_read_support_filter_xz.c:archive_le32enc:
  175|      2|{
  176|      2|	unsigned char *p = (unsigned char *)pp;
  177|       |
  178|      2|	p[0] = u & 0xff;
  179|      2|	p[1] = (u >> 8) & 0xff;
  180|      2|	p[2] = (u >> 16) & 0xff;
  181|      2|	p[3] = (u >> 24) & 0xff;
  182|      2|}
archive_read_support_filter_xz.c:archive_le32dec:
  113|  8.17k|{
  114|  8.17k|	unsigned char const *p = (unsigned char const *)pp;
  115|       |
  116|       |	/* Store into unsigned temporaries before left shifting, to avoid
  117|       |	promotion to signed int and then left shifting into the sign bit,
  118|       |	which is undefined behaviour. */
  119|  8.17k|	unsigned int p3 = p[3];
  120|  8.17k|	unsigned int p2 = p[2];
  121|  8.17k|	unsigned int p1 = p[1];
  122|  8.17k|	unsigned int p0 = p[0];
  123|       |
  124|  8.17k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  125|  8.17k|}
archive_read_support_filter_xz.c:archive_le64dec:
  129|  2.72k|{
  130|  2.72k|	unsigned char const *p = (unsigned char const *)pp;
  131|       |
  132|  2.72k|	return (((uint64_t)archive_le32dec(p + 4) << 32) | archive_le32dec(p));
  133|  2.72k|}
archive_read_support_filter_zstd.c:archive_le32dec:
  113|  2.80k|{
  114|  2.80k|	unsigned char const *p = (unsigned char const *)pp;
  115|       |
  116|       |	/* Store into unsigned temporaries before left shifting, to avoid
  117|       |	promotion to signed int and then left shifting into the sign bit,
  118|       |	which is undefined behaviour. */
  119|  2.80k|	unsigned int p3 = p[3];
  120|  2.80k|	unsigned int p2 = p[2];
  121|  2.80k|	unsigned int p1 = p[1];
  122|  2.80k|	unsigned int p0 = p[0];
  123|       |
  124|  2.80k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  125|  2.80k|}
archive_read_support_format_cab.c:archive_le32dec:
  113|   144k|{
  114|   144k|	unsigned char const *p = (unsigned char const *)pp;
  115|       |
  116|       |	/* Store into unsigned temporaries before left shifting, to avoid
  117|       |	promotion to signed int and then left shifting into the sign bit,
  118|       |	which is undefined behaviour. */
  119|   144k|	unsigned int p3 = p[3];
  120|   144k|	unsigned int p2 = p[2];
  121|   144k|	unsigned int p1 = p[1];
  122|   144k|	unsigned int p0 = p[0];
  123|       |
  124|   144k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  125|   144k|}
archive_read_support_format_cab.c:archive_le16dec:
   99|  2.45k|{
  100|  2.45k|	unsigned char const *p = (unsigned char const *)pp;
  101|       |
  102|       |	/* Store into unsigned temporaries before left shifting, to avoid
  103|       |	promotion to signed int and then left shifting into the sign bit,
  104|       |	which is undefined behaviour. */
  105|  2.45k|	unsigned int p1 = p[1];
  106|  2.45k|	unsigned int p0 = p[0];
  107|       |
  108|  2.45k|	return ((p1 << 8) | p0);
  109|  2.45k|}
archive_read_support_format_cab.c:archive_le16enc:
  166|    911|{
  167|    911|	unsigned char *p = (unsigned char *)pp;
  168|       |
  169|    911|	p[0] = u & 0xff;
  170|    911|	p[1] = (u >> 8) & 0xff;
  171|    911|}
archive_read_support_format_cab.c:archive_le32enc:
  175|     48|{
  176|     48|	unsigned char *p = (unsigned char *)pp;
  177|       |
  178|     48|	p[0] = u & 0xff;
  179|     48|	p[1] = (u >> 8) & 0xff;
  180|     48|	p[2] = (u >> 16) & 0xff;
  181|     48|	p[3] = (u >> 24) & 0xff;
  182|     48|}
archive_read_support_format_iso9660.c:archive_le32dec:
  113|  2.35k|{
  114|  2.35k|	unsigned char const *p = (unsigned char const *)pp;
  115|       |
  116|       |	/* Store into unsigned temporaries before left shifting, to avoid
  117|       |	promotion to signed int and then left shifting into the sign bit,
  118|       |	which is undefined behaviour. */
  119|  2.35k|	unsigned int p3 = p[3];
  120|  2.35k|	unsigned int p2 = p[2];
  121|  2.35k|	unsigned int p1 = p[1];
  122|  2.35k|	unsigned int p0 = p[0];
  123|       |
  124|  2.35k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  125|  2.35k|}
archive_read_support_format_iso9660.c:archive_le16dec:
   99|    464|{
  100|    464|	unsigned char const *p = (unsigned char const *)pp;
  101|       |
  102|       |	/* Store into unsigned temporaries before left shifting, to avoid
  103|       |	promotion to signed int and then left shifting into the sign bit,
  104|       |	which is undefined behaviour. */
  105|    464|	unsigned int p1 = p[1];
  106|    464|	unsigned int p0 = p[0];
  107|       |
  108|    464|	return ((p1 << 8) | p0);
  109|    464|}
archive_read_support_format_iso9660.c:archive_be32dec:
   75|    428|{
   76|    428|	unsigned char const *p = (unsigned char const *)pp;
   77|       |
   78|       |	/* Store into unsigned temporaries before left shifting, to avoid
   79|       |	promotion to signed int and then left shifting into the sign bit,
   80|       |	which is undefined behaviour. */
   81|    428|	unsigned int p3 = p[3];
   82|    428|	unsigned int p2 = p[2];
   83|    428|	unsigned int p1 = p[1];
   84|    428|	unsigned int p0 = p[0];
   85|       |
   86|    428|	return ((p0 << 24) | (p1 << 16) | (p2 << 8) | p3);
   87|    428|}
archive_read_support_format_lha.c:archive_le32dec:
  113|  8.60k|{
  114|  8.60k|	unsigned char const *p = (unsigned char const *)pp;
  115|       |
  116|       |	/* Store into unsigned temporaries before left shifting, to avoid
  117|       |	promotion to signed int and then left shifting into the sign bit,
  118|       |	which is undefined behaviour. */
  119|  8.60k|	unsigned int p3 = p[3];
  120|  8.60k|	unsigned int p2 = p[2];
  121|  8.60k|	unsigned int p1 = p[1];
  122|  8.60k|	unsigned int p0 = p[0];
  123|       |
  124|  8.60k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  125|  8.60k|}
archive_read_support_format_lha.c:archive_le16dec:
   99|  18.1k|{
  100|  18.1k|	unsigned char const *p = (unsigned char const *)pp;
  101|       |
  102|       |	/* Store into unsigned temporaries before left shifting, to avoid
  103|       |	promotion to signed int and then left shifting into the sign bit,
  104|       |	which is undefined behaviour. */
  105|  18.1k|	unsigned int p1 = p[1];
  106|  18.1k|	unsigned int p0 = p[0];
  107|       |
  108|  18.1k|	return ((p1 << 8) | p0);
  109|  18.1k|}
archive_read_support_format_rar.c:archive_le16dec:
   99|  9.58k|{
  100|  9.58k|	unsigned char const *p = (unsigned char const *)pp;
  101|       |
  102|       |	/* Store into unsigned temporaries before left shifting, to avoid
  103|       |	promotion to signed int and then left shifting into the sign bit,
  104|       |	which is undefined behaviour. */
  105|  9.58k|	unsigned int p1 = p[1];
  106|  9.58k|	unsigned int p0 = p[0];
  107|       |
  108|  9.58k|	return ((p1 << 8) | p0);
  109|  9.58k|}
archive_read_support_format_rar.c:archive_le64dec:
  129|     84|{
  130|     84|	unsigned char const *p = (unsigned char const *)pp;
  131|       |
  132|     84|	return (((uint64_t)archive_le32dec(p + 4) << 32) | archive_le32dec(p));
  133|     84|}
archive_read_support_format_rar.c:archive_le32dec:
  113|  8.95k|{
  114|  8.95k|	unsigned char const *p = (unsigned char const *)pp;
  115|       |
  116|       |	/* Store into unsigned temporaries before left shifting, to avoid
  117|       |	promotion to signed int and then left shifting into the sign bit,
  118|       |	which is undefined behaviour. */
  119|  8.95k|	unsigned int p3 = p[3];
  120|  8.95k|	unsigned int p2 = p[2];
  121|  8.95k|	unsigned int p1 = p[1];
  122|  8.95k|	unsigned int p0 = p[0];
  123|       |
  124|  8.95k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  125|  8.95k|}
archive_read_support_format_rar.c:archive_le32enc:
  175|   114k|{
  176|   114k|	unsigned char *p = (unsigned char *)pp;
  177|       |
  178|   114k|	p[0] = u & 0xff;
  179|   114k|	p[1] = (u >> 8) & 0xff;
  180|   114k|	p[2] = (u >> 16) & 0xff;
  181|   114k|	p[3] = (u >> 24) & 0xff;
  182|   114k|}
archive_read_support_format_rar5.c:archive_le32dec:
  113|  68.0k|{
  114|  68.0k|	unsigned char const *p = (unsigned char const *)pp;
  115|       |
  116|       |	/* Store into unsigned temporaries before left shifting, to avoid
  117|       |	promotion to signed int and then left shifting into the sign bit,
  118|       |	which is undefined behaviour. */
  119|  68.0k|	unsigned int p3 = p[3];
  120|  68.0k|	unsigned int p2 = p[2];
  121|  68.0k|	unsigned int p1 = p[1];
  122|  68.0k|	unsigned int p0 = p[0];
  123|       |
  124|  68.0k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  125|  68.0k|}
archive_read_support_format_rar5.c:archive_le64dec:
  129|    264|{
  130|    264|	unsigned char const *p = (unsigned char const *)pp;
  131|       |
  132|    264|	return (((uint64_t)archive_le32dec(p + 4) << 32) | archive_le32dec(p));
  133|    264|}
archive_read_support_format_rar5.c:archive_le16dec:
   99|  1.12k|{
  100|  1.12k|	unsigned char const *p = (unsigned char const *)pp;
  101|       |
  102|       |	/* Store into unsigned temporaries before left shifting, to avoid
  103|       |	promotion to signed int and then left shifting into the sign bit,
  104|       |	which is undefined behaviour. */
  105|  1.12k|	unsigned int p1 = p[1];
  106|  1.12k|	unsigned int p0 = p[0];
  107|       |
  108|  1.12k|	return ((p1 << 8) | p0);
  109|  1.12k|}
archive_read_support_format_xar.c:archive_be32dec:
   75|  3.20k|{
   76|  3.20k|	unsigned char const *p = (unsigned char const *)pp;
   77|       |
   78|       |	/* Store into unsigned temporaries before left shifting, to avoid
   79|       |	promotion to signed int and then left shifting into the sign bit,
   80|       |	which is undefined behaviour. */
   81|  3.20k|	unsigned int p3 = p[3];
   82|  3.20k|	unsigned int p2 = p[2];
   83|  3.20k|	unsigned int p1 = p[1];
   84|  3.20k|	unsigned int p0 = p[0];
   85|       |
   86|  3.20k|	return ((p0 << 24) | (p1 << 16) | (p2 << 8) | p3);
   87|  3.20k|}
archive_read_support_format_xar.c:archive_be16dec:
   61|    330|{
   62|    330|	unsigned char const *p = (unsigned char const *)pp;
   63|       |
   64|       |	/* Store into unsigned temporaries before left shifting, to avoid
   65|       |	promotion to signed int and then left shifting into the sign bit,
   66|       |	which is undefined behaviour. */
   67|    330|	unsigned int p1 = p[1];
   68|    330|	unsigned int p0 = p[0];
   69|       |
   70|    330|	return ((p0 << 8) | p1);
   71|    330|}
archive_read_support_format_xar.c:archive_be64dec:
   91|    220|{
   92|    220|	unsigned char const *p = (unsigned char const *)pp;
   93|       |
   94|    220|	return (((uint64_t)archive_be32dec(p) << 32) | archive_be32dec(p + 4));
   95|    220|}
archive_read_support_format_zip.c:archive_le16dec:
   99|   220k|{
  100|   220k|	unsigned char const *p = (unsigned char const *)pp;
  101|       |
  102|       |	/* Store into unsigned temporaries before left shifting, to avoid
  103|       |	promotion to signed int and then left shifting into the sign bit,
  104|       |	which is undefined behaviour. */
  105|   220k|	unsigned int p1 = p[1];
  106|   220k|	unsigned int p0 = p[0];
  107|       |
  108|   220k|	return ((p1 << 8) | p0);
  109|   220k|}
archive_read_support_format_zip.c:archive_le32dec:
  113|   337k|{
  114|   337k|	unsigned char const *p = (unsigned char const *)pp;
  115|       |
  116|       |	/* Store into unsigned temporaries before left shifting, to avoid
  117|       |	promotion to signed int and then left shifting into the sign bit,
  118|       |	which is undefined behaviour. */
  119|   337k|	unsigned int p3 = p[3];
  120|   337k|	unsigned int p2 = p[2];
  121|   337k|	unsigned int p1 = p[1];
  122|   337k|	unsigned int p0 = p[0];
  123|       |
  124|   337k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  125|   337k|}
archive_read_support_format_zip.c:archive_le64dec:
  129|  35.4k|{
  130|  35.4k|	unsigned char const *p = (unsigned char const *)pp;
  131|       |
  132|  35.4k|	return (((uint64_t)archive_le32dec(p + 4) << 32) | archive_le32dec(p));
  133|  35.4k|}
archive_string.c:archive_le16enc:
  166|  6.00k|{
  167|  6.00k|	unsigned char *p = (unsigned char *)pp;
  168|       |
  169|  6.00k|	p[0] = u & 0xff;
  170|  6.00k|	p[1] = (u >> 8) & 0xff;
  171|  6.00k|}
archive_string.c:archive_be16dec:
   61|    658|{
   62|    658|	unsigned char const *p = (unsigned char const *)pp;
   63|       |
   64|       |	/* Store into unsigned temporaries before left shifting, to avoid
   65|       |	promotion to signed int and then left shifting into the sign bit,
   66|       |	which is undefined behaviour. */
   67|    658|	unsigned int p1 = p[1];
   68|    658|	unsigned int p0 = p[0];
   69|       |
   70|    658|	return ((p0 << 8) | p1);
   71|    658|}
archive_string.c:archive_le16dec:
   99|  43.2k|{
  100|  43.2k|	unsigned char const *p = (unsigned char const *)pp;
  101|       |
  102|       |	/* Store into unsigned temporaries before left shifting, to avoid
  103|       |	promotion to signed int and then left shifting into the sign bit,
  104|       |	which is undefined behaviour. */
  105|  43.2k|	unsigned int p1 = p[1];
  106|  43.2k|	unsigned int p0 = p[0];
  107|       |
  108|  43.2k|	return ((p1 << 8) | p0);
  109|  43.2k|}
archive_read_support_format_7zip.c:archive_le32dec:
  113|  39.9k|{
  114|  39.9k|	unsigned char const *p = (unsigned char const *)pp;
  115|       |
  116|       |	/* Store into unsigned temporaries before left shifting, to avoid
  117|       |	promotion to signed int and then left shifting into the sign bit,
  118|       |	which is undefined behaviour. */
  119|  39.9k|	unsigned int p3 = p[3];
  120|  39.9k|	unsigned int p2 = p[2];
  121|  39.9k|	unsigned int p1 = p[1];
  122|  39.9k|	unsigned int p0 = p[0];
  123|       |
  124|  39.9k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  125|  39.9k|}
archive_read_support_format_7zip.c:archive_le16dec:
   99|    116|{
  100|    116|	unsigned char const *p = (unsigned char const *)pp;
  101|       |
  102|       |	/* Store into unsigned temporaries before left shifting, to avoid
  103|       |	promotion to signed int and then left shifting into the sign bit,
  104|       |	which is undefined behaviour. */
  105|    116|	unsigned int p1 = p[1];
  106|    116|	unsigned int p0 = p[0];
  107|       |
  108|    116|	return ((p1 << 8) | p0);
  109|    116|}
archive_read_support_format_7zip.c:archive_be16dec:
   61|      9|{
   62|      9|	unsigned char const *p = (unsigned char const *)pp;
   63|       |
   64|       |	/* Store into unsigned temporaries before left shifting, to avoid
   65|       |	promotion to signed int and then left shifting into the sign bit,
   66|       |	which is undefined behaviour. */
   67|      9|	unsigned int p1 = p[1];
   68|      9|	unsigned int p0 = p[0];
   69|       |
   70|      9|	return ((p0 << 8) | p1);
   71|      9|}
archive_read_support_format_7zip.c:archive_be32dec:
   75|    106|{
   76|    106|	unsigned char const *p = (unsigned char const *)pp;
   77|       |
   78|       |	/* Store into unsigned temporaries before left shifting, to avoid
   79|       |	promotion to signed int and then left shifting into the sign bit,
   80|       |	which is undefined behaviour. */
   81|    106|	unsigned int p3 = p[3];
   82|    106|	unsigned int p2 = p[2];
   83|    106|	unsigned int p1 = p[1];
   84|    106|	unsigned int p0 = p[0];
   85|       |
   86|    106|	return ((p0 << 24) | (p1 << 16) | (p2 << 8) | p3);
   87|    106|}
archive_read_support_format_7zip.c:archive_be64dec:
   91|      1|{
   92|      1|	unsigned char const *p = (unsigned char const *)pp;
   93|       |
   94|      1|	return (((uint64_t)archive_be32dec(p) << 32) | archive_be32dec(p + 4));
   95|      1|}
archive_read_support_format_7zip.c:archive_le64dec:
  129|  2.70k|{
  130|  2.70k|	unsigned char const *p = (unsigned char const *)pp;
  131|       |
  132|  2.70k|	return (((uint64_t)archive_le32dec(p + 4) << 32) | archive_le32dec(p));
  133|  2.70k|}

archive_entry_clear:
  155|   371k|{
  156|   371k|	if (entry == NULL)
  ------------------
  |  Branch (156:6): [True: 0, False: 371k]
  ------------------
  157|      0|		return (NULL);
  158|   371k|	archive_mstring_clean(&entry->ae_fflags_text);
  159|   371k|	archive_mstring_clean(&entry->ae_gname);
  160|   371k|	archive_mstring_clean(&entry->ae_linkname);
  161|   371k|	archive_mstring_clean(&entry->ae_pathname);
  162|   371k|	archive_mstring_clean(&entry->ae_sourcepath);
  163|   371k|	archive_mstring_clean(&entry->ae_uname);
  164|   371k|	archive_entry_copy_mac_metadata(entry, NULL, 0);
  165|   371k|	archive_acl_clear(&entry->acl);
  166|   371k|	archive_entry_xattr_clear(entry);
  167|   371k|	archive_entry_sparse_clear(entry);
  168|   371k|	free(entry->stat);
  169|   371k|	entry->ae_symlink_type = AE_SYMLINK_TYPE_UNDEFINED;
  ------------------
  |  |  227|   371k|#define AE_SYMLINK_TYPE_UNDEFINED	0
  ------------------
  170|   371k|	memset(entry, 0, sizeof(*entry));
  171|   371k|	return entry;
  172|   371k|}
archive_entry_free:
  250|  51.3k|{
  251|  51.3k|	archive_entry_clear(entry);
  252|  51.3k|	free(entry);
  253|  51.3k|}
archive_entry_new:
  257|  48.8k|{
  258|       |	return archive_entry_new2(NULL);
  259|  48.8k|}
archive_entry_new2:
  263|  51.3k|{
  264|  51.3k|	struct archive_entry *entry;
  265|       |
  266|  51.3k|	entry = calloc(1, sizeof(*entry));
  267|  51.3k|	if (entry == NULL)
  ------------------
  |  Branch (267:6): [True: 0, False: 51.3k]
  ------------------
  268|      0|		return (NULL);
  269|  51.3k|	entry->archive = a;
  270|  51.3k|	entry->ae_symlink_type = AE_SYMLINK_TYPE_UNDEFINED;
  ------------------
  |  |  227|  51.3k|#define AE_SYMLINK_TYPE_UNDEFINED	0
  ------------------
  271|  51.3k|	return (entry);
  272|  51.3k|}
archive_entry_atime:
  280|  87.4k|{
  281|  87.4k|	return (entry->ae_stat.aest_atime);
  282|  87.4k|}
archive_entry_atime_is_set:
  292|  1.84k|{
  293|  1.84k|	return (entry->ae_set & AE_SET_ATIME);
  ------------------
  |  |  141|  1.84k|#define	AE_SET_ATIME	4
  ------------------
  294|  1.84k|}
archive_entry_birthtime:
  298|  87.4k|{
  299|  87.4k|	return (entry->ae_stat.aest_birthtime);
  300|  87.4k|}
archive_entry_ctime:
  316|  87.4k|{
  317|  87.4k|	return (entry->ae_stat.aest_ctime);
  318|  87.4k|}
archive_entry_ctime_is_set:
  322|  1.84k|{
  323|  1.84k|	return (entry->ae_set & AE_SET_CTIME);
  ------------------
  |  |  142|  1.84k|#define	AE_SET_CTIME	8
  ------------------
  324|  1.84k|}
archive_entry_dev:
  334|  92.0k|{
  335|  92.0k|	if (entry->ae_stat.aest_dev_is_broken_down)
  ------------------
  |  Branch (335:6): [True: 8.64k, False: 83.4k]
  ------------------
  336|  8.64k|		return ae_makedev(entry->ae_stat.aest_devmajor,
  ------------------
  |  |   94|  8.64k|#define ae_makedev(maj, min) makedev((maj), (min))
  ------------------
  337|  83.4k|		    entry->ae_stat.aest_devminor);
  338|  83.4k|	else
  339|  83.4k|		return (entry->ae_stat.aest_dev);
  340|  92.0k|}
archive_entry_filetype:
  368|   122k|{
  369|   122k|	return (AE_IFMT & entry->acl.mode);
  ------------------
  |  |  215|   122k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
  370|   122k|}
archive_entry_gid:
  427|  87.4k|{
  428|  87.4k|	return (entry->ae_stat.aest_gid);
  429|  87.4k|}
archive_entry_gid_is_set:
  433|  21.2k|{
  434|  21.2k|	return (entry->ae_set & AE_SET_GID);
  ------------------
  |  |  151|  21.2k|#define	AE_SET_GID	4096
  ------------------
  435|  21.2k|}
archive_entry_gname:
  439|  8.00k|{
  440|  8.00k|	const char *p;
  441|  8.00k|	if (archive_mstring_get_mbs(entry->archive, &entry->ae_gname, &p) == 0)
  ------------------
  |  Branch (441:6): [True: 8.00k, False: 0]
  ------------------
  442|  8.00k|		return (p);
  443|      0|	if (errno == ENOMEM)
  ------------------
  |  Branch (443:6): [True: 0, False: 0]
  ------------------
  444|      0|		__archive_errx(1, "No memory");
  445|      0|	return (NULL);
  446|      0|}
archive_entry_set_link_to_hardlink:
  480|  6.19k|{
  481|  6.19k|	if ((entry->ae_set & AE_SET_SYMLINK) != 0) {
  ------------------
  |  |  140|  6.19k|#define	AE_SET_SYMLINK	2
  ------------------
  |  Branch (481:6): [True: 0, False: 6.19k]
  ------------------
  482|      0|		entry->ae_set &= ~AE_SET_SYMLINK;
  ------------------
  |  |  140|      0|#define	AE_SET_SYMLINK	2
  ------------------
  483|      0|	}
  484|  6.19k|	entry->ae_set |= AE_SET_HARDLINK;
  ------------------
  |  |  139|  6.19k|#define	AE_SET_HARDLINK	1
  ------------------
  485|  6.19k|}
archive_entry_hardlink:
  489|  6.19k|{
  490|  6.19k|	const char *p;
  491|  6.19k|	if ((entry->ae_set & AE_SET_HARDLINK) == 0)
  ------------------
  |  |  139|  6.19k|#define	AE_SET_HARDLINK	1
  ------------------
  |  Branch (491:6): [True: 0, False: 6.19k]
  ------------------
  492|      0|		return (NULL);
  493|  6.19k|	if (archive_mstring_get_mbs(
  ------------------
  |  Branch (493:6): [True: 6.19k, False: 0]
  ------------------
  494|  6.19k|	    entry->archive, &entry->ae_linkname, &p) == 0)
  495|  6.19k|		return (p);
  496|      0|	if (errno == ENOMEM)
  ------------------
  |  Branch (496:6): [True: 0, False: 0]
  ------------------
  497|      0|		__archive_errx(1, "No memory");
  498|      0|	return (NULL);
  499|      0|}
archive_entry_hardlink_w:
  517|  6.19k|{
  518|  6.19k|	const wchar_t *p;
  519|  6.19k|	if ((entry->ae_set & AE_SET_HARDLINK) == 0)
  ------------------
  |  |  139|  6.19k|#define	AE_SET_HARDLINK	1
  ------------------
  |  Branch (519:6): [True: 0, False: 6.19k]
  ------------------
  520|      0|		return (NULL);
  521|  6.19k|	if (archive_mstring_get_wcs(
  ------------------
  |  Branch (521:6): [True: 6.19k, False: 0]
  ------------------
  522|  6.19k|	    entry->archive, &entry->ae_linkname, &p) == 0)
  523|  6.19k|		return (p);
  524|      0|	if (errno == ENOMEM)
  ------------------
  |  Branch (524:6): [True: 0, False: 0]
  ------------------
  525|      0|		__archive_errx(1, "No memory");
  526|      0|	return (NULL);
  527|      0|}
archive_entry_ino64:
  561|  4.54k|{
  562|  4.54k|	return (entry->ae_stat.aest_ino);
  563|  4.54k|}
archive_entry_mode:
  567|  87.4k|{
  568|  87.4k|	return (entry->acl.mode);
  569|  87.4k|}
archive_entry_mtime:
  573|  87.4k|{
  574|  87.4k|	return (entry->ae_stat.aest_mtime);
  575|  87.4k|}
archive_entry_mtime_is_set:
  585|  21.2k|{
  586|  21.2k|	return (entry->ae_set & AE_SET_MTIME);
  ------------------
  |  |  143|  21.2k|#define	AE_SET_MTIME	16
  ------------------
  587|  21.2k|}
archive_entry_nlink:
  591|  6.93k|{
  592|  6.93k|	return (entry->ae_stat.aest_nlink);
  593|  6.93k|}
archive_entry_pathname:
  604|   120k|{
  605|   120k|	const char *p;
  606|   120k|	if (archive_mstring_get_mbs(
  ------------------
  |  Branch (606:6): [True: 119k, False: 1.43k]
  ------------------
  607|   120k|	    entry->archive, &entry->ae_pathname, &p) == 0)
  608|   119k|		return (p);
  609|       |#if HAVE_EILSEQ  /*{*/
  610|  1.43k|    if (errno == EILSEQ) {
  ------------------
  |  Branch (610:9): [True: 1.43k, False: 0]
  ------------------
  611|  1.43k|	    if (archive_mstring_get_utf8(
  ------------------
  |  Branch (611:10): [True: 1.43k, False: 0]
  ------------------
  612|  1.43k|	        entry->archive, &entry->ae_pathname, &p) == 0)
  613|  1.43k|		    return (p);
  614|  1.43k|    }
  615|      0|#endif  /*}*/
  616|      0|	if (errno == ENOMEM)
  ------------------
  |  Branch (616:6): [True: 0, False: 0]
  ------------------
  617|      0|		__archive_errx(1, "No memory");
  618|      0|	return (NULL);
  619|      0|}
archive_entry_pathname_utf8:
  623|  94.2k|{
  624|  94.2k|	const char *p;
  625|  94.2k|	if (archive_mstring_get_utf8(
  ------------------
  |  Branch (625:6): [True: 77.1k, False: 17.1k]
  ------------------
  626|  94.2k|	    entry->archive, &entry->ae_pathname, &p) == 0)
  627|  77.1k|		return (p);
  628|  17.1k|	if (errno == ENOMEM)
  ------------------
  |  Branch (628:6): [True: 0, False: 17.1k]
  ------------------
  629|      0|		__archive_errx(1, "No memory");
  630|  17.1k|	return (NULL);
  631|  17.1k|}
archive_entry_pathname_w:
  635|   201k|{
  636|   201k|	const wchar_t *p;
  637|   201k|	if (archive_mstring_get_wcs(
  ------------------
  |  Branch (637:6): [True: 169k, False: 31.9k]
  ------------------
  638|   201k|	    entry->archive, &entry->ae_pathname, &p) == 0)
  639|   169k|		return (p);
  640|  31.9k|	if (errno == ENOMEM)
  ------------------
  |  Branch (640:6): [True: 0, False: 31.9k]
  ------------------
  641|      0|		__archive_errx(1, "No memory");
  642|  31.9k|	return (NULL);
  643|  31.9k|}
archive_entry_perm:
  654|    116|{
  655|    116|	return (~AE_IFMT & entry->acl.mode);
  ------------------
  |  |  215|    116|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
  656|    116|}
archive_entry_perm_is_set:
  660|  21.2k|{
  661|  21.2k|	return (entry->ae_set & AE_SET_PERM);
  ------------------
  |  |  148|  21.2k|#define	AE_SET_PERM	512
  ------------------
  662|  21.2k|}
archive_entry_rdev_is_set:
  666|    734|{
  667|    734|	return (entry->ae_set & AE_SET_RDEV);
  ------------------
  |  |  152|    734|#define	AE_SET_RDEV	8192
  ------------------
  668|    734|}
archive_entry_size:
  712|   146k|{
  713|   146k|	return (entry->ae_stat.aest_size);
  714|   146k|}
archive_entry_symlink:
  746|  3.03k|{
  747|  3.03k|	const char *p;
  748|  3.03k|	if ((entry->ae_set & AE_SET_SYMLINK) == 0)
  ------------------
  |  |  140|  3.03k|#define	AE_SET_SYMLINK	2
  ------------------
  |  Branch (748:6): [True: 2.85k, False: 178]
  ------------------
  749|  2.85k|		return (NULL);
  750|    178|	if (archive_mstring_get_mbs(
  ------------------
  |  Branch (750:6): [True: 178, False: 0]
  ------------------
  751|    178|	    entry->archive, &entry->ae_linkname, &p) == 0)
  752|    178|		return (p);
  753|      0|	if (errno == ENOMEM)
  ------------------
  |  Branch (753:6): [True: 0, False: 0]
  ------------------
  754|      0|		__archive_errx(1, "No memory");
  755|      0|	return (NULL);
  756|      0|}
archive_entry_set_link_to_symlink:
  760|    178|{
  761|    178|	if ((entry->ae_set & AE_SET_HARDLINK) != 0) {
  ------------------
  |  |  139|    178|#define	AE_SET_HARDLINK	1
  ------------------
  |  Branch (761:6): [True: 0, False: 178]
  ------------------
  762|      0|		entry->ae_set &= ~AE_SET_HARDLINK;
  ------------------
  |  |  139|      0|#define	AE_SET_HARDLINK	1
  ------------------
  763|      0|	}
  764|    178|	entry->ae_set |= AE_SET_SYMLINK;
  ------------------
  |  |  140|    178|#define	AE_SET_SYMLINK	2
  ------------------
  765|    178|}
archive_entry_symlink_w:
  789|    178|{
  790|    178|	const wchar_t *p;
  791|    178|	if ((entry->ae_set & AE_SET_SYMLINK) == 0)
  ------------------
  |  |  140|    178|#define	AE_SET_SYMLINK	2
  ------------------
  |  Branch (791:6): [True: 0, False: 178]
  ------------------
  792|      0|		return (NULL);
  793|    178|	if (archive_mstring_get_wcs(
  ------------------
  |  Branch (793:6): [True: 178, False: 0]
  ------------------
  794|    178|	    entry->archive, &entry->ae_linkname, &p) == 0)
  795|    178|		return (p);
  796|      0|	if (errno == ENOMEM)
  ------------------
  |  Branch (796:6): [True: 0, False: 0]
  ------------------
  797|      0|		__archive_errx(1, "No memory");
  798|      0|	return (NULL);
  799|      0|}
archive_entry_uid:
  815|  87.4k|{
  816|  87.4k|	return (entry->ae_stat.aest_uid);
  817|  87.4k|}
archive_entry_uid_is_set:
  821|  21.2k|{
  822|  21.2k|	return (entry->ae_set & AE_SET_UID);
  ------------------
  |  |  150|  21.2k|#define	AE_SET_UID	2048
  ------------------
  823|  21.2k|}
archive_entry_uname:
  827|  8.00k|{
  828|  8.00k|	const char *p;
  829|  8.00k|	if (archive_mstring_get_mbs(entry->archive, &entry->ae_uname, &p) == 0)
  ------------------
  |  Branch (829:6): [True: 8.00k, False: 0]
  ------------------
  830|  8.00k|		return (p);
  831|      0|	if (errno == ENOMEM)
  ------------------
  |  Branch (831:6): [True: 0, False: 0]
  ------------------
  832|      0|		__archive_errx(1, "No memory");
  833|      0|	return (NULL);
  834|      0|}
archive_entry_is_data_encrypted:
  867|  87.4k|{
  868|  87.4k|	return ((entry->encryption & AE_ENCRYPTION_DATA) == AE_ENCRYPTION_DATA);
  ------------------
  |  |  169|  87.4k|#define AE_ENCRYPTION_DATA 1
  ------------------
              	return ((entry->encryption & AE_ENCRYPTION_DATA) == AE_ENCRYPTION_DATA);
  ------------------
  |  |  169|  87.4k|#define AE_ENCRYPTION_DATA 1
  ------------------
  869|  87.4k|}
archive_entry_is_metadata_encrypted:
  873|  87.4k|{
  874|  87.4k|	return ((entry->encryption & AE_ENCRYPTION_METADATA) == AE_ENCRYPTION_METADATA);
  ------------------
  |  |  170|  87.4k|#define AE_ENCRYPTION_METADATA 2
  ------------------
              	return ((entry->encryption & AE_ENCRYPTION_METADATA) == AE_ENCRYPTION_METADATA);
  ------------------
  |  |  170|  87.4k|#define AE_ENCRYPTION_METADATA 2
  ------------------
  875|  87.4k|}
archive_entry_is_encrypted:
  879|  87.4k|{
  880|  87.4k|	return (entry->encryption & (AE_ENCRYPTION_DATA|AE_ENCRYPTION_METADATA));
  ------------------
  |  |  169|  87.4k|#define AE_ENCRYPTION_DATA 1
  ------------------
              	return (entry->encryption & (AE_ENCRYPTION_DATA|AE_ENCRYPTION_METADATA));
  ------------------
  |  |  170|  87.4k|#define AE_ENCRYPTION_METADATA 2
  ------------------
  881|  87.4k|}
archive_entry_set_filetype:
  889|  64.2k|{
  890|  64.2k|	entry->stat_valid = 0;
  891|  64.2k|	entry->acl.mode &= ~AE_IFMT;
  ------------------
  |  |  215|  64.2k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
  892|  64.2k|	entry->acl.mode |= AE_IFMT & type;
  ------------------
  |  |  215|  64.2k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
  893|  64.2k|	entry->ae_set |= AE_SET_FILETYPE;
  ------------------
  |  |  149|  64.2k|#define	AE_SET_FILETYPE	1024
  ------------------
  894|  64.2k|}
archive_entry_copy_fflags_text:
  908|  16.1k|{
  909|  16.1k|	return archive_entry_copy_fflags_text_len(entry, flags, strlen(flags));
  910|  16.1k|}
archive_entry_copy_fflags_text_len:
  915|  16.1k|{
  916|  16.1k|	archive_mstring_copy_mbs_len(&entry->ae_fflags_text, flags, flags_length);
  917|  16.1k|	return (ae_strtofflags(flags, flags_length,
  918|  16.1k|		    &entry->ae_fflags_set, &entry->ae_fflags_clear));
  919|  16.1k|}
archive_entry_set_gid:
  932|  67.3k|{
  933|  67.3k|	if (g < 0) {
  ------------------
  |  Branch (933:6): [True: 124, False: 67.2k]
  ------------------
  934|    124|		g = 0;
  935|    124|	}
  936|  67.3k|	entry->stat_valid = 0;
  937|  67.3k|	entry->ae_stat.aest_gid = g;
  938|  67.3k|	entry->ae_set |= AE_SET_GID;
  ------------------
  |  |  151|  67.3k|#define	AE_SET_GID	4096
  ------------------
  939|  67.3k|}
archive_entry_set_gname:
  943|  1.10k|{
  944|  1.10k|	archive_mstring_copy_mbs(&entry->ae_gname, name);
  945|  1.10k|}
_archive_entry_copy_gname_l:
  979|  8.00k|{
  980|  8.00k|	return (archive_mstring_copy_mbs_len_l(&entry->ae_gname, name, len, sc));
  981|  8.00k|}
archive_entry_set_ino:
  985|   239k|{
  986|   239k|	if (ino < 0) {
  ------------------
  |  Branch (986:6): [True: 0, False: 239k]
  ------------------
  987|      0|		entry->stat_valid = 0;
  988|      0|		entry->ae_set &= ~AE_SET_INO;
  ------------------
  |  |  146|      0|#define	AE_SET_INO	128
  ------------------
  989|      0|		return;
  990|      0|	}
  991|   239k|	entry->stat_valid = 0;
  992|   239k|	entry->ae_set |= AE_SET_INO;
  ------------------
  |  |  146|   239k|#define	AE_SET_INO	128
  ------------------
  993|   239k|	entry->ae_stat.aest_ino = ino;
  994|   239k|}
archive_entry_set_hardlink:
 1011|     67|{
 1012|     67|	if (target == NULL) {
  ------------------
  |  Branch (1012:6): [True: 3, False: 64]
  ------------------
 1013|      3|		entry->ae_set &= ~AE_SET_HARDLINK;
  ------------------
  |  |  139|      3|#define	AE_SET_HARDLINK	1
  ------------------
 1014|      3|		if (entry->ae_set & AE_SET_SYMLINK) {
  ------------------
  |  |  140|      3|#define	AE_SET_SYMLINK	2
  ------------------
  |  Branch (1014:7): [True: 1, False: 2]
  ------------------
 1015|      1|			return;
 1016|      1|		}
 1017|     64|	} else {
 1018|     64|		entry->ae_set |= AE_SET_HARDLINK;
  ------------------
  |  |  139|     64|#define	AE_SET_HARDLINK	1
  ------------------
 1019|     64|	}
 1020|     66|	entry->ae_set &= ~AE_SET_SYMLINK;
  ------------------
  |  |  140|     66|#define	AE_SET_SYMLINK	2
  ------------------
 1021|     66|	archive_mstring_copy_mbs(&entry->ae_linkname, target);
 1022|     66|}
archive_entry_copy_hardlink:
 1038|  3.56k|{
 1039|  3.56k|	if (target == NULL && (entry->ae_set & AE_SET_SYMLINK))
  ------------------
  |  |  140|      0|#define	AE_SET_SYMLINK	2
  ------------------
  |  Branch (1039:6): [True: 0, False: 3.56k]
  |  Branch (1039:24): [True: 0, False: 0]
  ------------------
 1040|      0|		return;
 1041|  3.56k|	archive_mstring_copy_mbs(&entry->ae_linkname, target);
 1042|  3.56k|	if (target != NULL)
  ------------------
  |  Branch (1042:6): [True: 3.56k, False: 0]
  ------------------
 1043|  3.56k|		entry->ae_set |= AE_SET_HARDLINK;
  ------------------
  |  |  139|  3.56k|#define	AE_SET_HARDLINK	1
  ------------------
 1044|      0|	else
 1045|      0|		entry->ae_set &= ~AE_SET_HARDLINK;
  ------------------
  |  |  139|      0|#define	AE_SET_HARDLINK	1
  ------------------
 1046|  3.56k|}
archive_entry_update_hardlink_utf8:
 1062|    164|{
 1063|    164|	if (target == NULL && (entry->ae_set & AE_SET_SYMLINK))
  ------------------
  |  |  140|      0|#define	AE_SET_SYMLINK	2
  ------------------
  |  Branch (1063:6): [True: 0, False: 164]
  |  Branch (1063:24): [True: 0, False: 0]
  ------------------
 1064|      0|		return (0);
 1065|    164|	if (target != NULL)
  ------------------
  |  Branch (1065:6): [True: 164, False: 0]
  ------------------
 1066|    164|		entry->ae_set |= AE_SET_HARDLINK;
  ------------------
  |  |  139|    164|#define	AE_SET_HARDLINK	1
  ------------------
 1067|      0|	else
 1068|      0|		entry->ae_set &= ~AE_SET_HARDLINK;
  ------------------
  |  |  139|      0|#define	AE_SET_HARDLINK	1
  ------------------
 1069|    164|	if (archive_mstring_update_utf8(entry->archive,
  ------------------
  |  Branch (1069:6): [True: 0, False: 164]
  ------------------
 1070|    164|	    &entry->ae_linkname, target) == 0)
 1071|      0|		return (1);
 1072|    164|	if (errno == ENOMEM)
  ------------------
  |  Branch (1072:6): [True: 0, False: 164]
  ------------------
 1073|      0|		__archive_errx(1, "No memory");
 1074|    164|	return (0);
 1075|    164|}
_archive_entry_copy_hardlink_l:
 1080|  6.19k|{
 1081|  6.19k|	int r;
 1082|       |
 1083|  6.19k|	if (target == NULL && (entry->ae_set & AE_SET_SYMLINK))
  ------------------
  |  |  140|      0|#define	AE_SET_SYMLINK	2
  ------------------
  |  Branch (1083:6): [True: 0, False: 6.19k]
  |  Branch (1083:24): [True: 0, False: 0]
  ------------------
 1084|      0|		return (0);
 1085|  6.19k|	r = archive_mstring_copy_mbs_len_l(&entry->ae_linkname,
 1086|  6.19k|	    target, len, sc);
 1087|  6.19k|	if (target != NULL && r == 0)
  ------------------
  |  Branch (1087:6): [True: 6.19k, False: 0]
  |  Branch (1087:24): [True: 6.19k, False: 0]
  ------------------
 1088|  6.19k|		entry->ae_set |= AE_SET_HARDLINK;
  ------------------
  |  |  139|  6.19k|#define	AE_SET_HARDLINK	1
  ------------------
 1089|      0|	else
 1090|      0|		entry->ae_set &= ~AE_SET_HARDLINK;
  ------------------
  |  |  139|      0|#define	AE_SET_HARDLINK	1
  ------------------
 1091|  6.19k|	return (r);
 1092|  6.19k|}
archive_entry_set_atime:
 1096|  40.2k|{
 1097|  40.2k|	FIX_NS(t, ns);
  ------------------
  |  |  112|  40.2k|	do {	\
  |  |  113|  40.2k|		t += ns / 1000000000; \
  |  |  114|  40.2k|		ns %= 1000000000; \
  |  |  115|  40.2k|		if (ns < 0) { --t; ns += 1000000000; } \
  |  |  ------------------
  |  |  |  Branch (115:7): [True: 0, False: 40.2k]
  |  |  ------------------
  |  |  116|  40.2k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (116:11): [Folded, False: 40.2k]
  |  |  ------------------
  ------------------
 1098|  40.2k|	entry->stat_valid = 0;
 1099|  40.2k|	entry->ae_set |= AE_SET_ATIME;
  ------------------
  |  |  141|  40.2k|#define	AE_SET_ATIME	4
  ------------------
 1100|  40.2k|	entry->ae_stat.aest_atime = t;
 1101|  40.2k|	entry->ae_stat.aest_atime_nsec = ns;
 1102|  40.2k|}
archive_entry_unset_atime:
 1106|  3.17k|{
 1107|  3.17k|	archive_entry_set_atime(entry, 0, 0);
 1108|  3.17k|	entry->ae_set &= ~AE_SET_ATIME;
  ------------------
  |  |  141|  3.17k|#define	AE_SET_ATIME	4
  ------------------
 1109|  3.17k|}
archive_entry_set_birthtime:
 1113|  3.37k|{
 1114|  3.37k|	FIX_NS(t, ns);
  ------------------
  |  |  112|  3.37k|	do {	\
  |  |  113|  3.37k|		t += ns / 1000000000; \
  |  |  114|  3.37k|		ns %= 1000000000; \
  |  |  115|  3.37k|		if (ns < 0) { --t; ns += 1000000000; } \
  |  |  ------------------
  |  |  |  Branch (115:7): [True: 0, False: 3.37k]
  |  |  ------------------
  |  |  116|  3.37k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (116:11): [Folded, False: 3.37k]
  |  |  ------------------
  ------------------
 1115|  3.37k|	entry->stat_valid = 0;
 1116|  3.37k|	entry->ae_set |= AE_SET_BIRTHTIME;
  ------------------
  |  |  144|  3.37k|#define	AE_SET_BIRTHTIME 32
  ------------------
 1117|  3.37k|	entry->ae_stat.aest_birthtime = t;
 1118|  3.37k|	entry->ae_stat.aest_birthtime_nsec = ns;
 1119|  3.37k|}
archive_entry_unset_birthtime:
 1123|  3.37k|{
 1124|  3.37k|	archive_entry_set_birthtime(entry, 0, 0);
 1125|  3.37k|	entry->ae_set &= ~AE_SET_BIRTHTIME;
  ------------------
  |  |  144|  3.37k|#define	AE_SET_BIRTHTIME 32
  ------------------
 1126|  3.37k|}
archive_entry_set_ctime:
 1130|  48.3k|{
 1131|  48.3k|	FIX_NS(t, ns);
  ------------------
  |  |  112|  48.3k|	do {	\
  |  |  113|  48.3k|		t += ns / 1000000000; \
  |  |  114|  48.3k|		ns %= 1000000000; \
  |  |  115|  48.3k|		if (ns < 0) { --t; ns += 1000000000; } \
  |  |  ------------------
  |  |  |  Branch (115:7): [True: 0, False: 48.3k]
  |  |  ------------------
  |  |  116|  48.3k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (116:11): [Folded, False: 48.3k]
  |  |  ------------------
  ------------------
 1132|  48.3k|	entry->stat_valid = 0;
 1133|  48.3k|	entry->ae_set |= AE_SET_CTIME;
  ------------------
  |  |  142|  48.3k|#define	AE_SET_CTIME	8
  ------------------
 1134|  48.3k|	entry->ae_stat.aest_ctime = t;
 1135|  48.3k|	entry->ae_stat.aest_ctime_nsec = ns;
 1136|  48.3k|}
archive_entry_unset_ctime:
 1140|  3.18k|{
 1141|  3.18k|	archive_entry_set_ctime(entry, 0, 0);
 1142|  3.18k|	entry->ae_set &= ~AE_SET_CTIME;
  ------------------
  |  |  142|  3.18k|#define	AE_SET_CTIME	8
  ------------------
 1143|  3.18k|}
archive_entry_set_dev:
 1147|   235k|{
 1148|   235k|	entry->stat_valid = 0;
 1149|   235k|	entry->ae_set |= AE_SET_DEV;
  ------------------
  |  |  147|   235k|#define	AE_SET_DEV	256
  ------------------
 1150|   235k|	entry->ae_stat.aest_dev_is_broken_down = 0;
 1151|   235k|	entry->ae_stat.aest_dev = d;
 1152|   235k|}
archive_entry_set_devmajor:
 1156|  4.33k|{
 1157|  4.33k|	entry->stat_valid = 0;
 1158|  4.33k|	entry->ae_set |= AE_SET_DEV;
  ------------------
  |  |  147|  4.33k|#define	AE_SET_DEV	256
  ------------------
 1159|  4.33k|	entry->ae_stat.aest_dev_is_broken_down = 1;
 1160|  4.33k|	entry->ae_stat.aest_devmajor = m;
 1161|  4.33k|}
archive_entry_set_devminor:
 1165|  4.33k|{
 1166|  4.33k|	entry->stat_valid = 0;
 1167|  4.33k|	entry->ae_set |= AE_SET_DEV;
  ------------------
  |  |  147|  4.33k|#define	AE_SET_DEV	256
  ------------------
 1168|  4.33k|	entry->ae_stat.aest_dev_is_broken_down = 1;
 1169|  4.33k|	entry->ae_stat.aest_devminor = m;
 1170|  4.33k|}
archive_entry_set_link:
 1175|    379|{
 1176|    379|	archive_mstring_copy_mbs(&entry->ae_linkname, target);
 1177|    379|	if ((entry->ae_set & AE_SET_SYMLINK) == 0) {
  ------------------
  |  |  140|    379|#define	AE_SET_SYMLINK	2
  ------------------
  |  Branch (1177:6): [True: 379, False: 0]
  ------------------
 1178|    379|		entry->ae_set |= AE_SET_HARDLINK;
  ------------------
  |  |  139|    379|#define	AE_SET_HARDLINK	1
  ------------------
 1179|    379|	}
 1180|    379|}
archive_entry_set_mode:
 1243|  65.6k|{
 1244|  65.6k|	entry->stat_valid = 0;
 1245|  65.6k|	entry->acl.mode = m;
 1246|  65.6k|	entry->ae_set |= AE_SET_PERM | AE_SET_FILETYPE;
  ------------------
  |  |  148|  65.6k|#define	AE_SET_PERM	512
  ------------------
              	entry->ae_set |= AE_SET_PERM | AE_SET_FILETYPE;
  ------------------
  |  |  149|  65.6k|#define	AE_SET_FILETYPE	1024
  ------------------
 1247|  65.6k|}
archive_entry_set_mtime:
 1251|  90.3k|{
 1252|  90.3k|	FIX_NS(t, ns);
  ------------------
  |  |  112|  90.3k|	do {	\
  |  |  113|  90.3k|		t += ns / 1000000000; \
  |  |  114|  90.3k|		ns %= 1000000000; \
  |  |  115|  90.3k|		if (ns < 0) { --t; ns += 1000000000; } \
  |  |  ------------------
  |  |  |  Branch (115:7): [True: 0, False: 90.3k]
  |  |  ------------------
  |  |  116|  90.3k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (116:11): [Folded, False: 90.3k]
  |  |  ------------------
  ------------------
 1253|  90.3k|	entry->stat_valid = 0;
 1254|  90.3k|	entry->ae_set |= AE_SET_MTIME;
  ------------------
  |  |  143|  90.3k|#define	AE_SET_MTIME	16
  ------------------
 1255|  90.3k|	entry->ae_stat.aest_mtime = t;
 1256|  90.3k|	entry->ae_stat.aest_mtime_nsec = ns;
 1257|  90.3k|}
archive_entry_unset_mtime:
 1261|    324|{
 1262|    324|	archive_entry_set_mtime(entry, 0, 0);
 1263|    324|	entry->ae_set &= ~AE_SET_MTIME;
  ------------------
  |  |  143|    324|#define	AE_SET_MTIME	16
  ------------------
 1264|    324|}
archive_entry_set_nlink:
 1268|  6.63k|{
 1269|  6.63k|	entry->stat_valid = 0;
 1270|  6.63k|	entry->ae_stat.aest_nlink = nlink;
 1271|  6.63k|}
archive_entry_set_pathname:
 1275|    738|{
 1276|    738|	archive_mstring_copy_mbs(&entry->ae_pathname, name);
 1277|    738|}
archive_entry_copy_pathname:
 1287|  16.5k|{
 1288|  16.5k|	archive_mstring_copy_mbs(&entry->ae_pathname, name);
 1289|  16.5k|}
archive_entry_copy_pathname_w:
 1293|  3.45k|{
 1294|  3.45k|	archive_mstring_copy_wcs(&entry->ae_pathname, name);
 1295|  3.45k|}
archive_entry_update_pathname_utf8:
 1299|  24.8k|{
 1300|  24.8k|	if (archive_mstring_update_utf8(entry->archive,
  ------------------
  |  Branch (1300:6): [True: 15.4k, False: 9.35k]
  ------------------
 1301|  24.8k|	    &entry->ae_pathname, name) == 0)
 1302|  15.4k|		return (1);
 1303|  9.35k|	if (errno == ENOMEM)
  ------------------
  |  Branch (1303:6): [True: 0, False: 9.35k]
  ------------------
 1304|      0|		__archive_errx(1, "No memory");
 1305|  9.35k|	return (0);
 1306|  9.35k|}
_archive_entry_copy_pathname_l:
 1311|  64.4k|{
 1312|  64.4k|	return (archive_mstring_copy_mbs_len_l(&entry->ae_pathname,
 1313|  64.4k|	    name, len, sc));
 1314|  64.4k|}
archive_entry_set_perm:
 1318|  29.0k|{
 1319|  29.0k|	entry->stat_valid = 0;
 1320|  29.0k|	entry->acl.mode &= AE_IFMT;
  ------------------
  |  |  215|  29.0k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
 1321|  29.0k|	entry->acl.mode |= ~AE_IFMT & p;
  ------------------
  |  |  215|  29.0k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
 1322|  29.0k|	entry->ae_set |= AE_SET_PERM;
  ------------------
  |  |  148|  29.0k|#define	AE_SET_PERM	512
  ------------------
 1323|  29.0k|}
archive_entry_set_rdev:
 1327|  9.43k|{
 1328|  9.43k|	entry->stat_valid = 0;
 1329|  9.43k|	entry->ae_stat.aest_rdev = m;
 1330|  9.43k|	entry->ae_stat.aest_rdev_is_broken_down = 0;
 1331|  9.43k|	entry->ae_stat.aest_rdevmajor = 0;
 1332|  9.43k|	entry->ae_stat.aest_rdevminor = 0;
 1333|  9.43k|	entry->ae_set |= AE_SET_RDEV;
  ------------------
  |  |  152|  9.43k|#define	AE_SET_RDEV	8192
  ------------------
 1334|  9.43k|}
archive_entry_set_rdevmajor:
 1338|  5.07k|{
 1339|  5.07k|	entry->stat_valid = 0;
 1340|  5.07k|	entry->ae_stat.aest_rdev_is_broken_down = 1;
 1341|  5.07k|	entry->ae_stat.aest_rdev = 0;
 1342|  5.07k|	entry->ae_stat.aest_rdevmajor = m;
 1343|  5.07k|	entry->ae_set |= AE_SET_RDEV;
  ------------------
  |  |  152|  5.07k|#define	AE_SET_RDEV	8192
  ------------------
 1344|  5.07k|}
archive_entry_set_rdevminor:
 1348|  5.07k|{
 1349|  5.07k|	entry->stat_valid = 0;
 1350|  5.07k|	entry->ae_stat.aest_rdev_is_broken_down = 1;
 1351|  5.07k|	entry->ae_stat.aest_rdev = 0;
 1352|  5.07k|	entry->ae_stat.aest_rdevminor = m;
 1353|  5.07k|	entry->ae_set |= AE_SET_RDEV;
  ------------------
  |  |  152|  5.07k|#define	AE_SET_RDEV	8192
  ------------------
 1354|  5.07k|}
archive_entry_set_size:
 1358|  94.6k|{
 1359|  94.6k|	if (s < 0) {
  ------------------
  |  Branch (1359:6): [True: 0, False: 94.6k]
  ------------------
 1360|      0|		s = 0;
 1361|      0|	}
 1362|  94.6k|	entry->stat_valid = 0;
 1363|  94.6k|	entry->ae_stat.aest_size = s;
 1364|  94.6k|	entry->ae_set |= AE_SET_SIZE;
  ------------------
  |  |  145|  94.6k|#define	AE_SET_SIZE	64
  ------------------
 1365|  94.6k|}
archive_entry_unset_size:
 1369|     67|{
 1370|     67|	archive_entry_set_size(entry, 0);
 1371|     67|	entry->ae_set &= ~AE_SET_SIZE;
  ------------------
  |  |  145|     67|#define	AE_SET_SIZE	64
  ------------------
 1372|     67|}
archive_entry_set_symlink:
 1388|  2.85k|{
 1389|  2.85k|	if (linkname == NULL && (entry->ae_set & AE_SET_HARDLINK))
  ------------------
  |  |  139|  2.85k|#define	AE_SET_HARDLINK	1
  ------------------
  |  Branch (1389:6): [True: 2.85k, False: 0]
  |  Branch (1389:26): [True: 0, False: 2.85k]
  ------------------
 1390|      0|		return;
 1391|  2.85k|	archive_mstring_copy_mbs(&entry->ae_linkname, linkname);
 1392|  2.85k|	entry->ae_set &= ~AE_SET_HARDLINK;
  ------------------
  |  |  139|  2.85k|#define	AE_SET_HARDLINK	1
  ------------------
 1393|  2.85k|	if (linkname == NULL)
  ------------------
  |  Branch (1393:6): [True: 2.85k, False: 0]
  ------------------
 1394|  2.85k|		entry->ae_set &= ~AE_SET_SYMLINK;
  ------------------
  |  |  140|  2.85k|#define	AE_SET_SYMLINK	2
  ------------------
 1395|      0|	else
 1396|      0|		entry->ae_set |= AE_SET_SYMLINK;
  ------------------
  |  |  140|      0|#define	AE_SET_SYMLINK	2
  ------------------
 1397|  2.85k|}
archive_entry_copy_symlink:
 1420|     20|{
 1421|     20|	if (linkname == NULL && (entry->ae_set & AE_SET_HARDLINK))
  ------------------
  |  |  139|      0|#define	AE_SET_HARDLINK	1
  ------------------
  |  Branch (1421:6): [True: 0, False: 20]
  |  Branch (1421:26): [True: 0, False: 0]
  ------------------
 1422|      0|		return;
 1423|     20|	archive_mstring_copy_mbs(&entry->ae_linkname, linkname);
 1424|     20|	entry->ae_set &= ~AE_SET_HARDLINK;
  ------------------
  |  |  139|     20|#define	AE_SET_HARDLINK	1
  ------------------
 1425|     20|	if (linkname == NULL)
  ------------------
  |  Branch (1425:6): [True: 0, False: 20]
  ------------------
 1426|      0|		entry->ae_set &= ~AE_SET_SYMLINK;
  ------------------
  |  |  140|      0|#define	AE_SET_SYMLINK	2
  ------------------
 1427|     20|	else
 1428|     20|		entry->ae_set |= AE_SET_SYMLINK;
  ------------------
  |  |  140|     20|#define	AE_SET_SYMLINK	2
  ------------------
 1429|     20|}
_archive_entry_copy_symlink_l:
 1465|  2.46k|{
 1466|  2.46k|	int r;
 1467|       |
 1468|  2.46k|	if (linkname == NULL && (entry->ae_set & AE_SET_HARDLINK))
  ------------------
  |  |  139|      0|#define	AE_SET_HARDLINK	1
  ------------------
  |  Branch (1468:6): [True: 0, False: 2.46k]
  |  Branch (1468:26): [True: 0, False: 0]
  ------------------
 1469|      0|		return (0);
 1470|  2.46k|	entry->ae_set &= ~AE_SET_HARDLINK;
  ------------------
  |  |  139|  2.46k|#define	AE_SET_HARDLINK	1
  ------------------
 1471|  2.46k|	r = archive_mstring_copy_mbs_len_l(&entry->ae_linkname,
 1472|  2.46k|	    linkname, len, sc);
 1473|  2.46k|	if (linkname == NULL || r != 0)
  ------------------
  |  Branch (1473:6): [True: 0, False: 2.46k]
  |  Branch (1473:26): [True: 461, False: 2.00k]
  ------------------
 1474|    461|		entry->ae_set &= ~AE_SET_SYMLINK;
  ------------------
  |  |  140|    461|#define	AE_SET_SYMLINK	2
  ------------------
 1475|  2.00k|	else
 1476|  2.00k|		entry->ae_set |= AE_SET_SYMLINK;
  ------------------
  |  |  140|  2.00k|#define	AE_SET_SYMLINK	2
  ------------------
 1477|  2.46k|	return (r);
 1478|  2.46k|}
archive_entry_set_uid:
 1482|  68.0k|{
 1483|  68.0k|	if (u < 0) {
  ------------------
  |  Branch (1483:6): [True: 270, False: 67.7k]
  ------------------
 1484|    270|		u = 0;
 1485|    270|	}
 1486|  68.0k|	entry->stat_valid = 0;
 1487|  68.0k|	entry->ae_stat.aest_uid = u;
 1488|  68.0k|	entry->ae_set |= AE_SET_UID;
  ------------------
  |  |  150|  68.0k|#define	AE_SET_UID	2048
  ------------------
 1489|  68.0k|}
archive_entry_set_uname:
 1493|    238|{
 1494|    238|	archive_mstring_copy_mbs(&entry->ae_uname, name);
 1495|    238|}
archive_entry_set_is_data_encrypted:
 1528|  13.2k|{
 1529|  13.2k|	if (is_encrypted) {
  ------------------
  |  Branch (1529:6): [True: 13.2k, False: 0]
  ------------------
 1530|  13.2k|		entry->encryption |= AE_ENCRYPTION_DATA;
  ------------------
  |  |  169|  13.2k|#define AE_ENCRYPTION_DATA 1
  ------------------
 1531|  13.2k|	} else {
 1532|      0|		entry->encryption &= ~AE_ENCRYPTION_DATA;
  ------------------
  |  |  169|      0|#define AE_ENCRYPTION_DATA 1
  ------------------
 1533|      0|	}
 1534|  13.2k|}
archive_entry_set_is_metadata_encrypted:
 1538|      8|{
 1539|      8|	if (is_encrypted) {
  ------------------
  |  Branch (1539:6): [True: 8, False: 0]
  ------------------
 1540|      8|		entry->encryption |= AE_ENCRYPTION_METADATA;
  ------------------
  |  |  170|      8|#define AE_ENCRYPTION_METADATA 2
  ------------------
 1541|      8|	} else {
 1542|      0|		entry->encryption &= ~AE_ENCRYPTION_METADATA;
  ------------------
  |  |  170|      0|#define AE_ENCRYPTION_METADATA 2
  ------------------
 1543|      0|	}
 1544|      8|}
_archive_entry_copy_uname_l:
 1549|  8.00k|{
 1550|  8.00k|	return (archive_mstring_copy_mbs_len_l(&entry->ae_uname,
 1551|  8.00k|	    name, len, sc));
 1552|  8.00k|}
archive_entry_copy_mac_metadata:
 1564|   371k|{
 1565|   371k|  free(entry->mac_metadata);
 1566|   371k|  if (p == NULL || s == 0) {
  ------------------
  |  Branch (1566:7): [True: 371k, False: 0]
  |  Branch (1566:20): [True: 0, False: 0]
  ------------------
 1567|   371k|    entry->mac_metadata = NULL;
 1568|   371k|    entry->mac_metadata_size = 0;
 1569|   371k|  } else {
 1570|      0|    entry->mac_metadata_size = s;
 1571|      0|    entry->mac_metadata = malloc(s);
 1572|      0|    if (entry->mac_metadata == NULL)
  ------------------
  |  Branch (1572:9): [True: 0, False: 0]
  ------------------
 1573|      0|      abort();
 1574|      0|    memcpy(entry->mac_metadata, p, s);
 1575|      0|  }
 1576|   371k|}
archive_entry_digest:
 1581|  87.4k|{
 1582|  87.4k|	switch (type) {
 1583|      0|	case ARCHIVE_ENTRY_DIGEST_MD5:
  ------------------
  |  |  444|      0|#define ARCHIVE_ENTRY_DIGEST_MD5              0x00000001
  ------------------
  |  Branch (1583:2): [True: 0, False: 87.4k]
  ------------------
 1584|      0|		return entry->digest.md5;
 1585|      0|	case ARCHIVE_ENTRY_DIGEST_RMD160:
  ------------------
  |  |  445|      0|#define ARCHIVE_ENTRY_DIGEST_RMD160           0x00000002
  ------------------
  |  Branch (1585:2): [True: 0, False: 87.4k]
  ------------------
 1586|      0|		return entry->digest.rmd160;
 1587|  87.4k|	case ARCHIVE_ENTRY_DIGEST_SHA1:
  ------------------
  |  |  446|  87.4k|#define ARCHIVE_ENTRY_DIGEST_SHA1             0x00000003
  ------------------
  |  Branch (1587:2): [True: 87.4k, False: 0]
  ------------------
 1588|  87.4k|		return entry->digest.sha1;
 1589|      0|	case ARCHIVE_ENTRY_DIGEST_SHA256:
  ------------------
  |  |  447|      0|#define ARCHIVE_ENTRY_DIGEST_SHA256           0x00000004
  ------------------
  |  Branch (1589:2): [True: 0, False: 87.4k]
  ------------------
 1590|      0|		return entry->digest.sha256;
 1591|      0|	case ARCHIVE_ENTRY_DIGEST_SHA384:
  ------------------
  |  |  448|      0|#define ARCHIVE_ENTRY_DIGEST_SHA384           0x00000005
  ------------------
  |  Branch (1591:2): [True: 0, False: 87.4k]
  ------------------
 1592|      0|		return entry->digest.sha384;
 1593|      0|	case ARCHIVE_ENTRY_DIGEST_SHA512:
  ------------------
  |  |  449|      0|#define ARCHIVE_ENTRY_DIGEST_SHA512           0x00000006
  ------------------
  |  Branch (1593:2): [True: 0, False: 87.4k]
  ------------------
 1594|      0|		return entry->digest.sha512;
 1595|      0|	default:
  ------------------
  |  Branch (1595:2): [True: 0, False: 87.4k]
  ------------------
 1596|       |		return NULL;
 1597|  87.4k|	}
 1598|  87.4k|}
archive_entry_acl:
 1651|    116|{
 1652|    116|	return &entry->acl;
 1653|    116|}
archive_entry.c:ae_strtofflags:
 2145|  16.1k|{
 2146|  16.1k|	const char *start, *end;
 2147|  16.1k|	const struct flag *flag;
 2148|  16.1k|	unsigned long set, clear;
 2149|  16.1k|	const char *failed;
 2150|       |
 2151|  16.1k|	set = clear = 0;
 2152|  16.1k|	start = s;
 2153|  16.1k|	failed = NULL;
 2154|       |	/* Find start of first token. */
 2155|  16.1k|	while (l > 0 && (*start == '\t'  ||  *start == ' '  ||  *start == ',')) {
  ------------------
  |  Branch (2155:9): [True: 16.1k, False: 0]
  |  Branch (2155:19): [True: 0, False: 16.1k]
  |  Branch (2155:39): [True: 0, False: 16.1k]
  |  Branch (2155:58): [True: 0, False: 16.1k]
  ------------------
 2156|      0|		start++;
 2157|      0|		l--;
 2158|      0|	}
 2159|  50.0k|	while (l > 0) {
  ------------------
  |  Branch (2159:9): [True: 33.9k, False: 16.1k]
  ------------------
 2160|  33.9k|		size_t length;
 2161|       |		/* Locate end of token. */
 2162|  33.9k|		end = start;
 2163|   237k|		while (l > 0 && *end != '\t'  &&
  ------------------
  |  Branch (2163:10): [True: 221k, False: 16.1k]
  |  Branch (2163:19): [True: 221k, False: 0]
  ------------------
 2164|   221k|		    *end != ' '  &&  *end != ',') {
  ------------------
  |  Branch (2164:7): [True: 221k, False: 0]
  |  Branch (2164:24): [True: 203k, False: 17.8k]
  ------------------
 2165|   203k|			end++;
 2166|   203k|			l--;
 2167|   203k|		}
 2168|  33.9k|		length = end - start;
 2169|   678k|		for (flag = fileflags; flag->name != NULL; flag++) {
  ------------------
  |  Branch (2169:26): [True: 644k, False: 33.9k]
  ------------------
 2170|   644k|			size_t flag_length = strlen(flag->name);
 2171|   644k|			if (length == flag_length
  ------------------
  |  Branch (2171:8): [True: 135k, False: 508k]
  ------------------
 2172|   135k|			    && memcmp(start, flag->name, length) == 0) {
  ------------------
  |  Branch (2172:11): [True: 0, False: 135k]
  ------------------
 2173|       |				/* Matched "noXXXX", so reverse the sense. */
 2174|      0|				clear |= flag->set;
 2175|      0|				set |= flag->clear;
 2176|      0|				break;
 2177|   644k|			} else if (length == flag_length - 2
  ------------------
  |  Branch (2177:15): [True: 101k, False: 542k]
  ------------------
 2178|   101k|			    && memcmp(start, flag->name + 2, length) == 0) {
  ------------------
  |  Branch (2178:11): [True: 0, False: 101k]
  ------------------
 2179|       |				/* Matched "XXXX", so don't reverse. */
 2180|      0|				set |= flag->set;
 2181|      0|				clear |= flag->clear;
 2182|      0|				break;
 2183|      0|			}
 2184|   644k|		}
 2185|       |		/* Ignore unknown flag names. */
 2186|  33.9k|		if (flag->name == NULL  &&  failed == NULL)
  ------------------
  |  Branch (2186:7): [True: 33.9k, False: 0]
  |  Branch (2186:31): [True: 16.1k, False: 17.8k]
  ------------------
 2187|  16.1k|			failed = start;
 2188|       |
 2189|       |		/* Find start of next token. */
 2190|  33.9k|		start = end;
 2191|  51.7k|		while (l > 0 && (*start == '\t'  ||  *start == ' '  ||  *start == ',')) {
  ------------------
  |  Branch (2191:10): [True: 35.6k, False: 16.1k]
  |  Branch (2191:20): [True: 0, False: 35.6k]
  |  Branch (2191:40): [True: 0, False: 35.6k]
  |  Branch (2191:59): [True: 17.8k, False: 17.8k]
  ------------------
 2192|  17.8k|			start++;
 2193|  17.8k|			l--;
 2194|  17.8k|		}
 2195|       |
 2196|  33.9k|	}
 2197|       |
 2198|  16.1k|	if (setp)
  ------------------
  |  Branch (2198:6): [True: 16.1k, False: 0]
  ------------------
 2199|  16.1k|		*setp = set;
 2200|  16.1k|	if (clrp)
  ------------------
  |  Branch (2200:6): [True: 16.1k, False: 0]
  ------------------
 2201|  16.1k|		*clrp = clear;
 2202|       |
 2203|       |	/* Return location of first failure. */
 2204|  16.1k|	return (failed);
 2205|  16.1k|}

archive_entry_linkresolver_new:
  100|     33|{
  101|     33|	struct archive_entry_linkresolver *res;
  102|       |
  103|       |	/* Check for positive power-of-two */
  104|     33|	if (links_cache_initial_size == 0 ||
  ------------------
  |  |   67|     33|#define	links_cache_initial_size 1024
  ------------------
  |  Branch (104:6): [Folded, False: 0]
  ------------------
  105|      0|	    (links_cache_initial_size & (links_cache_initial_size - 1)) != 0)
  ------------------
  |  |   67|      0|#define	links_cache_initial_size 1024
  ------------------
              	    (links_cache_initial_size & (links_cache_initial_size - 1)) != 0)
  ------------------
  |  |   67|      0|#define	links_cache_initial_size 1024
  ------------------
  |  Branch (105:6): [Folded, False: 0]
  ------------------
  106|      0|		return (NULL);
  107|       |
  108|     33|	res = calloc(1, sizeof(struct archive_entry_linkresolver));
  109|     33|	if (res == NULL)
  ------------------
  |  Branch (109:6): [True: 0, False: 33]
  ------------------
  110|      0|		return (NULL);
  111|     33|	res->number_buckets = links_cache_initial_size;
  ------------------
  |  |   67|     33|#define	links_cache_initial_size 1024
  ------------------
  112|     33|	res->buckets = calloc(res->number_buckets, sizeof(res->buckets[0]));
  113|     33|	if (res->buckets == NULL) {
  ------------------
  |  Branch (113:6): [True: 0, False: 33]
  ------------------
  114|      0|		free(res);
  115|      0|		return (NULL);
  116|      0|	}
  117|     33|	return (res);
  118|     33|}
archive_entry_linkresolver_set_strategy:
  123|     33|{
  124|     33|	int fmtbase = fmt & ARCHIVE_FORMAT_BASE_MASK;
  ------------------
  |  |  355|     33|#define	ARCHIVE_FORMAT_BASE_MASK		0xff0000
  ------------------
  125|       |
  126|     33|	switch (fmtbase) {
  127|      0|	case ARCHIVE_FORMAT_7ZIP:
  ------------------
  |  |  385|      0|#define	ARCHIVE_FORMAT_7ZIP			0xE0000
  ------------------
  |  Branch (127:2): [True: 0, False: 33]
  ------------------
  128|      0|	case ARCHIVE_FORMAT_AR:
  ------------------
  |  |  376|      0|#define	ARCHIVE_FORMAT_AR			0x70000
  ------------------
  |  Branch (128:2): [True: 0, False: 33]
  ------------------
  129|      0|	case ARCHIVE_FORMAT_ZIP:
  ------------------
  |  |  374|      0|#define	ARCHIVE_FORMAT_ZIP			0x50000
  ------------------
  |  Branch (129:2): [True: 0, False: 33]
  ------------------
  130|      0|		res->strategy = ARCHIVE_ENTRY_LINKIFY_LIKE_OLD_CPIO;
  ------------------
  |  |   63|      0|#define ARCHIVE_ENTRY_LINKIFY_LIKE_OLD_CPIO 2
  ------------------
  131|      0|		break;
  132|      0|	case ARCHIVE_FORMAT_CPIO:
  ------------------
  |  |  356|      0|#define	ARCHIVE_FORMAT_CPIO			0x10000
  ------------------
  |  Branch (132:2): [True: 0, False: 33]
  ------------------
  133|      0|		switch (fmt) {
  134|      0|		case ARCHIVE_FORMAT_CPIO_SVR4_NOCRC:
  ------------------
  |  |  360|      0|#define	ARCHIVE_FORMAT_CPIO_SVR4_NOCRC		(ARCHIVE_FORMAT_CPIO | 4)
  |  |  ------------------
  |  |  |  |  356|      0|#define	ARCHIVE_FORMAT_CPIO			0x10000
  |  |  ------------------
  ------------------
  |  Branch (134:3): [True: 0, False: 0]
  ------------------
  135|      0|		case ARCHIVE_FORMAT_CPIO_SVR4_CRC:
  ------------------
  |  |  361|      0|#define	ARCHIVE_FORMAT_CPIO_SVR4_CRC		(ARCHIVE_FORMAT_CPIO | 5)
  |  |  ------------------
  |  |  |  |  356|      0|#define	ARCHIVE_FORMAT_CPIO			0x10000
  |  |  ------------------
  ------------------
  |  Branch (135:3): [True: 0, False: 0]
  ------------------
  136|      0|			res->strategy = ARCHIVE_ENTRY_LINKIFY_LIKE_NEW_CPIO;
  ------------------
  |  |   64|      0|#define ARCHIVE_ENTRY_LINKIFY_LIKE_NEW_CPIO 3
  ------------------
  137|      0|			break;
  138|      0|		default:
  ------------------
  |  Branch (138:3): [True: 0, False: 0]
  ------------------
  139|      0|			res->strategy = ARCHIVE_ENTRY_LINKIFY_LIKE_OLD_CPIO;
  ------------------
  |  |   63|      0|#define ARCHIVE_ENTRY_LINKIFY_LIKE_OLD_CPIO 2
  ------------------
  140|      0|			break;
  141|      0|		}
  142|      0|		break;
  143|     33|	case ARCHIVE_FORMAT_MTREE:
  ------------------
  |  |  379|     33|#define	ARCHIVE_FORMAT_MTREE			0x80000
  ------------------
  |  Branch (143:2): [True: 33, False: 0]
  ------------------
  144|     33|		res->strategy = ARCHIVE_ENTRY_LINKIFY_LIKE_MTREE;
  ------------------
  |  |   62|     33|#define ARCHIVE_ENTRY_LINKIFY_LIKE_MTREE 1
  ------------------
  145|     33|		break;
  146|      0|	case ARCHIVE_FORMAT_ISO9660:
  ------------------
  |  |  372|      0|#define	ARCHIVE_FORMAT_ISO9660			0x40000
  ------------------
  |  Branch (146:2): [True: 0, False: 33]
  ------------------
  147|      0|	case ARCHIVE_FORMAT_SHAR:
  ------------------
  |  |  364|      0|#define	ARCHIVE_FORMAT_SHAR			0x20000
  ------------------
  |  Branch (147:2): [True: 0, False: 33]
  ------------------
  148|      0|	case ARCHIVE_FORMAT_TAR:
  ------------------
  |  |  367|      0|#define	ARCHIVE_FORMAT_TAR			0x30000
  ------------------
  |  Branch (148:2): [True: 0, False: 33]
  ------------------
  149|      0|	case ARCHIVE_FORMAT_XAR:
  ------------------
  |  |  381|      0|#define	ARCHIVE_FORMAT_XAR			0xA0000
  ------------------
  |  Branch (149:2): [True: 0, False: 33]
  ------------------
  150|      0|		res->strategy = ARCHIVE_ENTRY_LINKIFY_LIKE_TAR;
  ------------------
  |  |   61|      0|#define ARCHIVE_ENTRY_LINKIFY_LIKE_TAR	0
  ------------------
  151|      0|		break;
  152|      0|	default:
  ------------------
  |  Branch (152:2): [True: 0, False: 33]
  ------------------
  153|      0|		res->strategy = ARCHIVE_ENTRY_LINKIFY_LIKE_OLD_CPIO;
  ------------------
  |  |   63|      0|#define ARCHIVE_ENTRY_LINKIFY_LIKE_OLD_CPIO 2
  ------------------
  154|      0|		break;
  155|     33|	}
  156|     33|}
archive_entry_linkresolver_free:
  160|  2.49k|{
  161|  2.49k|	if (res == NULL)
  ------------------
  |  Branch (161:6): [True: 2.46k, False: 33]
  ------------------
  162|  2.46k|		return;
  163|       |
  164|     33|	while (next_entry(res, NEXT_ENTRY_ALL) != NULL) {
  ------------------
  |  |   88|     33|#define	NEXT_ENTRY_ALL		(NEXT_ENTRY_DEFERRED | NEXT_ENTRY_PARTIAL)
  |  |  ------------------
  |  |  |  |   86|     33|#define	NEXT_ENTRY_DEFERRED	1
  |  |  ------------------
  |  |               #define	NEXT_ENTRY_ALL		(NEXT_ENTRY_DEFERRED | NEXT_ENTRY_PARTIAL)
  |  |  ------------------
  |  |  |  |   87|     33|#define	NEXT_ENTRY_PARTIAL	2
  |  |  ------------------
  ------------------
  |  Branch (164:9): [True: 0, False: 33]
  ------------------
  165|       |		/* Actual freeing done by next_entry() */
  166|      0|	}
  167|     33|	free(res->buckets);
  168|     33|	free(res);
  169|     33|}
archive_entry_link_resolver.c:next_entry:
  331|     33|{
  332|     33|	struct links_entry	*le;
  333|     33|	size_t			 bucket;
  334|       |
  335|       |	/* Free a held entry. */
  336|     33|	if (res->spare != NULL) {
  ------------------
  |  Branch (336:6): [True: 0, False: 33]
  ------------------
  337|      0|		archive_entry_free(res->spare->canonical);
  338|      0|		archive_entry_free(res->spare->entry);
  339|      0|		free(res->spare);
  340|      0|		res->spare = NULL;
  341|      0|	}
  342|       |
  343|       |	/* Look for next non-empty bucket in the links cache. */
  344|  33.8k|	for (bucket = 0; bucket < res->number_buckets; bucket++) {
  ------------------
  |  Branch (344:19): [True: 33.7k, False: 33]
  ------------------
  345|  33.7k|		for (le = res->buckets[bucket]; le != NULL; le = le->next) {
  ------------------
  |  Branch (345:35): [True: 0, False: 33.7k]
  ------------------
  346|      0|			if (le->entry != NULL &&
  ------------------
  |  Branch (346:8): [True: 0, False: 0]
  ------------------
  347|      0|			    (mode & NEXT_ENTRY_DEFERRED) == 0)
  ------------------
  |  |   86|      0|#define	NEXT_ENTRY_DEFERRED	1
  ------------------
  |  Branch (347:8): [True: 0, False: 0]
  ------------------
  348|      0|				continue;
  349|      0|			if (le->entry == NULL &&
  ------------------
  |  Branch (349:8): [True: 0, False: 0]
  ------------------
  350|      0|			    (mode & NEXT_ENTRY_PARTIAL) == 0)
  ------------------
  |  |   87|      0|#define	NEXT_ENTRY_PARTIAL	2
  ------------------
  |  Branch (350:8): [True: 0, False: 0]
  ------------------
  351|      0|				continue;
  352|       |			/* Remove it from this hash bucket. */
  353|      0|			if (le->next != NULL)
  ------------------
  |  Branch (353:8): [True: 0, False: 0]
  ------------------
  354|      0|				le->next->previous = le->previous;
  355|      0|			if (le->previous != NULL)
  ------------------
  |  Branch (355:8): [True: 0, False: 0]
  ------------------
  356|      0|				le->previous->next = le->next;
  357|      0|			else
  358|      0|				res->buckets[bucket] = le->next;
  359|      0|			res->number_entries--;
  360|       |			/* Defer freeing this entry. */
  361|      0|			res->spare = le;
  362|      0|			return (le);
  363|      0|		}
  364|  33.7k|	}
  365|     33|	return (NULL);
  366|     33|}

archive_entry_sparse_clear:
   40|   371k|{
   41|   371k|	struct ae_sparse *sp;
   42|       |
   43|   372k|	while (entry->sparse_head != NULL) {
  ------------------
  |  Branch (43:9): [True: 984, False: 371k]
  ------------------
   44|    984|		sp = entry->sparse_head->next;
   45|    984|		free(entry->sparse_head);
   46|    984|		entry->sparse_head = sp;
   47|    984|	}
   48|       |	entry->sparse_tail = NULL;
   49|   371k|}
archive_entry_sparse_add_entry:
   54|  39.1k|{
   55|  39.1k|	struct ae_sparse *sp;
   56|       |
   57|  39.1k|	if (offset < 0 || length < 0)
  ------------------
  |  Branch (57:6): [True: 0, False: 39.1k]
  |  Branch (57:20): [True: 0, False: 39.1k]
  ------------------
   58|       |		/* Invalid value */
   59|      0|		return;
   60|  39.1k|	if (offset > INT64_MAX - length ||
  ------------------
  |  Branch (60:6): [True: 0, False: 39.1k]
  ------------------
   61|  39.1k|	    offset + length > archive_entry_size(entry))
  ------------------
  |  Branch (61:6): [True: 5.37k, False: 33.7k]
  ------------------
   62|       |		/* A value of "length" parameter is too large. */
   63|  5.37k|		return;
   64|  33.7k|	if ((sp = entry->sparse_tail) != NULL) {
  ------------------
  |  Branch (64:6): [True: 33.1k, False: 652]
  ------------------
   65|  33.1k|		if (sp->offset + sp->length > offset)
  ------------------
  |  Branch (65:7): [True: 4.01k, False: 29.1k]
  ------------------
   66|       |			/* Invalid value. */
   67|  4.01k|			return;
   68|  29.1k|		if (sp->offset + sp->length == offset) {
  ------------------
  |  Branch (68:7): [True: 28.7k, False: 332]
  ------------------
   69|  28.7k|			if (sp->offset + sp->length + length < 0)
  ------------------
  |  Branch (69:8): [True: 0, False: 28.7k]
  ------------------
   70|       |				/* A value of "length" parameter is
   71|       |				 * too large. */
   72|      0|				return;
   73|       |			/* Expand existing sparse block size. */
   74|  28.7k|			sp->length += length;
   75|  28.7k|			return;
   76|  28.7k|		}
   77|  29.1k|	}
   78|       |
   79|    984|	if ((sp = malloc(sizeof(*sp))) == NULL)
  ------------------
  |  Branch (79:6): [True: 0, False: 984]
  ------------------
   80|       |		/* XXX Error XXX */
   81|      0|		return;
   82|       |
   83|    984|	sp->offset = offset;
   84|    984|	sp->length = length;
   85|    984|	sp->next = NULL;
   86|       |
   87|    984|	if (entry->sparse_head == NULL)
  ------------------
  |  Branch (87:6): [True: 652, False: 332]
  ------------------
   88|    652|		entry->sparse_head = entry->sparse_tail = sp;
   89|    332|	else {
   90|       |		/* Add a new sparse block to the tail of list. */
   91|    332|		if (entry->sparse_tail != NULL)
  ------------------
  |  Branch (91:7): [True: 332, False: 0]
  ------------------
   92|    332|			entry->sparse_tail->next = sp;
   93|    332|		entry->sparse_tail = sp;
   94|    332|	}
   95|    984|}

archive_entry_xattr_clear:
   73|   371k|{
   74|   371k|	struct ae_xattr	*xp;
   75|       |
   76|   371k|	while (entry->xattr_head != NULL) {
  ------------------
  |  Branch (76:9): [True: 36, False: 371k]
  ------------------
   77|     36|		xp = entry->xattr_head->next;
   78|     36|		free(entry->xattr_head->name);
   79|     36|		free(entry->xattr_head->value);
   80|     36|		free(entry->xattr_head);
   81|     36|		entry->xattr_head = xp;
   82|     36|	}
   83|       |
   84|       |	entry->xattr_head = NULL;
   85|   371k|}
archive_entry_xattr_add_entry:
   90|     36|{
   91|     36|	struct ae_xattr	*xp;
   92|       |
   93|     36|	if ((xp = malloc(sizeof(struct ae_xattr))) == NULL)
  ------------------
  |  Branch (93:6): [True: 0, False: 36]
  ------------------
   94|      0|		__archive_errx(1, "Out of memory");
   95|       |
   96|     36|	if ((xp->name = strdup(name)) == NULL)
  ------------------
  |  Branch (96:6): [True: 0, False: 36]
  ------------------
   97|      0|		__archive_errx(1, "Out of memory");
   98|       |
   99|     36|	if ((xp->value = malloc(size)) != NULL) {
  ------------------
  |  Branch (99:6): [True: 36, False: 0]
  ------------------
  100|     36|		memcpy(xp->value, value, size);
  101|     36|		xp->size = size;
  102|     36|	} else
  103|      0|		xp->size = 0;
  104|       |
  105|     36|	xp->next = entry->xattr_head;
  106|     36|	entry->xattr_head = xp;
  107|     36|}

archive_hmac.c:__hmac_sha1_init:
  238|  2.96k|{
  239|       |#if OPENSSL_VERSION_NUMBER >= 0x30000000L
  240|       |	EVP_MAC *mac;
  241|       |
  242|       |	char sha1[] = "SHA1";
  243|       |	OSSL_PARAM params[] = {
  244|       |		OSSL_PARAM_utf8_string("digest", sha1, sizeof(sha1) - 1),
  245|       |		OSSL_PARAM_END
  246|       |	};
  247|       |
  248|       |	mac = EVP_MAC_fetch(NULL, "HMAC", NULL);
  249|       |	*ctx = EVP_MAC_CTX_new(mac);
  250|       |	EVP_MAC_free(mac);
  251|       |	if (*ctx == NULL)
  252|       |		return -1;
  253|       |
  254|       |	EVP_MAC_init(*ctx, key, key_len, params);
  255|       |#else
  256|  2.96k|	*ctx = HMAC_CTX_new();
  257|  2.96k|	if (*ctx == NULL)
  ------------------
  |  Branch (257:6): [True: 0, False: 2.96k]
  ------------------
  258|      0|		return -1;
  259|  2.96k|	HMAC_Init_ex(*ctx, key, key_len, EVP_sha1(), NULL);
  260|  2.96k|#endif
  261|  2.96k|	return 0;
  262|  2.96k|}
archive_hmac.c:__hmac_sha1_update:
  267|  2.89k|{
  268|       |#if OPENSSL_VERSION_NUMBER >= 0x30000000L
  269|       |	EVP_MAC_update(*ctx, data, data_len);
  270|       |#else
  271|  2.89k|	HMAC_Update(*ctx, data, data_len);
  272|  2.89k|#endif
  273|  2.89k|}
archive_hmac.c:__hmac_sha1_final:
  277|  2.89k|{
  278|       |#if OPENSSL_VERSION_NUMBER >= 0x30000000L
  279|       |	size_t len = *out_len;
  280|       |#else
  281|  2.89k|	unsigned int len = (unsigned int)*out_len;
  282|  2.89k|#endif
  283|       |
  284|       |#if OPENSSL_VERSION_NUMBER >= 0x30000000L
  285|       |	EVP_MAC_final(*ctx, out, &len, *out_len);
  286|       |#else
  287|  2.89k|	HMAC_Final(*ctx, out, &len);
  288|  2.89k|#endif
  289|  2.89k|	*out_len = len;
  290|  2.89k|}
archive_hmac.c:__hmac_sha1_cleanup:
  294|  2.96k|{
  295|       |#if OPENSSL_VERSION_NUMBER >= 0x30000000L
  296|       |	EVP_MAC_CTX_free(*ctx);
  297|       |#else
  298|  2.96k|	HMAC_CTX_free(*ctx);
  299|  2.96k|#endif
  300|       |	*ctx = NULL;
  301|  2.96k|}

_archive_set_either_option:
   77|  7.49k|{
   78|  7.49k|	int r1, r2;
   79|       |
   80|  7.49k|	if (o == NULL && v == NULL)
  ------------------
  |  Branch (80:6): [True: 0, False: 7.49k]
  |  Branch (80:19): [True: 0, False: 0]
  ------------------
   81|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
   82|  7.49k|	if (o == NULL)
  ------------------
  |  Branch (82:6): [True: 0, False: 7.49k]
  ------------------
   83|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
   84|       |
   85|  7.49k|	r1 = use_format_option(a, m, o, v);
   86|  7.49k|	if (r1 == ARCHIVE_FATAL)
  ------------------
  |  |  239|  7.49k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (86:6): [True: 0, False: 7.49k]
  ------------------
   87|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
   88|       |
   89|  7.49k|	r2 = use_filter_option(a, m, o, v);
   90|  7.49k|	if (r2 == ARCHIVE_FATAL)
  ------------------
  |  |  239|  7.49k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (90:6): [True: 0, False: 7.49k]
  ------------------
   91|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
   92|       |
   93|  7.49k|	if (r1 == ARCHIVE_WARN - 1)
  ------------------
  |  |  235|  7.49k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (93:6): [True: 0, False: 7.49k]
  ------------------
   94|      0|		return r2;
   95|  7.49k|	if (r2 == ARCHIVE_WARN -1)
  ------------------
  |  |  235|  7.49k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (95:6): [True: 7.49k, False: 0]
  ------------------
   96|  7.49k|		return r1;
   97|      0|	return r1 > r2 ? r1 : r2;
  ------------------
  |  Branch (97:9): [True: 0, False: 0]
  ------------------
   98|  7.49k|}
_archive_set_options:
  103|  2.49k|{
  104|  2.49k|	int allok = 1, anyok = 0, ignore_mod_err = 0, r;
  105|  2.49k|	char *data;
  106|  2.49k|	char *s, *mod, *opt, *val;
  107|       |
  108|  2.49k|	archive_check_magic(a, magic, ARCHIVE_STATE_NEW, fn);
  ------------------
  |  |  151|  2.49k|	do { \
  |  |  152|  2.49k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|  2.49k|			(allowed_states), (function_name)); \
  |  |  154|  2.49k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  2.49k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 2.49k]
  |  |  ------------------
  |  |  155|  2.49k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|  2.49k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 2.49k]
  |  |  ------------------
  ------------------
  109|       |
  110|  2.49k|	if (options == NULL || options[0] == '\0')
  ------------------
  |  Branch (110:6): [True: 0, False: 2.49k]
  |  Branch (110:25): [True: 0, False: 2.49k]
  ------------------
  111|      0|		return ARCHIVE_OK;
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  112|       |
  113|  2.49k|	if ((data = strdup(options)) == NULL) {
  ------------------
  |  Branch (113:6): [True: 0, False: 2.49k]
  ------------------
  114|      0|		archive_set_error(a,
  115|      0|		    ENOMEM, "Out of memory adding file to list");
  116|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  117|      0|	}
  118|  2.49k|	s = data;
  119|       |
  120|  7.49k|	do {
  121|  7.49k|		mod = opt = val = NULL;
  122|       |
  123|  7.49k|		parse_option(&s, &mod, &opt, &val);
  124|  7.49k|		if (mod == NULL && opt != NULL &&
  ------------------
  |  Branch (124:7): [True: 0, False: 7.49k]
  |  Branch (124:22): [True: 0, False: 0]
  ------------------
  125|      0|		    strcmp("__ignore_wrong_module_name__", opt) == 0) {
  ------------------
  |  Branch (125:7): [True: 0, False: 0]
  ------------------
  126|       |			/* Ignore module name error */
  127|      0|			if (val != NULL) {
  ------------------
  |  Branch (127:8): [True: 0, False: 0]
  ------------------
  128|      0|				ignore_mod_err = 1;
  129|      0|				anyok = 1;
  130|      0|			}
  131|      0|			continue;
  132|      0|		}
  133|       |
  134|  7.49k|		r = use_option(a, mod, opt, val);
  135|  7.49k|		if (r == ARCHIVE_FATAL) {
  ------------------
  |  |  239|  7.49k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (135:7): [True: 0, False: 7.49k]
  ------------------
  136|      0|			free(data);
  137|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  138|      0|		}
  139|  7.49k|		if (r == ARCHIVE_FAILED && mod != NULL) {
  ------------------
  |  |  237|  14.9k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (139:7): [True: 0, False: 7.49k]
  |  Branch (139:30): [True: 0, False: 0]
  ------------------
  140|      0|			free(data);
  141|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  142|      0|		}
  143|  7.49k|		if (r == ARCHIVE_WARN - 1) {
  ------------------
  |  |  235|  7.49k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (143:7): [True: 0, False: 7.49k]
  ------------------
  144|      0|			if (ignore_mod_err)
  ------------------
  |  Branch (144:8): [True: 0, False: 0]
  ------------------
  145|      0|				continue;
  146|       |			/* The module name is wrong. */
  147|      0|			archive_set_error(a, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  148|      0|			    "Unknown module name: `%s'", mod);
  149|      0|			free(data);
  150|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  151|      0|		}
  152|  7.49k|		if (r == ARCHIVE_WARN) {
  ------------------
  |  |  235|  7.49k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (152:7): [True: 0, False: 7.49k]
  ------------------
  153|       |			/* The option name is wrong. No-one used this. */
  154|      0|			archive_set_error(a, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  155|      0|			    "Undefined option: `%s%s%s'",
  156|      0|			    mod?mod:"", mod?":":"", opt);
  ------------------
  |  Branch (156:8): [True: 0, False: 0]
  |  Branch (156:20): [True: 0, False: 0]
  ------------------
  157|      0|			free(data);
  158|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  159|      0|		}
  160|  7.49k|		if (r == ARCHIVE_OK)
  ------------------
  |  |  233|  7.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (160:7): [True: 7.49k, False: 0]
  ------------------
  161|  7.49k|			anyok = 1;
  162|      0|		else
  163|      0|			allok = 0;
  164|  7.49k|	} while (s != NULL);
  ------------------
  |  Branch (164:11): [True: 4.99k, False: 2.49k]
  ------------------
  165|       |
  166|  2.49k|	free(data);
  167|  2.49k|	return allok ? ARCHIVE_OK : anyok ? ARCHIVE_WARN : ARCHIVE_FAILED;
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
              	return allok ? ARCHIVE_OK : anyok ? ARCHIVE_WARN : ARCHIVE_FAILED;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
              	return allok ? ARCHIVE_OK : anyok ? ARCHIVE_WARN : ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (167:9): [True: 2.49k, False: 0]
  |  Branch (167:30): [True: 0, False: 0]
  ------------------
  168|  2.49k|}
archive_options.c:parse_option:
  172|  7.49k|{
  173|  7.49k|	char *end, *mod, *opt, *val;
  174|  7.49k|	char *p;
  175|       |
  176|  7.49k|	end = NULL;
  177|  7.49k|	mod = NULL;
  178|  7.49k|	opt = *s;
  179|  7.49k|	val = "1";
  180|       |
  181|  7.49k|	p = strchr(opt, ',');
  182|       |
  183|  7.49k|	if (p != NULL) {
  ------------------
  |  Branch (183:6): [True: 4.99k, False: 2.49k]
  ------------------
  184|  4.99k|		*p = '\0';
  185|  4.99k|		end = p + 1;
  186|  4.99k|	}
  187|       |
  188|  7.49k|	if (0 == strlen(opt)) {
  ------------------
  |  Branch (188:6): [True: 0, False: 7.49k]
  ------------------
  189|      0|		*s = end;
  190|      0|		*m = NULL;
  191|      0|		*o = NULL;
  192|      0|		*v = NULL;
  193|      0|		return end;
  194|      0|	}
  195|       |
  196|  7.49k|	p = strchr(opt, ':');
  197|  7.49k|	if (p != NULL) {
  ------------------
  |  Branch (197:6): [True: 7.49k, False: 0]
  ------------------
  198|  7.49k|		*p = '\0';
  199|  7.49k|		mod = opt;
  200|  7.49k|		opt = ++p;
  201|  7.49k|	}
  202|       |
  203|  7.49k|	p = strchr(opt, '=');
  204|  7.49k|	if (p != NULL) {
  ------------------
  |  Branch (204:6): [True: 0, False: 7.49k]
  ------------------
  205|      0|		*p = '\0';
  206|      0|		val = ++p;
  207|  7.49k|	} else if (opt[0] == '!') {
  ------------------
  |  Branch (207:13): [True: 0, False: 7.49k]
  ------------------
  208|      0|		++opt;
  209|      0|		val = NULL;
  210|      0|	}
  211|       |
  212|  7.49k|	*s = end;
  213|  7.49k|	*m = mod;
  214|  7.49k|	*o = opt;
  215|  7.49k|	*v = val;
  216|       |
  217|  7.49k|	return end;
  218|  7.49k|}

pack_find:
  321|    854|{
  322|    854|	const struct format	*format;
  323|       |
  324|    854|	format = bsearch(name, formats,
  325|    854|	    sizeof(formats)/sizeof(formats[0]),
  326|    854|	    sizeof(formats[0]), compare_format);
  327|    854|	if (format == 0)
  ------------------
  |  Branch (327:6): [True: 12, False: 842]
  ------------------
  328|     12|		return (NULL);
  329|    842|	return (format->pack);
  330|    854|}
archive_pack_dev.c:pack_12_20:
  190|     86|{
  191|     86|	dev_t dev = 0;
  192|       |
  193|     86|	if (n == 2) {
  ------------------
  |  Branch (193:6): [True: 7, False: 79]
  ------------------
  194|      7|		dev = makedev_12_20(numbers[0], numbers[1]);
  ------------------
  |  |  185|      7|#define	makedev_12_20(x,y)	((dev_t)((((x) << 20) & 0xfff00000) | \
  |  |  186|      7|					 (((y) <<  0) & 0x000fffff)))
  ------------------
  195|      7|		if ((unsigned long)major_12_20(dev) != numbers[0])
  ------------------
  |  |  183|      7|#define	major_12_20(x)		((int32_t)(((x) & 0xfff00000) >> 20))
  ------------------
  |  Branch (195:7): [True: 0, False: 7]
  ------------------
  196|      0|			*error = iMajorError;
  197|      7|		if ((unsigned long)minor_12_20(dev) != numbers[1])
  ------------------
  |  |  184|      7|#define	minor_12_20(x)		((int32_t)(((x) & 0x000fffff) >>  0))
  ------------------
  |  Branch (197:7): [True: 0, False: 7]
  ------------------
  198|      0|			*error = iMinorError;
  199|      7|	} else
  200|     79|		*error = tooManyFields;
  201|     86|	return (dev);
  202|     86|}
archive_pack_dev.c:compare_format:
  308|  3.41k|{
  309|  3.41k|	const char		*name;
  310|  3.41k|	const struct format	*format;
  311|       |
  312|  3.41k|	name = key;
  313|  3.41k|	format = element;
  314|       |
  315|  3.41k|	return (strcmp(name, format->name));
  316|  3.41k|}

archive_ppmd7.c:Ppmd7_Construct:
   88|     72|{
   89|     72|  unsigned i, k, m;
   90|       |
   91|     72|  p->Base = 0;
   92|       |
   93|  2.80k|  for (i = 0, k = 0; i < PPMD_NUM_INDEXES; i++)
  ------------------
  |  |  102|  2.80k|#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   98|  2.80k|#define PPMD_N1 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   99|  2.80k|#define PPMD_N2 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  100|  2.80k|#define PPMD_N3 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  101|  2.80k|#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|  2.80k|#define PPMD_N1 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|  2.80k|#define PPMD_N2 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|  2.80k|#define PPMD_N3 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (93:22): [True: 2.73k, False: 72]
  ------------------
   94|  2.73k|  {
   95|  2.73k|    unsigned step = (i >= 12 ? 4 : (i >> 2) + 1);
  ------------------
  |  Branch (95:22): [True: 1.87k, False: 864]
  ------------------
   96|  9.21k|    do { p->Units2Indx[k++] = (Byte)i; } while(--step);
  ------------------
  |  Branch (96:48): [True: 6.48k, False: 2.73k]
  ------------------
   97|  2.73k|    p->Indx2Units[i] = (Byte)k;
   98|  2.73k|  }
   99|       |
  100|     72|  p->NS2BSIndx[0] = (0 << 1);
  101|     72|  p->NS2BSIndx[1] = (1 << 1);
  102|     72|  memset(p->NS2BSIndx + 2, (2 << 1), 9);
  103|     72|  memset(p->NS2BSIndx + 11, (3 << 1), 256 - 11);
  104|       |
  105|    288|  for (i = 0; i < 3; i++)
  ------------------
  |  Branch (105:15): [True: 216, False: 72]
  ------------------
  106|    216|    p->NS2Indx[i] = (Byte)i;
  107|  18.2k|  for (m = i, k = 1; i < 256; i++)
  ------------------
  |  Branch (107:22): [True: 18.2k, False: 72]
  ------------------
  108|  18.2k|  {
  109|  18.2k|    p->NS2Indx[i] = (Byte)m;
  110|  18.2k|    if (--k == 0)
  ------------------
  |  Branch (110:9): [True: 1.58k, False: 16.6k]
  ------------------
  111|  1.58k|      k = (++m) - 2;
  112|  18.2k|  }
  113|       |
  114|     72|  memset(p->HB2Flag, 0, 0x40);
  115|     72|  memset(p->HB2Flag + 0x40, 8, 0x100 - 0x40);
  116|     72|}
archive_ppmd7.c:Ppmd7_Alloc:
  126|     72|{
  127|     72|  if (p->Base == 0 || p->Size != size)
  ------------------
  |  Branch (127:7): [True: 72, False: 0]
  |  Branch (127:23): [True: 0, False: 0]
  ------------------
  128|     72|  {
  129|       |    /* RestartModel() below assumes that p->Size >= UNIT_SIZE
  130|       |       (see the calculation of m->MinContext). */
  131|     72|    if (size < UNIT_SIZE) {
  ------------------
  |  |   30|     72|#define UNIT_SIZE 12
  ------------------
  |  Branch (131:9): [True: 0, False: 72]
  ------------------
  132|      0|      return False;
  ------------------
  |  |   56|      0|#define False 0
  ------------------
  133|      0|    }
  134|     72|    Ppmd7_Free(p);
  135|     72|    p->AlignOffset =
  136|       |      #ifdef PPMD_32BIT
  137|       |        (4 - size) & 3;
  138|       |      #else
  139|     72|        4 - (size & 3);
  140|     72|      #endif
  141|     72|    if ((p->Base = malloc(p->AlignOffset + size
  ------------------
  |  Branch (141:9): [True: 0, False: 72]
  ------------------
  142|     72|        #ifndef PPMD_32BIT
  143|     72|        + UNIT_SIZE
  ------------------
  |  |   30|     72|#define UNIT_SIZE 12
  ------------------
  144|     72|        #endif
  145|     72|        )) == 0)
  146|      0|      return False;
  ------------------
  |  |   56|      0|#define False 0
  ------------------
  147|     72|    p->Size = size;
  148|     72|  }
  149|     72|  return True;
  ------------------
  |  |   55|     72|#define True 1
  ------------------
  150|     72|}
archive_ppmd7.c:Ppmd7_Free:
  119|  3.30k|{
  120|  3.30k|  free(p->Base);
  121|  3.30k|  p->Size = 0;
  122|  3.30k|  p->Base = 0;
  123|  3.30k|}
archive_ppmd7.c:Ppmd7_Init:
  372|     68|{
  373|     68|  p->MaxOrder = maxOrder;
  374|     68|  RestartModel(p);
  375|     68|  p->DummySee.Shift = PPMD_PERIOD_BITS;
  ------------------
  |  |   90|     68|#define PPMD_PERIOD_BITS 7
  ------------------
  376|     68|  p->DummySee.Summ = 0; /* unused */
  377|     68|  p->DummySee.Count = 64; /* unused */
  378|     68|}
archive_ppmd7.c:RestartModel:
  325|    250|{
  326|    250|  unsigned i, k, m;
  327|       |
  328|    250|  memset(p->FreeList, 0, sizeof(p->FreeList));
  329|    250|  p->Text = p->Base + p->AlignOffset;
  330|    250|  p->HiUnit = p->Text + p->Size;
  331|    250|  p->LoUnit = p->UnitsStart = p->HiUnit - p->Size / 8 / UNIT_SIZE * 7 * UNIT_SIZE;
  ------------------
  |  |   30|    250|#define UNIT_SIZE 12
  ------------------
                p->LoUnit = p->UnitsStart = p->HiUnit - p->Size / 8 / UNIT_SIZE * 7 * UNIT_SIZE;
  ------------------
  |  |   30|    250|#define UNIT_SIZE 12
  ------------------
  332|    250|  p->GlueCount = 0;
  333|       |
  334|    250|  p->OrderFall = p->MaxOrder;
  335|    250|  p->RunLength = p->InitRL = -(Int32)((p->MaxOrder < 12) ? p->MaxOrder : 12) - 1;
  ------------------
  |  Branch (335:39): [True: 71, False: 179]
  ------------------
  336|    250|  p->PrevSuccess = 0;
  337|       |
  338|    250|  p->MinContext = p->MaxContext = (CTX_PTR)(p->HiUnit -= UNIT_SIZE); /* AllocContext(p); */
  ------------------
  |  |   30|    250|#define UNIT_SIZE 12
  ------------------
  339|    250|  p->MinContext->Suffix = 0;
  340|    250|  p->MinContext->NumStats = 256;
  341|    250|  p->MinContext->SummFreq = 256 + 1;
  342|    250|  p->FoundState = (CPpmd_State *)p->LoUnit; /* AllocUnits(p, PPMD_NUM_INDEXES - 1); */
  343|    250|  p->LoUnit += U2B(256 / 2);
  ------------------
  |  |   32|    250|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   30|    250|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  344|    250|  p->MinContext->Stats = REF(p->FoundState);
  ------------------
  |  |   39|    250|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  345|  64.2k|  for (i = 0; i < 256; i++)
  ------------------
  |  Branch (345:15): [True: 64.0k, False: 250]
  ------------------
  346|  64.0k|  {
  347|  64.0k|    CPpmd_State *s = &p->FoundState[i];
  348|  64.0k|    s->Symbol = (Byte)i;
  349|  64.0k|    s->Freq = 1;
  350|  64.0k|    SetSuccessor(s, 0);
  351|  64.0k|  }
  352|       |
  353|  32.2k|  for (i = 0; i < 128; i++)
  ------------------
  |  Branch (353:15): [True: 32.0k, False: 250]
  ------------------
  354|   288k|    for (k = 0; k < 8; k++)
  ------------------
  |  Branch (354:17): [True: 256k, False: 32.0k]
  ------------------
  355|   256k|    {
  356|   256k|      UInt16 *dest = p->BinSumm[i] + k;
  357|   256k|      UInt16 val = (UInt16)(PPMD_BIN_SCALE - kInitBinEsc[k] / (i + 2));
  ------------------
  |  |   91|   256k|#define PPMD_BIN_SCALE (1 << (PPMD_INT_BITS + PPMD_PERIOD_BITS))
  |  |  ------------------
  |  |  |  |   89|   256k|#define PPMD_INT_BITS 7
  |  |  ------------------
  |  |               #define PPMD_BIN_SCALE (1 << (PPMD_INT_BITS + PPMD_PERIOD_BITS))
  |  |  ------------------
  |  |  |  |   90|   256k|#define PPMD_PERIOD_BITS 7
  |  |  ------------------
  ------------------
  358|  2.30M|      for (m = 0; m < 64; m += 8)
  ------------------
  |  Branch (358:19): [True: 2.04M, False: 256k]
  ------------------
  359|  2.04M|        dest[m] = val;
  360|   256k|    }
  361|       |  
  362|  6.50k|  for (i = 0; i < 25; i++)
  ------------------
  |  Branch (362:15): [True: 6.25k, False: 250]
  ------------------
  363|   106k|    for (k = 0; k < 16; k++)
  ------------------
  |  Branch (363:17): [True: 100k, False: 6.25k]
  ------------------
  364|   100k|    {
  365|   100k|      CPpmd_See *s = &p->See[i][k];
  366|   100k|      s->Summ = (UInt16)((5 * i + 10) << (s->Shift = PPMD_PERIOD_BITS - 4));
  ------------------
  |  |   90|   100k|#define PPMD_PERIOD_BITS 7
  ------------------
  367|   100k|      s->Count = 4;
  368|   100k|    }
  369|    250|}
archive_ppmd7.c:SetSuccessor:
  319|  14.9M|{
  320|  14.9M|  (p)->SuccessorLow = (UInt16)((UInt32)(v) & 0xFFFF);
  321|  14.9M|  (p)->SuccessorHigh = (UInt16)(((UInt32)(v) >> 16) & 0xFFFF);
  322|  14.9M|}
archive_ppmd7.c:Ppmd7z_RangeDec_CreateVTable:
  852|     64|{
  853|     64|  p->p.GetThreshold = Range_GetThreshold;
  854|     64|  p->p.Decode = Range_Decode_7z;
  855|     64|  p->p.DecodeBit = Range_DecodeBit_7z;
  856|     64|}
archive_ppmd7.c:Range_GetThreshold:
  776|  4.67M|{
  777|  4.67M|  CPpmd7z_RangeDec *p = (CPpmd7z_RangeDec *)pp;
  778|  4.67M|  return (p->Code - p->Low) / (p->Range /= total);
  779|  4.67M|}
archive_ppmd7.c:Range_Decode_7z:
  799|  4.66M|{
  800|  4.66M|  CPpmd7z_RangeDec *p = (CPpmd7z_RangeDec *)pp;
  801|  4.66M|  p->Code -= start * p->Range;
  802|  4.66M|  p->Range *= size;
  803|  4.66M|  Range_Normalize(p);
  804|  4.66M|}
archive_ppmd7.c:Range_Normalize:
  782|  23.7M|{
  783|  25.4M|  while (1)
  ------------------
  |  Branch (783:10): [True: 25.4M, Folded]
  ------------------
  784|  25.4M|  {
  785|  25.4M|    if((p->Low ^ (p->Low + p->Range)) >= kTopValue)
  ------------------
  |  |   28|  25.4M|#define kTopValue (1 << 24)
  ------------------
  |  Branch (785:8): [True: 23.7M, False: 1.67M]
  ------------------
  786|  23.7M|    {
  787|  23.7M|      if(p->Range >= p->Bottom)
  ------------------
  |  Branch (787:10): [True: 23.7M, False: 0]
  ------------------
  788|  23.7M|        break;
  789|      0|      else
  790|      0|        p->Range = ((uint32_t)(-(int32_t)p->Low)) & (p->Bottom - 1);
  791|  23.7M|    }
  792|  1.67M|    p->Code = (p->Code << 8) | p->Stream->Read((void *)p->Stream);
  793|  1.67M|    p->Range <<= 8;
  794|  1.67M|    p->Low <<= 8;
  795|  1.67M|  }
  796|  23.7M|}
archive_ppmd7.c:Range_DecodeBit_7z:
  815|  19.0M|{
  816|  19.0M|  CPpmd7z_RangeDec *p = (CPpmd7z_RangeDec *)pp;
  817|  19.0M|  UInt32 newBound = (p->Range >> 14) * size0;
  818|  19.0M|  UInt32 symbol;
  819|  19.0M|  if (p->Code < newBound)
  ------------------
  |  Branch (819:7): [True: 18.6M, False: 421k]
  ------------------
  820|  18.6M|  {
  821|  18.6M|    symbol = 0;
  822|  18.6M|    p->Range = newBound;
  823|  18.6M|  }
  824|   421k|  else
  825|   421k|  {
  826|   421k|    symbol = 1;
  827|   421k|    p->Code -= newBound;
  828|   421k|    p->Range -= newBound;
  829|   421k|  }
  830|  19.0M|  Range_Normalize(p);
  831|  19.0M|  return symbol;
  832|  19.0M|}
archive_ppmd7.c:PpmdRAR_RangeDec_CreateVTable:
  859|      8|{
  860|      8|  p->p.GetThreshold = Range_GetThreshold;
  861|      8|  p->p.Decode = Range_Decode_RAR;
  862|      8|  p->p.DecodeBit = Range_DecodeBit_RAR;
  863|      8|}
archive_ppmd7.c:Range_Decode_RAR:
  807|  12.9k|{
  808|  12.9k|  CPpmd7z_RangeDec *p = (CPpmd7z_RangeDec *)pp;
  809|  12.9k|  p->Low += start * p->Range;
  810|  12.9k|  p->Range *= size;
  811|  12.9k|  Range_Normalize(p);
  812|  12.9k|}
archive_ppmd7.c:Range_DecodeBit_RAR:
  835|  12.8k|{
  836|  12.8k|  CPpmd7z_RangeDec *p = (CPpmd7z_RangeDec *)pp;
  837|  12.8k|  UInt32 bit, value = p->p.GetThreshold(p, PPMD_BIN_SCALE);
  ------------------
  |  |   91|  12.8k|#define PPMD_BIN_SCALE (1 << (PPMD_INT_BITS + PPMD_PERIOD_BITS))
  |  |  ------------------
  |  |  |  |   89|  12.8k|#define PPMD_INT_BITS 7
  |  |  ------------------
  |  |               #define PPMD_BIN_SCALE (1 << (PPMD_INT_BITS + PPMD_PERIOD_BITS))
  |  |  ------------------
  |  |  |  |   90|  12.8k|#define PPMD_PERIOD_BITS 7
  |  |  ------------------
  ------------------
  838|  12.8k|  if(value < size0)
  ------------------
  |  Branch (838:6): [True: 12.8k, False: 10]
  ------------------
  839|  12.8k|  {
  840|  12.8k|    bit = 0;
  841|  12.8k|    p->p.Decode(p, 0, size0);
  842|  12.8k|  }
  843|     10|  else
  844|     10|  {
  845|     10|    bit = 1;
  846|     10|    p->p.Decode(p, size0, PPMD_BIN_SCALE - size0);
  ------------------
  |  |   91|     10|#define PPMD_BIN_SCALE (1 << (PPMD_INT_BITS + PPMD_PERIOD_BITS))
  |  |  ------------------
  |  |  |  |   89|     10|#define PPMD_INT_BITS 7
  |  |  ------------------
  |  |               #define PPMD_BIN_SCALE (1 << (PPMD_INT_BITS + PPMD_PERIOD_BITS))
  |  |  ------------------
  |  |  |  |   90|     10|#define PPMD_PERIOD_BITS 7
  |  |  ------------------
  ------------------
  847|     10|  }
  848|  12.8k|  return bit;
  849|  12.8k|}
archive_ppmd7.c:Ppmd7z_RangeDec_Init:
  761|     64|{
  762|     64|  if (p->Stream->Read((void *)p->Stream) != 0)
  ------------------
  |  Branch (762:7): [True: 0, False: 64]
  ------------------
  763|      0|    return False;
  ------------------
  |  |   56|      0|#define False 0
  ------------------
  764|     64|  return Ppmd_RangeDec_Init(p);
  765|     64|}
archive_ppmd7.c:Ppmd_RangeDec_Init:
  751|  3.37k|{
  752|  3.37k|  unsigned i;
  753|  3.37k|  p->Low = p->Bottom = 0;
  754|  3.37k|  p->Range = 0xFFFFFFFF;
  755|  16.8k|  for (i = 0; i < 4; i++)
  ------------------
  |  Branch (755:15): [True: 13.5k, False: 3.37k]
  ------------------
  756|  13.5k|    p->Code = (p->Code << 8) | p->Stream->Read((void *)p->Stream);
  757|  3.37k|  return (p->Code < 0xFFFFFFFF);
  758|  3.37k|}
archive_ppmd7.c:PpmdRAR_RangeDec_Init:
  768|  3.31k|{
  769|  3.31k|  if (!Ppmd_RangeDec_Init(p))
  ------------------
  |  Branch (769:7): [True: 4, False: 3.30k]
  ------------------
  770|      4|    return False;
  ------------------
  |  |   56|      4|#define False 0
  ------------------
  771|  3.30k|  p->Bottom = 0x8000;
  772|  3.30k|  return True;
  ------------------
  |  |   55|  3.30k|#define True 1
  ------------------
  773|  3.31k|}
archive_ppmd7.c:Ppmd7_DecodeSymbol:
  868|  22.2M|{
  869|  22.2M|  size_t charMask[256 / sizeof(size_t)];
  870|  22.2M|  if (p->MinContext->NumStats != 1)
  ------------------
  |  Branch (870:7): [True: 3.13M, False: 19.0M]
  ------------------
  871|  3.13M|  {
  872|  3.13M|    CPpmd_State *s = Ppmd7_GetStats(p, p->MinContext);
  ------------------
  |  |   18|  3.13M|  #define Ppmd7_GetStats(p, ctx) ((CPpmd_State *)Ppmd7_GetPtr((p), ((ctx)->Stats)))
  |  |  ------------------
  |  |  |  |   16|  3.13M|  #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  ------------------
  ------------------
  873|  3.13M|    unsigned i;
  874|  3.13M|    UInt32 count, hiCnt;
  875|  3.13M|    if ((count = rc->GetThreshold(rc, p->MinContext->SummFreq)) < (hiCnt = s->Freq))
  ------------------
  |  Branch (875:9): [True: 1.25M, False: 1.88M]
  ------------------
  876|  1.25M|    {
  877|  1.25M|      Byte symbol;
  878|  1.25M|      rc->Decode(rc, 0, s->Freq);
  879|  1.25M|      p->FoundState = s;
  880|  1.25M|      symbol = s->Symbol;
  881|  1.25M|      Ppmd7_Update1_0(p);
  882|  1.25M|      return symbol;
  883|  1.25M|    }
  884|  1.88M|    p->PrevSuccess = 0;
  885|  1.88M|    i = p->MinContext->NumStats - 1;
  886|  1.88M|    do
  887|  13.4M|    {
  888|  13.4M|      if ((hiCnt += (++s)->Freq) > count)
  ------------------
  |  Branch (888:11): [True: 1.20M, False: 12.1M]
  ------------------
  889|  1.20M|      {
  890|  1.20M|        Byte symbol;
  891|  1.20M|        rc->Decode(rc, hiCnt - s->Freq, s->Freq);
  892|  1.20M|        p->FoundState = s;
  893|  1.20M|        symbol = s->Symbol;
  894|  1.20M|        Ppmd7_Update1(p);
  895|  1.20M|        return symbol;
  896|  1.20M|      }
  897|  13.4M|    }
  898|  12.1M|    while (--i);
  ------------------
  |  Branch (898:12): [True: 11.5M, False: 679k]
  ------------------
  899|   679k|    if (count >= p->MinContext->SummFreq)
  ------------------
  |  Branch (899:9): [True: 1, False: 679k]
  ------------------
  900|      1|      return -2;
  901|   679k|    p->HiBitsFlag = p->HB2Flag[p->FoundState->Symbol];
  902|   679k|    rc->Decode(rc, hiCnt, p->MinContext->SummFreq - hiCnt);
  903|   679k|    PPMD_SetAllBitsIn256Bytes(charMask);
  ------------------
  |  |  151|   679k|#define PPMD_SetAllBitsIn256Bytes(p) do {				\
  |  |  152|   679k|	unsigned j;							\
  |  |  153|  3.39M|	for (j = 0; j < 256 / sizeof(p[0]); j += 8) {			\
  |  |  ------------------
  |  |  |  Branch (153:14): [True: 2.71M, False: 679k]
  |  |  ------------------
  |  |  154|  2.71M|		p[j+7] = p[j+6] = p[j+5] = p[j+4] =			\
  |  |  155|  2.71M|		    p[j+3] = p[j+2] = p[j+1] = p[j+0] = ~(size_t)0;	\
  |  |  156|  2.71M|	}								\
  |  |  157|   679k|} while (0)
  |  |  ------------------
  |  |  |  Branch (157:10): [Folded, False: 679k]
  |  |  ------------------
  ------------------
  904|   679k|    MASK(s->Symbol) = 0;
  ------------------
  |  |  865|   679k|#define MASK(sym) ((signed char *)charMask)[sym]
  ------------------
  905|   679k|    i = p->MinContext->NumStats - 1;
  906|  5.17M|    do { MASK((--s)->Symbol) = 0; } while (--i);
  ------------------
  |  |  865|  5.17M|#define MASK(sym) ((signed char *)charMask)[sym]
  ------------------
  |  Branch (906:44): [True: 4.49M, False: 679k]
  ------------------
  907|   679k|  }
  908|  19.0M|  else
  909|  19.0M|  {
  910|  19.0M|    UInt16 *prob = Ppmd7_GetBinSumm(p);
  ------------------
  |  |   22|  19.0M|    &p->BinSumm[Ppmd7Context_OneState(p->MinContext)->Freq - 1][p->PrevSuccess + \
  |  |  ------------------
  |  |  |  |   42|  19.0M|#define Ppmd7Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  |  |   23|  19.0M|    p->NS2BSIndx[Ppmd7_GetContext(p, p->MinContext->Suffix)->NumStats - 1] + \
  |  |  ------------------
  |  |  |  |   17|  19.0M|  #define Ppmd7_GetContext(p, offs) ((CPpmd7_Context *)Ppmd7_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   16|  19.0M|  #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|  19.0M|    (p->HiBitsFlag = p->HB2Flag[p->FoundState->Symbol]) + \
  |  |   25|  19.0M|    2 * p->HB2Flag[Ppmd7Context_OneState(p->MinContext)->Symbol] + \
  |  |  ------------------
  |  |  |  |   42|  19.0M|#define Ppmd7Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  |  |   26|  19.0M|    ((p->RunLength >> 26) & 0x20)]
  ------------------
  911|  19.0M|    if (rc->DecodeBit(rc, *prob) == 0)
  ------------------
  |  Branch (911:9): [True: 18.6M, False: 421k]
  ------------------
  912|  18.6M|    {
  913|  18.6M|      Byte symbol;
  914|  18.6M|      *prob = (UInt16)PPMD_UPDATE_PROB_0(*prob);
  ------------------
  |  |   95|  18.6M|#define PPMD_UPDATE_PROB_0(prob) ((prob) + (1 << PPMD_INT_BITS) - PPMD_GET_MEAN(prob))
  |  |  ------------------
  |  |  |  |   89|  18.6M|#define PPMD_INT_BITS 7
  |  |  ------------------
  |  |               #define PPMD_UPDATE_PROB_0(prob) ((prob) + (1 << PPMD_INT_BITS) - PPMD_GET_MEAN(prob))
  |  |  ------------------
  |  |  |  |   94|  18.6M|#define PPMD_GET_MEAN(summ) PPMD_GET_MEAN_SPEC((summ), PPMD_PERIOD_BITS, 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  18.6M|#define PPMD_GET_MEAN_SPEC(summ, shift, round) (((summ) + (1 << ((shift) - (round)))) >> (shift))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  915|  18.6M|      symbol = (p->FoundState = Ppmd7Context_OneState(p->MinContext))->Symbol;
  ------------------
  |  |   42|  18.6M|#define Ppmd7Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  ------------------
  916|  18.6M|      Ppmd7_UpdateBin(p);
  917|  18.6M|      return symbol;
  918|  18.6M|    }
  919|   421k|    *prob = (UInt16)PPMD_UPDATE_PROB_1(*prob);
  ------------------
  |  |   96|   421k|#define PPMD_UPDATE_PROB_1(prob) ((prob) - PPMD_GET_MEAN(prob))
  |  |  ------------------
  |  |  |  |   94|   421k|#define PPMD_GET_MEAN(summ) PPMD_GET_MEAN_SPEC((summ), PPMD_PERIOD_BITS, 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|   421k|#define PPMD_GET_MEAN_SPEC(summ, shift, round) (((summ) + (1 << ((shift) - (round)))) >> (shift))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  920|   421k|    p->InitEsc = PPMD7_kExpEscape[*prob >> 10];
  921|   421k|    PPMD_SetAllBitsIn256Bytes(charMask);
  ------------------
  |  |  151|   421k|#define PPMD_SetAllBitsIn256Bytes(p) do {				\
  |  |  152|   421k|	unsigned j;							\
  |  |  153|  2.10M|	for (j = 0; j < 256 / sizeof(p[0]); j += 8) {			\
  |  |  ------------------
  |  |  |  Branch (153:14): [True: 1.68M, False: 421k]
  |  |  ------------------
  |  |  154|  1.68M|		p[j+7] = p[j+6] = p[j+5] = p[j+4] =			\
  |  |  155|  1.68M|		    p[j+3] = p[j+2] = p[j+1] = p[j+0] = ~(size_t)0;	\
  |  |  156|  1.68M|	}								\
  |  |  157|   421k|} while (0)
  |  |  ------------------
  |  |  |  Branch (157:10): [Folded, False: 421k]
  |  |  ------------------
  ------------------
  922|   421k|    MASK(Ppmd7Context_OneState(p->MinContext)->Symbol) = 0;
  ------------------
  |  |  865|   421k|#define MASK(sym) ((signed char *)charMask)[sym]
  ------------------
  923|   421k|    p->PrevSuccess = 0;
  924|   421k|  }
  925|  1.10M|  for (;;)
  926|  1.53M|  {
  927|  1.53M|    CPpmd_State *ps[256], *s;
  928|  1.53M|    UInt32 freqSum, count, hiCnt;
  929|  1.53M|    CPpmd_See *see;
  930|  1.53M|    unsigned i, num, numMasked = p->MinContext->NumStats;
  931|  1.53M|    do
  932|  3.03M|    {
  933|  3.03M|      p->OrderFall++;
  934|  3.03M|      if (!p->MinContext->Suffix)
  ------------------
  |  Branch (934:11): [True: 10, False: 3.03M]
  ------------------
  935|     10|        return -1;
  936|  3.03M|      p->MinContext = Ppmd7_GetContext(p, p->MinContext->Suffix);
  ------------------
  |  |   17|  3.03M|  #define Ppmd7_GetContext(p, offs) ((CPpmd7_Context *)Ppmd7_GetPtr((p), (offs)))
  |  |  ------------------
  |  |  |  |   16|  3.03M|  #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  ------------------
  ------------------
  937|  3.03M|    }
  938|  3.03M|    while (p->MinContext->NumStats == numMasked);
  ------------------
  |  Branch (938:12): [True: 1.50M, False: 1.53M]
  ------------------
  939|  1.53M|    hiCnt = 0;
  940|  1.53M|    s = Ppmd7_GetStats(p, p->MinContext);
  ------------------
  |  |   18|  1.53M|  #define Ppmd7_GetStats(p, ctx) ((CPpmd_State *)Ppmd7_GetPtr((p), ((ctx)->Stats)))
  |  |  ------------------
  |  |  |  |   16|  1.53M|  #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  ------------------
  ------------------
  941|  1.53M|    i = 0;
  942|  1.53M|    num = p->MinContext->NumStats - numMasked;
  943|  1.53M|    do
  944|  98.8M|    {
  945|  98.8M|      int k = (int)(MASK(s->Symbol));
  ------------------
  |  |  865|  98.8M|#define MASK(sym) ((signed char *)charMask)[sym]
  ------------------
  946|  98.8M|      hiCnt += (s->Freq & k);
  947|  98.8M|      ps[i] = s++;
  948|  98.8M|      i -= k;
  949|  98.8M|    }
  950|  98.8M|    while (i != num);
  ------------------
  |  Branch (950:12): [True: 97.2M, False: 1.53M]
  ------------------
  951|       |
  952|  1.53M|    see = Ppmd7_MakeEscFreq(p, numMasked, &freqSum);
  953|  1.53M|    freqSum += hiCnt;
  954|  1.53M|    count = rc->GetThreshold(rc, freqSum);
  955|       |
  956|  1.53M|    if (count < hiCnt)
  ------------------
  |  Branch (956:9): [True: 1.10M, False: 431k]
  ------------------
  957|  1.10M|    {
  958|  1.10M|      Byte symbol;
  959|  1.10M|      CPpmd_State **pps = ps;
  960|  22.4M|      for (hiCnt = 0; (hiCnt += (*pps)->Freq) <= count; pps++);
  ------------------
  |  Branch (960:23): [True: 21.3M, False: 1.10M]
  ------------------
  961|  1.10M|      s = *pps;
  962|  1.10M|      rc->Decode(rc, hiCnt - s->Freq, s->Freq);
  963|  1.10M|      Ppmd_See_Update(see);
  ------------------
  |  |  112|  1.10M|#define Ppmd_See_Update(p) do {						\
  |  |  113|  1.10M|	if ((p)->Shift < PPMD_PERIOD_BITS && --(p)->Count == 0) {	\
  |  |  ------------------
  |  |  |  |   90|  2.20M|#define PPMD_PERIOD_BITS 7
  |  |  ------------------
  |  |  |  Branch (113:6): [True: 387k, False: 713k]
  |  |  |  Branch (113:39): [True: 13.1k, False: 373k]
  |  |  ------------------
  |  |  114|  13.1k|		(p)->Summ <<= 1;					\
  |  |  115|  13.1k|		(p)->Count = (Byte)(3 << (p)->Shift++);			\
  |  |  116|  13.1k|    	}								\
  |  |  117|  1.10M|} while (0)
  |  |  ------------------
  |  |  |  Branch (117:10): [Folded, False: 1.10M]
  |  |  ------------------
  ------------------
  964|  1.10M|      p->FoundState = s;
  965|  1.10M|      symbol = s->Symbol;
  966|  1.10M|      Ppmd7_Update2(p);
  967|  1.10M|      return symbol;
  968|  1.10M|    }
  969|   431k|    if (count >= freqSum)
  ------------------
  |  Branch (969:9): [True: 2, False: 431k]
  ------------------
  970|      2|      return -2;
  971|   431k|    rc->Decode(rc, hiCnt, freqSum - hiCnt);
  972|   431k|    see->Summ = (UInt16)(see->Summ + freqSum);
  973|  3.64M|    do { MASK(ps[--i]->Symbol) = 0; } while (i != 0);
  ------------------
  |  |  865|  3.64M|#define MASK(sym) ((signed char *)charMask)[sym]
  ------------------
  |  Branch (973:46): [True: 3.21M, False: 431k]
  ------------------
  974|   431k|  }
  975|  1.10M|}
archive_ppmd7.c:Ppmd7_Update1_0:
  722|  1.25M|{
  723|  1.25M|  p->PrevSuccess = (2 * p->FoundState->Freq > p->MinContext->SummFreq);
  724|  1.25M|  p->RunLength += p->PrevSuccess;
  725|  1.25M|  p->MinContext->SummFreq += 4;
  726|  1.25M|  if ((p->FoundState->Freq += 4) > MAX_FREQ)
  ------------------
  |  |   29|  1.25M|#define MAX_FREQ 124
  ------------------
  |  Branch (726:7): [True: 44.8k, False: 1.20M]
  ------------------
  727|  44.8k|    Rescale(p);
  728|  1.25M|  NextContext(p);
  729|  1.25M|}
archive_ppmd7.c:Rescale:
  609|  47.4k|{
  610|  47.4k|  unsigned i, adder, sumFreq, escFreq;
  611|  47.4k|  CPpmd_State *stats = STATS(p->MinContext);
  ------------------
  |  |   45|  47.4k|#define STATS(ctx) Ppmd7_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   18|  47.4k|  #define Ppmd7_GetStats(p, ctx) ((CPpmd_State *)Ppmd7_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   16|  47.4k|  #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  612|  47.4k|  CPpmd_State *s = p->FoundState;
  613|  47.4k|  {
  614|  47.4k|    CPpmd_State tmp = *s;
  615|  56.1k|    for (; s != stats; s--)
  ------------------
  |  Branch (615:12): [True: 8.71k, False: 47.4k]
  ------------------
  616|  8.71k|      s[0] = s[-1];
  617|  47.4k|    *s = tmp;
  618|  47.4k|  }
  619|  47.4k|  escFreq = p->MinContext->SummFreq - s->Freq;
  620|  47.4k|  s->Freq += 4;
  621|  47.4k|  adder = (p->OrderFall != 0);
  622|  47.4k|  s->Freq = (Byte)((s->Freq + adder) >> 1);
  623|  47.4k|  sumFreq = s->Freq;
  624|       |  
  625|  47.4k|  i = p->MinContext->NumStats - 1;
  626|  47.4k|  do
  627|   535k|  {
  628|   535k|    escFreq -= (++s)->Freq;
  629|   535k|    s->Freq = (Byte)((s->Freq + adder) >> 1);
  630|   535k|    sumFreq += s->Freq;
  631|   535k|    if (s[0].Freq > s[-1].Freq)
  ------------------
  |  Branch (631:9): [True: 206k, False: 328k]
  ------------------
  632|   206k|    {
  633|   206k|      CPpmd_State *s1 = s;
  634|   206k|      CPpmd_State tmp = *s1;
  635|   206k|      do
  636|  3.06M|        s1[0] = s1[-1];
  637|  3.06M|      while (--s1 != stats && tmp.Freq > s1[-1].Freq);
  ------------------
  |  Branch (637:14): [True: 3.06M, False: 0]
  |  Branch (637:31): [True: 2.85M, False: 206k]
  ------------------
  638|   206k|      *s1 = tmp;
  639|   206k|    }
  640|   535k|  }
  641|   535k|  while (--i);
  ------------------
  |  Branch (641:10): [True: 487k, False: 47.4k]
  ------------------
  642|       |  
  643|  47.4k|  if (s->Freq == 0)
  ------------------
  |  Branch (643:7): [True: 20.3k, False: 27.0k]
  ------------------
  644|  20.3k|  {
  645|  20.3k|    unsigned numStats = p->MinContext->NumStats;
  646|  20.3k|    unsigned n0, n1;
  647|  39.8k|    do { i++; } while ((--s)->Freq == 0);
  ------------------
  |  Branch (647:24): [True: 19.4k, False: 20.3k]
  ------------------
  648|  20.3k|    escFreq += i;
  649|  20.3k|    p->MinContext->NumStats = (UInt16)(p->MinContext->NumStats - i);
  650|  20.3k|    if (p->MinContext->NumStats == 1)
  ------------------
  |  Branch (650:9): [True: 2.55k, False: 17.8k]
  ------------------
  651|  2.55k|    {
  652|  2.55k|      CPpmd_State tmp = *stats;
  653|  2.55k|      do
  654|  3.11k|      {
  655|  3.11k|        tmp.Freq = (Byte)(tmp.Freq - (tmp.Freq >> 1));
  656|  3.11k|        escFreq >>= 1;
  657|  3.11k|      }
  658|  3.11k|      while (escFreq > 1);
  ------------------
  |  Branch (658:14): [True: 553, False: 2.55k]
  ------------------
  659|  2.55k|      InsertNode(p, stats, U2I(((numStats + 1) >> 1)));
  ------------------
  |  |   33|  2.55k|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  660|  2.55k|      *(p->FoundState = ONE_STATE(p->MinContext)) = tmp;
  ------------------
  |  |   46|  2.55k|#define ONE_STATE(ctx) Ppmd7Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   42|  2.55k|#define Ppmd7Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  661|  2.55k|      return;
  662|  2.55k|    }
  663|  17.8k|    n0 = (numStats + 1) >> 1;
  664|  17.8k|    n1 = (p->MinContext->NumStats + 1) >> 1;
  665|  17.8k|    if (n0 != n1)
  ------------------
  |  Branch (665:9): [True: 13.4k, False: 4.32k]
  ------------------
  666|  13.4k|      p->MinContext->Stats = STATS_REF(ShrinkUnits(p, stats, n0, n1));
  ------------------
  |  |   42|  13.4k|#define STATS_REF(ptr) ((CPpmd_State_Ref)REF(ptr))
  |  |  ------------------
  |  |  |  |   39|  13.4k|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  |  |  ------------------
  ------------------
  667|  17.8k|  }
  668|  44.8k|  p->MinContext->SummFreq = (UInt16)(sumFreq + escFreq - (escFreq >> 1));
  669|  44.8k|  p->FoundState = STATS(p->MinContext);
  ------------------
  |  |   45|  44.8k|#define STATS(ctx) Ppmd7_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   18|  44.8k|  #define Ppmd7_GetStats(p, ctx) ((CPpmd_State *)Ppmd7_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   16|  44.8k|  #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  670|  44.8k|}
archive_ppmd7.c:InsertNode:
  153|   797k|{
  154|   797k|  *((CPpmd_Void_Ref *)node) = p->FreeList[indx];
  155|   797k|  p->FreeList[indx] = REF(node);
  ------------------
  |  |   39|   797k|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  156|   797k|}
archive_ppmd7.c:ShrinkUnits:
  300|  13.4k|{
  301|  13.4k|  unsigned i0 = U2I(oldNU);
  ------------------
  |  |   33|  13.4k|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  302|  13.4k|  unsigned i1 = U2I(newNU);
  ------------------
  |  |   33|  13.4k|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  303|  13.4k|  if (i0 == i1)
  ------------------
  |  Branch (303:7): [True: 1.87k, False: 11.6k]
  ------------------
  304|  1.87k|    return oldPtr;
  305|  11.6k|  if (p->FreeList[i1] != 0)
  ------------------
  |  Branch (305:7): [True: 9.03k, False: 2.59k]
  ------------------
  306|  9.03k|  {
  307|  9.03k|    void *ptr = RemoveNode(p, i1);
  308|  9.03k|    MyMem12Cpy(ptr, oldPtr, newNU);
  ------------------
  |  |  290|  9.03k|#define MyMem12Cpy(dest, src, num) do {					\
  |  |  291|  9.03k|	UInt32 *d = (UInt32 *)dest;					\
  |  |  292|  9.03k|	const UInt32 *s = (const UInt32 *)src;				\
  |  |  293|  9.03k|	UInt32 n = num;							\
  |  |  294|  39.9k|	do {								\
  |  |  295|  39.9k|		d[0] = s[0]; d[1] = s[1]; d[2] = s[2]; s += 3; d += 3;	\
  |  |  296|  39.9k|	} while(--n);							\
  |  |  ------------------
  |  |  |  Branch (296:10): [True: 30.8k, False: 9.03k]
  |  |  ------------------
  |  |  297|  9.03k|} while (0)
  |  |  ------------------
  |  |  |  Branch (297:10): [Folded, False: 9.03k]
  |  |  ------------------
  ------------------
  309|  9.03k|    InsertNode(p, oldPtr, i0);
  310|  9.03k|    return ptr;
  311|  9.03k|  }
  312|  2.59k|  SplitBlock(p, oldPtr, i0, i1);
  313|  2.59k|  return oldPtr;
  314|  11.6k|}
archive_ppmd7.c:RemoveNode:
  159|   793k|{
  160|   793k|  CPpmd_Void_Ref *node = (CPpmd_Void_Ref *)Ppmd7_GetPtr(p, p->FreeList[indx]);
  ------------------
  |  |   16|   793k|  #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  ------------------
  161|   793k|  p->FreeList[indx] = *node;
  162|   793k|  return node;
  163|   793k|}
archive_ppmd7.c:SplitBlock:
  166|  20.9k|{
  167|  20.9k|  unsigned i, nu = I2U(oldIndx) - I2U(newIndx);
  ------------------
  |  |   34|  20.9k|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
                unsigned i, nu = I2U(oldIndx) - I2U(newIndx);
  ------------------
  |  |   34|  20.9k|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  168|  20.9k|  ptr = (Byte *)ptr + U2B(I2U(newIndx));
  ------------------
  |  |   32|  20.9k|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   30|  20.9k|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  169|  20.9k|  if (I2U(i = U2I(nu)) != nu)
  ------------------
  |  |   34|  20.9k|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  |  Branch (169:7): [True: 3.44k, False: 17.4k]
  ------------------
  170|  3.44k|  {
  171|  3.44k|    unsigned k = I2U(--i);
  ------------------
  |  |   34|  3.44k|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  172|  3.44k|    InsertNode(p, ((Byte *)ptr) + U2B(k), nu - k - 1);
  ------------------
  |  |   32|  3.44k|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   30|  3.44k|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  173|  3.44k|  }
  174|  20.9k|  InsertNode(p, ptr, i);
  175|  20.9k|}
archive_ppmd7.c:NextContext:
  698|  21.1M|{
  699|  21.1M|  CTX_PTR c = CTX(SUCCESSOR(p->FoundState));
  ------------------
  |  |   44|  21.1M|#define CTX(ref) ((CPpmd7_Context *)Ppmd7_GetContext(p, ref))
  |  |  ------------------
  |  |  |  |   17|  21.1M|  #define Ppmd7_GetContext(p, offs) ((CPpmd7_Context *)Ppmd7_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   16|  21.1M|  #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  700|  21.1M|  if (p->OrderFall == 0 && (Byte *)c > p->Text)
  ------------------
  |  Branch (700:7): [True: 19.1M, False: 1.95M]
  |  Branch (700:28): [True: 18.9M, False: 205k]
  ------------------
  701|  18.9M|    p->MinContext = p->MaxContext = c;
  702|  2.16M|  else
  703|  2.16M|    UpdateModel(p);
  704|  21.1M|}
archive_ppmd7.c:UpdateModel:
  460|  3.26M|{
  461|  3.26M|  CPpmd_Void_Ref successor, fSuccessor = SUCCESSOR(p->FoundState);
  ------------------
  |  |  316|  3.26M|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  ------------------
  462|  3.26M|  CTX_PTR c;
  463|  3.26M|  unsigned s0, ns;
  464|       |  
  465|  3.26M|  if (p->FoundState->Freq < MAX_FREQ / 4 && p->MinContext->Suffix != 0)
  ------------------
  |  |   29|  3.26M|#define MAX_FREQ 124
  ------------------
  |  Branch (465:7): [True: 2.75M, False: 512k]
  |  Branch (465:45): [True: 2.61M, False: 132k]
  ------------------
  466|  2.61M|  {
  467|  2.61M|    c = SUFFIX(p->MinContext);
  ------------------
  |  |   47|  2.61M|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   44|  2.61M|#define CTX(ref) ((CPpmd7_Context *)Ppmd7_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   17|  2.61M|  #define Ppmd7_GetContext(p, offs) ((CPpmd7_Context *)Ppmd7_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   16|  2.61M|  #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  468|       |    
  469|  2.61M|    if (c->NumStats == 1)
  ------------------
  |  Branch (469:9): [True: 1.25M, False: 1.36M]
  ------------------
  470|  1.25M|    {
  471|  1.25M|      CPpmd_State *s = ONE_STATE(c);
  ------------------
  |  |   46|  1.25M|#define ONE_STATE(ctx) Ppmd7Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   42|  1.25M|#define Ppmd7Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  472|  1.25M|      if (s->Freq < 32)
  ------------------
  |  Branch (472:11): [True: 1.25M, False: 212]
  ------------------
  473|  1.25M|        s->Freq++;
  474|  1.25M|    }
  475|  1.36M|    else
  476|  1.36M|    {
  477|  1.36M|      CPpmd_State *s = STATS(c);
  ------------------
  |  |   45|  1.36M|#define STATS(ctx) Ppmd7_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   18|  1.36M|  #define Ppmd7_GetStats(p, ctx) ((CPpmd_State *)Ppmd7_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   16|  1.36M|  #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  478|  1.36M|      if (s->Symbol != p->FoundState->Symbol)
  ------------------
  |  Branch (478:11): [True: 1.00M, False: 353k]
  ------------------
  479|  1.00M|      {
  480|  24.8M|        do { s++; } while (s->Symbol != p->FoundState->Symbol);
  ------------------
  |  Branch (480:28): [True: 23.8M, False: 1.00M]
  ------------------
  481|  1.00M|        if (s[0].Freq >= s[-1].Freq)
  ------------------
  |  Branch (481:13): [True: 457k, False: 549k]
  ------------------
  482|   457k|        {
  483|   457k|          SwapStates(&s[0], &s[-1]);
  484|   457k|          s--;
  485|   457k|        }
  486|  1.00M|      }
  487|  1.36M|      if (s->Freq < MAX_FREQ - 9)
  ------------------
  |  |   29|  1.36M|#define MAX_FREQ 124
  ------------------
  |  Branch (487:11): [True: 1.33M, False: 27.3k]
  ------------------
  488|  1.33M|      {
  489|  1.33M|        s->Freq += 2;
  490|  1.33M|        c->SummFreq += 2;
  491|  1.33M|      }
  492|  1.36M|    }
  493|  2.61M|  }
  494|       |
  495|  3.26M|  if (p->OrderFall == 0)
  ------------------
  |  Branch (495:7): [True: 205k, False: 3.05M]
  ------------------
  496|   205k|  {
  497|   205k|    p->MinContext = p->MaxContext = CreateSuccessors(p, True);
  ------------------
  |  |   55|   205k|#define True 1
  ------------------
  498|   205k|    if (p->MinContext == 0)
  ------------------
  |  Branch (498:9): [True: 10, False: 205k]
  ------------------
  499|     10|    {
  500|     10|      RestartModel(p);
  501|     10|      return;
  502|     10|    }
  503|   205k|    SetSuccessor(p->FoundState, REF(p->MinContext));
  ------------------
  |  |   39|   205k|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  504|   205k|    return;
  505|   205k|  }
  506|       |  
  507|  3.05M|  *p->Text++ = p->FoundState->Symbol;
  508|  3.05M|  successor = REF(p->Text);
  ------------------
  |  |   39|  3.05M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  509|  3.05M|  if (p->Text >= p->UnitsStart)
  ------------------
  |  Branch (509:7): [True: 10, False: 3.05M]
  ------------------
  510|     10|  {
  511|     10|    RestartModel(p);
  512|     10|    return;
  513|     10|  }
  514|       |  
  515|  3.05M|  if (fSuccessor)
  ------------------
  |  Branch (515:7): [True: 3.03M, False: 21.6k]
  ------------------
  516|  3.03M|  {
  517|  3.03M|    if (fSuccessor <= successor)
  ------------------
  |  Branch (517:9): [True: 1.17M, False: 1.86M]
  ------------------
  518|  1.17M|    {
  519|  1.17M|      CTX_PTR cs = CreateSuccessors(p, False);
  ------------------
  |  |   56|  1.17M|#define False 0
  ------------------
  520|  1.17M|      if (cs == NULL)
  ------------------
  |  Branch (520:11): [True: 90, False: 1.17M]
  ------------------
  521|     90|      {
  522|     90|        RestartModel(p);
  523|     90|        return;
  524|     90|      }
  525|  1.17M|      fSuccessor = REF(cs);
  ------------------
  |  |   39|  1.17M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  526|  1.17M|    }
  527|  3.03M|    if (--p->OrderFall == 0)
  ------------------
  |  Branch (527:9): [True: 507k, False: 2.52M]
  ------------------
  528|   507k|    {
  529|   507k|      successor = fSuccessor;
  530|   507k|      p->Text -= (p->MaxContext != p->MinContext);
  531|   507k|    }
  532|  3.03M|  }
  533|  21.6k|  else
  534|  21.6k|  {
  535|  21.6k|    SetSuccessor(p->FoundState, successor);
  536|  21.6k|    fSuccessor = REF(p->MinContext);
  ------------------
  |  |   39|  21.6k|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  537|  21.6k|  }
  538|       |  
  539|  3.05M|  s0 = p->MinContext->SummFreq - (ns = p->MinContext->NumStats) - (p->FoundState->Freq - 1);
  540|       |  
  541|  6.09M|  for (c = p->MaxContext; c != p->MinContext; c = SUFFIX(c))
  ------------------
  |  |   47|  3.03M|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   44|  3.03M|#define CTX(ref) ((CPpmd7_Context *)Ppmd7_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   17|  3.03M|  #define Ppmd7_GetContext(p, offs) ((CPpmd7_Context *)Ppmd7_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   16|  3.03M|  #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (541:27): [True: 3.03M, False: 3.05M]
  ------------------
  542|  3.03M|  {
  543|  3.03M|    unsigned ns1;
  544|  3.03M|    UInt32 cf, sf;
  545|  3.03M|    if ((ns1 = c->NumStats) != 1)
  ------------------
  |  Branch (545:9): [True: 1.46M, False: 1.56M]
  ------------------
  546|  1.46M|    {
  547|  1.46M|      if ((ns1 & 1) == 0)
  ------------------
  |  Branch (547:11): [True: 878k, False: 586k]
  ------------------
  548|   878k|      {
  549|       |        /* Expand for one UNIT */
  550|   878k|        unsigned oldNU = ns1 >> 1;
  551|   878k|        unsigned i = U2I(oldNU);
  ------------------
  |  |   33|   878k|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  552|   878k|        if (i != U2I(oldNU + 1))
  ------------------
  |  |   33|   878k|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  |  Branch (552:13): [True: 760k, False: 118k]
  ------------------
  553|   760k|        {
  554|   760k|          void *ptr = AllocUnits(p, i + 1);
  555|   760k|          void *oldPtr;
  556|   760k|          if (!ptr)
  ------------------
  |  Branch (556:15): [True: 26, False: 760k]
  ------------------
  557|     26|          {
  558|     26|            RestartModel(p);
  559|     26|            return;
  560|     26|          }
  561|   760k|          oldPtr = STATS(c);
  ------------------
  |  |   45|   760k|#define STATS(ctx) Ppmd7_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   18|   760k|  #define Ppmd7_GetStats(p, ctx) ((CPpmd_State *)Ppmd7_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   16|   760k|  #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  562|   760k|          MyMem12Cpy(ptr, oldPtr, oldNU);
  ------------------
  |  |  290|   760k|#define MyMem12Cpy(dest, src, num) do {					\
  |  |  291|   760k|	UInt32 *d = (UInt32 *)dest;					\
  |  |  292|   760k|	const UInt32 *s = (const UInt32 *)src;				\
  |  |  293|   760k|	UInt32 n = num;							\
  |  |  294|  1.94M|	do {								\
  |  |  295|  1.94M|		d[0] = s[0]; d[1] = s[1]; d[2] = s[2]; s += 3; d += 3;	\
  |  |  296|  1.94M|	} while(--n);							\
  |  |  ------------------
  |  |  |  Branch (296:10): [True: 1.18M, False: 760k]
  |  |  ------------------
  |  |  297|   760k|} while (0)
  |  |  ------------------
  |  |  |  Branch (297:10): [Folded, False: 760k]
  |  |  ------------------
  ------------------
  563|   760k|          InsertNode(p, oldPtr, i);
  564|   760k|          c->Stats = STATS_REF(ptr);
  ------------------
  |  |   42|   760k|#define STATS_REF(ptr) ((CPpmd_State_Ref)REF(ptr))
  |  |  ------------------
  |  |  |  |   39|   760k|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  |  |  ------------------
  ------------------
  565|   760k|        }
  566|   878k|      }
  567|  1.46M|      c->SummFreq = (UInt16)(c->SummFreq + (2 * ns1 < ns) + 2 * ((4 * ns1 <= ns) & (c->SummFreq <= 8 * ns1)));
  568|  1.46M|    }
  569|  1.56M|    else
  570|  1.56M|    {
  571|  1.56M|      CPpmd_State *s = (CPpmd_State*)AllocUnits(p, 0);
  572|  1.56M|      if (!s)
  ------------------
  |  Branch (572:11): [True: 46, False: 1.56M]
  ------------------
  573|     46|      {
  574|     46|        RestartModel(p);
  575|     46|        return;
  576|     46|      }
  577|  1.56M|      *s = *ONE_STATE(c);
  ------------------
  |  |   46|  1.56M|#define ONE_STATE(ctx) Ppmd7Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   42|  1.56M|#define Ppmd7Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  578|  1.56M|      c->Stats = REF(s);
  ------------------
  |  |   39|  1.56M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  579|  1.56M|      if (s->Freq < MAX_FREQ / 4 - 1)
  ------------------
  |  |   29|  1.56M|#define MAX_FREQ 124
  ------------------
  |  Branch (579:11): [True: 1.56M, False: 2.62k]
  ------------------
  580|  1.56M|        s->Freq <<= 1;
  581|  2.62k|      else
  582|  2.62k|        s->Freq = MAX_FREQ - 4;
  ------------------
  |  |   29|  2.62k|#define MAX_FREQ 124
  ------------------
  583|  1.56M|      c->SummFreq = (UInt16)(s->Freq + p->InitEsc + (ns > 3));
  584|  1.56M|    }
  585|  3.03M|    cf = 2 * (UInt32)p->FoundState->Freq * (c->SummFreq + 6);
  586|  3.03M|    sf = (UInt32)s0 + c->SummFreq;
  587|  3.03M|    if (cf < 6 * sf)
  ------------------
  |  Branch (587:9): [True: 2.06M, False: 973k]
  ------------------
  588|  2.06M|    {
  589|  2.06M|      cf = 1 + (cf > sf) + (cf >= 4 * sf);
  590|  2.06M|      c->SummFreq += 3;
  591|  2.06M|    }
  592|   973k|    else
  593|   973k|    {
  594|   973k|      cf = 4 + (cf >= 9 * sf) + (cf >= 12 * sf) + (cf >= 15 * sf);
  595|   973k|      c->SummFreq = (UInt16)(c->SummFreq + cf);
  596|   973k|    }
  597|  3.03M|    {
  598|  3.03M|      CPpmd_State *s = STATS(c) + ns1;
  ------------------
  |  |   45|  3.03M|#define STATS(ctx) Ppmd7_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   18|  3.03M|  #define Ppmd7_GetStats(p, ctx) ((CPpmd_State *)Ppmd7_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   16|  3.03M|  #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  599|  3.03M|      SetSuccessor(s, successor);
  600|  3.03M|      s->Symbol = p->FoundState->Symbol;
  601|  3.03M|      s->Freq = (Byte)cf;
  602|  3.03M|      c->NumStats = (UInt16)(ns1 + 1);
  603|  3.03M|    }
  604|  3.03M|  }
  605|  3.05M|  p->MaxContext = p->MinContext = CTX(fSuccessor);
  ------------------
  |  |   44|  3.05M|#define CTX(ref) ((CPpmd7_Context *)Ppmd7_GetContext(p, ref))
  |  |  ------------------
  |  |  |  |   17|  3.05M|  #define Ppmd7_GetContext(p, offs) ((CPpmd7_Context *)Ppmd7_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   16|  3.05M|  #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  606|  3.05M|}
archive_ppmd7.c:SwapStates:
  453|  1.09M|{
  454|  1.09M|  CPpmd_State tmp = *t1;
  455|  1.09M|  *t1 = *t2;
  456|  1.09M|  *t2 = tmp;
  457|  1.09M|}
archive_ppmd7.c:CreateSuccessors:
  381|  1.37M|{
  382|  1.37M|  CPpmd_State upState;
  383|  1.37M|  CTX_PTR c = p->MinContext;
  384|  1.37M|  CPpmd_Byte_Ref upBranch = (CPpmd_Byte_Ref)SUCCESSOR(p->FoundState);
  ------------------
  |  |  316|  1.37M|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  ------------------
  385|  1.37M|  CPpmd_State *ps[PPMD7_MAX_ORDER];
  386|  1.37M|  unsigned numPs = 0;
  387|       |  
  388|  1.37M|  if (!skip)
  ------------------
  |  Branch (388:7): [True: 1.17M, False: 205k]
  ------------------
  389|  1.17M|    ps[numPs++] = p->FoundState;
  390|       |  
  391|  10.4M|  while (c->Suffix)
  ------------------
  |  Branch (391:10): [True: 10.4M, False: 17.4k]
  ------------------
  392|  10.4M|  {
  393|  10.4M|    CPpmd_Void_Ref successor;
  394|  10.4M|    CPpmd_State *s;
  395|  10.4M|    c = SUFFIX(c);
  ------------------
  |  |   47|  10.4M|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   44|  10.4M|#define CTX(ref) ((CPpmd7_Context *)Ppmd7_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   17|  10.4M|  #define Ppmd7_GetContext(p, offs) ((CPpmd7_Context *)Ppmd7_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   16|  10.4M|  #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  396|  10.4M|    if (c->NumStats != 1)
  ------------------
  |  Branch (396:9): [True: 1.70M, False: 8.75M]
  ------------------
  397|  1.70M|    {
  398|  16.8M|      for (s = STATS(c); s->Symbol != p->FoundState->Symbol; s++);
  ------------------
  |  |   45|  1.70M|#define STATS(ctx) Ppmd7_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   18|  1.70M|  #define Ppmd7_GetStats(p, ctx) ((CPpmd_State *)Ppmd7_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   16|  1.70M|  #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (398:26): [True: 15.1M, False: 1.70M]
  ------------------
  399|  1.70M|    }
  400|  8.75M|    else
  401|  8.75M|      s = ONE_STATE(c);
  ------------------
  |  |   46|  8.75M|#define ONE_STATE(ctx) Ppmd7Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   42|  8.75M|#define Ppmd7Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  402|  10.4M|    successor = SUCCESSOR(s);
  ------------------
  |  |  316|  10.4M|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  ------------------
  403|  10.4M|    if (successor != upBranch)
  ------------------
  |  Branch (403:9): [True: 1.36M, False: 9.09M]
  ------------------
  404|  1.36M|    {
  405|  1.36M|      c = CTX(successor);
  ------------------
  |  |   44|  1.36M|#define CTX(ref) ((CPpmd7_Context *)Ppmd7_GetContext(p, ref))
  |  |  ------------------
  |  |  |  |   17|  1.36M|  #define Ppmd7_GetContext(p, offs) ((CPpmd7_Context *)Ppmd7_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   16|  1.36M|  #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  406|  1.36M|      if (numPs == 0)
  ------------------
  |  Branch (406:11): [True: 66.5k, False: 1.29M]
  ------------------
  407|  66.5k|        return c;
  408|  1.29M|      break;
  409|  1.36M|    }
  410|  9.09M|    ps[numPs++] = s;
  411|  9.09M|  }
  412|       |  
  413|  1.31M|  upState.Symbol = *(const Byte *)Ppmd7_GetPtr(p, upBranch);
  ------------------
  |  |   16|  1.31M|  #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  ------------------
  414|  1.31M|  SetSuccessor(&upState, upBranch + 1);
  415|       |  
  416|  1.31M|  if (c->NumStats == 1)
  ------------------
  |  Branch (416:7): [True: 582k, False: 730k]
  ------------------
  417|   582k|    upState.Freq = ONE_STATE(c)->Freq;
  ------------------
  |  |   46|   582k|#define ONE_STATE(ctx) Ppmd7Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   42|   582k|#define Ppmd7Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  418|   730k|  else
  419|   730k|  {
  420|   730k|    UInt32 cf, s0;
  421|   730k|    CPpmd_State *s;
  422|  4.26M|    for (s = STATS(c); s->Symbol != upState.Symbol; s++);
  ------------------
  |  |   45|   730k|#define STATS(ctx) Ppmd7_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   18|   730k|  #define Ppmd7_GetStats(p, ctx) ((CPpmd_State *)Ppmd7_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   16|   730k|  #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (422:24): [True: 3.53M, False: 730k]
  ------------------
  423|   730k|    cf = s->Freq - 1;
  424|   730k|    s0 = c->SummFreq - c->NumStats - cf;
  425|   730k|    upState.Freq = (Byte)(1 + ((2 * cf <= s0) ? (5 * cf > s0) : ((2 * cf + 3 * s0 - 1) / (2 * s0))));
  ------------------
  |  Branch (425:32): [True: 519k, False: 210k]
  ------------------
  426|   730k|  }
  427|       |
  428|  11.5M|  while (numPs != 0)
  ------------------
  |  Branch (428:10): [True: 10.2M, False: 1.31M]
  ------------------
  429|  10.2M|  {
  430|       |    /* Create Child */
  431|  10.2M|    CTX_PTR c1; /* = AllocContext(p); */
  432|  10.2M|    if (p->HiUnit != p->LoUnit)
  ------------------
  |  Branch (432:9): [True: 9.57M, False: 693k]
  ------------------
  433|  9.57M|      c1 = (CTX_PTR)(p->HiUnit -= UNIT_SIZE);
  ------------------
  |  |   30|  9.57M|#define UNIT_SIZE 12
  ------------------
  434|   693k|    else if (p->FreeList[0] != 0)
  ------------------
  |  Branch (434:14): [True: 20.8k, False: 672k]
  ------------------
  435|  20.8k|      c1 = (CTX_PTR)RemoveNode(p, 0);
  436|   672k|    else
  437|   672k|    {
  438|   672k|      c1 = (CTX_PTR)AllocUnitsRare(p, 0);
  439|   672k|      if (!c1)
  ------------------
  |  Branch (439:11): [True: 100, False: 672k]
  ------------------
  440|    100|        return NULL;
  441|   672k|    }
  442|  10.2M|    c1->NumStats = 1;
  443|  10.2M|    *ONE_STATE(c1) = upState;
  ------------------
  |  |   46|  10.2M|#define ONE_STATE(ctx) Ppmd7Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   42|  10.2M|#define Ppmd7Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  444|  10.2M|    c1->Suffix = REF(c);
  ------------------
  |  |   39|  10.2M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  445|  10.2M|    SetSuccessor(ps[--numPs], REF(c1));
  ------------------
  |  |   39|  10.2M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  446|  10.2M|    c = c1;
  447|  10.2M|  }
  448|       |  
  449|  1.31M|  return c;
  450|  1.31M|}
archive_ppmd7.c:AllocUnitsRare:
  250|   782k|{
  251|   782k|  unsigned i;
  252|   782k|  void *retVal;
  253|   782k|  if (p->GlueCount == 0)
  ------------------
  |  Branch (253:7): [True: 3.16k, False: 778k]
  ------------------
  254|  3.16k|  {
  255|  3.16k|    GlueFreeBlocks(p);
  256|  3.16k|    if (p->FreeList[indx] != 0)
  ------------------
  |  Branch (256:9): [True: 33, False: 3.12k]
  ------------------
  257|     33|      return RemoveNode(p, indx);
  258|  3.16k|  }
  259|   782k|  i = indx;
  260|   782k|  do
  261|  29.0M|  {
  262|  29.0M|    if (++i == PPMD_NUM_INDEXES)
  ------------------
  |  |  102|  29.0M|#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   98|  29.0M|#define PPMD_N1 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   99|  29.0M|#define PPMD_N2 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  100|  29.0M|#define PPMD_N3 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  101|  29.0M|#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|  29.0M|#define PPMD_N1 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|  29.0M|#define PPMD_N2 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|  29.0M|#define PPMD_N3 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (262:9): [True: 763k, False: 28.2M]
  ------------------
  263|   763k|    {
  264|   763k|      UInt32 numBytes = U2B(I2U(indx));
  ------------------
  |  |   32|   763k|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   30|   763k|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  265|   763k|      p->GlueCount--;
  266|   763k|      return ((UInt32)(p->UnitsStart - p->Text) > numBytes) ? (p->UnitsStart -= numBytes) : (NULL);
  ------------------
  |  Branch (266:14): [True: 763k, False: 172]
  ------------------
  267|   763k|    }
  268|  29.0M|  }
  269|  28.2M|  while (p->FreeList[i] == 0);
  ------------------
  |  Branch (269:10): [True: 28.2M, False: 18.3k]
  ------------------
  270|  18.3k|  retVal = RemoveNode(p, i);
  271|  18.3k|  SplitBlock(p, retVal, i, indx);
  272|  18.3k|  return retVal;
  273|   782k|}
archive_ppmd7.c:GlueFreeBlocks:
  178|  3.16k|{
  179|       |  #ifdef PPMD_32BIT
  180|       |  CPpmd7_Node headItem;
  181|       |  CPpmd7_Node_Ref head = &headItem;
  182|       |  #else
  183|  3.16k|  CPpmd7_Node_Ref head = p->AlignOffset + p->Size;
  184|  3.16k|  #endif
  185|       |  
  186|  3.16k|  CPpmd7_Node_Ref n = head;
  187|  3.16k|  unsigned i;
  188|       |
  189|  3.16k|  p->GlueCount = 255;
  190|       |
  191|       |  /* create doubly-linked list of free blocks */
  192|   123k|  for (i = 0; i < PPMD_NUM_INDEXES; i++)
  ------------------
  |  |  102|   123k|#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   98|   123k|#define PPMD_N1 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   99|   123k|#define PPMD_N2 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  100|   123k|#define PPMD_N3 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  101|   123k|#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|   123k|#define PPMD_N1 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|   123k|#define PPMD_N2 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|   123k|#define PPMD_N3 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (192:15): [True: 120k, False: 3.16k]
  ------------------
  193|   120k|  {
  194|   120k|    UInt16 nu = I2U(i);
  ------------------
  |  |   34|   120k|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  195|   120k|    CPpmd7_Node_Ref next = (CPpmd7_Node_Ref)p->FreeList[i];
  196|   120k|    p->FreeList[i] = 0;
  197|   122k|    while (next != 0)
  ------------------
  |  Branch (197:12): [True: 2.15k, False: 120k]
  ------------------
  198|  2.15k|    {
  199|  2.15k|      CPpmd7_Node *node = NODE(next);
  ------------------
  |  |   75|  2.15k|  #define NODE(offs) ((CPpmd7_Node *)(p->Base + (offs)))
  ------------------
  200|  2.15k|      node->Next = n;
  201|  2.15k|      n = NODE(n)->Prev = next;
  ------------------
  |  |   75|  2.15k|  #define NODE(offs) ((CPpmd7_Node *)(p->Base + (offs)))
  ------------------
  202|  2.15k|      next = *(const CPpmd7_Node_Ref *)node;
  203|  2.15k|      node->Stamp = 0;
  204|  2.15k|      node->NU = (UInt16)nu;
  205|  2.15k|    }
  206|   120k|  }
  207|  3.16k|  NODE(head)->Stamp = 1;
  ------------------
  |  |   75|  3.16k|  #define NODE(offs) ((CPpmd7_Node *)(p->Base + (offs)))
  ------------------
  208|  3.16k|  NODE(head)->Next = n;
  ------------------
  |  |   75|  3.16k|  #define NODE(offs) ((CPpmd7_Node *)(p->Base + (offs)))
  ------------------
  209|  3.16k|  NODE(n)->Prev = head;
  ------------------
  |  |   75|  3.16k|  #define NODE(offs) ((CPpmd7_Node *)(p->Base + (offs)))
  ------------------
  210|  3.16k|  if (p->LoUnit != p->HiUnit)
  ------------------
  |  Branch (210:7): [True: 16, False: 3.14k]
  ------------------
  211|     16|    ((CPpmd7_Node *)p->LoUnit)->Stamp = 1;
  212|       |  
  213|       |  /* Glue free blocks */
  214|  4.38k|  while (n != head)
  ------------------
  |  Branch (214:10): [True: 1.22k, False: 3.16k]
  ------------------
  215|  1.22k|  {
  216|  1.22k|    CPpmd7_Node *node = NODE(n);
  ------------------
  |  |   75|  1.22k|  #define NODE(offs) ((CPpmd7_Node *)(p->Base + (offs)))
  ------------------
  217|  1.22k|    UInt32 nu = (UInt32)node->NU;
  218|  1.22k|    for (;;)
  219|  2.30k|    {
  220|  2.30k|      CPpmd7_Node *node2 = NODE(n) + nu;
  ------------------
  |  |   75|  2.30k|  #define NODE(offs) ((CPpmd7_Node *)(p->Base + (offs)))
  ------------------
  221|  2.30k|      nu += node2->NU;
  222|  2.30k|      if (node2->Stamp != 0 || nu >= 0x10000)
  ------------------
  |  Branch (222:11): [True: 1.22k, False: 1.08k]
  |  Branch (222:32): [True: 0, False: 1.08k]
  ------------------
  223|  1.22k|        break;
  224|  1.08k|      NODE(node2->Prev)->Next = node2->Next;
  ------------------
  |  |   75|  1.08k|  #define NODE(offs) ((CPpmd7_Node *)(p->Base + (offs)))
  ------------------
  225|  1.08k|      NODE(node2->Next)->Prev = node2->Prev;
  ------------------
  |  |   75|  1.08k|  #define NODE(offs) ((CPpmd7_Node *)(p->Base + (offs)))
  ------------------
  226|  1.08k|      node->NU = (UInt16)nu;
  227|  1.08k|    }
  228|  1.22k|    n = node->Next;
  229|  1.22k|  }
  230|       |  
  231|       |  /* Fill lists of free blocks */
  232|  4.22k|  for (n = NODE(head)->Next; n != head;)
  ------------------
  |  |   75|  3.16k|  #define NODE(offs) ((CPpmd7_Node *)(p->Base + (offs)))
  ------------------
  |  Branch (232:30): [True: 1.06k, False: 3.16k]
  ------------------
  233|  1.06k|  {
  234|  1.06k|    CPpmd7_Node *node = NODE(n);
  ------------------
  |  |   75|  1.06k|  #define NODE(offs) ((CPpmd7_Node *)(p->Base + (offs)))
  ------------------
  235|  1.06k|    unsigned nu;
  236|  1.06k|    CPpmd7_Node_Ref next = node->Next;
  237|  1.21k|    for (nu = node->NU; nu > 128; nu -= 128, node += 128)
  ------------------
  |  Branch (237:25): [True: 150, False: 1.06k]
  ------------------
  238|    150|      InsertNode(p, node, PPMD_NUM_INDEXES - 1);
  ------------------
  |  |  102|    150|#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   98|    150|#define PPMD_N1 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   99|    150|#define PPMD_N2 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  100|    150|#define PPMD_N3 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  101|    150|#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|    150|#define PPMD_N1 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|    150|#define PPMD_N2 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|    150|#define PPMD_N3 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  239|  1.06k|    if (I2U(i = U2I(nu)) != nu)
  ------------------
  |  |   34|  1.06k|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  |  Branch (239:9): [True: 56, False: 1.01k]
  ------------------
  240|     56|    {
  241|     56|      unsigned k = I2U(--i);
  ------------------
  |  |   34|     56|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  242|     56|      InsertNode(p, node + k, nu - k - 1);
  243|     56|    }
  244|  1.06k|    InsertNode(p, node, i);
  245|  1.06k|    n = next;
  246|  1.06k|  }
  247|  3.16k|}
archive_ppmd7.c:AllocUnits:
  276|  2.32M|{
  277|  2.32M|  UInt32 numBytes;
  278|  2.32M|  if (p->FreeList[indx] != 0)
  ------------------
  |  Branch (278:7): [True: 745k, False: 1.58M]
  ------------------
  279|   745k|    return RemoveNode(p, indx);
  280|  1.58M|  numBytes = U2B(I2U(indx));
  ------------------
  |  |   32|  1.58M|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   30|  1.58M|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  281|  1.58M|  if (numBytes <= (UInt32)(p->HiUnit - p->LoUnit))
  ------------------
  |  Branch (281:7): [True: 1.47M, False: 109k]
  ------------------
  282|  1.47M|  {
  283|  1.47M|    void *retVal = p->LoUnit;
  284|  1.47M|    p->LoUnit += numBytes;
  285|  1.47M|    return retVal;
  286|  1.47M|  }
  287|   109k|  return AllocUnitsRare(p, indx);
  288|  1.58M|}
archive_ppmd7.c:Ppmd7_Update1:
  707|  1.20M|{
  708|  1.20M|  CPpmd_State *s = p->FoundState;
  709|  1.20M|  s->Freq += 4;
  710|  1.20M|  p->MinContext->SummFreq += 4;
  711|  1.20M|  if (s[0].Freq > s[-1].Freq)
  ------------------
  |  Branch (711:7): [True: 632k, False: 570k]
  ------------------
  712|   632k|  {
  713|   632k|    SwapStates(&s[0], &s[-1]);
  714|   632k|    p->FoundState = --s;
  715|   632k|    if (s->Freq > MAX_FREQ)
  ------------------
  |  |   29|   632k|#define MAX_FREQ 124
  ------------------
  |  Branch (715:9): [True: 232, False: 632k]
  ------------------
  716|    232|      Rescale(p);
  717|   632k|  }
  718|  1.20M|  NextContext(p);
  719|  1.20M|}
archive_ppmd7.c:Ppmd7_UpdateBin:
  732|  18.6M|{
  733|  18.6M|  p->FoundState->Freq = (Byte)(p->FoundState->Freq + (p->FoundState->Freq < 128 ? 1: 0));
  ------------------
  |  Branch (733:55): [True: 2.58M, False: 16.0M]
  ------------------
  734|  18.6M|  p->PrevSuccess = 1;
  735|  18.6M|  p->RunLength++;
  736|  18.6M|  NextContext(p);
  737|  18.6M|}
archive_ppmd7.c:Ppmd7_MakeEscFreq:
  673|  1.53M|{
  674|  1.53M|  CPpmd_See *see;
  675|  1.53M|  unsigned nonMasked = p->MinContext->NumStats - numMasked;
  676|  1.53M|  if (p->MinContext->NumStats != 256)
  ------------------
  |  Branch (676:7): [True: 1.28M, False: 250k]
  ------------------
  677|  1.28M|  {
  678|  1.28M|    see = p->See[p->NS2Indx[nonMasked - 1]] +
  679|  1.28M|        (nonMasked < (unsigned)SUFFIX(p->MinContext)->NumStats - p->MinContext->NumStats) +
  ------------------
  |  |   47|  1.28M|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   44|  1.28M|#define CTX(ref) ((CPpmd7_Context *)Ppmd7_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   17|  1.28M|  #define Ppmd7_GetContext(p, offs) ((CPpmd7_Context *)Ppmd7_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   16|  1.28M|  #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  680|  1.28M|        2 * (p->MinContext->SummFreq < 11 * p->MinContext->NumStats) +
  681|  1.28M|        4 * (numMasked > nonMasked) +
  682|  1.28M|        p->HiBitsFlag;
  683|  1.28M|    {
  684|  1.28M|      unsigned r = (see->Summ >> see->Shift);
  685|  1.28M|      see->Summ = (UInt16)(see->Summ - r);
  686|  1.28M|      *escFreq = r + (r == 0);
  687|  1.28M|    }
  688|  1.28M|  }
  689|   250k|  else
  690|   250k|  {
  691|   250k|    see = &p->DummySee;
  692|   250k|    *escFreq = 1;
  693|   250k|  }
  694|  1.53M|  return see;
  695|  1.53M|}
archive_ppmd7.c:Ppmd7_Update2:
  740|  1.10M|{
  741|  1.10M|  p->MinContext->SummFreq += 4;
  742|  1.10M|  if ((p->FoundState->Freq += 4) > MAX_FREQ)
  ------------------
  |  |   29|  1.10M|#define MAX_FREQ 124
  ------------------
  |  Branch (742:7): [True: 2.37k, False: 1.09M]
  ------------------
  743|  2.37k|    Rescale(p);
  744|  1.10M|  p->RunLength = p->InitRL;
  745|  1.10M|  UpdateModel(p);
  746|  1.10M|}

archive_ppmd8.c:Ppmd8_Construct:
   65|  14.4k|{
   66|  14.4k|  unsigned i, k, m;
   67|       |
   68|  14.4k|  p->Base = 0;
   69|       |
   70|   564k|  for (i = 0, k = 0; i < PPMD_NUM_INDEXES; i++)
  ------------------
  |  |  102|   564k|#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   98|   564k|#define PPMD_N1 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   99|   564k|#define PPMD_N2 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  100|   564k|#define PPMD_N3 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  101|   564k|#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|   564k|#define PPMD_N1 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|   564k|#define PPMD_N2 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|   564k|#define PPMD_N3 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (70:22): [True: 549k, False: 14.4k]
  ------------------
   71|   549k|  {
   72|   549k|    unsigned step = (i >= 12 ? 4 : (i >> 2) + 1);
  ------------------
  |  Branch (72:22): [True: 376k, False: 173k]
  ------------------
   73|  1.85M|    do { p->Units2Indx[k++] = (Byte)i; } while (--step);
  ------------------
  |  Branch (73:49): [True: 1.30M, False: 549k]
  ------------------
   74|   549k|    p->Indx2Units[i] = (Byte)k;
   75|   549k|  }
   76|       |
   77|  14.4k|  p->NS2BSIndx[0] = (0 << 1);
   78|  14.4k|  p->NS2BSIndx[1] = (1 << 1);
   79|  14.4k|  memset(p->NS2BSIndx + 2, (2 << 1), 9);
   80|  14.4k|  memset(p->NS2BSIndx + 11, (3 << 1), 256 - 11);
   81|       |
   82|  86.7k|  for (i = 0; i < 5; i++)
  ------------------
  |  Branch (82:15): [True: 72.3k, False: 14.4k]
  ------------------
   83|  72.3k|    p->NS2Indx[i] = (Byte)i;
   84|  3.70M|  for (m = i, k = 1; i < 260; i++)
  ------------------
  |  Branch (84:22): [True: 3.68M, False: 14.4k]
  ------------------
   85|  3.68M|  {
   86|  3.68M|    p->NS2Indx[i] = (Byte)m;
   87|  3.68M|    if (--k == 0)
  ------------------
  |  Branch (87:9): [True: 318k, False: 3.36M]
  ------------------
   88|   318k|      k = (++m) - 4;
   89|  3.68M|  }
   90|  14.4k|}
archive_ppmd8.c:Ppmd8_Alloc:
  100|  11.3k|{
  101|  11.3k|  if (p->Base == 0 || p->Size != size)
  ------------------
  |  Branch (101:7): [True: 11.3k, False: 0]
  |  Branch (101:23): [True: 0, False: 0]
  ------------------
  102|  11.3k|  {
  103|  11.3k|    Ppmd8_Free(p);
  104|  11.3k|    p->AlignOffset =
  105|       |      #ifdef PPMD_32BIT
  106|       |        (4 - size) & 3;
  107|       |      #else
  108|  11.3k|        4 - (size & 3);
  109|  11.3k|      #endif
  110|  11.3k|    if ((p->Base = malloc(p->AlignOffset + size)) == 0)
  ------------------
  |  Branch (110:9): [True: 0, False: 11.3k]
  ------------------
  111|      0|      return False;
  ------------------
  |  |   56|      0|#define False 0
  ------------------
  112|  11.3k|    p->Size = size;
  113|  11.3k|  }
  114|  11.3k|  return True;
  ------------------
  |  |   55|  11.3k|#define True 1
  ------------------
  115|  11.3k|}
archive_ppmd8.c:Ppmd8_Free:
   93|  22.7k|{
   94|  22.7k|  free(p->Base);
   95|  22.7k|  p->Size = 0;
   96|  22.7k|  p->Base = 0;
   97|  22.7k|}
archive_ppmd8.c:Ppmd8_Init:
  411|  11.3k|{
  412|  11.3k|  p->MaxOrder = maxOrder;
  413|  11.3k|  p->RestoreMethod = restoreMethod;
  414|  11.3k|  RestartModel(p);
  415|  11.3k|  p->DummySee.Shift = PPMD_PERIOD_BITS;
  ------------------
  |  |   90|  11.3k|#define PPMD_PERIOD_BITS 7
  ------------------
  416|  11.3k|  p->DummySee.Summ = 0; /* unused */
  417|  11.3k|  p->DummySee.Count = 64; /* unused */
  418|  11.3k|}
archive_ppmd8.c:RestartModel:
  354|  11.5k|{
  355|  11.5k|  unsigned i, k, m, r;
  356|       |
  357|  11.5k|  memset(p->FreeList, 0, sizeof(p->FreeList));
  358|  11.5k|  memset(p->Stamps, 0, sizeof(p->Stamps));
  359|  11.5k|  RESET_TEXT(0);
  ------------------
  |  |  349|  11.5k|#define RESET_TEXT(offs) do {						\
  |  |  350|  11.5k|	p->Text = p->Base + p->AlignOffset + (offs);			\
  |  |  351|  11.5k|} while (0)
  |  |  ------------------
  |  |  |  Branch (351:10): [Folded, False: 11.5k]
  |  |  ------------------
  ------------------
  360|  11.5k|  p->HiUnit = p->Text + p->Size;
  361|  11.5k|  p->LoUnit = p->UnitsStart = p->HiUnit - p->Size / 8 / UNIT_SIZE * 7 * UNIT_SIZE;
  ------------------
  |  |   15|  11.5k|#define UNIT_SIZE 12
  ------------------
                p->LoUnit = p->UnitsStart = p->HiUnit - p->Size / 8 / UNIT_SIZE * 7 * UNIT_SIZE;
  ------------------
  |  |   15|  11.5k|#define UNIT_SIZE 12
  ------------------
  362|  11.5k|  p->GlueCount = 0;
  363|       |
  364|  11.5k|  p->OrderFall = p->MaxOrder;
  365|  11.5k|  p->RunLength = p->InitRL = -(Int32)((p->MaxOrder < 12) ? p->MaxOrder : 12) - 1;
  ------------------
  |  Branch (365:39): [True: 6.87k, False: 4.65k]
  ------------------
  366|  11.5k|  p->PrevSuccess = 0;
  367|       |
  368|  11.5k|  p->MinContext = p->MaxContext = (CTX_PTR)(p->HiUnit -= UNIT_SIZE); /* AllocContext(p); */
  ------------------
  |  |   15|  11.5k|#define UNIT_SIZE 12
  ------------------
  369|  11.5k|  p->MinContext->Suffix = 0;
  370|  11.5k|  p->MinContext->NumStats = 255;
  371|  11.5k|  p->MinContext->Flags = 0;
  372|  11.5k|  p->MinContext->SummFreq = 256 + 1;
  373|  11.5k|  p->FoundState = (CPpmd_State *)p->LoUnit; /* AllocUnits(p, PPMD_NUM_INDEXES - 1); */
  374|  11.5k|  p->LoUnit += U2B(256 / 2);
  ------------------
  |  |   17|  11.5k|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   15|  11.5k|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  375|  11.5k|  p->MinContext->Stats = REF(p->FoundState);
  ------------------
  |  |   24|  11.5k|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  376|  2.96M|  for (i = 0; i < 256; i++)
  ------------------
  |  Branch (376:15): [True: 2.95M, False: 11.5k]
  ------------------
  377|  2.95M|  {
  378|  2.95M|    CPpmd_State *s = &p->FoundState[i];
  379|  2.95M|    s->Symbol = (Byte)i;
  380|  2.95M|    s->Freq = 1;
  381|  2.95M|    SetSuccessor(s, 0);
  382|  2.95M|  }
  383|       |
  384|   299k|  for (i = m = 0; m < 25; m++)
  ------------------
  |  Branch (384:19): [True: 288k, False: 11.5k]
  ------------------
  385|   288k|  {
  386|  2.76M|    while (p->NS2Indx[i] == m)
  ------------------
  |  Branch (386:12): [True: 2.47M, False: 288k]
  ------------------
  387|  2.47M|      i++;
  388|  2.59M|    for (k = 0; k < 8; k++)
  ------------------
  |  Branch (388:17): [True: 2.30M, False: 288k]
  ------------------
  389|  2.30M|    {
  390|  2.30M|      UInt16 val = (UInt16)(PPMD_BIN_SCALE - kInitBinEsc[k] / (i + 1));
  ------------------
  |  |   91|  2.30M|#define PPMD_BIN_SCALE (1 << (PPMD_INT_BITS + PPMD_PERIOD_BITS))
  |  |  ------------------
  |  |  |  |   89|  2.30M|#define PPMD_INT_BITS 7
  |  |  ------------------
  |  |               #define PPMD_BIN_SCALE (1 << (PPMD_INT_BITS + PPMD_PERIOD_BITS))
  |  |  ------------------
  |  |  |  |   90|  2.30M|#define PPMD_PERIOD_BITS 7
  |  |  ------------------
  ------------------
  391|  2.30M|      UInt16 *dest = p->BinSumm[m] + k;
  392|  20.7M|      for (r = 0; r < 64; r += 8)
  ------------------
  |  Branch (392:19): [True: 18.4M, False: 2.30M]
  ------------------
  393|  18.4M|        dest[r] = val;
  394|  2.30M|    }
  395|   288k|  }
  396|       |
  397|   288k|  for (i = m = 0; m < 24; m++)
  ------------------
  |  Branch (397:19): [True: 276k, False: 11.5k]
  ------------------
  398|   276k|  {
  399|  3.21M|    while (p->NS2Indx[i + 3] == m + 3)
  ------------------
  |  Branch (399:12): [True: 2.93M, False: 276k]
  ------------------
  400|  2.93M|      i++;
  401|  9.12M|    for (k = 0; k < 32; k++)
  ------------------
  |  Branch (401:17): [True: 8.85M, False: 276k]
  ------------------
  402|  8.85M|    {
  403|  8.85M|      CPpmd_See *s = &p->See[m][k];
  404|  8.85M|      s->Summ = (UInt16)((2 * i + 5) << (s->Shift = PPMD_PERIOD_BITS - 4));
  ------------------
  |  |   90|  8.85M|#define PPMD_PERIOD_BITS 7
  ------------------
  405|  8.85M|      s->Count = 7;
  406|  8.85M|    }
  407|   276k|  }
  408|  11.5k|}
archive_ppmd8.c:SetSuccessor:
  344|   288M|{
  345|   288M|  (p)->SuccessorLow = (UInt16)((UInt32)(v) & 0xFFFF);
  346|   288M|  (p)->SuccessorHigh = (UInt16)(((UInt32)(v) >> 16) & 0xFFFF);
  347|   288M|}
archive_ppmd8.c:Ppmd8_RangeDec_Init:
 1131|  11.3k|{
 1132|  11.3k|  unsigned i;
 1133|  11.3k|  p->Low = 0;
 1134|  11.3k|  p->Range = 0xFFFFFFFF;
 1135|  11.3k|  p->Code = 0;
 1136|  56.7k|  for (i = 0; i < 4; i++)
  ------------------
  |  Branch (1136:15): [True: 45.4k, False: 11.3k]
  ------------------
 1137|  45.4k|    p->Code = (p->Code << 8) | p->Stream.In->Read(p->Stream.In);
 1138|  11.3k|  return (p->Code < 0xFFFFFFFF);
 1139|  11.3k|}
archive_ppmd8.c:Ppmd8_DecodeSymbol:
 1165|  79.7M|{
 1166|  79.7M|  size_t charMask[256 / sizeof(size_t)];
 1167|  79.7M|  if (p->MinContext->NumStats != 0)
  ------------------
  |  Branch (1167:7): [True: 15.2M, False: 64.5M]
  ------------------
 1168|  15.2M|  {
 1169|  15.2M|    CPpmd_State *s = Ppmd8_GetStats(p, p->MinContext);
  ------------------
  |  |   98|  15.2M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  ------------------
  |  |  |  |   96|  15.2M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  ------------------
  ------------------
 1170|  15.2M|    unsigned i;
 1171|  15.2M|    UInt32 count, hiCnt;
 1172|  15.2M|    if ((count = RangeDec_GetThreshold(p, p->MinContext->SummFreq)) < (hiCnt = s->Freq))
  ------------------
  |  Branch (1172:9): [True: 5.63M, False: 9.56M]
  ------------------
 1173|  5.63M|    {
 1174|  5.63M|      Byte symbol;
 1175|  5.63M|      RangeDec_Decode(p, 0, s->Freq);
 1176|  5.63M|      p->FoundState = s;
 1177|  5.63M|      symbol = s->Symbol;
 1178|  5.63M|      Ppmd8_Update1_0(p);
 1179|  5.63M|      return symbol;
 1180|  5.63M|    }
 1181|  9.56M|    p->PrevSuccess = 0;
 1182|  9.56M|    i = p->MinContext->NumStats;
 1183|  9.56M|    do
 1184|  88.7M|    {
 1185|  88.7M|      if ((hiCnt += (++s)->Freq) > count)
  ------------------
  |  Branch (1185:11): [True: 5.48M, False: 83.2M]
  ------------------
 1186|  5.48M|      {
 1187|  5.48M|        Byte symbol;
 1188|  5.48M|        RangeDec_Decode(p, hiCnt - s->Freq, s->Freq);
 1189|  5.48M|        p->FoundState = s;
 1190|  5.48M|        symbol = s->Symbol;
 1191|  5.48M|        Ppmd8_Update1(p);
 1192|  5.48M|        return symbol;
 1193|  5.48M|      }
 1194|  88.7M|    }
 1195|  83.2M|    while (--i);
  ------------------
  |  Branch (1195:12): [True: 79.1M, False: 4.08M]
  ------------------
 1196|  4.08M|    if (count >= p->MinContext->SummFreq)
  ------------------
  |  Branch (1196:9): [True: 5.06k, False: 4.08M]
  ------------------
 1197|  5.06k|      return -2;
 1198|  4.08M|    RangeDec_Decode(p, hiCnt, p->MinContext->SummFreq - hiCnt);
 1199|  4.08M|    PPMD_SetAllBitsIn256Bytes(charMask);
  ------------------
  |  |  151|  4.08M|#define PPMD_SetAllBitsIn256Bytes(p) do {				\
  |  |  152|  4.08M|	unsigned j;							\
  |  |  153|  20.4M|	for (j = 0; j < 256 / sizeof(p[0]); j += 8) {			\
  |  |  ------------------
  |  |  |  Branch (153:14): [True: 16.3M, False: 4.08M]
  |  |  ------------------
  |  |  154|  16.3M|		p[j+7] = p[j+6] = p[j+5] = p[j+4] =			\
  |  |  155|  16.3M|		    p[j+3] = p[j+2] = p[j+1] = p[j+0] = ~(size_t)0;	\
  |  |  156|  16.3M|	}								\
  |  |  157|  4.08M|} while (0)
  |  |  ------------------
  |  |  |  Branch (157:10): [Folded, False: 4.08M]
  |  |  ------------------
  ------------------
 1200|  4.08M|    MASK(s->Symbol) = 0;
  ------------------
  |  | 1162|  4.08M|#define MASK(sym) ((signed char *)charMask)[sym]
  ------------------
 1201|  4.08M|    i = p->MinContext->NumStats;
 1202|  11.7M|    do { MASK((--s)->Symbol) = 0; } while (--i);
  ------------------
  |  | 1162|  11.7M|#define MASK(sym) ((signed char *)charMask)[sym]
  ------------------
  |  Branch (1202:44): [True: 7.69M, False: 4.08M]
  ------------------
 1203|  4.08M|  }
 1204|  64.5M|  else
 1205|  64.5M|  {
 1206|  64.5M|    UInt16 *prob = Ppmd8_GetBinSumm(p);
  ------------------
  |  |  102|  64.5M|    &p->BinSumm[p->NS2Indx[Ppmd8Context_OneState(p->MinContext)->Freq - 1]][ \
  |  |  ------------------
  |  |  |  |   38|  64.5M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  |  |  103|  64.5M|    p->NS2BSIndx[Ppmd8_GetContext(p, p->MinContext->Suffix)->NumStats] + \
  |  |  ------------------
  |  |  |  |   97|  64.5M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  64.5M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  104|  64.5M|    p->PrevSuccess + p->MinContext->Flags + ((p->RunLength >> 26) & 0x20)]
  ------------------
 1207|  64.5M|    if (((p->Code / (p->Range >>= 14)) < *prob))
  ------------------
  |  Branch (1207:9): [True: 57.7M, False: 6.84M]
  ------------------
 1208|  57.7M|    {
 1209|  57.7M|      Byte symbol;
 1210|  57.7M|      RangeDec_Decode(p, 0, *prob);
 1211|  57.7M|      *prob = (UInt16)PPMD_UPDATE_PROB_0(*prob);
  ------------------
  |  |   95|  57.7M|#define PPMD_UPDATE_PROB_0(prob) ((prob) + (1 << PPMD_INT_BITS) - PPMD_GET_MEAN(prob))
  |  |  ------------------
  |  |  |  |   89|  57.7M|#define PPMD_INT_BITS 7
  |  |  ------------------
  |  |               #define PPMD_UPDATE_PROB_0(prob) ((prob) + (1 << PPMD_INT_BITS) - PPMD_GET_MEAN(prob))
  |  |  ------------------
  |  |  |  |   94|  57.7M|#define PPMD_GET_MEAN(summ) PPMD_GET_MEAN_SPEC((summ), PPMD_PERIOD_BITS, 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  57.7M|#define PPMD_GET_MEAN_SPEC(summ, shift, round) (((summ) + (1 << ((shift) - (round)))) >> (shift))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1212|  57.7M|      symbol = (p->FoundState = Ppmd8Context_OneState(p->MinContext))->Symbol;
  ------------------
  |  |   38|  57.7M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  ------------------
 1213|  57.7M|      Ppmd8_UpdateBin(p);
 1214|  57.7M|      return symbol;
 1215|  57.7M|    }
 1216|  6.84M|    RangeDec_Decode(p, *prob, (1 << 14) - *prob);
 1217|  6.84M|    *prob = (UInt16)PPMD_UPDATE_PROB_1(*prob);
  ------------------
  |  |   96|  6.84M|#define PPMD_UPDATE_PROB_1(prob) ((prob) - PPMD_GET_MEAN(prob))
  |  |  ------------------
  |  |  |  |   94|  6.84M|#define PPMD_GET_MEAN(summ) PPMD_GET_MEAN_SPEC((summ), PPMD_PERIOD_BITS, 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  6.84M|#define PPMD_GET_MEAN_SPEC(summ, shift, round) (((summ) + (1 << ((shift) - (round)))) >> (shift))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1218|  6.84M|    p->InitEsc = PPMD8_kExpEscape[*prob >> 10];
 1219|  6.84M|    PPMD_SetAllBitsIn256Bytes(charMask);
  ------------------
  |  |  151|  6.84M|#define PPMD_SetAllBitsIn256Bytes(p) do {				\
  |  |  152|  6.84M|	unsigned j;							\
  |  |  153|  34.2M|	for (j = 0; j < 256 / sizeof(p[0]); j += 8) {			\
  |  |  ------------------
  |  |  |  Branch (153:14): [True: 27.3M, False: 6.84M]
  |  |  ------------------
  |  |  154|  27.3M|		p[j+7] = p[j+6] = p[j+5] = p[j+4] =			\
  |  |  155|  27.3M|		    p[j+3] = p[j+2] = p[j+1] = p[j+0] = ~(size_t)0;	\
  |  |  156|  27.3M|	}								\
  |  |  157|  6.84M|} while (0)
  |  |  ------------------
  |  |  |  Branch (157:10): [Folded, False: 6.84M]
  |  |  ------------------
  ------------------
 1220|  6.84M|    MASK(Ppmd8Context_OneState(p->MinContext)->Symbol) = 0;
  ------------------
  |  | 1162|  6.84M|#define MASK(sym) ((signed char *)charMask)[sym]
  ------------------
 1221|  6.84M|    p->PrevSuccess = 0;
 1222|  6.84M|  }
 1223|  10.9M|  for (;;)
 1224|  15.4M|  {
 1225|  15.4M|    CPpmd_State *ps[256], *s;
 1226|  15.4M|    UInt32 freqSum, count, hiCnt;
 1227|  15.4M|    CPpmd_See *see;
 1228|  15.4M|    unsigned i, num, numMasked = p->MinContext->NumStats;
 1229|  15.4M|    do
 1230|  42.5M|    {
 1231|  42.5M|      p->OrderFall++;
 1232|  42.5M|      if (!p->MinContext->Suffix)
  ------------------
  |  Branch (1232:11): [True: 1.01k, False: 42.5M]
  ------------------
 1233|  1.01k|        return -1;
 1234|  42.5M|      p->MinContext = Ppmd8_GetContext(p, p->MinContext->Suffix);
  ------------------
  |  |   97|  42.5M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  ------------------
  |  |  |  |   96|  42.5M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  ------------------
  ------------------
 1235|  42.5M|    }
 1236|  42.5M|    while (p->MinContext->NumStats == numMasked);
  ------------------
  |  Branch (1236:12): [True: 27.1M, False: 15.4M]
  ------------------
 1237|  15.4M|    hiCnt = 0;
 1238|  15.4M|    s = Ppmd8_GetStats(p, p->MinContext);
  ------------------
  |  |   98|  15.4M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  ------------------
  |  |  |  |   96|  15.4M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  ------------------
  ------------------
 1239|  15.4M|    i = 0;
 1240|  15.4M|    num = p->MinContext->NumStats - numMasked;
 1241|  15.4M|    do
 1242|   716M|    {
 1243|   716M|      int k = (int)(MASK(s->Symbol));
  ------------------
  |  | 1162|   716M|#define MASK(sym) ((signed char *)charMask)[sym]
  ------------------
 1244|   716M|      hiCnt += (s->Freq & k);
 1245|   716M|      ps[i] = s++;
 1246|   716M|      i -= k;
 1247|   716M|    }
 1248|   716M|    while (i != num);
  ------------------
  |  Branch (1248:12): [True: 701M, False: 15.4M]
  ------------------
 1249|       |    
 1250|  15.4M|    see = Ppmd8_MakeEscFreq(p, numMasked, &freqSum);
 1251|  15.4M|    freqSum += hiCnt;
 1252|  15.4M|    count = RangeDec_GetThreshold(p, freqSum);
 1253|       |    
 1254|  15.4M|    if (count < hiCnt)
  ------------------
  |  Branch (1254:9): [True: 10.9M, False: 4.54M]
  ------------------
 1255|  10.9M|    {
 1256|  10.9M|      Byte symbol;
 1257|  10.9M|      CPpmd_State **pps = ps;
 1258|   213M|      for (hiCnt = 0; (hiCnt += (*pps)->Freq) <= count; pps++);
  ------------------
  |  Branch (1258:23): [True: 202M, False: 10.9M]
  ------------------
 1259|  10.9M|      s = *pps;
 1260|  10.9M|      RangeDec_Decode(p, hiCnt - s->Freq, s->Freq);
 1261|  10.9M|      Ppmd_See_Update(see);
  ------------------
  |  |  112|  10.9M|#define Ppmd_See_Update(p) do {						\
  |  |  113|  10.9M|	if ((p)->Shift < PPMD_PERIOD_BITS && --(p)->Count == 0) {	\
  |  |  ------------------
  |  |  |  |   90|  21.8M|#define PPMD_PERIOD_BITS 7
  |  |  ------------------
  |  |  |  Branch (113:6): [True: 6.75M, False: 4.17M]
  |  |  |  Branch (113:39): [True: 217k, False: 6.53M]
  |  |  ------------------
  |  |  114|   217k|		(p)->Summ <<= 1;					\
  |  |  115|   217k|		(p)->Count = (Byte)(3 << (p)->Shift++);			\
  |  |  116|   217k|    	}								\
  |  |  117|  10.9M|} while (0)
  |  |  ------------------
  |  |  |  Branch (117:10): [Folded, False: 10.9M]
  |  |  ------------------
  ------------------
 1262|  10.9M|      p->FoundState = s;
 1263|  10.9M|      symbol = s->Symbol;
 1264|  10.9M|      Ppmd8_Update2(p);
 1265|  10.9M|      return symbol;
 1266|  10.9M|    }
 1267|  4.54M|    if (count >= freqSum)
  ------------------
  |  Branch (1267:9): [True: 5.09k, False: 4.54M]
  ------------------
 1268|  5.09k|      return -2;
 1269|  4.54M|    RangeDec_Decode(p, hiCnt, freqSum - hiCnt);
 1270|  4.54M|    see->Summ = (UInt16)(see->Summ + freqSum);
 1271|  13.6M|    do { MASK(ps[--i]->Symbol) = 0; } while (i != 0);
  ------------------
  |  | 1162|  13.6M|#define MASK(sym) ((signed char *)charMask)[sym]
  ------------------
  |  Branch (1271:46): [True: 9.14M, False: 4.54M]
  ------------------
 1272|  4.54M|  }
 1273|  10.9M|}
archive_ppmd8.c:RangeDec_GetThreshold:
 1142|  30.6M|{
 1143|  30.6M|  return p->Code / (p->Range /= total);
 1144|  30.6M|}
archive_ppmd8.c:RangeDec_Decode:
 1147|  95.2M|{
 1148|  95.2M|  start *= p->Range;
 1149|  95.2M|  p->Low += start;
 1150|  95.2M|  p->Code -= start;
 1151|  95.2M|  p->Range *= size;
 1152|       |
 1153|   106M|  while ((p->Low ^ (p->Low + p->Range)) < kTop ||
  ------------------
  |  |   34|   213M|#define kTop (1 << 24)
  ------------------
  |  Branch (1153:10): [True: 11.4M, False: 95.2M]
  ------------------
 1154|  95.2M|      (p->Range < kBot && ((p->Range = (0 - p->Low) & (kBot - 1)), 1)))
  ------------------
  |  |   35|   190M|#define kBot (1 << 15)
  ------------------
                    (p->Range < kBot && ((p->Range = (0 - p->Low) & (kBot - 1)), 1)))
  ------------------
  |  |   35|  13.3k|#define kBot (1 << 15)
  ------------------
  |  Branch (1154:8): [True: 13.3k, False: 95.2M]
  |  Branch (1154:27): [True: 13.3k, False: 0]
  ------------------
 1155|  11.4M|  {
 1156|  11.4M|    p->Code = (p->Code << 8) | p->Stream.In->Read(p->Stream.In);
 1157|  11.4M|    p->Range <<= 8;
 1158|  11.4M|    p->Low <<= 8;
 1159|  11.4M|  }
 1160|  95.2M|}
archive_ppmd8.c:Ppmd8_Update1_0:
 1097|  5.63M|{
 1098|  5.63M|  p->PrevSuccess = (2 * p->FoundState->Freq >= p->MinContext->SummFreq);
 1099|  5.63M|  p->RunLength += p->PrevSuccess;
 1100|  5.63M|  p->MinContext->SummFreq += 4;
 1101|  5.63M|  if ((p->FoundState->Freq += 4) > MAX_FREQ)
  ------------------
  |  |   14|  5.63M|#define MAX_FREQ 124
  ------------------
  |  Branch (1101:7): [True: 41.3k, False: 5.59M]
  ------------------
 1102|  41.3k|    Rescale(p);
 1103|  5.63M|  NextContext(p);
 1104|  5.63M|}
archive_ppmd8.c:Rescale:
  975|  55.2k|{
  976|  55.2k|  unsigned i, adder, sumFreq, escFreq;
  977|  55.2k|  CPpmd_State *stats = STATS(p->MinContext);
  ------------------
  |  |   30|  55.2k|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  55.2k|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  55.2k|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  978|  55.2k|  CPpmd_State *s = p->FoundState;
  979|  55.2k|  {
  980|  55.2k|    CPpmd_State tmp = *s;
  981|   213k|    for (; s != stats; s--)
  ------------------
  |  Branch (981:12): [True: 158k, False: 55.2k]
  ------------------
  982|   158k|      s[0] = s[-1];
  983|  55.2k|    *s = tmp;
  984|  55.2k|  }
  985|  55.2k|  escFreq = p->MinContext->SummFreq - s->Freq;
  986|  55.2k|  s->Freq += 4;
  987|  55.2k|  adder = (p->OrderFall != 0
  988|       |      #ifdef PPMD8_FREEZE_SUPPORT
  989|       |      || p->RestoreMethod > PPMD8_RESTORE_METHOD_FREEZE
  990|       |      #endif
  991|  55.2k|      );
  992|  55.2k|  s->Freq = (Byte)((s->Freq + adder) >> 1);
  993|  55.2k|  sumFreq = s->Freq;
  994|       |  
  995|  55.2k|  i = p->MinContext->NumStats;
  996|  55.2k|  do
  997|  2.48M|  {
  998|  2.48M|    escFreq -= (++s)->Freq;
  999|  2.48M|    s->Freq = (Byte)((s->Freq + adder) >> 1);
 1000|  2.48M|    sumFreq += s->Freq;
 1001|  2.48M|    if (s[0].Freq > s[-1].Freq)
  ------------------
  |  Branch (1001:9): [True: 730k, False: 1.75M]
  ------------------
 1002|   730k|    {
 1003|   730k|      CPpmd_State *s1 = s;
 1004|   730k|      CPpmd_State tmp = *s1;
 1005|   730k|      do
 1006|  37.0M|        s1[0] = s1[-1];
 1007|  37.0M|      while (--s1 != stats && tmp.Freq > s1[-1].Freq);
  ------------------
  |  Branch (1007:14): [True: 37.0M, False: 0]
  |  Branch (1007:31): [True: 36.3M, False: 730k]
  ------------------
 1008|   730k|      *s1 = tmp;
 1009|   730k|    }
 1010|  2.48M|  }
 1011|  2.48M|  while (--i);
  ------------------
  |  Branch (1011:10): [True: 2.43M, False: 55.2k]
  ------------------
 1012|       |  
 1013|  55.2k|  if (s->Freq == 0)
  ------------------
  |  Branch (1013:7): [True: 10.7k, False: 44.5k]
  ------------------
 1014|  10.7k|  {
 1015|  10.7k|    unsigned numStats = p->MinContext->NumStats;
 1016|  10.7k|    unsigned n0, n1;
 1017|  12.5k|    do { i++; } while ((--s)->Freq == 0);
  ------------------
  |  Branch (1017:24): [True: 1.83k, False: 10.7k]
  ------------------
 1018|  10.7k|    escFreq += i;
 1019|  10.7k|    p->MinContext->NumStats = (Byte)(p->MinContext->NumStats - i);
 1020|  10.7k|    if (p->MinContext->NumStats == 0)
  ------------------
  |  Branch (1020:9): [True: 4.44k, False: 6.31k]
  ------------------
 1021|  4.44k|    {
 1022|  4.44k|      CPpmd_State tmp = *stats;
 1023|  4.44k|      tmp.Freq = (Byte)((2 * tmp.Freq + escFreq - 1) / escFreq);
 1024|  4.44k|      if (tmp.Freq > MAX_FREQ / 3)
  ------------------
  |  |   14|  4.44k|#define MAX_FREQ 124
  ------------------
  |  Branch (1024:11): [True: 4.30k, False: 139]
  ------------------
 1025|  4.30k|        tmp.Freq = MAX_FREQ / 3;
  ------------------
  |  |   14|  4.30k|#define MAX_FREQ 124
  ------------------
 1026|  4.44k|      InsertNode(p, stats, U2I((numStats + 2) >> 1));
  ------------------
  |  |   18|  4.44k|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
 1027|  4.44k|      p->MinContext->Flags = (Byte)((p->MinContext->Flags & 0x10) + 0x08 * (tmp.Symbol >= 0x40));
 1028|  4.44k|      *(p->FoundState = ONE_STATE(p->MinContext)) = tmp;
  ------------------
  |  |   31|  4.44k|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  4.44k|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
 1029|  4.44k|      return;
 1030|  4.44k|    }
 1031|  6.31k|    n0 = (numStats + 2) >> 1;
 1032|  6.31k|    n1 = (p->MinContext->NumStats + 2) >> 1;
 1033|  6.31k|    if (n0 != n1)
  ------------------
  |  Branch (1033:9): [True: 5.04k, False: 1.27k]
  ------------------
 1034|  5.04k|      p->MinContext->Stats = STATS_REF(ShrinkUnits(p, stats, n0, n1));
  ------------------
  |  |   27|  5.04k|#define STATS_REF(ptr) ((CPpmd_State_Ref)REF(ptr))
  |  |  ------------------
  |  |  |  |   24|  5.04k|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  |  |  ------------------
  ------------------
 1035|  6.31k|    p->MinContext->Flags &= ~0x08;
 1036|  6.31k|    p->MinContext->Flags |= 0x08 * ((s = STATS(p->MinContext))->Symbol >= 0x40);
  ------------------
  |  |   30|  6.31k|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  6.31k|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  6.31k|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1037|  6.31k|    i = p->MinContext->NumStats;
 1038|  17.3k|    do { p->MinContext->Flags |= 0x08*((++s)->Symbol >= 0x40); } while (--i);
  ------------------
  |  Branch (1038:73): [True: 11.0k, False: 6.31k]
  ------------------
 1039|  6.31k|  }
 1040|  50.8k|  p->MinContext->SummFreq = (UInt16)(sumFreq + escFreq - (escFreq >> 1));
 1041|  50.8k|  p->MinContext->Flags |= 0x4;
 1042|  50.8k|  p->FoundState = STATS(p->MinContext);
  ------------------
  |  |   30|  50.8k|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  50.8k|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  50.8k|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1043|  50.8k|}
archive_ppmd8.c:InsertNode:
  118|  69.3M|{
  119|  69.3M|  ((CPpmd8_Node *)node)->Stamp = EMPTY_NODE;
  ------------------
  |  |   62|  69.3M|#define EMPTY_NODE 0xFFFFFFFF
  ------------------
  120|  69.3M|  ((CPpmd8_Node *)node)->Next = (CPpmd8_Node_Ref)p->FreeList[indx];
  121|  69.3M|  ((CPpmd8_Node *)node)->NU = I2U(indx);
  ------------------
  |  |   19|  69.3M|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  122|  69.3M|  p->FreeList[indx] = REF(node);
  ------------------
  |  |   24|  69.3M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  123|  69.3M|  p->Stamps[indx]++;
  124|  69.3M|}
archive_ppmd8.c:ShrinkUnits:
  255|  2.62M|{
  256|  2.62M|  unsigned i0 = U2I(oldNU);
  ------------------
  |  |   18|  2.62M|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  257|  2.62M|  unsigned i1 = U2I(newNU);
  ------------------
  |  |   18|  2.62M|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  258|  2.62M|  if (i0 == i1)
  ------------------
  |  Branch (258:7): [True: 428k, False: 2.19M]
  ------------------
  259|   428k|    return oldPtr;
  260|  2.19M|  if (p->FreeList[i1] != 0)
  ------------------
  |  Branch (260:7): [True: 2.18M, False: 3.77k]
  ------------------
  261|  2.18M|  {
  262|  2.18M|    void *ptr = RemoveNode(p, i1);
  263|  2.18M|    MyMem12Cpy(ptr, oldPtr, newNU);
  ------------------
  |  |  245|  2.18M|#define MyMem12Cpy(dest, src, num) do {					\
  |  |  246|  2.18M|	UInt32 *d = (UInt32 *)dest;					\
  |  |  247|  2.18M|	const UInt32 *z = (const UInt32 *)src;				\
  |  |  248|  2.18M|	UInt32 n = num;							\
  |  |  249|  3.30M|	do {								\
  |  |  250|  3.30M|		d[0] = z[0]; d[1] = z[1]; d[2] = z[2]; z += 3; d += 3;	\
  |  |  251|  3.30M|	} while (--n);							\
  |  |  ------------------
  |  |  |  Branch (251:11): [True: 1.11M, False: 2.18M]
  |  |  ------------------
  |  |  252|  2.18M|} while (0)
  |  |  ------------------
  |  |  |  Branch (252:10): [Folded, False: 2.18M]
  |  |  ------------------
  ------------------
  264|  2.18M|    InsertNode(p, oldPtr, i0);
  265|  2.18M|    return ptr;
  266|  2.18M|  }
  267|  3.77k|  SplitBlock(p, oldPtr, i0, i1);
  268|  3.77k|  return oldPtr;
  269|  2.19M|}
archive_ppmd8.c:RemoveNode:
  127|  34.6M|{
  128|  34.6M|  CPpmd8_Node *node = NODE((CPpmd8_Node_Ref)p->FreeList[indx]);
  ------------------
  |  |   59|  34.6M|  #define NODE(offs) ((CPpmd8_Node *)(p->Base + (offs)))
  ------------------
  129|  34.6M|  p->FreeList[indx] = node->Next;
  130|  34.6M|  p->Stamps[indx]--;
  131|  34.6M|  return node;
  132|  34.6M|}
archive_ppmd8.c:SplitBlock:
  135|  4.28M|{
  136|  4.28M|  unsigned i, nu = I2U(oldIndx) - I2U(newIndx);
  ------------------
  |  |   19|  4.28M|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
                unsigned i, nu = I2U(oldIndx) - I2U(newIndx);
  ------------------
  |  |   19|  4.28M|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  137|  4.28M|  ptr = (Byte *)ptr + U2B(I2U(newIndx));
  ------------------
  |  |   17|  4.28M|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   15|  4.28M|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  138|  4.28M|  if (I2U(i = U2I(nu)) != nu)
  ------------------
  |  |   19|  4.28M|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  |  Branch (138:7): [True: 301k, False: 3.98M]
  ------------------
  139|   301k|  {
  140|   301k|    unsigned k = I2U(--i);
  ------------------
  |  |   19|   301k|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  141|   301k|    InsertNode(p, ((Byte *)ptr) + U2B(k), nu - k - 1);
  ------------------
  |  |   17|   301k|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   15|   301k|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  142|   301k|  }
  143|  4.28M|  InsertNode(p, ptr, i);
  144|  4.28M|}
archive_ppmd8.c:NextContext:
 1070|  68.8M|{
 1071|  68.8M|  CTX_PTR c = CTX(SUCCESSOR(p->FoundState));
  ------------------
  |  |   29|  68.8M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  ------------------
  |  |  |  |   97|  68.8M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  68.8M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1072|  68.8M|  if (p->OrderFall == 0 && (Byte *)c >= p->UnitsStart)
  ------------------
  |  Branch (1072:7): [True: 34.0M, False: 34.7M]
  |  Branch (1072:28): [True: 26.7M, False: 7.28M]
  ------------------
 1073|  26.7M|    p->MinContext = p->MaxContext = c;
 1074|  42.0M|  else
 1075|  42.0M|  {
 1076|  42.0M|    UpdateModel(p);
 1077|  42.0M|    p->MinContext = p->MaxContext;
 1078|  42.0M|  }
 1079|  68.8M|}
archive_ppmd8.c:UpdateModel:
  806|  53.0M|{
  807|  53.0M|  CPpmd_Void_Ref successor, fSuccessor = SUCCESSOR(p->FoundState);
  ------------------
  |  |  341|  53.0M|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  ------------------
  808|  53.0M|  CTX_PTR c;
  809|  53.0M|  unsigned s0, ns, fFreq = p->FoundState->Freq;
  810|  53.0M|  Byte flag, fSymbol = p->FoundState->Symbol;
  811|  53.0M|  CPpmd_State *s = NULL;
  812|       |  
  813|  53.0M|  if (p->FoundState->Freq < MAX_FREQ / 4 && p->MinContext->Suffix != 0)
  ------------------
  |  |   14|  53.0M|#define MAX_FREQ 124
  ------------------
  |  Branch (813:7): [True: 49.4M, False: 3.56M]
  |  Branch (813:45): [True: 47.5M, False: 1.91M]
  ------------------
  814|  47.5M|  {
  815|  47.5M|    c = SUFFIX(p->MinContext);
  ------------------
  |  |   32|  47.5M|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  47.5M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  47.5M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  47.5M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  816|       |    
  817|  47.5M|    if (c->NumStats == 0)
  ------------------
  |  Branch (817:9): [True: 27.9M, False: 19.5M]
  ------------------
  818|  27.9M|    {
  819|  27.9M|      s = ONE_STATE(c);
  ------------------
  |  |   31|  27.9M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  27.9M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  820|  27.9M|      if (s->Freq < 32)
  ------------------
  |  Branch (820:11): [True: 27.9M, False: 1.47k]
  ------------------
  821|  27.9M|        s->Freq++;
  822|  27.9M|    }
  823|  19.5M|    else
  824|  19.5M|    {
  825|  19.5M|      s = STATS(c);
  ------------------
  |  |   30|  19.5M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  19.5M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  19.5M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  826|  19.5M|      if (s->Symbol != p->FoundState->Symbol)
  ------------------
  |  Branch (826:11): [True: 12.1M, False: 7.43M]
  ------------------
  827|  12.1M|      {
  828|   183M|        do { s++; } while (s->Symbol != p->FoundState->Symbol);
  ------------------
  |  Branch (828:28): [True: 171M, False: 12.1M]
  ------------------
  829|  12.1M|        if (s[0].Freq >= s[-1].Freq)
  ------------------
  |  Branch (829:13): [True: 5.20M, False: 6.95M]
  ------------------
  830|  5.20M|        {
  831|  5.20M|          SwapStates(&s[0], &s[-1]);
  832|  5.20M|          s--;
  833|  5.20M|        }
  834|  12.1M|      }
  835|  19.5M|      if (s->Freq < MAX_FREQ - 9)
  ------------------
  |  |   14|  19.5M|#define MAX_FREQ 124
  ------------------
  |  Branch (835:11): [True: 19.4M, False: 176k]
  ------------------
  836|  19.4M|      {
  837|  19.4M|        s->Freq += 2;
  838|  19.4M|        c->SummFreq += 2;
  839|  19.4M|      }
  840|  19.5M|    }
  841|  47.5M|  }
  842|       |  
  843|  53.0M|  c = p->MaxContext;
  844|  53.0M|  if (p->OrderFall == 0 && fSuccessor)
  ------------------
  |  Branch (844:7): [True: 7.28M, False: 45.7M]
  |  Branch (844:28): [True: 7.18M, False: 101k]
  ------------------
  845|  7.18M|  {
  846|  7.18M|    CTX_PTR cs = CreateSuccessors(p, True, s, p->MinContext);
  ------------------
  |  |   55|  7.18M|#define True 1
  ------------------
  847|  7.18M|    if (cs == 0)
  ------------------
  |  Branch (847:9): [True: 403, False: 7.18M]
  ------------------
  848|    403|    {
  849|    403|      SetSuccessor(p->FoundState, 0);
  850|    403|      RESTORE_MODEL(c, CTX(fSuccessor));
  ------------------
  |  |  554|    403|  #define RESTORE_MODEL(c1, fSuccessor) RestoreModel(p, c1)
  ------------------
  851|    403|    }
  852|  7.18M|    else
  853|  7.18M|    {
  854|  7.18M|      SetSuccessor(p->FoundState, REF(cs));
  ------------------
  |  |   24|  7.18M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  855|  7.18M|      p->MaxContext = cs;
  856|  7.18M|    }
  857|  7.18M|    return;
  858|  7.18M|  }
  859|       |  
  860|  45.8M|  *p->Text++ = p->FoundState->Symbol;
  861|  45.8M|  successor = REF(p->Text);
  ------------------
  |  |   24|  45.8M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  862|  45.8M|  if (p->Text >= p->UnitsStart)
  ------------------
  |  Branch (862:7): [True: 16, False: 45.8M]
  ------------------
  863|     16|  {
  864|     16|    RESTORE_MODEL(c, CTX(fSuccessor)); /* check it */
  ------------------
  |  |  554|     16|  #define RESTORE_MODEL(c1, fSuccessor) RestoreModel(p, c1)
  ------------------
  865|     16|    return;
  866|     16|  }
  867|       |  
  868|  45.8M|  if (!fSuccessor)
  ------------------
  |  Branch (868:7): [True: 2.12M, False: 43.6M]
  ------------------
  869|  2.12M|  {
  870|  2.12M|    CTX_PTR cs = ReduceOrder(p, s, p->MinContext);
  871|  2.12M|    if (cs == NULL)
  ------------------
  |  Branch (871:9): [True: 46, False: 2.12M]
  ------------------
  872|     46|    {
  873|     46|      RESTORE_MODEL(c, 0);
  ------------------
  |  |  554|     46|  #define RESTORE_MODEL(c1, fSuccessor) RestoreModel(p, c1)
  ------------------
  874|     46|      return;
  875|     46|    }
  876|  2.12M|    fSuccessor = REF(cs);
  ------------------
  |  |   24|  2.12M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  877|  2.12M|  }
  878|  43.6M|  else if ((Byte *)Ppmd8_GetPtr(p, fSuccessor) < p->UnitsStart)
  ------------------
  |  |   96|  43.6M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  ------------------
  |  Branch (878:12): [True: 15.9M, False: 27.7M]
  ------------------
  879|  15.9M|  {
  880|  15.9M|    CTX_PTR cs = CreateSuccessors(p, False, s, p->MinContext);
  ------------------
  |  |   56|  15.9M|#define False 0
  ------------------
  881|  15.9M|    if (cs == NULL)
  ------------------
  |  Branch (881:9): [True: 230, False: 15.9M]
  ------------------
  882|    230|    {
  883|    230|      RESTORE_MODEL(c, 0);
  ------------------
  |  |  554|    230|  #define RESTORE_MODEL(c1, fSuccessor) RestoreModel(p, c1)
  ------------------
  884|    230|      return;
  885|    230|    }
  886|  15.9M|    fSuccessor = REF(cs);
  ------------------
  |  |   24|  15.9M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  887|  15.9M|  }
  888|       |  
  889|  45.8M|  if (--p->OrderFall == 0)
  ------------------
  |  Branch (889:7): [True: 1.44M, False: 44.3M]
  ------------------
  890|  1.44M|  {
  891|  1.44M|    successor = fSuccessor;
  892|  1.44M|    p->Text -= (p->MaxContext != p->MinContext);
  893|  1.44M|  }
  894|       |  #ifdef PPMD8_FREEZE_SUPPORT
  895|       |  else if (p->RestoreMethod > PPMD8_RESTORE_METHOD_FREEZE)
  896|       |  {
  897|       |    successor = fSuccessor;
  898|       |    RESET_TEXT(0);
  899|       |    p->OrderFall = 0;
  900|       |  }
  901|       |  #endif
  902|       |  
  903|  45.8M|  s0 = p->MinContext->SummFreq - (ns = p->MinContext->NumStats) - fFreq;
  904|  45.8M|  flag = (Byte)(0x08 * (fSymbol >= 0x40));
  905|       |  
  906|  88.3M|  for (; c != p->MinContext; c = SUFFIX(c))
  ------------------
  |  |   32|  42.5M|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  42.5M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  42.5M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  42.5M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (906:10): [True: 42.5M, False: 45.8M]
  ------------------
  907|  42.5M|  {
  908|  42.5M|    unsigned ns1;
  909|  42.5M|    UInt32 cf, sf;
  910|  42.5M|    if ((ns1 = c->NumStats) != 0)
  ------------------
  |  Branch (910:9): [True: 16.2M, False: 26.2M]
  ------------------
  911|  16.2M|    {
  912|  16.2M|      if ((ns1 & 1) != 0)
  ------------------
  |  Branch (912:11): [True: 10.9M, False: 5.31M]
  ------------------
  913|  10.9M|      {
  914|       |        /* Expand for one UNIT */
  915|  10.9M|        unsigned oldNU = (ns1 + 1) >> 1;
  916|  10.9M|        unsigned i = U2I(oldNU);
  ------------------
  |  |   18|  10.9M|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  917|  10.9M|        if (i != U2I(oldNU + 1))
  ------------------
  |  |   18|  10.9M|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  |  Branch (917:13): [True: 10.6M, False: 315k]
  ------------------
  918|  10.6M|        {
  919|  10.6M|          void *ptr = AllocUnits(p, i + 1);
  920|  10.6M|          void *oldPtr;
  921|  10.6M|          if (!ptr)
  ------------------
  |  Branch (921:15): [True: 270, False: 10.6M]
  ------------------
  922|    270|          {
  923|    270|            RESTORE_MODEL(c, CTX(fSuccessor));
  ------------------
  |  |  554|    270|  #define RESTORE_MODEL(c1, fSuccessor) RestoreModel(p, c1)
  ------------------
  924|    270|            return;
  925|    270|          }
  926|  10.6M|          oldPtr = STATS(c);
  ------------------
  |  |   30|  10.6M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  10.6M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  10.6M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  927|  10.6M|          MyMem12Cpy(ptr, oldPtr, oldNU);
  ------------------
  |  |  245|  10.6M|#define MyMem12Cpy(dest, src, num) do {					\
  |  |  246|  10.6M|	UInt32 *d = (UInt32 *)dest;					\
  |  |  247|  10.6M|	const UInt32 *z = (const UInt32 *)src;				\
  |  |  248|  10.6M|	UInt32 n = num;							\
  |  |  249|  15.8M|	do {								\
  |  |  250|  15.8M|		d[0] = z[0]; d[1] = z[1]; d[2] = z[2]; z += 3; d += 3;	\
  |  |  251|  15.8M|	} while (--n);							\
  |  |  ------------------
  |  |  |  Branch (251:11): [True: 5.22M, False: 10.6M]
  |  |  ------------------
  |  |  252|  10.6M|} while (0)
  |  |  ------------------
  |  |  |  Branch (252:10): [Folded, False: 10.6M]
  |  |  ------------------
  ------------------
  928|  10.6M|          InsertNode(p, oldPtr, i);
  929|  10.6M|          c->Stats = STATS_REF(ptr);
  ------------------
  |  |   27|  10.6M|#define STATS_REF(ptr) ((CPpmd_State_Ref)REF(ptr))
  |  |  ------------------
  |  |  |  |   24|  10.6M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  |  |  ------------------
  ------------------
  930|  10.6M|        }
  931|  10.9M|      }
  932|  16.2M|      c->SummFreq = (UInt16)(c->SummFreq + (3 * ns1 + 1 < ns));
  933|  16.2M|    }
  934|  26.2M|    else
  935|  26.2M|    {
  936|  26.2M|      CPpmd_State *s2 = (CPpmd_State*)AllocUnits(p, 0);
  937|  26.2M|      if (!s2)
  ------------------
  |  Branch (937:11): [True: 449, False: 26.2M]
  ------------------
  938|    449|      {
  939|    449|        RESTORE_MODEL(c, CTX(fSuccessor));
  ------------------
  |  |  554|    449|  #define RESTORE_MODEL(c1, fSuccessor) RestoreModel(p, c1)
  ------------------
  940|    449|        return;
  941|    449|      }
  942|  26.2M|      *s2 = *ONE_STATE(c);
  ------------------
  |  |   31|  26.2M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  26.2M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  943|  26.2M|      c->Stats = REF(s2);
  ------------------
  |  |   24|  26.2M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  944|  26.2M|      if (s2->Freq < MAX_FREQ / 4 - 1)
  ------------------
  |  |   14|  26.2M|#define MAX_FREQ 124
  ------------------
  |  Branch (944:11): [True: 26.2M, False: 11.8k]
  ------------------
  945|  26.2M|        s2->Freq <<= 1;
  946|  11.8k|      else
  947|  11.8k|        s2->Freq = MAX_FREQ - 4;
  ------------------
  |  |   14|  11.8k|#define MAX_FREQ 124
  ------------------
  948|  26.2M|      c->SummFreq = (UInt16)(s2->Freq + p->InitEsc + (ns > 2));
  949|  26.2M|    }
  950|  42.5M|    cf = 2 * fFreq * (c->SummFreq + 6);
  951|  42.5M|    sf = (UInt32)s0 + c->SummFreq;
  952|  42.5M|    if (cf < 6 * sf)
  ------------------
  |  Branch (952:9): [True: 22.1M, False: 20.3M]
  ------------------
  953|  22.1M|    {
  954|  22.1M|      cf = 1 + (cf > sf) + (cf >= 4 * sf);
  955|  22.1M|      c->SummFreq += 4;
  956|  22.1M|    }
  957|  20.3M|    else
  958|  20.3M|    {
  959|  20.3M|      cf = 4 + (cf > 9 * sf) + (cf > 12 * sf) + (cf > 15 * sf);
  960|  20.3M|      c->SummFreq = (UInt16)(c->SummFreq + cf);
  961|  20.3M|    }
  962|  42.5M|    {
  963|  42.5M|      CPpmd_State *s2 = STATS(c) + ns1 + 1;
  ------------------
  |  |   30|  42.5M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  42.5M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  42.5M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  964|  42.5M|      SetSuccessor(s2, successor);
  965|  42.5M|      s2->Symbol = fSymbol;
  966|  42.5M|      s2->Freq = (Byte)cf;
  967|  42.5M|      c->Flags |= flag;
  968|  42.5M|      c->NumStats = (Byte)(ns1 + 1);
  969|  42.5M|    }
  970|  42.5M|  }
  971|  45.8M|  p->MaxContext = p->MinContext = CTX(fSuccessor);
  ------------------
  |  |   29|  45.8M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  ------------------
  |  |  |  |   97|  45.8M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  45.8M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  972|  45.8M|}
archive_ppmd8.c:SwapStates:
  444|  30.6M|{
  445|  30.6M|  CPpmd_State tmp = *t1;
  446|  30.6M|  *t1 = *t2;
  447|  30.6M|  *t2 = tmp;
  448|  30.6M|}
archive_ppmd8.c:CreateSuccessors:
  619|  23.1M|{
  620|  23.1M|  CPpmd_State upState;
  621|  23.1M|  Byte flags;
  622|  23.1M|  CPpmd_Byte_Ref upBranch = (CPpmd_Byte_Ref)SUCCESSOR(p->FoundState);
  ------------------
  |  |  341|  23.1M|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  ------------------
  623|       |  /* fixed over Shkarin's code. Maybe it could work without + 1 too. */
  624|  23.1M|  CPpmd_State *ps[PPMD8_MAX_ORDER + 1];
  625|  23.1M|  unsigned numPs = 0;
  626|       |  
  627|  23.1M|  if (!skip)
  ------------------
  |  Branch (627:7): [True: 15.9M, False: 7.18M]
  ------------------
  628|  15.9M|    ps[numPs++] = p->FoundState;
  629|       |  
  630|   109M|  while (c->Suffix)
  ------------------
  |  Branch (630:10): [True: 108M, False: 450k]
  ------------------
  631|   108M|  {
  632|   108M|    CPpmd_Void_Ref successor;
  633|   108M|    CPpmd_State *s;
  634|   108M|    c = SUFFIX(c);
  ------------------
  |  |   32|   108M|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|   108M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|   108M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|   108M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  635|   108M|    if (s1)
  ------------------
  |  Branch (635:9): [True: 22.9M, False: 86.0M]
  ------------------
  636|  22.9M|    {
  637|  22.9M|      s = s1;
  638|  22.9M|      s1 = NULL;
  639|  22.9M|    }
  640|  86.0M|    else if (c->NumStats != 0)
  ------------------
  |  Branch (640:14): [True: 22.6M, False: 63.3M]
  ------------------
  641|  22.6M|    {
  642|   138M|      for (s = STATS(c); s->Symbol != p->FoundState->Symbol; s++);
  ------------------
  |  |   30|  22.6M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  22.6M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  22.6M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (642:26): [True: 115M, False: 22.6M]
  ------------------
  643|  22.6M|      if (s->Freq < MAX_FREQ - 9)
  ------------------
  |  |   14|  22.6M|#define MAX_FREQ 124
  ------------------
  |  Branch (643:11): [True: 22.6M, False: 39.7k]
  ------------------
  644|  22.6M|      {
  645|  22.6M|        s->Freq++;
  646|  22.6M|        c->SummFreq++;
  647|  22.6M|      }
  648|  22.6M|    }
  649|  63.3M|    else
  650|  63.3M|    {
  651|  63.3M|      s = ONE_STATE(c);
  ------------------
  |  |   31|  63.3M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  63.3M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  652|  63.3M|      s->Freq = (Byte)(s->Freq + (!SUFFIX(c)->NumStats & (s->Freq < 24)));
  ------------------
  |  |   32|  63.3M|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  63.3M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  63.3M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  63.3M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  653|  63.3M|    }
  654|   108M|    successor = SUCCESSOR(s);
  ------------------
  |  |  341|   108M|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  ------------------
  655|   108M|    if (successor != upBranch)
  ------------------
  |  Branch (655:9): [True: 22.7M, False: 86.2M]
  ------------------
  656|  22.7M|    {
  657|  22.7M|      c = CTX(successor);
  ------------------
  |  |   29|  22.7M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  ------------------
  |  |  |  |   97|  22.7M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  22.7M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  658|  22.7M|      if (numPs == 0)
  ------------------
  |  Branch (658:11): [True: 498k, False: 22.2M]
  ------------------
  659|   498k|        return c;
  660|  22.2M|      break;
  661|  22.7M|    }
  662|  86.2M|    ps[numPs++] = s;
  663|  86.2M|  }
  664|       |  
  665|  22.6M|  upState.Symbol = *(const Byte *)Ppmd8_GetPtr(p, upBranch);
  ------------------
  |  |   96|  22.6M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  ------------------
  666|  22.6M|  SetSuccessor(&upState, upBranch + 1);
  667|  22.6M|  flags = (Byte)(0x10 * (p->FoundState->Symbol >= 0x40) + 0x08 * (upState.Symbol >= 0x40));
  668|       |
  669|  22.6M|  if (c->NumStats == 0)
  ------------------
  |  Branch (669:7): [True: 11.4M, False: 11.2M]
  ------------------
  670|  11.4M|    upState.Freq = ONE_STATE(c)->Freq;
  ------------------
  |  |   31|  11.4M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  11.4M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  671|  11.2M|  else
  672|  11.2M|  {
  673|  11.2M|    UInt32 cf, s0;
  674|  11.2M|    CPpmd_State *s;
  675|  70.8M|    for (s = STATS(c); s->Symbol != upState.Symbol; s++);
  ------------------
  |  |   30|  11.2M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  11.2M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  11.2M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (675:24): [True: 59.5M, False: 11.2M]
  ------------------
  676|  11.2M|    cf = s->Freq - 1;
  677|  11.2M|    s0 = c->SummFreq - c->NumStats - cf;
  678|  11.2M|    upState.Freq = (Byte)(1 + ((2 * cf <= s0) ? (5 * cf > s0) : ((cf + 2 * s0 - 3) / s0)));
  ------------------
  |  Branch (678:32): [True: 7.26M, False: 3.97M]
  ------------------
  679|  11.2M|  }
  680|       |
  681|   124M|  while (numPs != 0)
  ------------------
  |  Branch (681:10): [True: 102M, False: 22.6M]
  ------------------
  682|   102M|  {
  683|       |    /* Create Child */
  684|   102M|    CTX_PTR c1; /* = AllocContext(p); */
  685|   102M|    if (p->HiUnit != p->LoUnit)
  ------------------
  |  Branch (685:9): [True: 78.9M, False: 23.2M]
  ------------------
  686|  78.9M|      c1 = (CTX_PTR)(p->HiUnit -= UNIT_SIZE);
  ------------------
  |  |   15|  78.9M|#define UNIT_SIZE 12
  ------------------
  687|  23.2M|    else if (p->FreeList[0] != 0)
  ------------------
  |  Branch (687:14): [True: 13.7M, False: 9.52M]
  ------------------
  688|  13.7M|      c1 = (CTX_PTR)RemoveNode(p, 0);
  689|  9.52M|    else
  690|  9.52M|    {
  691|  9.52M|      c1 = (CTX_PTR)AllocUnitsRare(p, 0);
  692|  9.52M|      if (!c1)
  ------------------
  |  Branch (692:11): [True: 679, False: 9.52M]
  ------------------
  693|    679|        return NULL;
  694|  9.52M|    }
  695|   102M|    c1->NumStats = 0;
  696|   102M|    c1->Flags = flags;
  697|   102M|    *ONE_STATE(c1) = upState;
  ------------------
  |  |   31|   102M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|   102M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  698|   102M|    c1->Suffix = REF(c);
  ------------------
  |  |   24|   102M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  699|   102M|    SetSuccessor(ps[--numPs], REF(c1));
  ------------------
  |  |   24|   102M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  700|   102M|    c = c1;
  701|   102M|  }
  702|       |
  703|  22.6M|  return c;
  704|  22.6M|}
archive_ppmd8.c:AllocUnitsRare:
  205|  12.3M|{
  206|  12.3M|  unsigned i;
  207|  12.3M|  void *retVal;
  208|  12.3M|  if (p->GlueCount == 0)
  ------------------
  |  Branch (208:7): [True: 2.05k, False: 12.3M]
  ------------------
  209|  2.05k|  {
  210|  2.05k|    GlueFreeBlocks(p);
  211|  2.05k|    if (p->FreeList[indx] != 0)
  ------------------
  |  Branch (211:9): [True: 921, False: 1.13k]
  ------------------
  212|    921|      return RemoveNode(p, indx);
  213|  2.05k|  }
  214|  12.3M|  i = indx;
  215|  12.3M|  do
  216|   314M|  {
  217|   314M|    if (++i == PPMD_NUM_INDEXES)
  ------------------
  |  |  102|   314M|#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   98|   314M|#define PPMD_N1 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   99|   314M|#define PPMD_N2 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  100|   314M|#define PPMD_N3 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  101|   314M|#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|   314M|#define PPMD_N1 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|   314M|#define PPMD_N2 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|   314M|#define PPMD_N3 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (217:9): [True: 8.08M, False: 306M]
  ------------------
  218|  8.08M|    {
  219|  8.08M|      UInt32 numBytes = U2B(I2U(indx));
  ------------------
  |  |   17|  8.08M|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   15|  8.08M|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  220|  8.08M|      p->GlueCount--;
  221|  8.08M|      return ((UInt32)(p->UnitsStart - p->Text) > numBytes) ? (p->UnitsStart -= numBytes) : (NULL);
  ------------------
  |  Branch (221:14): [True: 8.08M, False: 1.39k]
  ------------------
  222|  8.08M|    }
  223|   314M|  }
  224|   306M|  while (p->FreeList[i] == 0);
  ------------------
  |  Branch (224:10): [True: 301M, False: 4.28M]
  ------------------
  225|  4.28M|  retVal = RemoveNode(p, i);
  226|  4.28M|  SplitBlock(p, retVal, i, indx);
  227|  4.28M|  return retVal;
  228|  12.3M|}
archive_ppmd8.c:GlueFreeBlocks:
  147|  2.05k|{
  148|  2.05k|  CPpmd8_Node_Ref head = 0;
  149|  2.05k|  CPpmd8_Node_Ref *prev = &head;
  150|  2.05k|  unsigned i;
  151|       |
  152|  2.05k|  p->GlueCount = 1 << 13;
  153|  2.05k|  memset(p->Stamps, 0, sizeof(p->Stamps));
  154|       |  
  155|       |  /* Order-0 context is always at top UNIT, so we don't need guard NODE at the end.
  156|       |     All blocks up to p->LoUnit can be free, so we need guard NODE at LoUnit. */
  157|  2.05k|  if (p->LoUnit != p->HiUnit)
  ------------------
  |  Branch (157:7): [True: 254, False: 1.79k]
  ------------------
  158|    254|    ((CPpmd8_Node *)p->LoUnit)->Stamp = 0;
  159|       |
  160|       |  /* Glue free blocks */
  161|  79.9k|  for (i = 0; i < PPMD_NUM_INDEXES; i++)
  ------------------
  |  |  102|  79.9k|#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   98|  79.9k|#define PPMD_N1 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   99|  79.9k|#define PPMD_N2 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  100|  79.9k|#define PPMD_N3 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  101|  79.9k|#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|  79.9k|#define PPMD_N1 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|  79.9k|#define PPMD_N2 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|  79.9k|#define PPMD_N3 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (161:15): [True: 77.9k, False: 2.05k]
  ------------------
  162|  77.9k|  {
  163|  77.9k|    CPpmd8_Node_Ref next = (CPpmd8_Node_Ref)p->FreeList[i];
  164|  77.9k|    p->FreeList[i] = 0;
  165|  18.7M|    while (next != 0)
  ------------------
  |  Branch (165:12): [True: 18.7M, False: 77.9k]
  ------------------
  166|  18.7M|    {
  167|  18.7M|      CPpmd8_Node *node = NODE(next);
  ------------------
  |  |   59|  18.7M|  #define NODE(offs) ((CPpmd8_Node *)(p->Base + (offs)))
  ------------------
  168|  18.7M|      if (node->NU != 0)
  ------------------
  |  Branch (168:11): [True: 11.5M, False: 7.17M]
  ------------------
  169|  11.5M|      {
  170|  11.5M|        CPpmd8_Node *node2;
  171|  11.5M|        *prev = next;
  172|  11.5M|        prev = &(node->Next);
  173|  22.2M|        while ((node2 = node + node->NU)->Stamp == EMPTY_NODE)
  ------------------
  |  |   62|  22.2M|#define EMPTY_NODE 0xFFFFFFFF
  ------------------
  |  Branch (173:16): [True: 10.6M, False: 11.5M]
  ------------------
  174|  10.6M|        {
  175|  10.6M|          node->NU += node2->NU;
  176|  10.6M|          node2->NU = 0;
  177|  10.6M|        }
  178|  11.5M|      }
  179|  18.7M|      next = node->Next;
  180|  18.7M|    }
  181|  77.9k|  }
  182|  2.05k|  *prev = 0;
  183|       |  
  184|       |  /* Fill lists of free blocks */
  185|  11.5M|  while (head != 0)
  ------------------
  |  Branch (185:10): [True: 11.5M, False: 2.05k]
  ------------------
  186|  11.5M|  {
  187|  11.5M|    CPpmd8_Node *node = NODE(head);
  ------------------
  |  |   59|  11.5M|  #define NODE(offs) ((CPpmd8_Node *)(p->Base + (offs)))
  ------------------
  188|  11.5M|    unsigned nu;
  189|  11.5M|    head = node->Next;
  190|  11.5M|    nu = node->NU;
  191|  11.5M|    if (nu == 0)
  ------------------
  |  Branch (191:9): [True: 3.52M, False: 8.00M]
  ------------------
  192|  3.52M|      continue;
  193|  8.00M|    for (; nu > 128; nu -= 128, node += 128)
  ------------------
  |  Branch (193:12): [True: 177, False: 8.00M]
  ------------------
  194|    177|      InsertNode(p, node, PPMD_NUM_INDEXES - 1);
  ------------------
  |  |  102|    177|#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   98|    177|#define PPMD_N1 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   99|    177|#define PPMD_N2 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  100|    177|#define PPMD_N3 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  101|    177|#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|    177|#define PPMD_N1 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|    177|#define PPMD_N2 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|    177|#define PPMD_N3 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  195|  8.00M|    if (I2U(i = U2I(nu)) != nu)
  ------------------
  |  |   19|  8.00M|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  |  Branch (195:9): [True: 497k, False: 7.50M]
  ------------------
  196|   497k|    {
  197|   497k|      unsigned k = I2U(--i);
  ------------------
  |  |   19|   497k|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  198|   497k|      InsertNode(p, node + k, nu - k - 1);
  199|   497k|    }
  200|  8.00M|    InsertNode(p, node, i);
  201|  8.00M|  }
  202|  2.05k|}
archive_ppmd8.c:RestoreModel:
  562|  1.41k|{
  563|  1.41k|  CTX_PTR c;
  564|  1.41k|  CPpmd_State *s;
  565|  1.41k|  RESET_TEXT(0);
  ------------------
  |  |  349|  1.41k|#define RESET_TEXT(offs) do {						\
  |  |  350|  1.41k|	p->Text = p->Base + p->AlignOffset + (offs);			\
  |  |  351|  1.41k|} while (0)
  |  |  ------------------
  |  |  |  Branch (351:10): [Folded, False: 1.41k]
  |  |  ------------------
  ------------------
  566|  3.92k|  for (c = p->MaxContext; c != c1; c = SUFFIX(c))
  ------------------
  |  |   32|  2.50k|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  2.50k|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  2.50k|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  2.50k|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (566:27): [True: 2.50k, False: 1.41k]
  ------------------
  567|  2.50k|    if (--(c->NumStats) == 0)
  ------------------
  |  Branch (567:9): [True: 1.70k, False: 797]
  ------------------
  568|  1.70k|    {
  569|  1.70k|      s = STATS(c);
  ------------------
  |  |   30|  1.70k|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  1.70k|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  1.70k|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  570|  1.70k|      c->Flags = (Byte)((c->Flags & 0x10) + 0x08 * (s->Symbol >= 0x40));
  571|  1.70k|      *ONE_STATE(c) = *s;
  ------------------
  |  |   31|  1.70k|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  1.70k|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  572|  1.70k|      SpecialFreeUnit(p, s);
  573|  1.70k|      ONE_STATE(c)->Freq = (Byte)(((unsigned)ONE_STATE(c)->Freq + 11) >> 3);
  ------------------
  |  |   31|  1.70k|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  1.70k|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
                    ONE_STATE(c)->Freq = (Byte)(((unsigned)ONE_STATE(c)->Freq + 11) >> 3);
  ------------------
  |  |   31|  1.70k|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  1.70k|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  574|  1.70k|    }
  575|    797|    else
  576|    797|      Refresh(p, c, (c->NumStats+3) >> 1, 0);
  577|       | 
  578|  6.03k|  for (; c != p->MinContext; c = SUFFIX(c))
  ------------------
  |  |   32|  4.62k|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  4.62k|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  4.62k|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  4.62k|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (578:10): [True: 4.62k, False: 1.41k]
  ------------------
  579|  4.62k|    if (!c->NumStats)
  ------------------
  |  Branch (579:9): [True: 2.74k, False: 1.87k]
  ------------------
  580|  2.74k|      ONE_STATE(c)->Freq = (Byte)(ONE_STATE(c)->Freq - (ONE_STATE(c)->Freq >> 1));
  ------------------
  |  |   31|  2.74k|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  2.74k|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
                    ONE_STATE(c)->Freq = (Byte)(ONE_STATE(c)->Freq - (ONE_STATE(c)->Freq >> 1));
  ------------------
  |  |   31|  2.74k|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  2.74k|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
                    ONE_STATE(c)->Freq = (Byte)(ONE_STATE(c)->Freq - (ONE_STATE(c)->Freq >> 1));
  ------------------
  |  |   31|  2.74k|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  2.74k|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  581|  1.87k|    else if ((c->SummFreq += 4) > 128 + 4 * c->NumStats)
  ------------------
  |  Branch (581:14): [True: 93, False: 1.78k]
  ------------------
  582|     93|      Refresh(p, c, (c->NumStats + 2) >> 1, 1);
  583|       |
  584|       |  #ifdef PPMD8_FREEZE_SUPPORT
  585|       |  if (p->RestoreMethod > PPMD8_RESTORE_METHOD_FREEZE)
  586|       |  {
  587|       |    p->MaxContext = fSuccessor;
  588|       |    p->GlueCount += !(p->Stamps[1] & 1);
  589|       |  }
  590|       |  else if (p->RestoreMethod == PPMD8_RESTORE_METHOD_FREEZE)
  591|       |  {
  592|       |    while (p->MaxContext->Suffix)
  593|       |      p->MaxContext = SUFFIX(p->MaxContext);
  594|       |    RemoveBinContexts(p, p->MaxContext, 0);
  595|       |    p->RestoreMethod++;
  596|       |    p->GlueCount = 0;
  597|       |    p->OrderFall = p->MaxOrder;
  598|       |  }
  599|       |  else
  600|       |  #endif
  601|  1.41k|  if (p->RestoreMethod == PPMD8_RESTORE_METHOD_RESTART || GetUsedMemory(p) < (p->Size >> 1))
  ------------------
  |  Branch (601:7): [True: 173, False: 1.24k]
  |  Branch (601:59): [True: 0, False: 1.24k]
  ------------------
  602|    173|    RestartModel(p);
  603|  1.24k|  else
  604|  1.24k|  {
  605|  16.9k|    while (p->MaxContext->Suffix)
  ------------------
  |  Branch (605:12): [True: 15.7k, False: 1.24k]
  ------------------
  606|  15.7k|      p->MaxContext = SUFFIX(p->MaxContext);
  ------------------
  |  |   32|  15.7k|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  15.7k|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  15.7k|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  15.7k|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  607|  1.24k|    do
  608|  1.24k|    {
  609|  1.24k|      CutOff(p, p->MaxContext, 0);
  610|  1.24k|      ExpandTextArea(p);
  611|  1.24k|    }
  612|  1.24k|    while (GetUsedMemory(p) > 3 * (p->Size >> 2));
  ------------------
  |  Branch (612:12): [True: 0, False: 1.24k]
  ------------------
  613|  1.24k|    p->GlueCount = 0;
  614|  1.24k|    p->OrderFall = p->MaxOrder;
  615|  1.24k|  }
  616|  1.41k|}
archive_ppmd8.c:SpecialFreeUnit:
  277|  31.8M|{
  278|  31.8M|  if ((Byte *)ptr != p->UnitsStart)
  ------------------
  |  Branch (278:7): [True: 31.8M, False: 1.56k]
  ------------------
  279|  31.8M|    InsertNode(p, ptr, 0);
  280|  1.56k|  else
  281|  1.56k|  {
  282|       |    #ifdef PPMD8_FREEZE_SUPPORT
  283|       |    *(UInt32 *)ptr = EMPTY_NODE; /* it's used for (Flags == 0xFF) check in RemoveBinContexts */
  284|       |    #endif
  285|  1.56k|    p->UnitsStart += UNIT_SIZE;
  ------------------
  |  |   15|  1.56k|#define UNIT_SIZE 12
  ------------------
  286|  1.56k|  }
  287|  31.8M|}
archive_ppmd8.c:Refresh:
  421|  2.61M|{
  422|  2.61M|  unsigned i = ctx->NumStats, escFreq, sumFreq, flags;
  423|  2.61M|  CPpmd_State *s = (CPpmd_State *)ShrinkUnits(p, STATS(ctx), oldNU, (i + 2) >> 1);
  ------------------
  |  |   30|  2.61M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  2.61M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  2.61M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  424|  2.61M|  ctx->Stats = REF(s);
  ------------------
  |  |   24|  2.61M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  425|       |  #ifdef PPMD8_FREEZE_SUPPORT
  426|       |  /* fixed over Shkarin's code. Fixed code is not compatible with original code for some files in FREEZE mode. */
  427|       |  scale |= (ctx->SummFreq >= ((UInt32)1 << 15));
  428|       |  #endif
  429|  2.61M|  flags = (ctx->Flags & (0x10 + 0x04 * scale)) + 0x08 * (s->Symbol >= 0x40);
  430|  2.61M|  escFreq = ctx->SummFreq - s->Freq;
  431|  2.61M|  sumFreq = (s->Freq = (Byte)((s->Freq + scale) >> scale));
  432|  2.61M|  do
  433|  5.64M|  {
  434|  5.64M|    escFreq -= (++s)->Freq;
  435|  5.64M|    sumFreq += (s->Freq = (Byte)((s->Freq + scale) >> scale));
  436|  5.64M|    flags |= 0x08 * (s->Symbol >= 0x40);
  437|  5.64M|  }
  438|  5.64M|  while (--i);
  ------------------
  |  Branch (438:10): [True: 3.02M, False: 2.61M]
  ------------------
  439|  2.61M|  ctx->SummFreq = (UInt16)(sumFreq + ((escFreq + scale) >> scale));
  440|  2.61M|  ctx->Flags = (Byte)flags;
  441|  2.61M|}
archive_ppmd8.c:GetUsedMemory:
  543|  2.48k|{
  544|  2.48k|  UInt32 v = 0;
  545|  2.48k|  unsigned i;
  546|  96.7k|  for (i = 0; i < PPMD_NUM_INDEXES; i++)
  ------------------
  |  |  102|  96.7k|#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   98|  96.7k|#define PPMD_N1 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   99|  96.7k|#define PPMD_N2 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  100|  96.7k|#define PPMD_N3 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  101|  96.7k|#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|  96.7k|#define PPMD_N1 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|  96.7k|#define PPMD_N2 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|  96.7k|#define PPMD_N3 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (546:15): [True: 94.3k, False: 2.48k]
  ------------------
  547|  94.3k|    v += p->Stamps[i] * I2U(i);
  ------------------
  |  |   19|  94.3k|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  548|  2.48k|  return p->Size - (UInt32)(p->HiUnit - p->LoUnit) - (UInt32)(p->UnitsStart - p->Text) - U2B(v);
  ------------------
  |  |   17|  2.48k|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   15|  2.48k|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  549|  2.48k|}
archive_ppmd8.c:CutOff:
  451|  80.7M|{
  452|  80.7M|  int i;
  453|  80.7M|  unsigned tmp;
  454|  80.7M|  CPpmd_State *s;
  455|       |  
  456|  80.7M|  if (!ctx->NumStats)
  ------------------
  |  Branch (456:7): [True: 62.8M, False: 17.8M]
  ------------------
  457|  62.8M|  {
  458|  62.8M|    s = ONE_STATE(ctx);
  ------------------
  |  |   31|  62.8M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  62.8M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  459|  62.8M|    if ((Byte *)Ppmd8_GetPtr(p, SUCCESSOR(s)) >= p->UnitsStart)
  ------------------
  |  |   96|  62.8M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  ------------------
  |  Branch (459:9): [True: 60.3M, False: 2.53M]
  ------------------
  460|  60.3M|    {
  461|  60.3M|      if (order < p->MaxOrder)
  ------------------
  |  Branch (461:11): [True: 56.0M, False: 4.35M]
  ------------------
  462|  56.0M|        SetSuccessor(s, CutOff(p, CTX(SUCCESSOR(s)), order + 1));
  ------------------
  |  |   29|  56.0M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  ------------------
  |  |  |  |   97|  56.0M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  56.0M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  463|  4.35M|      else
  464|  4.35M|        SetSuccessor(s, 0);
  465|  60.3M|      if (SUCCESSOR(s) || order <= 9) /* O_BOUND */
  ------------------
  |  |  341|   120M|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  |  |  ------------------
  |  |  |  Branch (341:22): [True: 29.0M, False: 31.3M]
  |  |  ------------------
  ------------------
  |  Branch (465:27): [True: 6.31M, False: 25.0M]
  ------------------
  466|  35.3M|        return REF(ctx);
  ------------------
  |  |   24|  35.3M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  467|  60.3M|    }
  468|  27.5M|    SpecialFreeUnit(p, ctx);
  469|  27.5M|    return 0;
  470|  62.8M|  }
  471|       |
  472|  17.8M|  ctx->Stats = STATS_REF(MoveUnitsUp(p, STATS(ctx), tmp = ((unsigned)ctx->NumStats + 2) >> 1));
  ------------------
  |  |   27|  17.8M|#define STATS_REF(ptr) ((CPpmd_State_Ref)REF(ptr))
  |  |  ------------------
  |  |  |  |   24|  17.8M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  |  |  ------------------
  ------------------
  473|       |
  474|  64.7M|  for (s = STATS(ctx) + (i = ctx->NumStats); s >= STATS(ctx); s--)
  ------------------
  |  |   30|  17.8M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  17.8M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  17.8M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                for (s = STATS(ctx) + (i = ctx->NumStats); s >= STATS(ctx); s--)
  ------------------
  |  |   30|  64.7M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  64.7M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  64.7M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (474:46): [True: 46.9M, False: 17.8M]
  ------------------
  475|  46.9M|    if ((Byte *)Ppmd8_GetPtr(p, SUCCESSOR(s)) < p->UnitsStart)
  ------------------
  |  |   96|  46.9M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  ------------------
  |  Branch (475:9): [True: 21.8M, False: 25.1M]
  ------------------
  476|  21.8M|    {
  477|  21.8M|      CPpmd_State *s2 = STATS(ctx) + (i--);
  ------------------
  |  |   30|  21.8M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  21.8M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  21.8M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  478|  21.8M|      SetSuccessor(s, 0);
  479|  21.8M|      SwapStates(s, s2);
  480|  21.8M|    }
  481|  25.1M|    else if (order < p->MaxOrder)
  ------------------
  |  Branch (481:14): [True: 24.7M, False: 445k]
  ------------------
  482|  24.7M|      SetSuccessor(s, CutOff(p, CTX(SUCCESSOR(s)), order + 1));
  ------------------
  |  |   29|  24.7M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  ------------------
  |  |  |  |   97|  24.7M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  24.7M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  483|   445k|    else
  484|   445k|      SetSuccessor(s, 0);
  485|       |    
  486|  17.8M|  if (i != ctx->NumStats && order)
  ------------------
  |  Branch (486:7): [True: 13.8M, False: 3.94M]
  |  Branch (486:29): [True: 13.8M, False: 1.24k]
  ------------------
  487|  13.8M|  {
  488|  13.8M|    ctx->NumStats = (Byte)i;
  489|  13.8M|    s = STATS(ctx);
  ------------------
  |  |   30|  13.8M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  13.8M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  13.8M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  490|  13.8M|    if (i < 0)
  ------------------
  |  Branch (490:9): [True: 4.31M, False: 9.55M]
  ------------------
  491|  4.31M|    {
  492|  4.31M|      FreeUnits(p, s, tmp);
  493|  4.31M|      SpecialFreeUnit(p, ctx);
  494|  4.31M|      return 0;
  495|  4.31M|    }
  496|  9.55M|    if (i == 0)
  ------------------
  |  Branch (496:9): [True: 6.94M, False: 2.61M]
  ------------------
  497|  6.94M|    {
  498|  6.94M|      ctx->Flags = (Byte)((ctx->Flags & 0x10) + 0x08 * (s->Symbol >= 0x40));
  499|  6.94M|      *ONE_STATE(ctx) = *s;
  ------------------
  |  |   31|  6.94M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  6.94M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  500|  6.94M|      FreeUnits(p, s, tmp);
  501|       |      /* 9.31: the code was fixed. It's was not BUG, if Freq <= MAX_FREQ = 124 */
  502|  6.94M|      ONE_STATE(ctx)->Freq = (Byte)(((unsigned)ONE_STATE(ctx)->Freq + 11) >> 3);
  ------------------
  |  |   31|  6.94M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  6.94M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
                    ONE_STATE(ctx)->Freq = (Byte)(((unsigned)ONE_STATE(ctx)->Freq + 11) >> 3);
  ------------------
  |  |   31|  6.94M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  6.94M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  503|  6.94M|    }
  504|  2.61M|    else
  505|  2.61M|      Refresh(p, ctx, tmp, ctx->SummFreq > 16 * i);
  506|  9.55M|  }
  507|  13.5M|  return REF(ctx);
  ------------------
  |  |   24|  13.5M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  508|  17.8M|}
archive_ppmd8.c:MoveUnitsUp:
  290|  17.8M|{
  291|  17.8M|  unsigned indx = U2I(nu);
  ------------------
  |  |   18|  17.8M|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  292|  17.8M|  void *ptr;
  293|  17.8M|  if ((Byte *)oldPtr > p->UnitsStart + 16 * 1024 || REF(oldPtr) > p->FreeList[indx])
  ------------------
  |  |   24|   310k|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  |  Branch (293:7): [True: 17.5M, False: 310k]
  |  Branch (293:53): [True: 2.89k, False: 307k]
  ------------------
  294|  17.5M|    return oldPtr;
  295|   307k|  ptr = RemoveNode(p, indx);
  296|   307k|  MyMem12Cpy(ptr, oldPtr, nu);
  ------------------
  |  |  245|   307k|#define MyMem12Cpy(dest, src, num) do {					\
  |  |  246|   307k|	UInt32 *d = (UInt32 *)dest;					\
  |  |  247|   307k|	const UInt32 *z = (const UInt32 *)src;				\
  |  |  248|   307k|	UInt32 n = num;							\
  |  |  249|   430k|	do {								\
  |  |  250|   430k|		d[0] = z[0]; d[1] = z[1]; d[2] = z[2]; z += 3; d += 3;	\
  |  |  251|   430k|	} while (--n);							\
  |  |  ------------------
  |  |  |  Branch (251:11): [True: 122k, False: 307k]
  |  |  ------------------
  |  |  252|   307k|} while (0)
  |  |  ------------------
  |  |  |  Branch (252:10): [Folded, False: 307k]
  |  |  ------------------
  ------------------
  297|   307k|  if ((Byte*)oldPtr != p->UnitsStart)
  ------------------
  |  Branch (297:7): [True: 307k, False: 236]
  ------------------
  298|   307k|    InsertNode(p, oldPtr, indx);
  299|    236|  else
  300|    236|    p->UnitsStart += U2B(I2U(indx));
  ------------------
  |  |   17|    236|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   15|    236|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  301|   307k|  return ptr;
  302|  17.8M|}
archive_ppmd8.c:FreeUnits:
  272|  11.2M|{
  273|  11.2M|  InsertNode(p, ptr, U2I(nu));
  ------------------
  |  |   18|  11.2M|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  274|  11.2M|}
archive_ppmd8.c:ExpandTextArea:
  305|  1.24k|{
  306|  1.24k|  UInt32 count[PPMD_NUM_INDEXES];
  307|  1.24k|  unsigned i;
  308|  1.24k|  memset(count, 0, sizeof(count));
  309|  1.24k|  if (p->LoUnit != p->HiUnit)
  ------------------
  |  Branch (309:7): [True: 0, False: 1.24k]
  ------------------
  310|      0|    ((CPpmd8_Node *)p->LoUnit)->Stamp = 0;
  311|       |  
  312|  1.24k|  {
  313|  1.24k|    CPpmd8_Node *node = (CPpmd8_Node *)p->UnitsStart;
  314|  29.7k|    for (; node->Stamp == EMPTY_NODE; node += node->NU)
  ------------------
  |  |   62|  29.7k|#define EMPTY_NODE 0xFFFFFFFF
  ------------------
  |  Branch (314:12): [True: 28.4k, False: 1.24k]
  ------------------
  315|  28.4k|    {
  316|  28.4k|      node->Stamp = 0;
  317|  28.4k|      count[U2I(node->NU)]++;
  ------------------
  |  |   18|  28.4k|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  318|  28.4k|    }
  319|  1.24k|    p->UnitsStart = (Byte *)node;
  320|  1.24k|  }
  321|       |  
  322|  48.3k|  for (i = 0; i < PPMD_NUM_INDEXES; i++)
  ------------------
  |  |  102|  48.3k|#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   98|  48.3k|#define PPMD_N1 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   99|  48.3k|#define PPMD_N2 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  100|  48.3k|#define PPMD_N3 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  101|  48.3k|#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|  48.3k|#define PPMD_N1 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|  48.3k|#define PPMD_N2 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|  48.3k|#define PPMD_N3 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (322:15): [True: 47.1k, False: 1.24k]
  ------------------
  323|  47.1k|  {
  324|  47.1k|    CPpmd8_Node_Ref *next = (CPpmd8_Node_Ref *)&p->FreeList[i];
  325|  32.7M|    while (count[i] != 0)
  ------------------
  |  Branch (325:12): [True: 32.6M, False: 47.1k]
  ------------------
  326|  32.6M|    {
  327|  32.6M|      CPpmd8_Node *node = NODE(*next);
  ------------------
  |  |   59|  32.6M|  #define NODE(offs) ((CPpmd8_Node *)(p->Base + (offs)))
  ------------------
  328|  32.7M|      while (node->Stamp == 0)
  ------------------
  |  Branch (328:14): [True: 28.4k, False: 32.6M]
  ------------------
  329|  28.4k|      {
  330|  28.4k|        *next = node->Next;
  331|  28.4k|        node = NODE(*next);
  ------------------
  |  |   59|  28.4k|  #define NODE(offs) ((CPpmd8_Node *)(p->Base + (offs)))
  ------------------
  332|  28.4k|        p->Stamps[i]--;
  333|  28.4k|        if (--count[i] == 0)
  ------------------
  |  Branch (333:13): [True: 1.69k, False: 26.7k]
  ------------------
  334|  1.69k|          break;
  335|  28.4k|      }
  336|  32.6M|      next = &node->Next;
  337|  32.6M|    }
  338|  47.1k|  }
  339|  1.24k|}
archive_ppmd8.c:ReduceOrder:
  707|  2.12M|{
  708|  2.12M|  CPpmd_State *s = NULL;
  709|  2.12M|  CTX_PTR c1 = c;
  710|  2.12M|  CPpmd_Void_Ref upBranch = REF(p->Text);
  ------------------
  |  |   24|  2.12M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  711|       |  
  712|       |  #ifdef PPMD8_FREEZE_SUPPORT
  713|       |  /* The BUG in Shkarin's code was fixed: ps could overflow in CUT_OFF mode. */
  714|       |  CPpmd_State *ps[PPMD8_MAX_ORDER + 1];
  715|       |  unsigned numPs = 0;
  716|       |  ps[numPs++] = p->FoundState;
  717|       |  #endif
  718|       |
  719|  2.12M|  SetSuccessor(p->FoundState, upBranch);
  720|  2.12M|  p->OrderFall++;
  721|       |
  722|  2.12M|  for (;;)
  723|  3.20M|  {
  724|  3.20M|    if (s1)
  ------------------
  |  Branch (724:9): [True: 1.53M, False: 1.66M]
  ------------------
  725|  1.53M|    {
  726|  1.53M|      c = SUFFIX(c);
  ------------------
  |  |   32|  1.53M|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  1.53M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  1.53M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  1.53M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  727|  1.53M|      s = s1;
  728|  1.53M|      s1 = NULL;
  729|  1.53M|    }
  730|  1.66M|    else
  731|  1.66M|    {
  732|  1.66M|      if (!c->Suffix)
  ------------------
  |  Branch (732:11): [True: 586k, False: 1.08M]
  ------------------
  733|   586k|      {
  734|       |        #ifdef PPMD8_FREEZE_SUPPORT
  735|       |        if (p->RestoreMethod > PPMD8_RESTORE_METHOD_FREEZE)
  736|       |        {
  737|       |          do { SetSuccessor(ps[--numPs], REF(c)); } while (numPs);
  738|       |          RESET_TEXT(1);
  739|       |          p->OrderFall = 1;
  740|       |        }
  741|       |        #endif
  742|   586k|        return c;
  743|   586k|      }
  744|  1.08M|      c = SUFFIX(c);
  ------------------
  |  |   32|  1.08M|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  1.08M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  1.08M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  1.08M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  745|  1.08M|      if (c->NumStats)
  ------------------
  |  Branch (745:11): [True: 519k, False: 561k]
  ------------------
  746|   519k|      {
  747|   519k|        if ((s = STATS(c))->Symbol != p->FoundState->Symbol)
  ------------------
  |  |   30|   519k|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|   519k|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|   519k|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (747:13): [True: 313k, False: 206k]
  ------------------
  748|   928k|          do { s++; } while (s->Symbol != p->FoundState->Symbol);
  ------------------
  |  Branch (748:30): [True: 614k, False: 313k]
  ------------------
  749|   519k|        if (s->Freq < MAX_FREQ - 9)
  ------------------
  |  |   14|   519k|#define MAX_FREQ 124
  ------------------
  |  Branch (749:13): [True: 518k, False: 1.12k]
  ------------------
  750|   518k|        {
  751|   518k|          s->Freq += 2;
  752|   518k|          c->SummFreq += 2;
  753|   518k|        }
  754|   519k|      }
  755|   561k|      else
  756|   561k|      {
  757|   561k|        s = ONE_STATE(c);
  ------------------
  |  |   31|   561k|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|   561k|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  758|   561k|        s->Freq = (Byte)(s->Freq + (s->Freq < 32));
  759|   561k|      }
  760|  1.08M|    }
  761|  2.61M|    if (SUCCESSOR(s))
  ------------------
  |  |  341|  2.61M|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  |  |  ------------------
  |  |  |  Branch (341:22): [True: 1.54M, False: 1.07M]
  |  |  ------------------
  ------------------
  762|  1.54M|      break;
  763|       |    #ifdef PPMD8_FREEZE_SUPPORT
  764|       |    ps[numPs++] = s;
  765|       |    #endif
  766|  1.07M|    SetSuccessor(s, upBranch);
  767|  1.07M|    p->OrderFall++;
  768|  1.07M|  }
  769|       |  
  770|       |  #ifdef PPMD8_FREEZE_SUPPORT
  771|       |  if (p->RestoreMethod > PPMD8_RESTORE_METHOD_FREEZE)
  772|       |  {
  773|       |    c = CTX(SUCCESSOR(s));
  774|       |    do { SetSuccessor(ps[--numPs], REF(c)); } while (numPs);
  775|       |    RESET_TEXT(1);
  776|       |    p->OrderFall = 1;
  777|       |    return c;
  778|       |  }
  779|       |  else
  780|       |  #endif
  781|  1.54M|  if (SUCCESSOR(s) <= upBranch)
  ------------------
  |  |  341|  1.54M|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  ------------------
  |  Branch (781:7): [True: 23.6k, False: 1.51M]
  ------------------
  782|  23.6k|  {
  783|  23.6k|    CTX_PTR successor;
  784|  23.6k|    CPpmd_State *s2 = p->FoundState;
  785|  23.6k|    p->FoundState = s;
  786|       |
  787|  23.6k|    successor = CreateSuccessors(p, False, NULL, c);
  ------------------
  |  |   56|  23.6k|#define False 0
  ------------------
  788|  23.6k|    if (successor == NULL)
  ------------------
  |  Branch (788:9): [True: 46, False: 23.6k]
  ------------------
  789|     46|      SetSuccessor(s, 0);
  790|  23.6k|    else
  791|  23.6k|      SetSuccessor(s, REF(successor));
  ------------------
  |  |   24|  23.6k|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  792|  23.6k|    p->FoundState = s2;
  793|  23.6k|  }
  794|       |  
  795|  1.54M|  if (p->OrderFall == 1 && c1 == p->MaxContext)
  ------------------
  |  Branch (795:7): [True: 18.4k, False: 1.52M]
  |  Branch (795:28): [True: 18.4k, False: 0]
  ------------------
  796|  18.4k|  {
  797|  18.4k|    SetSuccessor(p->FoundState, SUCCESSOR(s));
  ------------------
  |  |  341|  18.4k|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  ------------------
  798|  18.4k|    p->Text--;
  799|  18.4k|  }
  800|  1.54M|  if (SUCCESSOR(s) == 0)
  ------------------
  |  |  341|  1.54M|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  ------------------
  |  Branch (800:7): [True: 46, False: 1.54M]
  ------------------
  801|     46|    return NULL;
  802|  1.54M|  return CTX(SUCCESSOR(s));
  ------------------
  |  |   29|  1.54M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  ------------------
  |  |  |  |   97|  1.54M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  1.54M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  803|  1.54M|}
archive_ppmd8.c:AllocUnits:
  231|  36.9M|{
  232|  36.9M|  UInt32 numBytes;
  233|  36.9M|  if (p->FreeList[indx] != 0)
  ------------------
  |  Branch (233:7): [True: 14.1M, False: 22.8M]
  ------------------
  234|  14.1M|    return RemoveNode(p, indx);
  235|  22.8M|  numBytes = U2B(I2U(indx));
  ------------------
  |  |   17|  22.8M|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   15|  22.8M|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  236|  22.8M|  if (numBytes <= (UInt32)(p->HiUnit - p->LoUnit))
  ------------------
  |  Branch (236:7): [True: 19.9M, False: 2.84M]
  ------------------
  237|  19.9M|  {
  238|  19.9M|    void *retVal = p->LoUnit;
  239|  19.9M|    p->LoUnit += numBytes;
  240|  19.9M|    return retVal;
  241|  19.9M|  }
  242|  2.84M|  return AllocUnitsRare(p, indx);
  243|  22.8M|}
archive_ppmd8.c:Ppmd8_Update1:
 1082|  5.48M|{
 1083|  5.48M|  CPpmd_State *s = p->FoundState;
 1084|  5.48M|  s->Freq += 4;
 1085|  5.48M|  p->MinContext->SummFreq += 4;
 1086|  5.48M|  if (s[0].Freq > s[-1].Freq)
  ------------------
  |  Branch (1086:7): [True: 3.68M, False: 1.79M]
  ------------------
 1087|  3.68M|  {
 1088|  3.68M|    SwapStates(&s[0], &s[-1]);
 1089|  3.68M|    p->FoundState = --s;
 1090|  3.68M|    if (s->Freq > MAX_FREQ)
  ------------------
  |  |   14|  3.68M|#define MAX_FREQ 124
  ------------------
  |  Branch (1090:9): [True: 524, False: 3.68M]
  ------------------
 1091|    524|      Rescale(p);
 1092|  3.68M|  }
 1093|  5.48M|  NextContext(p);
 1094|  5.48M|}
archive_ppmd8.c:Ppmd8_UpdateBin:
 1107|  57.7M|{
 1108|  57.7M|  p->FoundState->Freq = (Byte)(p->FoundState->Freq + (p->FoundState->Freq < 196));
 1109|  57.7M|  p->PrevSuccess = 1;
 1110|  57.7M|  p->RunLength++;
 1111|  57.7M|  NextContext(p);
 1112|  57.7M|}
archive_ppmd8.c:Ppmd8_MakeEscFreq:
 1046|  15.4M|{
 1047|  15.4M|  CPpmd_See *see;
 1048|  15.4M|  if (p->MinContext->NumStats != 0xFF)
  ------------------
  |  Branch (1048:7): [True: 13.0M, False: 2.43M]
  ------------------
 1049|  13.0M|  {
 1050|  13.0M|    see = p->See[(unsigned)p->NS2Indx[(unsigned)p->MinContext->NumStats + 2] - 3] +
 1051|  13.0M|        (p->MinContext->SummFreq > 11 * ((unsigned)p->MinContext->NumStats + 1)) +
 1052|  13.0M|        2 * (unsigned)(2 * (unsigned)p->MinContext->NumStats <
 1053|  13.0M|        ((unsigned)SUFFIX(p->MinContext)->NumStats + numMasked1)) +
  ------------------
  |  |   32|  13.0M|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  13.0M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  13.0M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  13.0M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1054|  13.0M|        p->MinContext->Flags;
 1055|  13.0M|    {
 1056|  13.0M|      unsigned r = (see->Summ >> see->Shift);
 1057|  13.0M|      see->Summ = (UInt16)(see->Summ - r);
 1058|  13.0M|      *escFreq = r + (r == 0);
 1059|  13.0M|    }
 1060|  13.0M|  }
 1061|  2.43M|  else
 1062|  2.43M|  {
 1063|  2.43M|    see = &p->DummySee;
 1064|  2.43M|    *escFreq = 1;
 1065|  2.43M|  }
 1066|  15.4M|  return see;
 1067|  15.4M|}
archive_ppmd8.c:Ppmd8_Update2:
 1115|  10.9M|{
 1116|  10.9M|  p->MinContext->SummFreq += 4;
 1117|  10.9M|  if ((p->FoundState->Freq += 4) > MAX_FREQ)
  ------------------
  |  |   14|  10.9M|#define MAX_FREQ 124
  ------------------
  |  Branch (1117:7): [True: 13.4k, False: 10.9M]
  ------------------
 1118|  13.4k|    Rescale(p);
 1119|  10.9M|  p->RunLength = p->InitRL;
 1120|  10.9M|  UpdateModel(p);
 1121|  10.9M|  p->MinContext = p->MaxContext;
 1122|  10.9M|}

__archive_rb_tree_init:
   97|  2.57k|{
   98|  2.57k|	rbt->rbt_ops = ops;
   99|       |	*((struct archive_rb_node **)&rbt->rbt_root) = RB_SENTINEL_NODE;
  ------------------
  |  |   89|  2.57k|#define	RB_SENTINEL_NODE	NULL
  ------------------
  100|  2.57k|}
__archive_rb_tree_find_node:
  104|    419|{
  105|    419|	archive_rbto_compare_key_fn compare_key = rbt->rbt_ops->rbto_compare_key;
  106|    419|	struct archive_rb_node *parent = rbt->rbt_root;
  107|       |
  108|  1.46k|	while (!RB_SENTINEL_P(parent)) {
  ------------------
  |  |   53|  1.46k|#define	RB_SENTINEL_P(rb)	((rb) == NULL)
  ------------------
  |  Branch (108:9): [True: 1.46k, False: 0]
  ------------------
  109|  1.46k|		const signed int diff = (*compare_key)(parent, key);
  110|  1.46k|		if (diff == 0)
  ------------------
  |  Branch (110:7): [True: 419, False: 1.04k]
  ------------------
  111|    419|			return parent;
  112|  1.04k|		parent = parent->rb_nodes[diff > 0];
  113|  1.04k|	}
  114|       |
  115|      0|	return NULL;
  116|    419|}
__archive_rb_tree_insert_node:
  159|  1.51k|{
  160|  1.51k|	archive_rbto_compare_nodes_fn compare_nodes = rbt->rbt_ops->rbto_compare_nodes;
  161|  1.51k|	struct archive_rb_node *parent, *tmp;
  162|  1.51k|	unsigned int position;
  163|  1.51k|	int rebalance;
  164|       |
  165|  1.51k|	tmp = rbt->rbt_root;
  166|       |	/*
  167|       |	 * This is a hack.  Because rbt->rbt_root is just a
  168|       |	 * struct archive_rb_node *, just like rb_node->rb_nodes[RB_DIR_LEFT],
  169|       |	 * we can use this fact to avoid a lot of tests for root and know
  170|       |	 * that even at root, updating
  171|       |	 * RB_FATHER(rb_node)->rb_nodes[RB_POSITION(rb_node)] will
  172|       |	 * update rbt->rbt_root.
  173|       |	 */
  174|  1.51k|	parent = (struct archive_rb_node *)(void *)&rbt->rbt_root;
  175|  1.51k|	position = RB_DIR_LEFT;
  ------------------
  |  |   39|  1.51k|#define	RB_DIR_LEFT		0
  ------------------
  176|       |
  177|       |	/*
  178|       |	 * Find out where to place this new leaf.
  179|       |	 */
  180|  9.47k|	while (!RB_SENTINEL_P(tmp)) {
  ------------------
  |  |   53|  9.47k|#define	RB_SENTINEL_P(rb)	((rb) == NULL)
  ------------------
  |  Branch (180:9): [True: 8.27k, False: 1.19k]
  ------------------
  181|  8.27k|		const signed int diff = (*compare_nodes)(tmp, self);
  182|  8.27k|		if (diff == 0) {
  ------------------
  |  Branch (182:7): [True: 322, False: 7.95k]
  ------------------
  183|       |			/*
  184|       |			 * Node already exists; don't insert.
  185|       |			 */
  186|    322|			return F;
  ------------------
  |  |   92|    322|#define	F	0
  ------------------
  187|    322|		}
  188|  7.95k|		parent = tmp;
  189|  7.95k|		position = (diff > 0);
  190|  7.95k|		tmp = parent->rb_nodes[position];
  191|  7.95k|	}
  192|       |
  193|       |	/*
  194|       |	 * Initialize the node and insert as a leaf into the tree.
  195|       |	 */
  196|  1.19k|	RB_SET_FATHER(self, parent);
  ------------------
  |  |   51|  1.19k|    ((void)((rb)->rb_info = (uintptr_t)(father)|((rb)->rb_info & RB_FLAG_MASK)))
  |  |  ------------------
  |  |  |  |   47|  1.19k|#define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  1.19k|#define	RB_FLAG_POSITION	0x2
  |  |  |  |  ------------------
  |  |  |  |               #define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   46|  1.19k|#define	RB_FLAG_RED		0x1
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  197|  1.19k|	RB_SET_POSITION(self, position);
  ------------------
  |  |   73|  1.19k|    ((void)((position) ? ((rb)->rb_info |= RB_FLAG_POSITION) : \
  |  |  ------------------
  |  |  |  |   45|    892|#define	RB_FLAG_POSITION	0x2
  |  |  ------------------
  |  |  |  Branch (73:13): [True: 892, False: 305]
  |  |  ------------------
  |  |   74|  1.19k|    ((rb)->rb_info &= ~RB_FLAG_POSITION)))
  |  |  ------------------
  |  |  |  |   45|    305|#define	RB_FLAG_POSITION	0x2
  |  |  ------------------
  ------------------
  198|  1.19k|	if (parent == (struct archive_rb_node *)(void *)&rbt->rbt_root) {
  ------------------
  |  Branch (198:6): [True: 52, False: 1.14k]
  ------------------
  199|     52|		RB_MARK_BLACK(self);		/* root is always black */
  ------------------
  |  |   69|     52|#define	RB_MARK_BLACK(rb) 	((void)((rb)->rb_info &= ~RB_FLAG_RED))
  |  |  ------------------
  |  |  |  |   46|     52|#define	RB_FLAG_RED		0x1
  |  |  ------------------
  ------------------
  200|     52|		rebalance = F;
  ------------------
  |  |   92|     52|#define	F	0
  ------------------
  201|  1.14k|	} else {
  202|       |		/*
  203|       |		 * All new nodes are colored red.  We only need to rebalance
  204|       |		 * if our parent is also red.
  205|       |		 */
  206|  1.14k|		RB_MARK_RED(self);
  ------------------
  |  |   68|  1.14k|#define	RB_MARK_RED(rb) 	((void)((rb)->rb_info |= RB_FLAG_RED))
  |  |  ------------------
  |  |  |  |   46|  1.14k|#define	RB_FLAG_RED		0x1
  |  |  ------------------
  ------------------
  207|  1.14k|		rebalance = RB_RED_P(parent);
  ------------------
  |  |   66|  1.14k|#define	RB_RED_P(rb) 		(!RB_SENTINEL_P(rb) && ((rb)->rb_info & RB_FLAG_RED) != 0)
  |  |  ------------------
  |  |  |  |   53|  2.29k|#define	RB_SENTINEL_P(rb)	((rb) == NULL)
  |  |  ------------------
  |  |               #define	RB_RED_P(rb) 		(!RB_SENTINEL_P(rb) && ((rb)->rb_info & RB_FLAG_RED) != 0)
  |  |  ------------------
  |  |  |  |   46|  1.14k|#define	RB_FLAG_RED		0x1
  |  |  ------------------
  |  |  |  Branch (66:25): [True: 1.14k, False: 0]
  |  |  |  Branch (66:47): [True: 1.05k, False: 87]
  |  |  ------------------
  ------------------
  208|  1.14k|	}
  209|  1.19k|	self->rb_left = parent->rb_nodes[position];
  ------------------
  |  |   42|  1.19k|#define	rb_left			rb_nodes[RB_DIR_LEFT]
  |  |  ------------------
  |  |  |  |   39|  1.19k|#define	RB_DIR_LEFT		0
  |  |  ------------------
  ------------------
  210|  1.19k|	self->rb_right = parent->rb_nodes[position];
  ------------------
  |  |   43|  1.19k|#define	rb_right		rb_nodes[RB_DIR_RIGHT]
  |  |  ------------------
  |  |  |  |   40|  1.19k|#define	RB_DIR_RIGHT		1
  |  |  ------------------
  ------------------
  211|  1.19k|	parent->rb_nodes[position] = self;
  212|       |
  213|       |	/*
  214|       |	 * Rebalance tree after insertion
  215|       |	 */
  216|  1.19k|	if (rebalance)
  ------------------
  |  Branch (216:6): [True: 1.05k, False: 139]
  ------------------
  217|  1.05k|		__archive_rb_tree_insert_rebalance(rbt, self);
  218|       |
  219|  1.19k|	return T;
  ------------------
  |  |   91|  1.19k|#define T	1
  ------------------
  220|  1.51k|}
__archive_rb_tree_iterate:
  677|    231|{
  678|    231|	const unsigned int other = direction ^ RB_DIR_OTHER;
  ------------------
  |  |   41|    231|#define	RB_DIR_OTHER		1
  ------------------
  679|       |
  680|    231|	if (self == NULL) {
  ------------------
  |  Branch (680:6): [True: 23, False: 208]
  ------------------
  681|     23|		self = rbt->rbt_root;
  682|     23|		if (RB_SENTINEL_P(self))
  ------------------
  |  |   53|     23|#define	RB_SENTINEL_P(rb)	((rb) == NULL)
  |  |  ------------------
  |  |  |  Branch (53:27): [True: 3, False: 20]
  |  |  ------------------
  ------------------
  683|      3|			return NULL;
  684|     79|		while (!RB_SENTINEL_P(self->rb_nodes[direction]))
  ------------------
  |  |   53|     79|#define	RB_SENTINEL_P(rb)	((rb) == NULL)
  ------------------
  |  Branch (684:10): [True: 59, False: 20]
  ------------------
  685|     59|			self = self->rb_nodes[direction];
  686|     20|		return self;
  687|     23|	}
  688|       |	/*
  689|       |	 * We can't go any further in this direction.  We proceed up in the
  690|       |	 * opposite direction until our parent is in direction we want to go.
  691|       |	 */
  692|    208|	if (RB_SENTINEL_P(self->rb_nodes[direction])) {
  ------------------
  |  |   53|    208|#define	RB_SENTINEL_P(rb)	((rb) == NULL)
  |  |  ------------------
  |  |  |  Branch (53:27): [True: 107, False: 101]
  |  |  ------------------
  ------------------
  693|    190|		while (!RB_ROOT_P(rbt, self)) {
  ------------------
  |  |   71|    190|#define	RB_ROOT_P(rbt, rb)	((rbt)->rbt_root == (rb))
  ------------------
  |  Branch (693:10): [True: 186, False: 4]
  ------------------
  694|    186|			if (other == (unsigned int)RB_POSITION(self))
  ------------------
  |  |   63|    186|    (((rb)->rb_info & RB_FLAG_POSITION) ? RB_DIR_RIGHT : RB_DIR_LEFT)
  |  |  ------------------
  |  |  |  |   45|    186|#define	RB_FLAG_POSITION	0x2
  |  |  ------------------
  |  |                   (((rb)->rb_info & RB_FLAG_POSITION) ? RB_DIR_RIGHT : RB_DIR_LEFT)
  |  |  ------------------
  |  |  |  |   40|     83|#define	RB_DIR_RIGHT		1
  |  |  ------------------
  |  |                   (((rb)->rb_info & RB_FLAG_POSITION) ? RB_DIR_RIGHT : RB_DIR_LEFT)
  |  |  ------------------
  |  |  |  |   39|    103|#define	RB_DIR_LEFT		0
  |  |  ------------------
  |  |  |  Branch (63:6): [True: 83, False: 103]
  |  |  ------------------
  ------------------
  |  Branch (694:8): [True: 103, False: 83]
  ------------------
  695|    103|				return RB_FATHER(self);
  ------------------
  |  |   49|    103|    ((struct archive_rb_node *)((rb)->rb_info & ~RB_FLAG_MASK))
  |  |  ------------------
  |  |  |  |   47|    103|#define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|    103|#define	RB_FLAG_POSITION	0x2
  |  |  |  |  ------------------
  |  |  |  |               #define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   46|    103|#define	RB_FLAG_RED		0x1
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  696|     83|			self = RB_FATHER(self);
  ------------------
  |  |   49|     83|    ((struct archive_rb_node *)((rb)->rb_info & ~RB_FLAG_MASK))
  |  |  ------------------
  |  |  |  |   47|     83|#define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|     83|#define	RB_FLAG_POSITION	0x2
  |  |  |  |  ------------------
  |  |  |  |               #define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   46|     83|#define	RB_FLAG_RED		0x1
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  697|     83|		}
  698|      4|		return NULL;
  699|    107|	}
  700|       |
  701|       |	/*
  702|       |	 * Advance down one in current direction and go down as far as possible
  703|       |	 * in the opposite direction.
  704|       |	 */
  705|    101|	self = self->rb_nodes[direction];
  706|    175|	while (!RB_SENTINEL_P(self->rb_nodes[other]))
  ------------------
  |  |   53|    175|#define	RB_SENTINEL_P(rb)	((rb) == NULL)
  ------------------
  |  Branch (706:9): [True: 74, False: 101]
  ------------------
  707|     74|		self = self->rb_nodes[other];
  708|    101|	return self;
  709|    208|}
archive_rb.c:__archive_rb_tree_insert_rebalance:
  275|  1.05k|{
  276|  1.05k|	struct archive_rb_node * father = RB_FATHER(self);
  ------------------
  |  |   49|  1.05k|    ((struct archive_rb_node *)((rb)->rb_info & ~RB_FLAG_MASK))
  |  |  ------------------
  |  |  |  |   47|  1.05k|#define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  1.05k|#define	RB_FLAG_POSITION	0x2
  |  |  |  |  ------------------
  |  |  |  |               #define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   46|  1.05k|#define	RB_FLAG_RED		0x1
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  277|  1.05k|	struct archive_rb_node * grandpa;
  278|  1.05k|	struct archive_rb_node * uncle;
  279|  1.05k|	unsigned int which;
  280|  1.05k|	unsigned int other;
  281|       |
  282|  1.74k|	for (;;) {
  283|       |		/*
  284|       |		 * We are red and our parent is red, therefore we must have a
  285|       |		 * grandfather and he must be black.
  286|       |		 */
  287|  1.74k|		grandpa = RB_FATHER(father);
  ------------------
  |  |   49|  1.74k|    ((struct archive_rb_node *)((rb)->rb_info & ~RB_FLAG_MASK))
  |  |  ------------------
  |  |  |  |   47|  1.74k|#define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  1.74k|#define	RB_FLAG_POSITION	0x2
  |  |  |  |  ------------------
  |  |  |  |               #define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   46|  1.74k|#define	RB_FLAG_RED		0x1
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  288|  1.74k|		which = (father == grandpa->rb_right);
  ------------------
  |  |   43|  1.74k|#define	rb_right		rb_nodes[RB_DIR_RIGHT]
  |  |  ------------------
  |  |  |  |   40|  1.74k|#define	RB_DIR_RIGHT		1
  |  |  ------------------
  ------------------
  289|  1.74k|		other = which ^ RB_DIR_OTHER;
  ------------------
  |  |   41|  1.74k|#define	RB_DIR_OTHER		1
  ------------------
  290|  1.74k|		uncle = grandpa->rb_nodes[other];
  291|       |
  292|  1.74k|		if (RB_BLACK_P(uncle))
  ------------------
  |  |   67|  1.74k|#define	RB_BLACK_P(rb) 		(RB_SENTINEL_P(rb) || ((rb)->rb_info & RB_FLAG_RED) == 0)
  |  |  ------------------
  |  |  |  |   53|  3.49k|#define	RB_SENTINEL_P(rb)	((rb) == NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (53:27): [True: 532, False: 1.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define	RB_BLACK_P(rb) 		(RB_SENTINEL_P(rb) || ((rb)->rb_info & RB_FLAG_RED) == 0)
  |  |  ------------------
  |  |  |  |   46|  1.21k|#define	RB_FLAG_RED		0x1
  |  |  ------------------
  |  |  |  Branch (67:48): [True: 355, False: 860]
  |  |  ------------------
  ------------------
  293|    887|			break;
  294|       |
  295|       |		/*
  296|       |		 * Case 1: our uncle is red
  297|       |		 *   Simply invert the colors of our parent and
  298|       |		 *   uncle and make our grandparent red.  And
  299|       |		 *   then solve the problem up at his level.
  300|       |		 */
  301|    860|		RB_MARK_BLACK(uncle);
  ------------------
  |  |   69|    860|#define	RB_MARK_BLACK(rb) 	((void)((rb)->rb_info &= ~RB_FLAG_RED))
  |  |  ------------------
  |  |  |  |   46|    860|#define	RB_FLAG_RED		0x1
  |  |  ------------------
  ------------------
  302|    860|		RB_MARK_BLACK(father);
  ------------------
  |  |   69|    860|#define	RB_MARK_BLACK(rb) 	((void)((rb)->rb_info &= ~RB_FLAG_RED))
  |  |  ------------------
  |  |  |  |   46|    860|#define	RB_FLAG_RED		0x1
  |  |  ------------------
  ------------------
  303|    860|		if (RB_ROOT_P(rbt, grandpa)) {
  ------------------
  |  |   71|    860|#define	RB_ROOT_P(rbt, rb)	((rbt)->rbt_root == (rb))
  |  |  ------------------
  |  |  |  Branch (71:28): [True: 95, False: 765]
  |  |  ------------------
  ------------------
  304|       |			/*
  305|       |			 * If our grandpa is root, don't bother
  306|       |			 * setting him to red, just return.
  307|       |			 */
  308|     95|			return;
  309|     95|		}
  310|    765|		RB_MARK_RED(grandpa);
  ------------------
  |  |   68|    765|#define	RB_MARK_RED(rb) 	((void)((rb)->rb_info |= RB_FLAG_RED))
  |  |  ------------------
  |  |  |  |   46|    765|#define	RB_FLAG_RED		0x1
  |  |  ------------------
  ------------------
  311|    765|		self = grandpa;
  312|    765|		father = RB_FATHER(self);
  ------------------
  |  |   49|    765|    ((struct archive_rb_node *)((rb)->rb_info & ~RB_FLAG_MASK))
  |  |  ------------------
  |  |  |  |   47|    765|#define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|    765|#define	RB_FLAG_POSITION	0x2
  |  |  |  |  ------------------
  |  |  |  |               #define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   46|    765|#define	RB_FLAG_RED		0x1
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  313|    765|		if (RB_BLACK_P(father)) {
  ------------------
  |  |   67|    765|#define	RB_BLACK_P(rb) 		(RB_SENTINEL_P(rb) || ((rb)->rb_info & RB_FLAG_RED) == 0)
  |  |  ------------------
  |  |  |  |   53|  1.53k|#define	RB_SENTINEL_P(rb)	((rb) == NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (53:27): [True: 0, False: 765]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define	RB_BLACK_P(rb) 		(RB_SENTINEL_P(rb) || ((rb)->rb_info & RB_FLAG_RED) == 0)
  |  |  ------------------
  |  |  |  |   46|    765|#define	RB_FLAG_RED		0x1
  |  |  ------------------
  |  |  |  Branch (67:48): [True: 76, False: 689]
  |  |  ------------------
  ------------------
  314|       |			/*
  315|       |			 * If our great-grandpa is black, we're done.
  316|       |			 */
  317|     76|			return;
  318|     76|		}
  319|    765|	}
  320|       |
  321|       |	/*
  322|       |	 * Case 2&3: our uncle is black.
  323|       |	 */
  324|    887|	if (self == father->rb_nodes[other]) {
  ------------------
  |  Branch (324:6): [True: 279, False: 608]
  ------------------
  325|       |		/*
  326|       |		 * Case 2: we are on the same side as our uncle
  327|       |		 *   Swap ourselves with our parent so this case
  328|       |		 *   becomes case 3.  Basically our parent becomes our
  329|       |		 *   child.
  330|       |		 */
  331|    279|		__archive_rb_tree_reparent_nodes(father, other);
  332|    279|	}
  333|       |	/*
  334|       |	 * Case 3: we are opposite a child of a black uncle.
  335|       |	 *   Swap our parent and grandparent.  Since our grandfather
  336|       |	 *   is black, our father will become black and our new sibling
  337|       |	 *   (former grandparent) will become red.
  338|       |	 */
  339|    887|	__archive_rb_tree_reparent_nodes(grandpa, which);
  340|       |
  341|       |	/*
  342|       |	 * Final step: Set the root to black.
  343|       |	 */
  344|    887|	RB_MARK_BLACK(rbt->rbt_root);
  ------------------
  |  |   69|    887|#define	RB_MARK_BLACK(rb) 	((void)((rb)->rb_info &= ~RB_FLAG_RED))
  |  |  ------------------
  |  |  |  |   46|    887|#define	RB_FLAG_RED		0x1
  |  |  ------------------
  ------------------
  345|    887|}
archive_rb.c:__archive_rb_tree_reparent_nodes:
  233|  1.16k|{
  234|  1.16k|	const unsigned int other = which ^ RB_DIR_OTHER;
  ------------------
  |  |   41|  1.16k|#define	RB_DIR_OTHER		1
  ------------------
  235|  1.16k|	struct archive_rb_node * const grandpa = RB_FATHER(old_father);
  ------------------
  |  |   49|  1.16k|    ((struct archive_rb_node *)((rb)->rb_info & ~RB_FLAG_MASK))
  |  |  ------------------
  |  |  |  |   47|  1.16k|#define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  1.16k|#define	RB_FLAG_POSITION	0x2
  |  |  |  |  ------------------
  |  |  |  |               #define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   46|  1.16k|#define	RB_FLAG_RED		0x1
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  236|  1.16k|	struct archive_rb_node * const old_child = old_father->rb_nodes[which];
  237|  1.16k|	struct archive_rb_node * const new_father = old_child;
  238|  1.16k|	struct archive_rb_node * const new_child = old_father;
  239|       |
  240|  1.16k|	if (new_father == NULL)
  ------------------
  |  Branch (240:6): [True: 0, False: 1.16k]
  ------------------
  241|      0|		return;
  242|       |	/*
  243|       |	 * Exchange descendant linkages.
  244|       |	 */
  245|  1.16k|	grandpa->rb_nodes[RB_POSITION(old_father)] = new_father;
  ------------------
  |  |   63|  1.16k|    (((rb)->rb_info & RB_FLAG_POSITION) ? RB_DIR_RIGHT : RB_DIR_LEFT)
  |  |  ------------------
  |  |  |  |   45|  1.16k|#define	RB_FLAG_POSITION	0x2
  |  |  ------------------
  |  |                   (((rb)->rb_info & RB_FLAG_POSITION) ? RB_DIR_RIGHT : RB_DIR_LEFT)
  |  |  ------------------
  |  |  |  |   40|    716|#define	RB_DIR_RIGHT		1
  |  |  ------------------
  |  |                   (((rb)->rb_info & RB_FLAG_POSITION) ? RB_DIR_RIGHT : RB_DIR_LEFT)
  |  |  ------------------
  |  |  |  |   39|    450|#define	RB_DIR_LEFT		0
  |  |  ------------------
  |  |  |  Branch (63:6): [True: 716, False: 450]
  |  |  ------------------
  ------------------
  246|  1.16k|	new_child->rb_nodes[which] = old_child->rb_nodes[other];
  247|  1.16k|	new_father->rb_nodes[other] = new_child;
  248|       |
  249|       |	/*
  250|       |	 * Update ancestor linkages
  251|       |	 */
  252|  1.16k|	RB_SET_FATHER(new_father, grandpa);
  ------------------
  |  |   51|  1.16k|    ((void)((rb)->rb_info = (uintptr_t)(father)|((rb)->rb_info & RB_FLAG_MASK)))
  |  |  ------------------
  |  |  |  |   47|  1.16k|#define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  1.16k|#define	RB_FLAG_POSITION	0x2
  |  |  |  |  ------------------
  |  |  |  |               #define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   46|  1.16k|#define	RB_FLAG_RED		0x1
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  253|  1.16k|	RB_SET_FATHER(new_child, new_father);
  ------------------
  |  |   51|  1.16k|    ((void)((rb)->rb_info = (uintptr_t)(father)|((rb)->rb_info & RB_FLAG_MASK)))
  |  |  ------------------
  |  |  |  |   47|  1.16k|#define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  1.16k|#define	RB_FLAG_POSITION	0x2
  |  |  |  |  ------------------
  |  |  |  |               #define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   46|  1.16k|#define	RB_FLAG_RED		0x1
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  254|       |
  255|       |	/*
  256|       |	 * Exchange properties between new_father and new_child.  The only
  257|       |	 * change is that new_child's position is now on the other side.
  258|       |	 */
  259|  1.16k|	RB_SWAP_PROPERTIES(new_father, new_child);
  ------------------
  |  |   78|  1.16k|#define RB_SWAP_PROPERTIES(a, b) do { \
  |  |   79|  1.16k|    uintptr_t xorinfo = ((a)->rb_info ^ (b)->rb_info) & RB_FLAG_MASK; \
  |  |  ------------------
  |  |  |  |   47|  1.16k|#define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  1.16k|#define	RB_FLAG_POSITION	0x2
  |  |  |  |  ------------------
  |  |  |  |               #define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   46|  1.16k|#define	RB_FLAG_RED		0x1
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   80|  1.16k|    (a)->rb_info ^= xorinfo; \
  |  |   81|  1.16k|    (b)->rb_info ^= xorinfo; \
  |  |   82|  1.16k|  } while (/*CONSTCOND*/ 0)
  |  |  ------------------
  |  |  |  Branch (82:26): [Folded, False: 1.16k]
  |  |  ------------------
  ------------------
  260|  1.16k|	RB_SET_POSITION(new_child, other);
  ------------------
  |  |   73|  1.16k|    ((void)((position) ? ((rb)->rb_info |= RB_FLAG_POSITION) : \
  |  |  ------------------
  |  |  |  |   45|    287|#define	RB_FLAG_POSITION	0x2
  |  |  ------------------
  |  |  |  Branch (73:13): [True: 287, False: 879]
  |  |  ------------------
  |  |   74|  1.16k|    ((rb)->rb_info &= ~RB_FLAG_POSITION)))
  |  |  ------------------
  |  |  |  |   45|    879|#define	RB_FLAG_POSITION	0x2
  |  |  ------------------
  ------------------
  261|       |
  262|       |	/*
  263|       |	 * Make sure to reparent the new child to ourself.
  264|       |	 */
  265|  1.16k|	if (!RB_SENTINEL_P(new_child->rb_nodes[which])) {
  ------------------
  |  |   53|  1.16k|#define	RB_SENTINEL_P(rb)	((rb) == NULL)
  ------------------
  |  Branch (265:6): [True: 436, False: 730]
  ------------------
  266|    436|		RB_SET_FATHER(new_child->rb_nodes[which], new_child);
  ------------------
  |  |   51|    436|    ((void)((rb)->rb_info = (uintptr_t)(father)|((rb)->rb_info & RB_FLAG_MASK)))
  |  |  ------------------
  |  |  |  |   47|    436|#define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|    436|#define	RB_FLAG_POSITION	0x2
  |  |  |  |  ------------------
  |  |  |  |               #define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   46|    436|#define	RB_FLAG_RED		0x1
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  267|    436|		RB_SET_POSITION(new_child->rb_nodes[which], which);
  ------------------
  |  |   73|    436|    ((void)((position) ? ((rb)->rb_info |= RB_FLAG_POSITION) : \
  |  |  ------------------
  |  |  |  |   45|    354|#define	RB_FLAG_POSITION	0x2
  |  |  ------------------
  |  |  |  Branch (73:13): [True: 354, False: 82]
  |  |  ------------------
  |  |   74|    436|    ((rb)->rb_info &= ~RB_FLAG_POSITION)))
  |  |  ------------------
  |  |  |  |   45|     82|#define	RB_FLAG_POSITION	0x2
  |  |  ------------------
  ------------------
  268|    436|	}
  269|       |
  270|  1.16k|}

archive_read_new:
   92|  2.49k|{
   93|  2.49k|	struct archive_read *a;
   94|       |
   95|  2.49k|	a = calloc(1, sizeof(*a));
   96|  2.49k|	if (a == NULL)
  ------------------
  |  Branch (96:6): [True: 0, False: 2.49k]
  ------------------
   97|      0|		return (NULL);
   98|  2.49k|	a->archive.magic = ARCHIVE_READ_MAGIC;
  ------------------
  |  |   59|  2.49k|#define	ARCHIVE_READ_MAGIC	(0xdeb0c5U)
  ------------------
   99|       |
  100|  2.49k|	a->archive.state = ARCHIVE_STATE_NEW;
  ------------------
  |  |   64|  2.49k|#define	ARCHIVE_STATE_NEW	1U
  ------------------
  101|  2.49k|	a->entry = archive_entry_new2(&a->archive);
  102|  2.49k|	a->archive.vtable = &archive_read_vtable;
  103|       |
  104|  2.49k|	a->passphrases.last = &a->passphrases.first;
  105|       |
  106|  2.49k|	return (&a->archive);
  107|  2.49k|}
archive_read_set_open_callback:
  295|  2.49k|{
  296|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
  297|  2.49k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
  ------------------
  |  |  151|  2.49k|	do { \
  |  |  152|  2.49k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|  2.49k|			(allowed_states), (function_name)); \
  |  |  154|  2.49k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  2.49k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 2.49k]
  |  |  ------------------
  |  |  155|  2.49k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|  2.49k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 2.49k]
  |  |  ------------------
  ------------------
  298|  2.49k|	    "archive_read_set_open_callback");
  299|  2.49k|	a->client.opener = client_opener;
  300|  2.49k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  301|  2.49k|}
archive_read_set_read_callback:
  306|  2.49k|{
  307|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
  308|  2.49k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
  ------------------
  |  |  151|  2.49k|	do { \
  |  |  152|  2.49k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|  2.49k|			(allowed_states), (function_name)); \
  |  |  154|  2.49k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  2.49k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 2.49k]
  |  |  ------------------
  |  |  155|  2.49k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|  2.49k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 2.49k]
  |  |  ------------------
  ------------------
  309|  2.49k|	    "archive_read_set_read_callback");
  310|  2.49k|	a->client.reader = client_reader;
  311|  2.49k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  312|  2.49k|}
archive_read_set_skip_callback:
  317|  2.49k|{
  318|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
  319|  2.49k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
  ------------------
  |  |  151|  2.49k|	do { \
  |  |  152|  2.49k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|  2.49k|			(allowed_states), (function_name)); \
  |  |  154|  2.49k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  2.49k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 2.49k]
  |  |  ------------------
  |  |  155|  2.49k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|  2.49k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 2.49k]
  |  |  ------------------
  ------------------
  320|  2.49k|	    "archive_read_set_skip_callback");
  321|  2.49k|	a->client.skipper = client_skipper;
  322|  2.49k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  323|  2.49k|}
archive_read_set_seek_callback:
  328|  2.49k|{
  329|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
  330|  2.49k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
  ------------------
  |  |  151|  2.49k|	do { \
  |  |  152|  2.49k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|  2.49k|			(allowed_states), (function_name)); \
  |  |  154|  2.49k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  2.49k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 2.49k]
  |  |  ------------------
  |  |  155|  2.49k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|  2.49k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 2.49k]
  |  |  ------------------
  ------------------
  331|  2.49k|	    "archive_read_set_seek_callback");
  332|  2.49k|	a->client.seeker = client_seeker;
  333|  2.49k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  334|  2.49k|}
archive_read_set_close_callback:
  339|  2.49k|{
  340|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
  341|  2.49k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
  ------------------
  |  |  151|  2.49k|	do { \
  |  |  152|  2.49k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|  2.49k|			(allowed_states), (function_name)); \
  |  |  154|  2.49k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  2.49k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 2.49k]
  |  |  ------------------
  |  |  155|  2.49k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|  2.49k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 2.49k]
  |  |  ------------------
  ------------------
  342|  2.49k|	    "archive_read_set_close_callback");
  343|  2.49k|	a->client.closer = client_closer;
  344|  2.49k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  345|  2.49k|}
archive_read_set_callback_data:
  360|  2.49k|{
  361|  2.49k|	return archive_read_set_callback_data2(_a, client_data, 0);
  362|  2.49k|}
archive_read_set_callback_data2:
  367|  2.49k|{
  368|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
  369|  2.49k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
  ------------------
  |  |  151|  2.49k|	do { \
  |  |  152|  2.49k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|  2.49k|			(allowed_states), (function_name)); \
  |  |  154|  2.49k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  2.49k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 2.49k]
  |  |  ------------------
  |  |  155|  2.49k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|  2.49k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 2.49k]
  |  |  ------------------
  ------------------
  370|  2.49k|	    "archive_read_set_callback_data2");
  371|       |
  372|  2.49k|	if (a->client.nodes == 0)
  ------------------
  |  Branch (372:6): [True: 2.49k, False: 0]
  ------------------
  373|  2.49k|	{
  374|  2.49k|		a->client.dataset = (struct archive_read_data_node *)
  375|  2.49k|		    calloc(1, sizeof(*a->client.dataset));
  376|  2.49k|		if (a->client.dataset == NULL)
  ------------------
  |  Branch (376:7): [True: 0, False: 2.49k]
  ------------------
  377|      0|		{
  378|      0|			archive_set_error(&a->archive, ENOMEM,
  379|      0|				"No memory");
  380|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  381|      0|		}
  382|  2.49k|		a->client.nodes = 1;
  383|  2.49k|	}
  384|       |
  385|  2.49k|	if (iindex > a->client.nodes - 1)
  ------------------
  |  Branch (385:6): [True: 0, False: 2.49k]
  ------------------
  386|      0|	{
  387|      0|		archive_set_error(&a->archive, EINVAL,
  388|      0|			"Invalid index specified");
  389|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  390|      0|	}
  391|  2.49k|	a->client.dataset[iindex].data = client_data;
  392|  2.49k|	a->client.dataset[iindex].begin_position = -1;
  393|  2.49k|	a->client.dataset[iindex].total_size = -1;
  394|  2.49k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  395|  2.49k|}
archive_read_open1:
  452|  2.49k|{
  453|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
  454|  2.49k|	struct archive_read_filter *filter, *tmp;
  455|  2.49k|	int slot, e = ARCHIVE_OK;
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  456|       |
  457|  2.49k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
  ------------------
  |  |  151|  2.49k|	do { \
  |  |  152|  2.49k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|  2.49k|			(allowed_states), (function_name)); \
  |  |  154|  2.49k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  2.49k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 2.49k]
  |  |  ------------------
  |  |  155|  2.49k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|  2.49k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 2.49k]
  |  |  ------------------
  ------------------
  458|  2.49k|	    "archive_read_open");
  459|  2.49k|	archive_clear_error(&a->archive);
  460|       |
  461|  2.49k|	if (a->client.reader == NULL) {
  ------------------
  |  Branch (461:6): [True: 0, False: 2.49k]
  ------------------
  462|      0|		archive_set_error(&a->archive, EINVAL,
  463|      0|		    "No reader function provided to archive_read_open");
  464|      0|		a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   69|      0|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  465|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  466|      0|	}
  467|       |
  468|       |	/* Open data source. */
  469|  2.49k|	if (a->client.opener != NULL) {
  ------------------
  |  Branch (469:6): [True: 2.49k, False: 0]
  ------------------
  470|  2.49k|		e = (a->client.opener)(&a->archive, a->client.dataset[0].data);
  471|  2.49k|		if (e != 0) {
  ------------------
  |  Branch (471:7): [True: 0, False: 2.49k]
  ------------------
  472|       |			/* If the open failed, call the closer to clean up. */
  473|      0|			read_client_close_proxy(a);
  474|      0|			return (e);
  475|      0|		}
  476|  2.49k|	}
  477|       |
  478|  2.49k|	filter = calloc(1, sizeof(*filter));
  479|  2.49k|	if (filter == NULL)
  ------------------
  |  Branch (479:6): [True: 0, False: 2.49k]
  ------------------
  480|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  481|  2.49k|	filter->bidder = NULL;
  482|  2.49k|	filter->upstream = NULL;
  483|  2.49k|	filter->archive = a;
  484|  2.49k|	filter->data = a->client.dataset[0].data;
  485|  2.49k|	filter->vtable = &none_reader_vtable;
  486|  2.49k|	filter->name = "none";
  487|  2.49k|	filter->code = ARCHIVE_FILTER_NONE;
  ------------------
  |  |  309|  2.49k|#define	ARCHIVE_FILTER_NONE	0
  ------------------
  488|  2.49k|	filter->can_skip = 1;
  489|  2.49k|	filter->can_seek = 1;
  490|       |
  491|  2.49k|	a->client.dataset[0].begin_position = 0;
  492|  2.49k|	if (!a->filter || !a->bypass_filter_bidding)
  ------------------
  |  Branch (492:6): [True: 2.49k, False: 0]
  |  Branch (492:20): [True: 0, False: 0]
  ------------------
  493|  2.49k|	{
  494|  2.49k|		a->filter = filter;
  495|       |		/* Build out the input pipeline. */
  496|  2.49k|		e = choose_filters(a);
  497|  2.49k|		if (e < ARCHIVE_WARN) {
  ------------------
  |  |  235|  2.49k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (497:7): [True: 39, False: 2.46k]
  ------------------
  498|     39|			a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   69|     39|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  499|     39|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     39|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  500|     39|		}
  501|  2.49k|	}
  502|      0|	else
  503|      0|	{
  504|       |		/* Need to add "NONE" type filter at the end of the filter chain */
  505|      0|		tmp = a->filter;
  506|      0|		while (tmp->upstream)
  ------------------
  |  Branch (506:10): [True: 0, False: 0]
  ------------------
  507|      0|			tmp = tmp->upstream;
  508|      0|		tmp->upstream = filter;
  509|      0|	}
  510|       |
  511|  2.46k|	if (!a->format)
  ------------------
  |  Branch (511:6): [True: 2.46k, False: 0]
  ------------------
  512|  2.46k|	{
  513|  2.46k|		slot = choose_format(a);
  514|  2.46k|		if (slot < 0) {
  ------------------
  |  Branch (514:7): [True: 17, False: 2.44k]
  ------------------
  515|     17|			close_filters(a);
  516|     17|			a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   69|     17|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  517|     17|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     17|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  518|     17|		}
  519|  2.44k|		a->format = &(a->formats[slot]);
  520|  2.44k|	}
  521|       |
  522|  2.44k|	a->archive.state = ARCHIVE_STATE_HEADER;
  ------------------
  |  |   65|  2.44k|#define	ARCHIVE_STATE_HEADER	2U
  ------------------
  523|       |
  524|       |	/* Ensure libarchive starts from the first node in a multivolume set */
  525|  2.44k|	client_switch_proxy(a->filter, 0);
  526|  2.44k|	return (e);
  527|  2.46k|}
__archive_read_header:
  595|     64|{
  596|     64|	if (!a->filter->vtable->read_header)
  ------------------
  |  Branch (596:6): [True: 41, False: 23]
  ------------------
  597|     41|		return (ARCHIVE_OK);
  ------------------
  |  |  233|     41|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  598|     23|	return a->filter->vtable->read_header(a->filter, entry);
  599|     64|}
archive_read_has_encrypted_entries:
  767|  2.44k|{
  768|  2.44k|	struct archive_read *a = (struct archive_read *)_a;
  769|  2.44k|	int format_supports_encryption = archive_read_format_capabilities(_a)
  770|  2.44k|			& (ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA | ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA);
  ------------------
  |  |  398|  2.44k|#define ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA (1<<0)  /* reader can detect encrypted data */
  ------------------
              			& (ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA | ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA);
  ------------------
  |  |  399|  2.44k|#define ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA (1<<1)  /* reader can detect encryptable metadata (pathname, mtime, etc.) */
  ------------------
  771|       |
  772|  2.44k|	if (!_a || !format_supports_encryption) {
  ------------------
  |  Branch (772:6): [True: 0, False: 2.44k]
  |  Branch (772:13): [True: 1.22k, False: 1.21k]
  ------------------
  773|       |		/* Format in general doesn't support encryption */
  774|  1.22k|		return ARCHIVE_READ_FORMAT_ENCRYPTION_UNSUPPORTED;
  ------------------
  |  |  410|  1.22k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_UNSUPPORTED -2
  ------------------
  775|  1.22k|	}
  776|       |
  777|       |	/* A reader potentially has read enough data now. */
  778|  1.21k|	if (a->format && a->format->has_encrypted_entries) {
  ------------------
  |  Branch (778:6): [True: 1.21k, False: 0]
  |  Branch (778:19): [True: 1.21k, False: 0]
  ------------------
  779|  1.21k|		return (a->format->has_encrypted_entries)(a);
  780|  1.21k|	}
  781|       |
  782|       |	/* For any other reason we cannot say how many entries are there. */
  783|      0|	return ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW;
  ------------------
  |  |  411|      0|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  784|  1.21k|}
archive_read_format_capabilities:
  792|  4.88k|{
  793|  4.88k|	struct archive_read *a = (struct archive_read *)_a;
  794|  4.88k|	if (a && a->format && a->format->format_capabilties) {
  ------------------
  |  Branch (794:6): [True: 4.88k, False: 0]
  |  Branch (794:11): [True: 4.88k, False: 0]
  |  Branch (794:24): [True: 2.43k, False: 2.45k]
  ------------------
  795|  2.43k|		return (a->format->format_capabilties)(a);
  796|  2.43k|	}
  797|  2.45k|	return ARCHIVE_READ_FORMAT_CAPS_NONE;
  ------------------
  |  |  397|  2.45k|#define ARCHIVE_READ_FORMAT_CAPS_NONE (0) /* no special capabilities */
  ------------------
  798|  4.88k|}
archive_read_data:
  813|   106M|{
  814|   106M|	struct archive *a = (struct archive *)_a;
  815|   106M|	char	*dest;
  816|   106M|	const void *read_buf;
  817|   106M|	size_t	 bytes_read;
  818|   106M|	size_t	 len;
  819|   106M|	int	 r;
  820|       |
  821|   106M|	bytes_read = 0;
  822|   106M|	dest = (char *)buff;
  823|       |
  824|   213M|	while (s > 0) {
  ------------------
  |  Branch (824:9): [True: 106M, False: 106M]
  ------------------
  825|   106M|		if (a->read_data_offset == a->read_data_output_offset &&
  ------------------
  |  Branch (825:7): [True: 531k, False: 106M]
  ------------------
  826|   531k|		    a->read_data_remaining == 0) {
  ------------------
  |  Branch (826:7): [True: 159k, False: 372k]
  ------------------
  827|   159k|			read_buf = a->read_data_block;
  828|   159k|			a->read_data_is_posix_read = 1;
  829|   159k|			a->read_data_requested = s;
  830|   159k|			r = archive_read_data_block(a, &read_buf,
  831|   159k|			    &a->read_data_remaining, &a->read_data_offset);
  832|   159k|			a->read_data_block = read_buf;
  833|   159k|			if (r == ARCHIVE_EOF &&
  ------------------
  |  |  232|   318k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (833:8): [True: 84.2k, False: 74.8k]
  ------------------
  834|  84.2k|			    a->read_data_offset == a->read_data_output_offset &&
  ------------------
  |  Branch (834:8): [True: 76.2k, False: 8.06k]
  ------------------
  835|  76.2k|			    a->read_data_remaining == 0)
  ------------------
  |  Branch (835:8): [True: 76.2k, False: 0]
  ------------------
  836|  76.2k|				return (bytes_read);
  837|       |			/*
  838|       |			 * Error codes are all negative, so the status
  839|       |			 * return here cannot be confused with a valid
  840|       |			 * byte count.  (ARCHIVE_OK is zero.)
  841|       |			 */
  842|  82.9k|			if (r < ARCHIVE_OK)
  ------------------
  |  |  233|  82.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (842:8): [True: 32.6k, False: 50.2k]
  ------------------
  843|  32.6k|				return (r);
  844|  82.9k|		}
  845|       |
  846|   106M|		if (a->read_data_offset < a->read_data_output_offset) {
  ------------------
  |  Branch (846:7): [True: 934, False: 106M]
  ------------------
  847|    934|			archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    934|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  848|    934|			    "Encountered out-of-order sparse blocks");
  849|    934|			return (ARCHIVE_RETRY);
  ------------------
  |  |  234|    934|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  850|    934|		}
  851|       |
  852|       |		/* Compute the amount of zero padding needed. */
  853|   106M|		if (a->read_data_output_offset + (int64_t)s <
  ------------------
  |  Branch (853:7): [True: 106M, False: 421k]
  ------------------
  854|   106M|		    a->read_data_offset) {
  855|   106M|			len = s;
  856|   106M|		} else if (a->read_data_output_offset <
  ------------------
  |  Branch (856:14): [True: 7.51k, False: 414k]
  ------------------
  857|   421k|		    a->read_data_offset) {
  858|  7.51k|			len = (size_t)(a->read_data_offset -
  859|  7.51k|			    a->read_data_output_offset);
  860|  7.51k|		} else
  861|   414k|			len = 0;
  862|       |
  863|       |		/* Add zeroes. */
  864|   106M|		memset(dest, 0, len);
  865|   106M|		s -= len;
  866|   106M|		a->read_data_output_offset += len;
  867|   106M|		dest += len;
  868|   106M|		bytes_read += len;
  869|       |
  870|       |		/* Copy data if there is any space left. */
  871|   106M|		if (s > 0) {
  ------------------
  |  Branch (871:7): [True: 421k, False: 106M]
  ------------------
  872|   421k|			len = a->read_data_remaining;
  873|   421k|			if (len > s)
  ------------------
  |  Branch (873:8): [True: 372k, False: 49.3k]
  ------------------
  874|   372k|				len = s;
  875|   421k|			if (len) {
  ------------------
  |  Branch (875:8): [True: 412k, False: 9.40k]
  ------------------
  876|   412k|				memcpy(dest, a->read_data_block, len);
  877|   412k|				s -= len;
  878|   412k|				a->read_data_block += len;
  879|   412k|				a->read_data_remaining -= len;
  880|   412k|				a->read_data_output_offset += len;
  881|   412k|				a->read_data_offset += len;
  882|   412k|				dest += len;
  883|   412k|				bytes_read += len;
  884|   412k|			}
  885|   421k|		}
  886|   106M|	}
  887|   106M|	a->read_data_is_posix_read = 0;
  888|   106M|	a->read_data_requested = 0;
  889|   106M|	return (bytes_read);
  890|   106M|}
__archive_reset_read_data:
  896|   301k|{
  897|   301k|	a->read_data_output_offset = 0;
  898|   301k|	a->read_data_remaining = 0;
  899|   301k|	a->read_data_is_posix_read = 0;
  900|   301k|	a->read_data_requested = 0;
  901|       |
  902|       |   /* extra resets, from rar.c */
  903|       |   a->read_data_block = NULL;
  904|   301k|   a->read_data_offset = 0;
  905|   301k|}
archive_read_data_skip:
  912|  87.0k|{
  913|  87.0k|	struct archive_read *a = (struct archive_read *)_a;
  914|  87.0k|	int r;
  915|  87.0k|	const void *buff;
  916|  87.0k|	size_t size;
  917|  87.0k|	int64_t offset;
  918|       |
  919|  87.0k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_DATA,
  ------------------
  |  |  151|  87.0k|	do { \
  |  |  152|  87.0k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|  87.0k|			(allowed_states), (function_name)); \
  |  |  154|  87.0k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  87.0k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 87.0k]
  |  |  ------------------
  |  |  155|  87.0k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|  87.0k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 87.0k]
  |  |  ------------------
  ------------------
  920|  87.0k|	    "archive_read_data_skip");
  921|       |
  922|  87.0k|	if (a->format->read_data_skip != NULL)
  ------------------
  |  Branch (922:6): [True: 87.0k, False: 0]
  ------------------
  923|  87.0k|		r = (a->format->read_data_skip)(a);
  924|      0|	else {
  925|      0|		while ((r = archive_read_data_block(&a->archive,
  ------------------
  |  Branch (925:10): [True: 0, False: 0]
  ------------------
  926|      0|			    &buff, &size, &offset))
  927|      0|		    == ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  928|      0|			;
  929|      0|	}
  930|       |
  931|  87.0k|	if (r == ARCHIVE_EOF)
  ------------------
  |  |  232|  87.0k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (931:6): [True: 682, False: 86.4k]
  ------------------
  932|    682|		r = ARCHIVE_OK;
  ------------------
  |  |  233|    682|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  933|       |
  934|  87.0k|	if (r == ARCHIVE_FATAL)
  ------------------
  |  |  239|  87.0k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (934:6): [True: 264, False: 86.8k]
  ------------------
  935|    264|		a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   69|    264|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  936|  86.8k|	else
  937|  86.8k|		a->archive.state = ARCHIVE_STATE_HEADER;
  ------------------
  |  |   65|  86.8k|#define	ARCHIVE_STATE_HEADER	2U
  ------------------
  938|  87.0k|	return (r);
  939|  87.0k|}
archive_seek_data:
  943|  2.44k|{
  944|  2.44k|	struct archive_read *a = (struct archive_read *)_a;
  945|  2.44k|	la_int64_t r;
  946|       |
  947|  2.44k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_DATA,
  ------------------
  |  |  151|  2.44k|	do { \
  |  |  152|  2.44k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|  2.44k|			(allowed_states), (function_name)); \
  |  |  154|  2.44k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  2.44k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 2.44k, False: 0]
  |  |  ------------------
  |  |  155|  2.44k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|  2.44k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|  2.44k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  948|  2.44k|	    "archive_seek_data_block");
  949|       |
  950|      0|	if (a->format->seek_data == NULL) {
  ------------------
  |  Branch (950:6): [True: 0, False: 0]
  ------------------
  951|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
  952|      0|		    "Internal error: "
  953|      0|		    "No format_seek_data_block function registered");
  954|      0|		a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   69|      0|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  955|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  956|      0|	}
  957|       |
  958|      0|	r = (a->format->seek_data)(a, offset, whence);
  959|      0|	if (r == ARCHIVE_FATAL)
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (959:6): [True: 0, False: 0]
  ------------------
  960|      0|		a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   69|      0|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  961|      0|	return (r);
  962|      0|}
__archive_read_free_filters:
 1019|  2.53k|{
 1020|       |	/* Make sure filters are closed and their buffers are freed */
 1021|  2.53k|	close_filters(a);
 1022|       |
 1023|  5.40k|	while (a->filter != NULL) {
  ------------------
  |  Branch (1023:9): [True: 2.86k, False: 2.53k]
  ------------------
 1024|  2.86k|		struct archive_read_filter *t = a->filter->upstream;
 1025|  2.86k|		free(a->filter);
 1026|  2.86k|		a->filter = t;
 1027|  2.86k|	}
 1028|  2.53k|}
__archive_read_register_format:
 1200|  44.9k|{
 1201|  44.9k|	int i, number_slots;
 1202|       |
 1203|  44.9k|	archive_check_magic(&a->archive,
  ------------------
  |  |  151|  44.9k|	do { \
  |  |  152|  44.9k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|  44.9k|			(allowed_states), (function_name)); \
  |  |  154|  44.9k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  44.9k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 44.9k]
  |  |  ------------------
  |  |  155|  44.9k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|  44.9k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 44.9k]
  |  |  ------------------
  ------------------
 1204|  44.9k|	    ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
 1205|  44.9k|	    "__archive_read_register_format");
 1206|       |
 1207|  44.9k|	number_slots = sizeof(a->formats) / sizeof(a->formats[0]);
 1208|       |
 1209|   362k|	for (i = 0; i < number_slots; i++) {
  ------------------
  |  Branch (1209:14): [True: 362k, False: 0]
  ------------------
 1210|   362k|		if (a->formats[i].bid == bid)
  ------------------
  |  Branch (1210:7): [True: 4.99k, False: 357k]
  ------------------
 1211|  4.99k|			return (ARCHIVE_WARN); /* We've already installed */
  ------------------
  |  |  235|  4.99k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1212|   357k|		if (a->formats[i].bid == NULL) {
  ------------------
  |  Branch (1212:7): [True: 39.9k, False: 317k]
  ------------------
 1213|  39.9k|			a->formats[i].bid = bid;
 1214|  39.9k|			a->formats[i].options = options;
 1215|  39.9k|			a->formats[i].read_header = read_header;
 1216|  39.9k|			a->formats[i].read_data = read_data;
 1217|  39.9k|			a->formats[i].read_data_skip = read_data_skip;
 1218|  39.9k|			a->formats[i].seek_data = seek_data;
 1219|  39.9k|			a->formats[i].cleanup = cleanup;
 1220|  39.9k|			a->formats[i].data = format_data;
 1221|  39.9k|			a->formats[i].name = name;
 1222|  39.9k|			a->formats[i].format_capabilties = format_capabilities;
 1223|  39.9k|			a->formats[i].has_encrypted_entries = has_encrypted_entries;
 1224|  39.9k|			return (ARCHIVE_OK);
  ------------------
  |  |  233|  39.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1225|  39.9k|		}
 1226|   357k|	}
 1227|       |
 1228|      0|	archive_set_error(&a->archive, ENOMEM,
 1229|      0|	    "Not enough slots for format registration");
 1230|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1231|  44.9k|}
__archive_read_register_bidder:
 1242|  32.4k|{
 1243|  32.4k|	struct archive_read_filter_bidder *bidder;
 1244|  32.4k|	int i, number_slots;
 1245|       |
 1246|  32.4k|	archive_check_magic(&a->archive, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  151|  32.4k|	do { \
  |  |  152|  32.4k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|  32.4k|			(allowed_states), (function_name)); \
  |  |  154|  32.4k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  32.4k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 32.4k]
  |  |  ------------------
  |  |  155|  32.4k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|  32.4k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 32.4k]
  |  |  ------------------
  ------------------
 1247|  32.4k|	    ARCHIVE_STATE_NEW, "__archive_read_register_bidder");
 1248|       |
 1249|  32.4k|	number_slots = sizeof(a->bidders) / sizeof(a->bidders[0]);
 1250|       |
 1251|   227k|	for (i = 0; i < number_slots; i++) {
  ------------------
  |  Branch (1251:14): [True: 227k, False: 0]
  ------------------
 1252|   227k|		if (a->bidders[i].vtable != NULL)
  ------------------
  |  Branch (1252:7): [True: 194k, False: 32.4k]
  ------------------
 1253|   194k|			continue;
 1254|  32.4k|		memset(a->bidders + i, 0, sizeof(a->bidders[0]));
 1255|  32.4k|		bidder = (a->bidders + i);
 1256|  32.4k|		bidder->data = bidder_data;
 1257|  32.4k|		bidder->name = name;
 1258|  32.4k|		bidder->vtable = vtable;
 1259|  32.4k|		if (bidder->vtable->bid == NULL || bidder->vtable->init == NULL) {
  ------------------
  |  Branch (1259:7): [True: 0, False: 32.4k]
  |  Branch (1259:38): [True: 0, False: 32.4k]
  ------------------
 1260|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1261|      0|					"Internal error: "
 1262|      0|					"no bid/init for filter bidder");
 1263|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1264|      0|		}
 1265|       |
 1266|  32.4k|		return (ARCHIVE_OK);
  ------------------
  |  |  233|  32.4k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1267|  32.4k|	}
 1268|       |
 1269|      0|	archive_set_error(&a->archive, ENOMEM,
 1270|      0|	    "Not enough slots for filter registration");
 1271|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1272|  32.4k|}
__archive_read_ahead:
 1327|  13.6M|{
 1328|  13.6M|	return (__archive_read_filter_ahead(a->filter, min, avail));
 1329|  13.6M|}
__archive_read_filter_ahead:
 1334|  13.6M|{
 1335|  13.6M|	ssize_t bytes_read;
 1336|  13.6M|	size_t tocopy;
 1337|       |
 1338|  13.6M|	if (filter->fatal) {
  ------------------
  |  Branch (1338:6): [True: 773, False: 13.6M]
  ------------------
 1339|    773|		if (avail)
  ------------------
  |  Branch (1339:7): [True: 703, False: 70]
  ------------------
 1340|    703|			*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|    703|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1341|    773|		return (NULL);
 1342|    773|	}
 1343|       |
 1344|       |	/*
 1345|       |	 * Keep pulling more data until we can satisfy the request.
 1346|       |	 */
 1347|  13.7M|	for (;;) {
 1348|       |
 1349|       |		/*
 1350|       |		 * If we can satisfy from the copy buffer (and the
 1351|       |		 * copy buffer isn't empty), we're done.  In particular,
 1352|       |		 * note that min == 0 is a perfectly well-defined
 1353|       |		 * request.
 1354|       |		 */
 1355|  13.7M|		if (filter->avail >= min && filter->avail > 0) {
  ------------------
  |  Branch (1355:7): [True: 274k, False: 13.4M]
  |  Branch (1355:31): [True: 228k, False: 45.8k]
  ------------------
 1356|   228k|			if (avail != NULL)
  ------------------
  |  Branch (1356:8): [True: 151k, False: 76.9k]
  ------------------
 1357|   151k|				*avail = filter->avail;
 1358|   228k|			return (filter->next);
 1359|   228k|		}
 1360|       |
 1361|       |		/*
 1362|       |		 * We can satisfy directly from client buffer if everything
 1363|       |		 * currently in the copy buffer is still in the client buffer.
 1364|       |		 */
 1365|  13.4M|		if (filter->client_total >= filter->client_avail + filter->avail
  ------------------
  |  Branch (1365:7): [True: 13.4M, False: 11.6k]
  ------------------
 1366|  13.4M|		    && filter->client_avail + filter->avail >= min) {
  ------------------
  |  Branch (1366:10): [True: 13.4M, False: 13.9k]
  ------------------
 1367|       |			/* "Roll back" to client buffer. */
 1368|  13.4M|			filter->client_avail += filter->avail;
 1369|  13.4M|			filter->client_next -= filter->avail;
 1370|       |			/* Copy buffer is now empty. */
 1371|  13.4M|			filter->avail = 0;
 1372|  13.4M|			filter->next = filter->buffer;
 1373|       |			/* Return data from client buffer. */
 1374|  13.4M|			if (avail != NULL)
  ------------------
  |  Branch (1374:8): [True: 13.2M, False: 220k]
  ------------------
 1375|  13.2M|				*avail = filter->client_avail;
 1376|  13.4M|			return (filter->client_next);
 1377|  13.4M|		}
 1378|       |
 1379|       |		/* Move data forward in copy buffer if necessary. */
 1380|  25.5k|		if (filter->next > filter->buffer &&
  ------------------
  |  Branch (1380:7): [True: 3.33k, False: 22.2k]
  ------------------
 1381|  3.33k|		    min > filter->buffer_size - (filter->next - filter->buffer)) {
  ------------------
  |  Branch (1381:7): [True: 1.14k, False: 2.19k]
  ------------------
 1382|  1.14k|			if (filter->avail > 0)
  ------------------
  |  Branch (1382:8): [True: 1.14k, False: 2]
  ------------------
 1383|  1.14k|				memmove(filter->buffer, filter->next,
 1384|  1.14k|				    filter->avail);
 1385|  1.14k|			filter->next = filter->buffer;
 1386|  1.14k|		}
 1387|       |
 1388|       |		/* If we've used up the client data, get more. */
 1389|  25.5k|		if (filter->client_avail <= 0) {
  ------------------
  |  Branch (1389:7): [True: 17.6k, False: 7.95k]
  ------------------
 1390|  17.6k|			if (filter->end_of_file) {
  ------------------
  |  Branch (1390:8): [True: 3.62k, False: 13.9k]
  ------------------
 1391|  3.62k|				if (avail != NULL)
  ------------------
  |  Branch (1391:9): [True: 3.33k, False: 294]
  ------------------
 1392|  3.33k|					*avail = filter->avail;
 1393|  3.62k|				return (NULL);
 1394|  3.62k|			}
 1395|  13.9k|			bytes_read = (filter->vtable->read)(filter,
 1396|  13.9k|			    &filter->client_buff);
 1397|  13.9k|			if (bytes_read < 0) {		/* Read error. */
  ------------------
  |  Branch (1397:8): [True: 98, False: 13.8k]
  ------------------
 1398|     98|				filter->client_total = filter->client_avail = 0;
 1399|     98|				filter->client_next =
 1400|     98|				    filter->client_buff = NULL;
 1401|     98|				filter->fatal = 1;
 1402|     98|				if (avail != NULL)
  ------------------
  |  Branch (1402:9): [True: 96, False: 2]
  ------------------
 1403|     96|					*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|     96|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1404|     98|				return (NULL);
 1405|     98|			}
 1406|  13.8k|			if (bytes_read == 0) {
  ------------------
  |  Branch (1406:8): [True: 2.59k, False: 11.2k]
  ------------------
 1407|       |				/* Check for another client object first */
 1408|  2.59k|				if (filter->archive->client.cursor !=
  ------------------
  |  Branch (1408:9): [True: 0, False: 2.59k]
  ------------------
 1409|  2.59k|				      filter->archive->client.nodes - 1) {
 1410|      0|					if (client_switch_proxy(filter,
  ------------------
  |  Branch (1410:10): [True: 0, False: 0]
  ------------------
 1411|      0|					    filter->archive->client.cursor + 1)
 1412|      0|					    == ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1413|      0|						continue;
 1414|      0|				}
 1415|       |				/* Premature end-of-file. */
 1416|  2.59k|				filter->client_total = filter->client_avail = 0;
 1417|  2.59k|				filter->client_next =
 1418|  2.59k|				    filter->client_buff = NULL;
 1419|  2.59k|				filter->end_of_file = 1;
 1420|       |				/* Return whatever we do have. */
 1421|  2.59k|				if (avail != NULL)
  ------------------
  |  Branch (1421:9): [True: 2.46k, False: 129]
  ------------------
 1422|  2.46k|					*avail = filter->avail;
 1423|  2.59k|				return (NULL);
 1424|  2.59k|			}
 1425|  11.2k|			filter->client_total = bytes_read;
 1426|  11.2k|			filter->client_avail = filter->client_total;
 1427|  11.2k|			filter->client_next = filter->client_buff;
 1428|  11.2k|		} else {
 1429|       |			/*
 1430|       |			 * We can't satisfy the request from the copy
 1431|       |			 * buffer or the existing client data, so we
 1432|       |			 * need to copy more client data over to the
 1433|       |			 * copy buffer.
 1434|       |			 */
 1435|       |
 1436|       |			/* Ensure the buffer is big enough. */
 1437|  7.95k|			if (min > filter->buffer_size) {
  ------------------
  |  Branch (1437:8): [True: 1.89k, False: 6.06k]
  ------------------
 1438|  1.89k|				size_t s, t;
 1439|  1.89k|				char *p;
 1440|       |
 1441|       |				/* Double the buffer; watch for overflow. */
 1442|  1.89k|				s = t = filter->buffer_size;
 1443|  1.89k|				if (s == 0)
  ------------------
  |  Branch (1443:9): [True: 1.67k, False: 215]
  ------------------
 1444|  1.67k|					s = min;
 1445|  2.83k|				while (s < min) {
  ------------------
  |  Branch (1445:12): [True: 945, False: 1.89k]
  ------------------
 1446|    945|					t *= 2;
 1447|    945|					if (t <= s) { /* Integer overflow! */
  ------------------
  |  Branch (1447:10): [True: 3, False: 942]
  ------------------
 1448|      3|						archive_set_error(
 1449|      3|						    &filter->archive->archive,
 1450|      3|						    ENOMEM,
 1451|      3|						    "Unable to allocate copy"
 1452|      3|						    " buffer");
 1453|      3|						filter->fatal = 1;
 1454|      3|						if (avail != NULL)
  ------------------
  |  Branch (1454:11): [True: 3, False: 0]
  ------------------
 1455|      3|							*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      3|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1456|      3|						return (NULL);
 1457|      3|					}
 1458|    942|					s = t;
 1459|    942|				}
 1460|       |				/* Now s >= min, so allocate a new buffer. */
 1461|  1.89k|				p = malloc(s);
 1462|  1.89k|				if (p == NULL) {
  ------------------
  |  Branch (1462:9): [True: 5, False: 1.88k]
  ------------------
 1463|      5|					archive_set_error(
 1464|      5|						&filter->archive->archive,
 1465|      5|						ENOMEM,
 1466|      5|					    "Unable to allocate copy buffer");
 1467|      5|					filter->fatal = 1;
 1468|      5|					if (avail != NULL)
  ------------------
  |  Branch (1468:10): [True: 5, False: 0]
  ------------------
 1469|      5|						*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      5|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1470|      5|					return (NULL);
 1471|      5|				}
 1472|       |				/* Move data into newly-enlarged buffer. */
 1473|  1.88k|				if (filter->avail > 0)
  ------------------
  |  Branch (1473:9): [True: 162, False: 1.72k]
  ------------------
 1474|    162|					memmove(p, filter->next, filter->avail);
 1475|  1.88k|				free(filter->buffer);
 1476|  1.88k|				filter->next = filter->buffer = p;
 1477|  1.88k|				filter->buffer_size = s;
 1478|  1.88k|			}
 1479|       |
 1480|       |			/* We can add client data to copy buffer. */
 1481|       |			/* First estimate: copy to fill rest of buffer. */
 1482|  7.95k|			tocopy = (filter->buffer + filter->buffer_size)
 1483|  7.95k|			    - (filter->next + filter->avail);
 1484|       |			/* Don't waste time buffering more than we need to. */
 1485|  7.95k|			if (tocopy + filter->avail > min)
  ------------------
  |  Branch (1485:8): [True: 4.39k, False: 3.55k]
  ------------------
 1486|  4.39k|				tocopy = min - filter->avail;
 1487|       |			/* Don't copy more than is available. */
 1488|  7.95k|			if (tocopy > filter->client_avail)
  ------------------
  |  Branch (1488:8): [True: 5.15k, False: 2.79k]
  ------------------
 1489|  5.15k|				tocopy = filter->client_avail;
 1490|       |
 1491|  7.95k|			memcpy(filter->next + filter->avail,
 1492|  7.95k|			    filter->client_next, tocopy);
 1493|       |			/* Remove this data from client buffer. */
 1494|  7.95k|			filter->client_next += tocopy;
 1495|  7.95k|			filter->client_avail -= tocopy;
 1496|       |			/* add it to copy buffer. */
 1497|  7.95k|			filter->avail += tocopy;
 1498|  7.95k|		}
 1499|  25.5k|	}
 1500|  13.6M|}
__archive_read_consume:
 1507|  12.8M|{
 1508|  12.8M|	return (__archive_read_filter_consume(a->filter, request));
 1509|  12.8M|}
__archive_read_filter_consume:
 1514|  12.8M|{
 1515|  12.8M|	int64_t skipped;
 1516|       |
 1517|  12.8M|	if (request < 0)
  ------------------
  |  Branch (1517:6): [True: 1.71k, False: 12.8M]
  ------------------
 1518|  1.71k|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|  1.71k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1519|  12.8M|	if (request == 0)
  ------------------
  |  Branch (1519:6): [True: 230k, False: 12.6M]
  ------------------
 1520|   230k|		return 0;
 1521|       |
 1522|  12.6M|	skipped = advance_file_pointer(filter, request);
 1523|  12.6M|	if (skipped == request)
  ------------------
  |  Branch (1523:6): [True: 12.6M, False: 442]
  ------------------
 1524|  12.6M|		return (skipped);
 1525|       |	/* We hit EOF before we satisfied the skip request. */
 1526|    442|	if (skipped < 0)  /* Map error code to 0 for error message below. */
  ------------------
  |  Branch (1526:6): [True: 4, False: 438]
  ------------------
 1527|      4|		skipped = 0;
 1528|    442|	archive_set_error(&filter->archive->archive,
 1529|    442|	    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|    442|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1530|    442|	    "Truncated input file (needed %jd bytes, only %jd available)",
 1531|    442|	    (intmax_t)request, (intmax_t)skipped);
 1532|    442|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    442|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1533|  12.6M|}
__archive_read_seek:
 1630|  3.36k|{
 1631|  3.36k|	return __archive_read_filter_seek(a->filter, offset, whence);
 1632|  3.36k|}
__archive_read_filter_seek:
 1637|  3.36k|{
 1638|  3.36k|	struct archive_read_client *client;
 1639|  3.36k|	int64_t r;
 1640|  3.36k|	unsigned int cursor;
 1641|       |
 1642|  3.36k|	if (filter->closed || filter->fatal)
  ------------------
  |  Branch (1642:6): [True: 0, False: 3.36k]
  |  Branch (1642:24): [True: 17, False: 3.35k]
  ------------------
 1643|     17|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     17|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1644|  3.35k|	if (filter->can_seek == 0)
  ------------------
  |  Branch (1644:6): [True: 60, False: 3.29k]
  ------------------
 1645|     60|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|     60|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1646|       |
 1647|  3.29k|	client = &(filter->archive->client);
 1648|  3.29k|	switch (whence) {
 1649|      0|	case SEEK_CUR:
  ------------------
  |  Branch (1649:2): [True: 0, False: 3.29k]
  ------------------
 1650|       |		/* Adjust the offset and use SEEK_SET instead */
 1651|      0|		offset += filter->position;
 1652|      0|		__LA_FALLTHROUGH;
 1653|    802|	case SEEK_SET:
  ------------------
  |  Branch (1653:2): [True: 802, False: 2.48k]
  ------------------
 1654|    802|		cursor = 0;
 1655|    802|		while (1)
  ------------------
  |  Branch (1655:10): [True: 802, Folded]
  ------------------
 1656|    802|		{
 1657|    802|			if (client->dataset[cursor].begin_position < 0 ||
  ------------------
  |  Branch (1657:8): [True: 0, False: 802]
  ------------------
 1658|    802|			    client->dataset[cursor].total_size < 0 ||
  ------------------
  |  Branch (1658:8): [True: 152, False: 650]
  ------------------
 1659|    650|			    client->dataset[cursor].begin_position +
  ------------------
  |  Branch (1659:8): [True: 650, False: 0]
  ------------------
 1660|    650|			      client->dataset[cursor].total_size - 1 > offset ||
 1661|      0|			    cursor + 1 >= client->nodes)
  ------------------
  |  Branch (1661:8): [True: 0, False: 0]
  ------------------
 1662|    802|				break;
 1663|      0|			r = client->dataset[cursor].begin_position +
 1664|      0|				client->dataset[cursor].total_size;
 1665|      0|			client->dataset[++cursor].begin_position = r;
 1666|      0|		}
 1667|    802|		while (1) {
  ------------------
  |  Branch (1667:10): [True: 802, Folded]
  ------------------
 1668|    802|			r = client_switch_proxy(filter, cursor);
 1669|    802|			if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    802|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1669:8): [True: 0, False: 802]
  ------------------
 1670|      0|				return r;
 1671|    802|			if ((r = client_seek_proxy(filter, 0, SEEK_END)) < 0)
  ------------------
  |  Branch (1671:8): [True: 0, False: 802]
  ------------------
 1672|      0|				return r;
 1673|    802|			client->dataset[cursor].total_size = r;
 1674|    802|			if (client->dataset[cursor].begin_position +
  ------------------
  |  Branch (1674:8): [True: 798, False: 4]
  ------------------
 1675|    802|			    client->dataset[cursor].total_size - 1 > offset ||
 1676|      4|			    cursor + 1 >= client->nodes)
  ------------------
  |  Branch (1676:8): [True: 4, False: 0]
  ------------------
 1677|    802|				break;
 1678|      0|			r = client->dataset[cursor].begin_position +
 1679|      0|				client->dataset[cursor].total_size;
 1680|      0|			client->dataset[++cursor].begin_position = r;
 1681|      0|		}
 1682|    802|		offset -= client->dataset[cursor].begin_position;
 1683|    802|		if (offset < 0
  ------------------
  |  Branch (1683:7): [True: 0, False: 802]
  ------------------
 1684|    802|		    || offset > client->dataset[cursor].total_size)
  ------------------
  |  Branch (1684:10): [True: 4, False: 798]
  ------------------
 1685|      4|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1686|    798|		if ((r = client_seek_proxy(filter, offset, SEEK_SET)) < 0)
  ------------------
  |  Branch (1686:7): [True: 0, False: 798]
  ------------------
 1687|      0|			return r;
 1688|    798|		break;
 1689|       |
 1690|  2.48k|	case SEEK_END:
  ------------------
  |  Branch (1690:2): [True: 2.48k, False: 802]
  ------------------
 1691|  2.48k|		cursor = 0;
 1692|  2.48k|		while (1) {
  ------------------
  |  Branch (1692:10): [True: 2.48k, Folded]
  ------------------
 1693|  2.48k|			if (client->dataset[cursor].begin_position < 0 ||
  ------------------
  |  Branch (1693:8): [True: 0, False: 2.48k]
  ------------------
 1694|  2.48k|			    client->dataset[cursor].total_size < 0 ||
  ------------------
  |  Branch (1694:8): [True: 1.23k, False: 1.25k]
  ------------------
 1695|  1.25k|			    cursor + 1 >= client->nodes)
  ------------------
  |  Branch (1695:8): [True: 1.25k, False: 0]
  ------------------
 1696|  2.48k|				break;
 1697|      0|			r = client->dataset[cursor].begin_position +
 1698|      0|				client->dataset[cursor].total_size;
 1699|      0|			client->dataset[++cursor].begin_position = r;
 1700|      0|		}
 1701|  2.48k|		while (1) {
  ------------------
  |  Branch (1701:10): [True: 2.48k, Folded]
  ------------------
 1702|  2.48k|			r = client_switch_proxy(filter, cursor);
 1703|  2.48k|			if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  2.48k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1703:8): [True: 0, False: 2.48k]
  ------------------
 1704|      0|				return r;
 1705|  2.48k|			if ((r = client_seek_proxy(filter, 0, SEEK_END)) < 0)
  ------------------
  |  Branch (1705:8): [True: 0, False: 2.48k]
  ------------------
 1706|      0|				return r;
 1707|  2.48k|			client->dataset[cursor].total_size = r;
 1708|  2.48k|			r = client->dataset[cursor].begin_position +
 1709|  2.48k|				client->dataset[cursor].total_size;
 1710|  2.48k|			if (cursor + 1 >= client->nodes)
  ------------------
  |  Branch (1710:8): [True: 2.48k, False: 0]
  ------------------
 1711|  2.48k|				break;
 1712|      0|			client->dataset[++cursor].begin_position = r;
 1713|      0|		}
 1714|  2.48k|		while (1) {
  ------------------
  |  Branch (1714:10): [True: 2.48k, Folded]
  ------------------
 1715|  2.48k|			if (r + offset >=
  ------------------
  |  Branch (1715:8): [True: 2.48k, False: 0]
  ------------------
 1716|  2.48k|			    client->dataset[cursor].begin_position)
 1717|  2.48k|				break;
 1718|      0|			offset += client->dataset[cursor].total_size;
 1719|      0|			if (cursor == 0)
  ------------------
  |  Branch (1719:8): [True: 0, False: 0]
  ------------------
 1720|      0|				break;
 1721|      0|			cursor--;
 1722|      0|			r = client->dataset[cursor].begin_position +
 1723|      0|				client->dataset[cursor].total_size;
 1724|      0|		}
 1725|  2.48k|		offset = (r + offset) - client->dataset[cursor].begin_position;
 1726|  2.48k|		if ((r = client_switch_proxy(filter, cursor)) != ARCHIVE_OK)
  ------------------
  |  |  233|  2.48k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1726:7): [True: 0, False: 2.48k]
  ------------------
 1727|      0|			return r;
 1728|  2.48k|		r = client_seek_proxy(filter, offset, SEEK_SET);
 1729|  2.48k|		if (r < ARCHIVE_OK)
  ------------------
  |  |  233|  2.48k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1729:7): [True: 0, False: 2.48k]
  ------------------
 1730|      0|			return r;
 1731|  2.48k|		break;
 1732|       |
 1733|  2.48k|	default:
  ------------------
  |  Branch (1733:2): [True: 0, False: 3.29k]
  ------------------
 1734|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1735|  3.29k|	}
 1736|  3.28k|	r += client->dataset[cursor].begin_position;
 1737|       |
 1738|  3.28k|	if (r >= 0) {
  ------------------
  |  Branch (1738:6): [True: 3.28k, False: 0]
  ------------------
 1739|       |		/*
 1740|       |		 * Ouch.  Clearing the buffer like this hurts, especially
 1741|       |		 * at bid time.  A lot of our efficiency at bid time comes
 1742|       |		 * from having bidders reuse the data we've already read.
 1743|       |		 *
 1744|       |		 * TODO: If the seek request is in data we already
 1745|       |		 * have, then don't call the seek callback.
 1746|       |		 *
 1747|       |		 * TODO: Zip seeks to end-of-file at bid time.  If
 1748|       |		 * other formats also start doing this, we may need to
 1749|       |		 * find a way for clients to fudge the seek offset to
 1750|       |		 * a block boundary.
 1751|       |		 *
 1752|       |		 * Hmmm... If whence was SEEK_END, we know the file
 1753|       |		 * size is (r - offset).  Can we use that to simplify
 1754|       |		 * the TODO items above?
 1755|       |		 */
 1756|  3.28k|		filter->avail = filter->client_avail = 0;
 1757|  3.28k|		filter->next = filter->buffer;
 1758|  3.28k|		filter->position = r;
 1759|  3.28k|		filter->end_of_file = 0;
 1760|  3.28k|	}
 1761|  3.28k|	return r;
 1762|  3.29k|}
archive_read.c:_archive_read_free:
 1077|  2.49k|{
 1078|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
 1079|  2.49k|	struct archive_read_passphrase *p;
 1080|  2.49k|	int i, n;
 1081|  2.49k|	int slots;
 1082|  2.49k|	int r = ARCHIVE_OK;
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1083|       |
 1084|  2.49k|	if (_a == NULL)
  ------------------
  |  Branch (1084:6): [True: 0, False: 2.49k]
  ------------------
 1085|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1086|  2.49k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  151|  2.49k|	do { \
  |  |  152|  2.49k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|  2.49k|			(allowed_states), (function_name)); \
  |  |  154|  2.49k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  2.49k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 2.49k]
  |  |  ------------------
  |  |  155|  2.49k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|  2.49k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 2.49k]
  |  |  ------------------
  ------------------
 1087|  2.49k|	    ARCHIVE_STATE_ANY | ARCHIVE_STATE_FATAL, "archive_read_free");
 1088|  2.49k|	if (a->archive.state != ARCHIVE_STATE_CLOSED
  ------------------
  |  |   68|  4.99k|#define	ARCHIVE_STATE_CLOSED	0x20U
  ------------------
  |  Branch (1088:6): [True: 2.49k, False: 0]
  ------------------
 1089|  2.49k|	    && a->archive.state != ARCHIVE_STATE_FATAL)
  ------------------
  |  |   69|  2.49k|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  |  Branch (1089:9): [True: 0, False: 2.49k]
  ------------------
 1090|      0|		r = archive_read_close(&a->archive);
 1091|       |
 1092|       |	/* Call cleanup functions registered by optional components. */
 1093|  2.49k|	if (a->cleanup_archive_extract != NULL)
  ------------------
  |  Branch (1093:6): [True: 0, False: 2.49k]
  ------------------
 1094|      0|		r = (a->cleanup_archive_extract)(a);
 1095|       |
 1096|       |	/* Cleanup format-specific data. */
 1097|  2.49k|	slots = sizeof(a->formats) / sizeof(a->formats[0]);
 1098|  42.4k|	for (i = 0; i < slots; i++) {
  ------------------
  |  Branch (1098:14): [True: 39.9k, False: 2.49k]
  ------------------
 1099|  39.9k|		a->format = &(a->formats[i]);
 1100|  39.9k|		if (a->formats[i].cleanup)
  ------------------
  |  Branch (1100:7): [True: 37.4k, False: 2.49k]
  ------------------
 1101|  37.4k|			(a->formats[i].cleanup)(a);
 1102|  39.9k|	}
 1103|       |
 1104|       |	/* Free the filters */
 1105|  2.49k|	__archive_read_free_filters(a);
 1106|       |
 1107|       |	/* Release the bidder objects. */
 1108|  2.49k|	n = sizeof(a->bidders)/sizeof(a->bidders[0]);
 1109|  42.4k|	for (i = 0; i < n; i++) {
  ------------------
  |  Branch (1109:14): [True: 39.9k, False: 2.49k]
  ------------------
 1110|  39.9k|		if (a->bidders[i].vtable == NULL ||
  ------------------
  |  Branch (1110:7): [True: 7.49k, False: 32.4k]
  ------------------
 1111|  32.4k|		    a->bidders[i].vtable->free == NULL)
  ------------------
  |  Branch (1111:7): [True: 32.4k, False: 0]
  ------------------
 1112|  39.9k|			continue;
 1113|      0|		(a->bidders[i].vtable->free)(&a->bidders[i]);
 1114|      0|	}
 1115|       |
 1116|       |	/* Release passphrase list. */
 1117|  2.49k|	p = a->passphrases.first;
 1118|  4.99k|	while (p != NULL) {
  ------------------
  |  Branch (1118:9): [True: 2.49k, False: 2.49k]
  ------------------
 1119|  2.49k|		struct archive_read_passphrase *np = p->next;
 1120|       |
 1121|       |		/* A passphrase should be cleaned. */
 1122|  2.49k|		memset(p->passphrase, 0, strlen(p->passphrase));
 1123|  2.49k|		free(p->passphrase);
 1124|  2.49k|		free(p);
 1125|  2.49k|		p = np;
 1126|  2.49k|	}
 1127|       |
 1128|  2.49k|	archive_string_free(&a->archive.error_string);
 1129|  2.49k|	archive_entry_free(a->entry);
 1130|  2.49k|	a->archive.magic = 0;
 1131|  2.49k|	__archive_clean(&a->archive);
 1132|  2.49k|	free(a->client.dataset);
 1133|  2.49k|	free(a);
 1134|  2.49k|	return (r);
 1135|  2.49k|}
archive_read.c:_archive_read_next_header:
  670|   301k|{
  671|   301k|	int ret;
  672|   301k|	struct archive_read *a = (struct archive_read *)_a;
  673|       |	*entryp = NULL;
  674|   301k|	ret = _archive_read_next_header2(_a, a->entry);
  675|   301k|	*entryp = a->entry;
  676|   301k|	return ret;
  677|   301k|}
archive_read.c:_archive_read_next_header2:
  606|   301k|{
  607|   301k|	struct archive_read *a = (struct archive_read *)_a;
  608|   301k|	int r1 = ARCHIVE_OK, r2;
  ------------------
  |  |  233|   301k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  609|       |
  610|   301k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  151|   301k|	do { \
  |  |  152|   301k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|   301k|			(allowed_states), (function_name)); \
  |  |  154|   301k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|   301k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 301k]
  |  |  ------------------
  |  |  155|   301k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|   301k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 301k]
  |  |  ------------------
  ------------------
  611|   301k|	    ARCHIVE_STATE_HEADER | ARCHIVE_STATE_DATA,
  612|   301k|	    "archive_read_next_header");
  613|       |
  614|   301k|	archive_entry_clear(entry);
  615|   301k|	archive_clear_error(&a->archive);
  616|       |
  617|       |	/*
  618|       |	 * If client didn't consume entire data, skip any remainder
  619|       |	 * (This is especially important for GNU incremental directories.)
  620|       |	 */
  621|   301k|	if (a->archive.state == ARCHIVE_STATE_DATA) {
  ------------------
  |  |   66|   301k|#define	ARCHIVE_STATE_DATA	4U
  ------------------
  |  Branch (621:6): [True: 87.0k, False: 214k]
  ------------------
  622|  87.0k|		r1 = archive_read_data_skip(&a->archive);
  623|  87.0k|		if (r1 == ARCHIVE_EOF)
  ------------------
  |  |  232|  87.0k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (623:7): [True: 0, False: 87.0k]
  ------------------
  624|      0|			archive_set_error(&a->archive, EIO,
  625|      0|			    "Premature end-of-file");
  626|  87.0k|		if (r1 == ARCHIVE_EOF || r1 == ARCHIVE_FATAL) {
  ------------------
  |  |  232|   174k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
              		if (r1 == ARCHIVE_EOF || r1 == ARCHIVE_FATAL) {
  ------------------
  |  |  239|  87.0k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (626:7): [True: 0, False: 87.0k]
  |  Branch (626:28): [True: 264, False: 86.8k]
  ------------------
  627|    264|			a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   69|    264|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  628|    264|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    264|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  629|    264|		}
  630|  87.0k|	}
  631|       |
  632|       |	/* Record start-of-header offset in uncompressed stream. */
  633|   301k|	a->header_position = a->filter->position;
  634|       |
  635|   301k|	++_a->file_count;
  636|   301k|	r2 = (a->format->read_header)(a, entry);
  637|       |
  638|       |	/*
  639|       |	 * EOF and FATAL are persistent at this layer.  By
  640|       |	 * modifying the state, we guarantee that future calls to
  641|       |	 * read a header or read data will fail.
  642|       |	 */
  643|   301k|	switch (r2) {
  ------------------
  |  Branch (643:10): [True: 301k, False: 10]
  ------------------
  644|    350|	case ARCHIVE_EOF:
  ------------------
  |  |  232|    350|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (644:2): [True: 350, False: 301k]
  ------------------
  645|    350|		a->archive.state = ARCHIVE_STATE_EOF;
  ------------------
  |  |   67|    350|#define	ARCHIVE_STATE_EOF	0x10U
  ------------------
  646|    350|		--_a->file_count;/* Revert a file counter. */
  647|    350|		break;
  648|  74.1k|	case ARCHIVE_OK:
  ------------------
  |  |  233|  74.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (648:2): [True: 74.1k, False: 227k]
  ------------------
  649|  74.1k|		a->archive.state = ARCHIVE_STATE_DATA;
  ------------------
  |  |   66|  74.1k|#define	ARCHIVE_STATE_DATA	4U
  ------------------
  650|  74.1k|		break;
  651|  13.3k|	case ARCHIVE_WARN:
  ------------------
  |  |  235|  13.3k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (651:2): [True: 13.3k, False: 288k]
  ------------------
  652|  13.3k|		a->archive.state = ARCHIVE_STATE_DATA;
  ------------------
  |  |   66|  13.3k|#define	ARCHIVE_STATE_DATA	4U
  ------------------
  653|  13.3k|		break;
  654|   212k|	case ARCHIVE_RETRY:
  ------------------
  |  |  234|   212k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  |  Branch (654:2): [True: 212k, False: 89.2k]
  ------------------
  655|   212k|		break;
  656|  1.42k|	case ARCHIVE_FATAL:
  ------------------
  |  |  239|  1.42k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (656:2): [True: 1.42k, False: 300k]
  ------------------
  657|  1.42k|		a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   69|  1.42k|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  658|  1.42k|		break;
  659|   301k|	}
  660|       |
  661|   301k|	__archive_reset_read_data(&a->archive);
  662|       |
  663|   301k|	a->data_start_node = a->client.cursor;
  664|       |	/* EOF always wins; otherwise return the worst error. */
  665|   301k|	return (r2 < r1 || r2 == ARCHIVE_EOF) ? r2 : r1;
  ------------------
  |  |  232|  74.6k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (665:10): [True: 226k, False: 74.6k]
  |  Branch (665:21): [True: 350, False: 74.3k]
  ------------------
  666|   301k|}
archive_read.c:_archive_read_data_block:
  975|   159k|{
  976|   159k|	struct archive_read *a = (struct archive_read *)_a;
  977|   159k|	int r;
  978|       |
  979|   159k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_DATA,
  ------------------
  |  |  151|   159k|	do { \
  |  |  152|   159k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|   159k|			(allowed_states), (function_name)); \
  |  |  154|   159k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|   159k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 10, False: 159k]
  |  |  ------------------
  |  |  155|   159k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|     10|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|   159k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 159k]
  |  |  ------------------
  ------------------
  980|   159k|	    "archive_read_data_block");
  981|       |
  982|   159k|	if (a->format->read_data == NULL) {
  ------------------
  |  Branch (982:6): [True: 0, False: 159k]
  ------------------
  983|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
  984|      0|		    "Internal error: "
  985|      0|		    "No format->read_data function registered");
  986|      0|		a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   69|      0|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  987|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  988|      0|	}
  989|       |
  990|   159k|	r = (a->format->read_data)(a, buff, size, offset);
  991|   159k|	if (r == ARCHIVE_FATAL)
  ------------------
  |  |  239|   159k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (991:6): [True: 390, False: 158k]
  ------------------
  992|    390|		a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   69|    390|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  993|   159k|	return (r);
  994|   159k|}
archive_read.c:_archive_filter_bytes:
 1178|    263|{
 1179|    263|	struct archive_read_filter *f = get_filter(_a, n);
 1180|    263|	return f == NULL ? -1 : f->position;
  ------------------
  |  Branch (1180:9): [True: 0, False: 263]
  ------------------
 1181|    263|}
archive_read.c:get_filter:
 1139|    263|{
 1140|    263|	struct archive_read *a = (struct archive_read *)_a;
 1141|    263|	struct archive_read_filter *f = a->filter;
 1142|       |	/* We use n == -1 for 'the last filter', which is always the
 1143|       |	 * client proxy. */
 1144|    263|	if (n == -1 && f != NULL) {
  ------------------
  |  Branch (1144:6): [True: 0, False: 263]
  |  Branch (1144:17): [True: 0, False: 0]
  ------------------
 1145|      0|		struct archive_read_filter *last = f;
 1146|      0|		f = f->upstream;
 1147|      0|		while (f != NULL) {
  ------------------
  |  Branch (1147:10): [True: 0, False: 0]
  ------------------
 1148|      0|			last = f;
 1149|      0|			f = f->upstream;
 1150|      0|		}
 1151|      0|		return (last);
 1152|      0|	}
 1153|    263|	if (n < 0)
  ------------------
  |  Branch (1153:6): [True: 0, False: 263]
  ------------------
 1154|      0|		return NULL;
 1155|    263|	while (n > 0 && f != NULL) {
  ------------------
  |  Branch (1155:9): [True: 0, False: 263]
  |  Branch (1155:18): [True: 0, False: 0]
  ------------------
 1156|      0|		f = f->upstream;
 1157|      0|		--n;
 1158|      0|	}
 1159|    263|	return (f);
 1160|    263|}
archive_read.c:read_client_close_proxy:
  233|  2.49k|{
  234|  2.49k|	int r = ARCHIVE_OK, r2;
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  235|  2.49k|	unsigned int i;
  236|       |
  237|  2.49k|	if (a->client.closer == NULL)
  ------------------
  |  Branch (237:6): [True: 0, False: 2.49k]
  ------------------
  238|      0|		return (r);
  239|  4.99k|	for (i = 0; i < a->client.nodes; i++)
  ------------------
  |  Branch (239:14): [True: 2.49k, False: 2.49k]
  ------------------
  240|  2.49k|	{
  241|  2.49k|		r2 = (a->client.closer)
  242|  2.49k|			((struct archive *)a, a->client.dataset[i].data);
  243|  2.49k|		if (r > r2)
  ------------------
  |  Branch (243:7): [True: 0, False: 2.49k]
  ------------------
  244|      0|			r = r2;
  245|  2.49k|	}
  246|  2.49k|	return (r);
  247|  2.49k|}
archive_read.c:client_read_proxy:
  163|  7.31k|{
  164|  7.31k|	ssize_t r;
  165|  7.31k|	r = (self->archive->client.reader)(&self->archive->archive,
  166|  7.31k|	    self->data, buff);
  167|  7.31k|	return (r);
  168|  7.31k|}
archive_read.c:client_close_proxy:
  251|  2.49k|{
  252|  2.49k|	return read_client_close_proxy(self->archive);
  253|  2.49k|}
archive_read.c:client_switch_proxy:
  257|  8.22k|{
  258|  8.22k|	struct archive_read *a;
  259|  8.22k|	int r1 = ARCHIVE_OK, r2 = ARCHIVE_OK;
  ------------------
  |  |  233|  8.22k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
              	int r1 = ARCHIVE_OK, r2 = ARCHIVE_OK;
  ------------------
  |  |  233|  8.22k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  260|  8.22k|	void *data2;
  261|       |
  262|  8.51k|	while (self->upstream != NULL)
  ------------------
  |  Branch (262:9): [True: 292, False: 8.22k]
  ------------------
  263|    292|		self = self->upstream;
  264|  8.22k|	a = self->archive;
  265|       |
  266|       |	/* Don't do anything if already in the specified data node */
  267|  8.22k|	if (a->client.cursor == iindex)
  ------------------
  |  Branch (267:6): [True: 8.22k, False: 0]
  ------------------
  268|  8.22k|		return (ARCHIVE_OK);
  ------------------
  |  |  233|  8.22k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  269|       |
  270|      0|	a->client.cursor = iindex;
  271|      0|	data2 = a->client.dataset[a->client.cursor].data;
  272|      0|	if (a->client.switcher != NULL)
  ------------------
  |  Branch (272:6): [True: 0, False: 0]
  ------------------
  273|      0|	{
  274|      0|		r1 = r2 = (a->client.switcher)
  275|      0|			((struct archive *)a, self->data, data2);
  276|      0|		self->data = data2;
  277|      0|	}
  278|      0|	else
  279|      0|	{
  280|       |		/* Attempt to call close and open instead */
  281|      0|		if (a->client.closer != NULL)
  ------------------
  |  Branch (281:7): [True: 0, False: 0]
  ------------------
  282|      0|			r1 = (a->client.closer)
  283|      0|				((struct archive *)a, self->data);
  284|      0|		self->data = data2;
  285|      0|		if (a->client.opener != NULL)
  ------------------
  |  Branch (285:7): [True: 0, False: 0]
  ------------------
  286|      0|			r2 = (a->client.opener)
  287|      0|				((struct archive *)a, self->data);
  288|      0|	}
  289|      0|	return (r1 < r2) ? r1 : r2;
  ------------------
  |  Branch (289:9): [True: 0, False: 0]
  ------------------
  290|  8.22k|}
archive_read.c:choose_filters:
  540|  2.49k|{
  541|  2.49k|	int number_bidders, i, bid, best_bid, number_filters;
  542|  2.49k|	struct archive_read_filter_bidder *bidder, *best_bidder;
  543|  2.49k|	struct archive_read_filter *filter;
  544|  2.49k|	ssize_t avail;
  545|  2.49k|	int r;
  546|       |
  547|  2.86k|	for (number_filters = 0; number_filters < MAX_NUMBER_FILTERS; ++number_filters) {
  ------------------
  |  |  536|  2.86k|#define MAX_NUMBER_FILTERS 25
  ------------------
  |  Branch (547:27): [True: 2.86k, False: 0]
  ------------------
  548|  2.86k|		number_bidders = sizeof(a->bidders) / sizeof(a->bidders[0]);
  549|       |
  550|  2.86k|		best_bid = 0;
  551|  2.86k|		best_bidder = NULL;
  552|       |
  553|  2.86k|		bidder = a->bidders;
  554|  48.7k|		for (i = 0; i < number_bidders; i++, bidder++) {
  ------------------
  |  Branch (554:15): [True: 45.8k, False: 2.86k]
  ------------------
  555|  45.8k|			if (bidder->vtable == NULL)
  ------------------
  |  Branch (555:8): [True: 8.59k, False: 37.2k]
  ------------------
  556|  8.59k|				continue;
  557|  37.2k|			bid = (bidder->vtable->bid)(bidder, a->filter);
  558|  37.2k|			if (bid > best_bid) {
  ------------------
  |  Branch (558:8): [True: 367, False: 36.8k]
  ------------------
  559|    367|				best_bid = bid;
  560|    367|				best_bidder = bidder;
  561|    367|			}
  562|  37.2k|		}
  563|       |
  564|       |		/* If no bidder, we're done. */
  565|  2.86k|		if (best_bidder == NULL) {
  ------------------
  |  Branch (565:7): [True: 2.49k, False: 367]
  ------------------
  566|       |			/* Verify the filter by asking it for some data. */
  567|  2.49k|			__archive_read_filter_ahead(a->filter, 1, &avail);
  568|  2.49k|			if (avail < 0) {
  ------------------
  |  Branch (568:8): [True: 39, False: 2.46k]
  ------------------
  569|     39|				__archive_read_free_filters(a);
  570|     39|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     39|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  571|     39|			}
  572|  2.46k|			return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.46k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  573|  2.49k|		}
  574|       |
  575|    367|		filter = calloc(1, sizeof(*filter));
  576|    367|		if (filter == NULL)
  ------------------
  |  Branch (576:7): [True: 0, False: 367]
  ------------------
  577|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  578|    367|		filter->bidder = best_bidder;
  579|    367|		filter->archive = a;
  580|    367|		filter->upstream = a->filter;
  581|    367|		a->filter = filter;
  582|    367|		r = (best_bidder->vtable->init)(a->filter);
  583|    367|		if (r != ARCHIVE_OK) {
  ------------------
  |  |  233|    367|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (583:7): [True: 0, False: 367]
  ------------------
  584|      0|			__archive_read_free_filters(a);
  585|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  586|      0|		}
  587|    367|	}
  588|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  589|      0|	    "Input requires too many filters for decoding");
  590|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  591|  2.49k|}
archive_read.c:choose_format:
  685|  2.46k|{
  686|  2.46k|	int slots;
  687|  2.46k|	int i;
  688|  2.46k|	int bid, best_bid;
  689|  2.46k|	int best_bid_slot;
  690|       |
  691|  2.46k|	slots = sizeof(a->formats) / sizeof(a->formats[0]);
  692|  2.46k|	best_bid = -1;
  693|  2.46k|	best_bid_slot = -1;
  694|       |
  695|       |	/* Set up a->format for convenience of bidders. */
  696|  2.46k|	a->format = &(a->formats[0]);
  697|  41.8k|	for (i = 0; i < slots; i++, a->format++) {
  ------------------
  |  Branch (697:14): [True: 39.3k, False: 2.46k]
  ------------------
  698|  39.3k|		if (a->format->bid) {
  ------------------
  |  Branch (698:7): [True: 39.3k, False: 0]
  ------------------
  699|  39.3k|			bid = (a->format->bid)(a, best_bid);
  700|  39.3k|			if (bid == ARCHIVE_FATAL)
  ------------------
  |  |  239|  39.3k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (700:8): [True: 0, False: 39.3k]
  ------------------
  701|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  702|  39.3k|			if (a->filter->position != 0)
  ------------------
  |  Branch (702:8): [True: 547, False: 38.8k]
  ------------------
  703|    547|				__archive_read_seek(a, 0, SEEK_SET);
  704|  39.3k|			if ((bid > best_bid) || (best_bid_slot < 0)) {
  ------------------
  |  Branch (704:8): [True: 4.94k, False: 34.4k]
  |  Branch (704:28): [True: 2.44k, False: 31.9k]
  ------------------
  705|  7.38k|				best_bid = bid;
  706|  7.38k|				best_bid_slot = i;
  707|  7.38k|			}
  708|  39.3k|		}
  709|  39.3k|	}
  710|       |
  711|       |	/*
  712|       |	 * There were no bidders; this is a serious programmer error
  713|       |	 * and demands a quick and definitive abort.
  714|       |	 */
  715|  2.46k|	if (best_bid_slot < 0) {
  ------------------
  |  Branch (715:6): [True: 0, False: 2.46k]
  ------------------
  716|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  717|      0|		    "No formats registered");
  718|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  719|      0|	}
  720|       |
  721|       |	/*
  722|       |	 * There were bidders, but no non-zero bids; this means we
  723|       |	 * can't support this stream.
  724|       |	 */
  725|  2.46k|	if (best_bid < 1) {
  ------------------
  |  Branch (725:6): [True: 17, False: 2.44k]
  ------------------
  726|     17|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     17|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  727|     17|		    "Unrecognized archive format");
  728|     17|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     17|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  729|     17|	}
  730|       |
  731|  2.44k|	return (best_bid_slot);
  732|  2.46k|}
archive_read.c:close_filters:
  998|  2.55k|{
  999|  2.55k|	struct archive_read_filter *f = a->filter;
 1000|  2.55k|	int r = ARCHIVE_OK;
  ------------------
  |  |  233|  2.55k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1001|       |	/* Close each filter in the pipeline. */
 1002|  5.45k|	while (f != NULL) {
  ------------------
  |  Branch (1002:9): [True: 2.90k, False: 2.55k]
  ------------------
 1003|  2.90k|		struct archive_read_filter *t = f->upstream;
 1004|  2.90k|		if (!f->closed && f->vtable != NULL) {
  ------------------
  |  Branch (1004:7): [True: 2.86k, False: 35]
  |  Branch (1004:21): [True: 2.86k, False: 0]
  ------------------
 1005|  2.86k|			int r1 = (f->vtable->close)(f);
 1006|  2.86k|			f->closed = 1;
 1007|  2.86k|			if (r1 < r)
  ------------------
  |  Branch (1007:8): [True: 0, False: 2.86k]
  ------------------
 1008|      0|				r = r1;
 1009|  2.86k|		}
 1010|  2.90k|		free(f->buffer);
 1011|       |		f->buffer = NULL;
 1012|  2.90k|		f = t;
 1013|  2.90k|	}
 1014|  2.55k|	return r;
 1015|  2.55k|}
archive_read.c:advance_file_pointer:
 1543|  12.6M|{
 1544|  12.6M|	int64_t bytes_skipped, total_bytes_skipped = 0;
 1545|  12.6M|	ssize_t bytes_read;
 1546|  12.6M|	size_t min;
 1547|       |
 1548|  12.6M|	if (filter->fatal)
  ------------------
  |  Branch (1548:6): [True: 1, False: 12.6M]
  ------------------
 1549|      1|		return (-1);
 1550|       |
 1551|       |	/* Use up the copy buffer first. */
 1552|  12.6M|	if (filter->avail > 0) {
  ------------------
  |  Branch (1552:6): [True: 203k, False: 12.4M]
  ------------------
 1553|   203k|		min = (size_t)minimum(request, (int64_t)filter->avail);
  ------------------
  |  |   55|   203k|#define minimum(a, b) (a < b ? a : b)
  |  |  ------------------
  |  |  |  Branch (55:24): [True: 203k, False: 205]
  |  |  ------------------
  ------------------
 1554|   203k|		filter->next += min;
 1555|   203k|		filter->avail -= min;
 1556|   203k|		request -= min;
 1557|   203k|		filter->position += min;
 1558|   203k|		total_bytes_skipped += min;
 1559|   203k|	}
 1560|       |
 1561|       |	/* Then use up the client buffer. */
 1562|  12.6M|	if (filter->client_avail > 0) {
  ------------------
  |  Branch (1562:6): [True: 12.4M, False: 200k]
  ------------------
 1563|  12.4M|		min = (size_t)minimum(request, (int64_t)filter->client_avail);
  ------------------
  |  |   55|  12.4M|#define minimum(a, b) (a < b ? a : b)
  |  |  ------------------
  |  |  |  Branch (55:24): [True: 12.4M, False: 4.39k]
  |  |  ------------------
  ------------------
 1564|  12.4M|		filter->client_next += min;
 1565|  12.4M|		filter->client_avail -= min;
 1566|  12.4M|		request -= min;
 1567|  12.4M|		filter->position += min;
 1568|  12.4M|		total_bytes_skipped += min;
 1569|  12.4M|	}
 1570|  12.6M|	if (request == 0)
  ------------------
  |  Branch (1570:6): [True: 12.6M, False: 520]
  ------------------
 1571|  12.6M|		return (total_bytes_skipped);
 1572|       |
 1573|       |	/* If there's an optimized skip function, use it. */
 1574|    520|	if (filter->can_skip != 0) {
  ------------------
  |  Branch (1574:6): [True: 433, False: 87]
  ------------------
 1575|    433|		bytes_skipped = client_skip_proxy(filter, request);
 1576|    433|		if (bytes_skipped < 0) {	/* error */
  ------------------
  |  Branch (1576:7): [True: 0, False: 433]
  ------------------
 1577|      0|			filter->fatal = 1;
 1578|      0|			return (bytes_skipped);
 1579|      0|		}
 1580|    433|		filter->position += bytes_skipped;
 1581|    433|		total_bytes_skipped += bytes_skipped;
 1582|    433|		request -= bytes_skipped;
 1583|    433|		if (request == 0)
  ------------------
  |  Branch (1583:7): [True: 0, False: 433]
  ------------------
 1584|      0|			return (total_bytes_skipped);
 1585|    433|	}
 1586|       |
 1587|       |	/* Use ordinary reads as necessary to complete the request. */
 1588|    852|	for (;;) {
 1589|    852|		bytes_read = (filter->vtable->read)(filter, &filter->client_buff);
 1590|    852|		if (bytes_read < 0) {
  ------------------
  |  Branch (1590:7): [True: 3, False: 849]
  ------------------
 1591|      3|			filter->client_buff = NULL;
 1592|      3|			filter->fatal = 1;
 1593|      3|			return (bytes_read);
 1594|      3|		}
 1595|       |
 1596|    849|		if (bytes_read == 0) {
  ------------------
  |  Branch (1596:7): [True: 438, False: 411]
  ------------------
 1597|    438|			if (filter->archive->client.cursor !=
  ------------------
  |  Branch (1597:8): [True: 0, False: 438]
  ------------------
 1598|    438|			      filter->archive->client.nodes - 1) {
 1599|      0|				if (client_switch_proxy(filter,
  ------------------
  |  Branch (1599:9): [True: 0, False: 0]
  ------------------
 1600|      0|				    filter->archive->client.cursor + 1)
 1601|      0|				    == ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1602|      0|					continue;
 1603|      0|			}
 1604|    438|			filter->client_buff = NULL;
 1605|    438|			filter->end_of_file = 1;
 1606|    438|			return (total_bytes_skipped);
 1607|    438|		}
 1608|       |
 1609|    411|		if (bytes_read >= request) {
  ------------------
  |  Branch (1609:7): [True: 79, False: 332]
  ------------------
 1610|     79|			filter->client_next =
 1611|     79|			    ((const char *)filter->client_buff) + request;
 1612|     79|			filter->client_avail = (size_t)(bytes_read - request);
 1613|     79|			filter->client_total = bytes_read;
 1614|     79|			total_bytes_skipped += request;
 1615|     79|			filter->position += request;
 1616|     79|			return (total_bytes_skipped);
 1617|     79|		}
 1618|       |
 1619|    332|		filter->position += bytes_read;
 1620|    332|		total_bytes_skipped += bytes_read;
 1621|    332|		request -= bytes_read;
 1622|    332|	}
 1623|    520|}
archive_read.c:client_skip_proxy:
  172|    433|{
  173|    433|	if (request < 0)
  ------------------
  |  Branch (173:6): [True: 0, False: 433]
  ------------------
  174|      0|		__archive_errx(1, "Negative skip requested");
  175|    433|	if (request == 0)
  ------------------
  |  Branch (175:6): [True: 0, False: 433]
  ------------------
  176|      0|		return 0;
  177|       |
  178|    433|	if (self->archive->client.skipper != NULL) {
  ------------------
  |  Branch (178:6): [True: 433, False: 0]
  ------------------
  179|    433|		int64_t total = 0;
  180|    433|		for (;;) {
  181|    433|			int64_t get, ask = request;
  182|    433|			get = (self->archive->client.skipper)
  183|    433|				(&self->archive->archive, self->data, ask);
  184|    433|			total += get;
  185|    433|			if (get == 0 || get == request)
  ------------------
  |  Branch (185:8): [True: 433, False: 0]
  |  Branch (185:20): [True: 0, False: 0]
  ------------------
  186|    433|				return (total);
  187|      0|			if (get > request)
  ------------------
  |  Branch (187:8): [True: 0, False: 0]
  ------------------
  188|      0|				return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  189|      0|			request -= get;
  190|      0|		}
  191|    433|	} else if (self->archive->client.seeker != NULL
  ------------------
  |  Branch (191:13): [True: 0, False: 0]
  ------------------
  192|      0|		&& request > 64 * 1024) {
  ------------------
  |  Branch (192:6): [True: 0, False: 0]
  ------------------
  193|       |		/* If the client provided a seeker but not a skipper,
  194|       |		 * we can use the seeker to skip forward.
  195|       |		 *
  196|       |		 * Note: This isn't always a good idea.  The client
  197|       |		 * skipper is allowed to skip by less than requested
  198|       |		 * if it needs to maintain block alignment.  The
  199|       |		 * seeker is not allowed to play such games, so using
  200|       |		 * the seeker here may be a performance loss compared
  201|       |		 * to just reading and discarding.  That's why we
  202|       |		 * only do this for skips of over 64k.
  203|       |		 */
  204|      0|		int64_t before = self->position;
  205|      0|		int64_t after = (self->archive->client.seeker)
  206|      0|		    (&self->archive->archive, self->data, request, SEEK_CUR);
  207|      0|		if (after != before + request)
  ------------------
  |  Branch (207:7): [True: 0, False: 0]
  ------------------
  208|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  209|      0|		return after - before;
  210|      0|	}
  211|      0|	return 0;
  212|    433|}
archive_read.c:client_seek_proxy:
  216|  6.57k|{
  217|       |	/* DO NOT use the skipper here!  If we transparently handled
  218|       |	 * forward seek here by using the skipper, that will break
  219|       |	 * other libarchive code that assumes a successful forward
  220|       |	 * seek means it can also seek backwards.
  221|       |	 */
  222|  6.57k|	if (self->archive->client.seeker == NULL) {
  ------------------
  |  Branch (222:6): [True: 0, False: 6.57k]
  ------------------
  223|      0|		archive_set_error(&self->archive->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  224|      0|		    "Current client reader does not support seeking a device");
  225|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  226|      0|	}
  227|  6.57k|	return (self->archive->client.seeker)(&self->archive->archive,
  228|  6.57k|	    self->data, offset, whence);
  229|  6.57k|}

archive_read_add_passphrase:
   88|  2.49k|{
   89|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
   90|  2.49k|	struct archive_read_passphrase *p;
   91|       |
   92|  2.49k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
  ------------------
  |  |  151|  2.49k|	do { \
  |  |  152|  2.49k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|  2.49k|			(allowed_states), (function_name)); \
  |  |  154|  2.49k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  2.49k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 2.49k]
  |  |  ------------------
  |  |  155|  2.49k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|  2.49k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 2.49k]
  |  |  ------------------
  ------------------
   93|  2.49k|		"archive_read_add_passphrase");
   94|       |
   95|  2.49k|	if (passphrase == NULL || passphrase[0] == '\0') {
  ------------------
  |  Branch (95:6): [True: 0, False: 2.49k]
  |  Branch (95:28): [True: 0, False: 2.49k]
  ------------------
   96|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
   97|      0|		    "Empty passphrase is unacceptable");
   98|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
   99|      0|	}
  100|       |
  101|  2.49k|	p = new_read_passphrase(a, passphrase);
  102|  2.49k|	if (p == NULL)
  ------------------
  |  Branch (102:6): [True: 0, False: 2.49k]
  ------------------
  103|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  104|  2.49k|	add_passphrase_to_tail(a, p);
  105|       |
  106|  2.49k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  107|  2.49k|}
__archive_read_reset_passphrase:
  129|  35.7k|{
  130|       |
  131|  35.7k|	a->passphrases.candidate = -1;
  132|  35.7k|}
__archive_read_next_passphrase:
  139|  9.89k|{
  140|  9.89k|	struct archive_read_passphrase *p;
  141|  9.89k|	const char *passphrase;
  142|       |
  143|  9.89k|	if (a->passphrases.candidate < 0) {
  ------------------
  |  Branch (143:6): [True: 6.31k, False: 3.57k]
  ------------------
  144|       |		/* Count out how many passphrases we have. */
  145|  6.31k|		int cnt = 0;
  146|       |
  147|  12.6k|		for (p = a->passphrases.first; p != NULL; p = p->next)
  ------------------
  |  Branch (147:34): [True: 6.31k, False: 6.31k]
  ------------------
  148|  6.31k|			cnt++;
  149|  6.31k|		a->passphrases.candidate = cnt;
  150|  6.31k|		p = a->passphrases.first;
  151|  6.31k|	} else if (a->passphrases.candidate > 1) {
  ------------------
  |  Branch (151:13): [True: 0, False: 3.57k]
  ------------------
  152|       |		/* Rotate a passphrase list. */
  153|      0|		a->passphrases.candidate--;
  154|      0|		p = remove_passphrases_from_head(a);
  155|      0|		add_passphrase_to_tail(a, p);
  156|       |		/* Pick a new passphrase candidate up. */
  157|      0|		p = a->passphrases.first;
  158|  3.57k|	} else if (a->passphrases.candidate == 1) {
  ------------------
  |  Branch (158:13): [True: 2.18k, False: 1.39k]
  ------------------
  159|       |		/* This case is that all candidates failed to decrypt. */
  160|  2.18k|		a->passphrases.candidate = 0;
  161|  2.18k|		if (a->passphrases.first->next != NULL) {
  ------------------
  |  Branch (161:7): [True: 0, False: 2.18k]
  ------------------
  162|       |			/* Rotate a passphrase list. */
  163|      0|			p = remove_passphrases_from_head(a);
  164|      0|			add_passphrase_to_tail(a, p);
  165|      0|		}
  166|  2.18k|		p = NULL;
  167|  2.18k|	} else  /* There is no passphrase candidate. */
  168|  1.39k|		p = NULL;
  169|       |
  170|  9.89k|	if (p != NULL)
  ------------------
  |  Branch (170:6): [True: 6.31k, False: 3.57k]
  ------------------
  171|  6.31k|		passphrase = p->passphrase;
  172|  3.57k|	else if (a->passphrases.callback != NULL) {
  ------------------
  |  Branch (172:11): [True: 0, False: 3.57k]
  ------------------
  173|       |		/* Get a passphrase through a call-back function
  174|       |		 * since we tried all passphrases out or we don't
  175|       |		 * have it. */
  176|      0|		passphrase = a->passphrases.callback(&a->archive,
  177|      0|		    a->passphrases.client_data);
  178|      0|		if (passphrase != NULL) {
  ------------------
  |  Branch (178:7): [True: 0, False: 0]
  ------------------
  179|      0|			p = new_read_passphrase(a, passphrase);
  180|      0|			if (p == NULL)
  ------------------
  |  Branch (180:8): [True: 0, False: 0]
  ------------------
  181|      0|				return (NULL);
  182|      0|			insert_passphrase_to_head(a, p);
  183|      0|			a->passphrases.candidate = 1;
  184|      0|		}
  185|      0|	} else
  186|  3.57k|		passphrase = NULL;
  187|       |
  188|  9.89k|	return (passphrase);
  189|  9.89k|}
archive_read_add_passphrase.c:new_read_passphrase:
   67|  2.49k|{
   68|  2.49k|	struct archive_read_passphrase *p;
   69|       |
   70|  2.49k|	p = malloc(sizeof(*p));
   71|  2.49k|	if (p == NULL) {
  ------------------
  |  Branch (71:6): [True: 0, False: 2.49k]
  ------------------
   72|      0|		archive_set_error(&a->archive, ENOMEM,
   73|      0|		    "Can't allocate memory");
   74|      0|		return (NULL);
   75|      0|	}
   76|  2.49k|	p->passphrase = strdup(passphrase);
   77|  2.49k|	if (p->passphrase == NULL) {
  ------------------
  |  Branch (77:6): [True: 0, False: 2.49k]
  ------------------
   78|      0|		free(p);
   79|      0|		archive_set_error(&a->archive, ENOMEM,
   80|      0|		    "Can't allocate memory");
   81|      0|		return (NULL);
   82|      0|	}
   83|  2.49k|	return (p);
   84|  2.49k|}
archive_read_add_passphrase.c:add_passphrase_to_tail:
   36|  2.49k|{
   37|  2.49k|	*a->passphrases.last = p;
   38|  2.49k|	a->passphrases.last = &p->next;
   39|       |	p->next = NULL;
   40|  2.49k|}

archive_read_open_memory:
   57|  2.49k|{
   58|  2.49k|	return archive_read_open_memory2(a, buff, size, size);
   59|  2.49k|}
archive_read_open_memory2:
   69|  2.49k|{
   70|  2.49k|	struct read_memory_data *mine;
   71|       |
   72|  2.49k|	mine = calloc(1, sizeof(*mine));
   73|  2.49k|	if (mine == NULL) {
  ------------------
  |  Branch (73:6): [True: 0, False: 2.49k]
  ------------------
   74|      0|		archive_set_error(a, ENOMEM, "No memory");
   75|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
   76|      0|	}
   77|  2.49k|	mine->start = mine->p = (const unsigned char *)buff;
   78|  2.49k|	mine->end = mine->start + size;
   79|  2.49k|	mine->read_size = read_size;
   80|  2.49k|	archive_read_set_open_callback(a, memory_read_open);
   81|  2.49k|	archive_read_set_read_callback(a, memory_read);
   82|  2.49k|	archive_read_set_seek_callback(a, memory_read_seek);
   83|  2.49k|	archive_read_set_skip_callback(a, memory_read_skip);
   84|  2.49k|	archive_read_set_close_callback(a, memory_read_close);
   85|  2.49k|	archive_read_set_callback_data(a, mine);
   86|  2.49k|	return (archive_read_open1(a));
   87|  2.49k|}
archive_read_open_memory.c:memory_read_open:
   94|  2.49k|{
   95|  2.49k|	(void)a; /* UNUSED */
   96|  2.49k|	(void)client_data; /* UNUSED */
   97|  2.49k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
   98|  2.49k|}
archive_read_open_memory.c:memory_read:
  109|  7.31k|{
  110|  7.31k|	struct read_memory_data *mine = (struct read_memory_data *)client_data;
  111|  7.31k|	ssize_t size;
  112|       |
  113|  7.31k|	(void)a; /* UNUSED */
  114|  7.31k|	*buff = mine->p;
  115|  7.31k|	size = mine->end - mine->p;
  116|  7.31k|	if (size > mine->read_size)
  ------------------
  |  Branch (116:6): [True: 0, False: 7.31k]
  ------------------
  117|      0|		size = mine->read_size;
  118|  7.31k|        mine->p += size;
  119|  7.31k|	return (size);
  120|  7.31k|}
archive_read_open_memory.c:memory_read_skip:
  129|    433|{
  130|    433|	struct read_memory_data *mine = (struct read_memory_data *)client_data;
  131|       |
  132|    433|	(void)a; /* UNUSED */
  133|    433|	if ((int64_t)skip > (int64_t)(mine->end - mine->p))
  ------------------
  |  Branch (133:6): [True: 433, False: 0]
  ------------------
  134|    433|		skip = mine->end - mine->p;
  135|       |	/* Round down to block size. */
  136|    433|	skip /= mine->read_size;
  137|    433|	skip *= mine->read_size;
  138|    433|	mine->p += skip;
  139|    433|	return (skip);
  140|    433|}
archive_read_open_memory.c:memory_read_seek:
  147|  6.57k|{
  148|  6.57k|	struct read_memory_data *mine = (struct read_memory_data *)client_data;
  149|       |
  150|  6.57k|	(void)a; /* UNUSED */
  151|  6.57k|	switch (whence) {
  152|  3.28k|	case SEEK_SET:
  ------------------
  |  Branch (152:2): [True: 3.28k, False: 3.29k]
  ------------------
  153|  3.28k|		mine->p = mine->start + offset;
  154|  3.28k|		break;
  155|      0|	case SEEK_CUR:
  ------------------
  |  Branch (155:2): [True: 0, False: 6.57k]
  ------------------
  156|      0|		mine->p += offset;
  157|      0|		break;
  158|  3.29k|	case SEEK_END:
  ------------------
  |  Branch (158:2): [True: 3.29k, False: 3.28k]
  ------------------
  159|  3.29k|		mine->p = mine->end + offset;
  160|  3.29k|		break;
  161|      0|	default:
  ------------------
  |  Branch (161:2): [True: 0, False: 6.57k]
  ------------------
  162|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  163|  6.57k|	}
  164|  6.57k|	if (mine->p < mine->start) {
  ------------------
  |  Branch (164:6): [True: 0, False: 6.57k]
  ------------------
  165|      0|		mine->p = mine->start;
  166|      0|		return ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  167|      0|	}
  168|  6.57k|	if (mine->p > mine->end) {
  ------------------
  |  Branch (168:6): [True: 0, False: 6.57k]
  ------------------
  169|      0|		mine->p = mine->end;
  170|      0|		return ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  171|      0|	}
  172|  6.57k|	return (mine->p - mine->start);
  173|  6.57k|}
archive_read_open_memory.c:memory_read_close:
  180|  2.49k|{
  181|  2.49k|	struct read_memory_data *mine = (struct read_memory_data *)client_data;
  182|  2.49k|	(void)a; /* UNUSED */
  183|  2.49k|	free(mine);
  184|  2.49k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  185|  2.49k|}

archive_read_set_options:
   67|  2.49k|{
   68|  2.49k|	return _archive_set_options(a, options,
   69|  2.49k|	    ARCHIVE_READ_MAGIC, "archive_read_set_options",
  ------------------
  |  |   59|  2.49k|#define	ARCHIVE_READ_MAGIC	(0xdeb0c5U)
  ------------------
   70|  2.49k|	    archive_set_option);
   71|  2.49k|}
archive_read_set_options.c:archive_set_format_option:
   76|  7.49k|{
   77|  7.49k|	struct archive_read *a = (struct archive_read *)_a;
   78|  7.49k|	size_t i;
   79|  7.49k|	int r, rv = ARCHIVE_WARN, matched_modules = 0;
  ------------------
  |  |  235|  7.49k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
   80|       |
   81|   127k|	for (i = 0; i < sizeof(a->formats)/sizeof(a->formats[0]); i++) {
  ------------------
  |  Branch (81:14): [True: 119k, False: 7.49k]
  ------------------
   82|   119k|		struct archive_format_descriptor *format = &a->formats[i];
   83|       |
   84|   119k|		if (format->options == NULL || format->name == NULL)
  ------------------
  |  Branch (84:7): [True: 44.9k, False: 74.9k]
  |  Branch (84:34): [True: 0, False: 74.9k]
  ------------------
   85|       |			/* This format does not support option. */
   86|  44.9k|			continue;
   87|  74.9k|		if (m != NULL) {
  ------------------
  |  Branch (87:7): [True: 74.9k, False: 0]
  ------------------
   88|  74.9k|			if (strcmp(format->name, m) != 0)
  ------------------
  |  Branch (88:8): [True: 64.9k, False: 9.99k]
  ------------------
   89|  64.9k|				continue;
   90|  9.99k|			++matched_modules;
   91|  9.99k|		}
   92|       |
   93|  9.99k|		a->format = format;
   94|  9.99k|		r = format->options(a, o, v);
   95|  9.99k|		a->format = NULL;
   96|       |
   97|  9.99k|		if (r == ARCHIVE_FATAL)
  ------------------
  |  |  239|  9.99k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (97:7): [True: 0, False: 9.99k]
  ------------------
   98|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
   99|       |
  100|  9.99k|		if (r == ARCHIVE_OK)
  ------------------
  |  |  233|  9.99k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (100:7): [True: 9.99k, False: 0]
  ------------------
  101|  9.99k|			rv = ARCHIVE_OK;
  ------------------
  |  |  233|  9.99k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  102|  9.99k|	}
  103|       |	/* If the format name didn't match, return a special code for
  104|       |	 * _archive_set_option[s]. */
  105|  7.49k|	if (m != NULL && matched_modules == 0)
  ------------------
  |  Branch (105:6): [True: 7.49k, False: 0]
  |  Branch (105:19): [True: 0, False: 7.49k]
  ------------------
  106|      0|		return ARCHIVE_WARN - 1;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  107|  7.49k|	return (rv);
  108|  7.49k|}
archive_read_set_options.c:archive_set_filter_option:
  113|  7.49k|{
  114|  7.49k|	(void)_a; /* UNUSED */
  115|  7.49k|	(void)o; /* UNUSED */
  116|  7.49k|	(void)v; /* UNUSED */
  117|       |
  118|       |	/* If the filter name didn't match, return a special code for
  119|       |	 * _archive_set_option[s]. */
  120|  7.49k|	if (m != NULL)
  ------------------
  |  Branch (120:6): [True: 7.49k, False: 0]
  ------------------
  121|  7.49k|		return ARCHIVE_WARN - 1;
  ------------------
  |  |  235|  7.49k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  122|      0|	return ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  123|  7.49k|}
archive_read_set_options.c:archive_set_option:
  128|  7.49k|{
  129|  7.49k|	return _archive_set_either_option(a, m, o, v,
  130|  7.49k|	    archive_set_format_option,
  131|  7.49k|	    archive_set_filter_option);
  132|  7.49k|}

archive_read_support_filter_all:
   42|  2.49k|{
   43|  2.49k|	archive_check_magic(a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  151|  2.49k|	do { \
  |  |  152|  2.49k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|  2.49k|			(allowed_states), (function_name)); \
  |  |  154|  2.49k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  2.49k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 2.49k]
  |  |  ------------------
  |  |  155|  2.49k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|  2.49k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 2.49k]
  |  |  ------------------
  ------------------
   44|  2.49k|	    ARCHIVE_STATE_NEW, "archive_read_support_filter_all");
   45|       |
   46|       |	/* Bzip falls back to "bunzip2" command-line */
   47|  2.49k|	archive_read_support_filter_bzip2(a);
   48|       |	/* The decompress code doesn't use an outside library. */
   49|  2.49k|	archive_read_support_filter_compress(a);
   50|       |	/* Gzip decompress falls back to "gzip -d" command-line. */
   51|  2.49k|	archive_read_support_filter_gzip(a);
   52|       |	/* Lzip falls back to "unlzip" command-line program. */
   53|  2.49k|	archive_read_support_filter_lzip(a);
   54|       |	/* The LZMA file format has a very weak signature, so it
   55|       |	 * may not be feasible to keep this here, but we'll try.
   56|       |	 * This will come back out if there are problems. */
   57|       |	/* Lzma falls back to "unlzma" command-line program. */
   58|  2.49k|	archive_read_support_filter_lzma(a);
   59|       |	/* Xz falls back to "unxz" command-line program. */
   60|  2.49k|	archive_read_support_filter_xz(a);
   61|       |	/* The decode code doesn't use an outside library. */
   62|  2.49k|	archive_read_support_filter_uu(a);
   63|       |	/* The decode code doesn't use an outside library. */
   64|  2.49k|	archive_read_support_filter_rpm(a);
   65|       |	/* The decode code always uses "lrzip -q -d" command-line. */
   66|  2.49k|	archive_read_support_filter_lrzip(a);
   67|       |	/* Lzop decompress falls back to "lzop -d" command-line. */
   68|  2.49k|	archive_read_support_filter_lzop(a);
   69|       |	/* The decode code always uses "grzip -d" command-line. */
   70|  2.49k|	archive_read_support_filter_grzip(a);
   71|       |	/* Lz4 falls back to "lz4 -d" command-line program. */
   72|  2.49k|	archive_read_support_filter_lz4(a);
   73|       |	/* Zstd falls back to "zstd -d" command-line program. */
   74|  2.49k|	archive_read_support_filter_zstd(a);
   75|       |
   76|       |	/* Note: We always return ARCHIVE_OK here, even if some of the
   77|       |	 * above return ARCHIVE_WARN.  The intent here is to enable
   78|       |	 * "as much as possible."  Clients who need specific
   79|       |	 * compression should enable those individually so they can
   80|       |	 * verify the level of support. */
   81|       |	/* Clear any warning messages set by the above functions. */
   82|  2.49k|	archive_clear_error(a);
   83|  2.49k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
   84|  2.49k|}

archive_read_support_filter_bzip2:
   92|  2.49k|{
   93|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
   94|       |
   95|  2.49k|	if (__archive_read_register_bidder(a, NULL, "bzip2",
  ------------------
  |  Branch (95:6): [True: 0, False: 2.49k]
  ------------------
   96|  2.49k|				&bzip2_bidder_vtable) != ARCHIVE_OK)
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
   97|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
   98|       |
   99|  2.49k|#if defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR)
  100|  2.49k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  101|       |#else
  102|       |	archive_set_error(_a, ARCHIVE_ERRNO_MISC,
  103|       |	    "Using external bzip2 program");
  104|       |	return (ARCHIVE_WARN);
  105|       |#endif
  106|  2.49k|}
archive_read_support_filter_bzip2.c:bzip2_reader_bid:
  117|  2.86k|{
  118|  2.86k|	const unsigned char *buffer;
  119|  2.86k|	ssize_t avail;
  120|  2.86k|	int bits_checked;
  121|       |
  122|  2.86k|	(void)self; /* UNUSED */
  123|       |
  124|       |	/* Minimal bzip2 archive is 14 bytes. */
  125|  2.86k|	buffer = __archive_read_filter_ahead(filter, 14, &avail);
  126|  2.86k|	if (buffer == NULL)
  ------------------
  |  Branch (126:6): [True: 60, False: 2.80k]
  ------------------
  127|     60|		return (0);
  128|       |
  129|       |	/* First three bytes must be "BZh" */
  130|  2.80k|	bits_checked = 0;
  131|  2.80k|	if (memcmp(buffer, "BZh", 3) != 0)
  ------------------
  |  Branch (131:6): [True: 2.78k, False: 19]
  ------------------
  132|  2.78k|		return (0);
  133|     19|	bits_checked += 24;
  134|       |
  135|       |	/* Next follows a compression flag which must be an ASCII digit. */
  136|     19|	if (buffer[3] < '1' || buffer[3] > '9')
  ------------------
  |  Branch (136:6): [True: 0, False: 19]
  |  Branch (136:25): [True: 15, False: 4]
  ------------------
  137|     15|		return (0);
  138|      4|	bits_checked += 5;
  139|       |
  140|       |	/* After BZh[1-9], there must be either a data block
  141|       |	 * which begins with 0x314159265359 or an end-of-data
  142|       |	 * marker of 0x177245385090. */
  143|      4|	if (memcmp(buffer + 4, "\x31\x41\x59\x26\x53\x59", 6) == 0)
  ------------------
  |  Branch (143:6): [True: 4, False: 0]
  ------------------
  144|      4|		bits_checked += 48;
  145|      0|	else if (memcmp(buffer + 4, "\x17\x72\x45\x38\x50\x90", 6) == 0)
  ------------------
  |  Branch (145:11): [True: 0, False: 0]
  ------------------
  146|      0|		bits_checked += 48;
  147|      0|	else
  148|      0|		return (0);
  149|       |
  150|      4|	return (bits_checked);
  151|      4|}
archive_read_support_filter_bzip2.c:bzip2_reader_init:
  188|      2|{
  189|      2|	static const size_t out_block_size = 64 * 1024;
  190|      2|	void *out_block;
  191|      2|	struct private_data *state;
  192|       |
  193|      2|	self->code = ARCHIVE_FILTER_BZIP2;
  ------------------
  |  |  311|      2|#define	ARCHIVE_FILTER_BZIP2	2
  ------------------
  194|      2|	self->name = "bzip2";
  195|       |
  196|      2|	state = calloc(1, sizeof(*state));
  197|      2|	out_block = malloc(out_block_size);
  198|      2|	if (state == NULL || out_block == NULL) {
  ------------------
  |  Branch (198:6): [True: 0, False: 2]
  |  Branch (198:23): [True: 0, False: 2]
  ------------------
  199|      0|		archive_set_error(&self->archive->archive, ENOMEM,
  200|      0|		    "Can't allocate data for bzip2 decompression");
  201|      0|		free(out_block);
  202|      0|		free(state);
  203|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  204|      0|	}
  205|       |
  206|      2|	self->data = state;
  207|      2|	state->out_block_size = out_block_size;
  208|      2|	state->out_block = out_block;
  209|      2|	self->vtable = &bzip2_reader_vtable;
  210|       |
  211|      2|	return (ARCHIVE_OK);
  ------------------
  |  |  233|      2|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  212|      2|}
archive_read_support_filter_bzip2.c:bzip2_filter_read:
  219|     17|{
  220|     17|	struct private_data *state;
  221|     17|	size_t decompressed;
  222|     17|	const char *read_buf;
  223|     17|	ssize_t ret;
  224|       |
  225|     17|	state = (struct private_data *)self->data;
  226|       |
  227|     17|	if (state->eof) {
  ------------------
  |  Branch (227:6): [True: 0, False: 17]
  ------------------
  228|      0|		*p = NULL;
  229|      0|		return (0);
  230|      0|	}
  231|       |
  232|       |	/* Empty our output buffer. */
  233|     17|	state->stream.next_out = state->out_block;
  234|     17|	state->stream.avail_out = (uint32_t)state->out_block_size;
  235|       |
  236|       |	/* Try to fill the output buffer. */
  237|     17|	for (;;) {
  238|     17|		ssize_t max_in;
  239|       |
  240|     17|		if (!state->valid) {
  ------------------
  |  Branch (240:7): [True: 2, False: 15]
  ------------------
  241|      2|			if (bzip2_reader_bid(self->bidder, self->upstream) == 0) {
  ------------------
  |  Branch (241:8): [True: 0, False: 2]
  ------------------
  242|      0|				state->eof = 1;
  243|      0|				*p = state->out_block;
  244|      0|				decompressed = state->stream.next_out
  245|      0|				    - state->out_block;
  246|      0|				return (decompressed);
  247|      0|			}
  248|       |			/* Initialize compression library. */
  249|      2|			ret = BZ2_bzDecompressInit(&(state->stream),
  250|      2|					   0 /* library verbosity */,
  251|      2|					   0 /* don't use low-mem algorithm */);
  252|       |
  253|       |			/* If init fails, try low-memory algorithm instead. */
  254|      2|			if (ret == BZ_MEM_ERROR)
  ------------------
  |  Branch (254:8): [True: 0, False: 2]
  ------------------
  255|      0|				ret = BZ2_bzDecompressInit(&(state->stream),
  256|      0|					   0 /* library verbosity */,
  257|      0|					   1 /* do use low-mem algo */);
  258|       |
  259|      2|			if (ret != BZ_OK) {
  ------------------
  |  Branch (259:8): [True: 0, False: 2]
  ------------------
  260|      0|				const char *detail = NULL;
  261|      0|				int err = ARCHIVE_ERRNO_MISC;
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  262|      0|				switch (ret) {
  ------------------
  |  Branch (262:13): [True: 0, False: 0]
  ------------------
  263|      0|				case BZ_PARAM_ERROR:
  ------------------
  |  Branch (263:5): [True: 0, False: 0]
  ------------------
  264|      0|					detail = "invalid setup parameter";
  265|      0|					break;
  266|      0|				case BZ_MEM_ERROR:
  ------------------
  |  Branch (266:5): [True: 0, False: 0]
  ------------------
  267|      0|					err = ENOMEM;
  268|      0|					detail = "out of memory";
  269|      0|					break;
  270|      0|				case BZ_CONFIG_ERROR:
  ------------------
  |  Branch (270:5): [True: 0, False: 0]
  ------------------
  271|      0|					detail = "mis-compiled library";
  272|      0|					break;
  273|      0|				}
  274|      0|				archive_set_error(&self->archive->archive, err,
  275|      0|				    "Internal error initializing decompressor%s%s",
  276|      0|				    detail == NULL ? "" : ": ",
  ------------------
  |  Branch (276:9): [True: 0, False: 0]
  ------------------
  277|      0|				    detail);
  278|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  279|      0|			}
  280|      2|			state->valid = 1;
  281|      2|		}
  282|       |
  283|       |		/* stream.next_in is really const, but bzlib
  284|       |		 * doesn't declare it so. <sigh> */
  285|     17|		read_buf =
  286|     17|		    __archive_read_filter_ahead(self->upstream, 1, &ret);
  287|     17|		if (read_buf == NULL) {
  ------------------
  |  Branch (287:7): [True: 0, False: 17]
  ------------------
  288|      0|			archive_set_error(&self->archive->archive,
  289|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  290|      0|			    "truncated bzip2 input");
  291|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  292|      0|		}
  293|     17|		state->stream.next_in = (char *)(uintptr_t)read_buf;
  294|     17|		if (UINT_MAX >= SSIZE_MAX)
  ------------------
  |  Branch (294:7): [Folded, False: 17]
  ------------------
  295|      0|			max_in = SSIZE_MAX;
  296|     17|		else
  297|     17|			max_in = UINT_MAX;
  298|     17|		if (ret > max_in)
  ------------------
  |  Branch (298:7): [True: 0, False: 17]
  ------------------
  299|      0|			ret = max_in;
  300|     17|		state->stream.avail_in = (uint32_t)ret;
  301|       |		/* There is no more data, return whatever we have. */
  302|     17|		if (ret == 0) {
  ------------------
  |  Branch (302:7): [True: 0, False: 17]
  ------------------
  303|      0|			state->eof = 1;
  304|      0|			*p = state->out_block;
  305|      0|			decompressed = state->stream.next_out
  306|      0|			    - state->out_block;
  307|      0|			return (decompressed);
  308|      0|		}
  309|       |
  310|       |		/* Decompress as much as we can in one pass. */
  311|     17|		ret = BZ2_bzDecompress(&(state->stream));
  312|     17|		__archive_read_filter_consume(self->upstream,
  313|     17|		    state->stream.next_in - read_buf);
  314|       |
  315|     17|		switch (ret) {
  316|      0|		case BZ_STREAM_END: /* Found end of stream. */
  ------------------
  |  Branch (316:3): [True: 0, False: 17]
  ------------------
  317|      0|			switch (BZ2_bzDecompressEnd(&(state->stream))) {
  318|      0|			case BZ_OK:
  ------------------
  |  Branch (318:4): [True: 0, False: 0]
  ------------------
  319|      0|				break;
  320|      0|			default:
  ------------------
  |  Branch (320:4): [True: 0, False: 0]
  ------------------
  321|      0|				archive_set_error(&(self->archive->archive),
  322|      0|					  ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  323|      0|					  "Failed to clean up decompressor");
  324|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  325|      0|			}
  326|      0|			state->valid = 0;
  327|       |			/* FALLTHROUGH */
  328|     15|		case BZ_OK: /* Decompressor made some progress. */
  ------------------
  |  Branch (328:3): [True: 15, False: 2]
  ------------------
  329|       |			/* If we filled our buffer, update stats and return. */
  330|     15|			if (state->stream.avail_out == 0) {
  ------------------
  |  Branch (330:8): [True: 15, False: 0]
  ------------------
  331|     15|				*p = state->out_block;
  332|     15|				decompressed = state->stream.next_out
  333|     15|				    - state->out_block;
  334|     15|				return (decompressed);
  335|     15|			}
  336|      0|			break;
  337|      2|		default: /* Return an error. */
  ------------------
  |  Branch (337:3): [True: 2, False: 15]
  ------------------
  338|      2|			archive_set_error(&self->archive->archive,
  339|      2|			    ARCHIVE_ERRNO_MISC, "bzip decompression failed");
  ------------------
  |  |  204|      2|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  340|      2|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  341|     17|		}
  342|     17|	}
  343|     17|}
archive_read_support_filter_bzip2.c:bzip2_filter_close:
  350|      2|{
  351|      2|	struct private_data *state;
  352|      2|	int ret = ARCHIVE_OK;
  ------------------
  |  |  233|      2|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  353|       |
  354|      2|	state = (struct private_data *)self->data;
  355|       |
  356|      2|	if (state->valid) {
  ------------------
  |  Branch (356:6): [True: 2, False: 0]
  ------------------
  357|      2|		switch (BZ2_bzDecompressEnd(&state->stream)) {
  358|      2|		case BZ_OK:
  ------------------
  |  Branch (358:3): [True: 2, False: 0]
  ------------------
  359|      2|			break;
  360|      0|		default:
  ------------------
  |  Branch (360:3): [True: 0, False: 2]
  ------------------
  361|      0|			archive_set_error(&self->archive->archive,
  362|      0|					  ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  363|      0|					  "Failed to clean up decompressor");
  364|      0|			ret = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  365|      2|		}
  366|      2|		state->valid = 0;
  367|      2|	}
  368|       |
  369|      2|	free(state->out_block);
  370|      2|	free(state);
  371|      2|	return (ret);
  372|      2|}

archive_read_support_filter_compress:
  160|  2.49k|{
  161|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
  162|       |
  163|       |	return __archive_read_register_bidder(a, NULL, "compress (.Z)",
  164|  2.49k|			&compress_bidder_vtable);
  165|  2.49k|}
archive_read_support_filter_compress.c:compress_bidder_bid:
  174|  2.86k|{
  175|  2.86k|	const unsigned char *buffer;
  176|  2.86k|	ssize_t avail;
  177|  2.86k|	int bits_checked;
  178|       |
  179|  2.86k|	(void)self; /* UNUSED */
  180|       |
  181|       |	/* Shortest valid compress file is 3 bytes. */
  182|  2.86k|	buffer = __archive_read_filter_ahead(filter, 3, &avail);
  183|       |
  184|  2.86k|	if (buffer == NULL)
  ------------------
  |  Branch (184:6): [True: 60, False: 2.80k]
  ------------------
  185|     60|		return (0);
  186|       |
  187|  2.80k|	bits_checked = 0;
  188|       |	/* First two bytes are the magic value */
  189|  2.80k|	if (buffer[0] != 0x1F || buffer[1] != 0x9D)
  ------------------
  |  Branch (189:6): [True: 2.58k, False: 219]
  |  Branch (189:27): [True: 143, False: 76]
  ------------------
  190|  2.73k|		return (0);
  191|       |	/* Third byte holds compression parameters. */
  192|     76|	if (buffer[2] & 0x20) /* Reserved bit, must be zero. */
  ------------------
  |  Branch (192:6): [True: 0, False: 76]
  ------------------
  193|      0|		return (0);
  194|     76|	if (buffer[2] & 0x40) /* Reserved bit, must be zero. */
  ------------------
  |  Branch (194:6): [True: 0, False: 76]
  ------------------
  195|      0|		return (0);
  196|     76|	bits_checked += 18;
  197|       |
  198|     76|	return (bits_checked);
  199|     76|}
archive_read_support_filter_compress.c:compress_bidder_init:
  212|     76|{
  213|     76|	struct private_data *state;
  214|     76|	static const size_t out_block_size = 64 * 1024;
  215|     76|	void *out_block;
  216|       |
  217|     76|	self->code = ARCHIVE_FILTER_COMPRESS;
  ------------------
  |  |  312|     76|#define	ARCHIVE_FILTER_COMPRESS	3
  ------------------
  218|     76|	self->name = "compress (.Z)";
  219|       |
  220|     76|	state = calloc(1, sizeof(*state));
  221|     76|	out_block = malloc(out_block_size);
  222|     76|	if (state == NULL || out_block == NULL) {
  ------------------
  |  Branch (222:6): [True: 0, False: 76]
  |  Branch (222:23): [True: 0, False: 76]
  ------------------
  223|      0|		free(out_block);
  224|      0|		free(state);
  225|      0|		archive_set_error(&self->archive->archive, ENOMEM,
  226|      0|		    "Can't allocate data for %s decompression",
  227|      0|		    self->name);
  228|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  229|      0|	}
  230|       |
  231|     76|	self->data = state;
  232|     76|	state->out_block_size = out_block_size;
  233|     76|	state->out_block = out_block;
  234|     76|	self->vtable = &compress_reader_vtable;
  235|       |
  236|     76|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     76|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  237|     76|}
archive_read_support_filter_compress.c:compress_filter_read:
  284|    280|{
  285|    280|	struct private_data *state;
  286|    280|	unsigned char *p, *start, *end;
  287|    280|	int ret;
  288|       |
  289|    280|	state = (struct private_data *)self->data;
  290|    280|	if (!state->initialized) {
  ------------------
  |  Branch (290:6): [True: 76, False: 204]
  ------------------
  291|     76|		ret = compress_filter_init(self);
  292|     76|		if (ret != ARCHIVE_OK)
  ------------------
  |  |  233|     76|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (292:7): [True: 0, False: 76]
  ------------------
  293|      0|			return (ret);
  294|     76|	}
  295|    280|	if (state->end_of_stream) {
  ------------------
  |  Branch (295:6): [True: 52, False: 228]
  ------------------
  296|     52|		*pblock = NULL;
  297|     52|		return (0);
  298|     52|	}
  299|    228|	p = start = (unsigned char *)state->out_block;
  300|    228|	end = start + state->out_block_size;
  301|       |
  302|  18.4M|	while (p < end && !state->end_of_stream) {
  ------------------
  |  Branch (302:9): [True: 18.4M, False: 153]
  |  Branch (302:20): [True: 18.4M, False: 61]
  ------------------
  303|  18.4M|		if (state->stackp > state->stack) {
  ------------------
  |  Branch (303:7): [True: 11.4M, False: 6.96M]
  ------------------
  304|  11.4M|			*p++ = *--state->stackp;
  305|  11.4M|		} else {
  306|  6.96M|			ret = next_code(self);
  307|  6.96M|			if (ret == -1)
  ------------------
  |  Branch (307:8): [True: 61, False: 6.96M]
  ------------------
  308|     61|				state->end_of_stream = ret;
  309|  6.96M|			else if (ret != ARCHIVE_OK)
  ------------------
  |  |  233|  6.96M|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (309:13): [True: 14, False: 6.96M]
  ------------------
  310|     14|				return (ret);
  311|  6.96M|		}
  312|  18.4M|	}
  313|       |
  314|    214|	*pblock = start;
  315|    214|	return (p - start);
  316|    228|}
archive_read_support_filter_compress.c:compress_filter_init:
  241|     76|{
  242|     76|	struct private_data *state = (struct private_data *)self->data;
  243|     76|	int code;
  244|       |
  245|     76|	state->initialized = 1;
  246|       |
  247|     76|	(void)getbits(self, 8); /* Skip first signature byte. */
  248|     76|	(void)getbits(self, 8); /* Skip second signature byte. */
  249|       |
  250|       |	/* Get compression parameters. */
  251|     76|	code = getbits(self, 8);
  252|     76|	if (code < 0 || (code & 0x1f) > 16) {
  ------------------
  |  Branch (252:6): [True: 0, False: 76]
  |  Branch (252:18): [True: 0, False: 76]
  ------------------
  253|      0|		archive_set_error(&self->archive->archive, -1,
  254|      0|		    "Invalid compressed data");
  255|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  256|      0|	}
  257|     76|	state->maxcode_bits = code & 0x1f;
  258|     76|	state->maxcode = (1 << state->maxcode_bits);
  259|     76|	state->use_reset_code = code & 0x80;
  260|       |
  261|       |	/* Initialize decompressor. */
  262|     76|	state->free_ent = 256;
  263|     76|	state->stackp = state->stack;
  264|     76|	if (state->use_reset_code)
  ------------------
  |  Branch (264:6): [True: 52, False: 24]
  ------------------
  265|     52|		state->free_ent++;
  266|     76|	state->bits = 9;
  267|     76|	state->section_end_code = (1<<state->bits) - 1;
  268|     76|	state->oldcode = -1;
  269|  19.5k|	for (code = 255; code >= 0; code--) {
  ------------------
  |  Branch (269:19): [True: 19.4k, False: 76]
  ------------------
  270|  19.4k|		state->prefix[code] = 0;
  271|  19.4k|		state->suffix[code] = code;
  272|  19.4k|	}
  273|     76|	next_code(self);
  274|       |
  275|     76|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     76|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  276|     76|}
archive_read_support_filter_compress.c:getbits:
  423|  8.35M|{
  424|  8.35M|	struct private_data *state = (struct private_data *)self->data;
  425|  8.35M|	int code;
  426|  8.35M|	ssize_t ret;
  427|  8.35M|	static const int mask[] = {
  428|  8.35M|		0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff,
  429|  8.35M|		0x1ff, 0x3ff, 0x7ff, 0xfff, 0x1fff, 0x3fff, 0x7fff, 0xffff
  430|  8.35M|	};
  431|       |
  432|  19.2M|	while (state->bits_avail < n) {
  ------------------
  |  Branch (432:9): [True: 10.9M, False: 8.35M]
  ------------------
  433|  10.9M|		if (state->avail_in <= 0) {
  ------------------
  |  Branch (433:7): [True: 265, False: 10.9M]
  ------------------
  434|    265|			if (state->consume_unnotified) {
  ------------------
  |  Branch (434:8): [True: 189, False: 76]
  ------------------
  435|    189|				__archive_read_filter_consume(self->upstream,
  436|    189|					state->consume_unnotified);
  437|    189|				state->consume_unnotified = 0;
  438|    189|			}
  439|    265|			state->next_in
  440|    265|			    = __archive_read_filter_ahead(self->upstream,
  441|    265|				1, &ret);
  442|    265|			if (ret == 0)
  ------------------
  |  Branch (442:8): [True: 61, False: 204]
  ------------------
  443|     61|				return (-1);
  444|    204|			if (ret < 0 || state->next_in == NULL)
  ------------------
  |  Branch (444:8): [True: 4, False: 200]
  |  Branch (444:19): [True: 0, False: 200]
  ------------------
  445|      4|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  446|    200|			state->consume_unnotified = state->avail_in = ret;
  447|    200|		}
  448|  10.9M|		state->bit_buffer |= *state->next_in++ << state->bits_avail;
  449|  10.9M|		state->avail_in--;
  450|  10.9M|		state->bits_avail += 8;
  451|  10.9M|		state->bytes_in_section++;
  452|  10.9M|	}
  453|       |
  454|  8.35M|	code = state->bit_buffer;
  455|  8.35M|	state->bit_buffer >>= n;
  456|  8.35M|	state->bits_avail -= n;
  457|       |
  458|  8.35M|	return (code & mask[n]);
  459|  8.35M|}
archive_read_support_filter_compress.c:next_code:
  338|  6.96M|{
  339|  6.96M|	struct private_data *state = (struct private_data *)self->data;
  340|  6.96M|	int code, newcode;
  341|       |
  342|  7.14M|again:
  343|  7.14M|	code = newcode = getbits(self, state->bits);
  344|  7.14M|	if (code < 0)
  ------------------
  |  Branch (344:6): [True: 62, False: 7.14M]
  ------------------
  345|     62|		return (code);
  346|       |
  347|       |	/* If it's a reset code, reset the dictionary. */
  348|  7.14M|	if ((code == 256) && state->use_reset_code) {
  ------------------
  |  Branch (348:6): [True: 183k, False: 6.95M]
  |  Branch (348:23): [True: 173k, False: 9.58k]
  ------------------
  349|       |		/*
  350|       |		 * The original 'compress' implementation blocked its
  351|       |		 * I/O in a manner that resulted in junk bytes being
  352|       |		 * inserted after every reset.  The next section skips
  353|       |		 * this junk.  (Yes, the number of *bytes* to skip is
  354|       |		 * a function of the current *bit* length.)
  355|       |		 */
  356|   173k|		int skip_bytes =  state->bits -
  357|   173k|		    (state->bytes_in_section % state->bits);
  358|   173k|		skip_bytes %= state->bits;
  359|   173k|		state->bits_avail = 0; /* Discard rest of this byte. */
  360|  1.38M|		while (skip_bytes-- > 0) {
  ------------------
  |  Branch (360:10): [True: 1.21M, False: 173k]
  ------------------
  361|  1.21M|			code = getbits(self, 8);
  362|  1.21M|			if (code < 0)
  ------------------
  |  Branch (362:8): [True: 3, False: 1.21M]
  ------------------
  363|      3|				return (code);
  364|  1.21M|		}
  365|       |		/* Now, actually do the reset. */
  366|   173k|		state->bytes_in_section = 0;
  367|   173k|		state->bits = 9;
  368|   173k|		state->section_end_code = (1 << state->bits) - 1;
  369|   173k|		state->free_ent = 257;
  370|   173k|		state->oldcode = -1;
  371|   173k|		goto again;
  372|   173k|	}
  373|       |
  374|  6.96M|	if (code > state->free_ent
  ------------------
  |  Branch (374:6): [True: 10, False: 6.96M]
  ------------------
  375|  6.96M|	    || (code == state->free_ent && state->oldcode < 0)) {
  ------------------
  |  Branch (375:10): [True: 8.70k, False: 6.95M]
  |  Branch (375:37): [True: 19, False: 8.68k]
  ------------------
  376|       |		/* An invalid code is a fatal error. */
  377|     29|		archive_set_error(&(self->archive->archive), -1,
  378|     29|		    "Invalid compressed data");
  379|     29|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     29|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  380|     29|	}
  381|       |
  382|       |	/* Special case for KwKwK string. */
  383|  6.96M|	if (code >= state->free_ent) {
  ------------------
  |  Branch (383:6): [True: 8.68k, False: 6.95M]
  ------------------
  384|  8.68k|		*state->stackp++ = state->finbyte;
  385|  8.68k|		code = state->oldcode;
  386|  8.68k|	}
  387|       |
  388|       |	/* Generate output characters in reverse order. */
  389|  11.4M|	while (code >= 256) {
  ------------------
  |  Branch (389:9): [True: 4.47M, False: 6.96M]
  ------------------
  390|  4.47M|		*state->stackp++ = state->suffix[code];
  391|  4.47M|		code = state->prefix[code];
  392|  4.47M|	}
  393|  6.96M|	*state->stackp++ = state->finbyte = code;
  394|       |
  395|       |	/* Generate the new entry. */
  396|  6.96M|	code = state->free_ent;
  397|  6.96M|	if (code < state->maxcode && state->oldcode >= 0) {
  ------------------
  |  Branch (397:6): [True: 429k, False: 6.53M]
  |  Branch (397:31): [True: 428k, False: 1.12k]
  ------------------
  398|   428k|		state->prefix[code] = state->oldcode;
  399|   428k|		state->suffix[code] = state->finbyte;
  400|   428k|		++state->free_ent;
  401|   428k|	}
  402|  6.96M|	if (state->free_ent > state->section_end_code) {
  ------------------
  |  Branch (402:6): [True: 1.05k, False: 6.96M]
  ------------------
  403|  1.05k|		state->bits++;
  404|  1.05k|		state->bytes_in_section = 0;
  405|  1.05k|		if (state->bits == state->maxcode_bits)
  ------------------
  |  Branch (405:7): [True: 931, False: 122]
  ------------------
  406|    931|			state->section_end_code = state->maxcode;
  407|    122|		else
  408|    122|			state->section_end_code = (1 << state->bits) - 1;
  409|  1.05k|	}
  410|       |
  411|       |	/* Remember previous code. */
  412|  6.96M|	state->oldcode = newcode;
  413|  6.96M|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  6.96M|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  414|  6.96M|}
archive_read_support_filter_compress.c:compress_filter_close:
  323|     76|{
  324|     76|	struct private_data *state = (struct private_data *)self->data;
  325|       |
  326|     76|	free(state->out_block);
  327|     76|	free(state);
  328|     76|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     76|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  329|     76|}

archive_read_support_filter_grzip:
   62|  2.49k|{
   63|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
   64|       |
   65|  2.49k|	if (__archive_read_register_bidder(a, NULL, "grzip",
  ------------------
  |  Branch (65:6): [True: 0, False: 2.49k]
  ------------------
   66|  2.49k|				&grzip_bidder_vtable) != ARCHIVE_OK)
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
   67|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
   68|       |
   69|       |	/* This filter always uses an external program. */
   70|  2.49k|	archive_set_error(_a, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|  2.49k|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
   71|  2.49k|	    "Using external grzip program for grzip decompression");
   72|  2.49k|	return (ARCHIVE_WARN);
  ------------------
  |  |  235|  2.49k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
   73|  2.49k|}
archive_read_support_filter_grzip.c:grzip_bidder_bid:
   81|  2.86k|{
   82|  2.86k|	const unsigned char *p;
   83|  2.86k|	ssize_t avail;
   84|       |
   85|  2.86k|	(void)self; /* UNUSED */
   86|       |
   87|  2.86k|	p = __archive_read_filter_ahead(filter, sizeof(grzip_magic), &avail);
   88|  2.86k|	if (p == NULL || avail == 0)
  ------------------
  |  Branch (88:6): [True: 62, False: 2.80k]
  |  Branch (88:19): [True: 0, False: 2.80k]
  ------------------
   89|     62|		return (0);
   90|       |
   91|  2.80k|	if (memcmp(p, grzip_magic, sizeof(grzip_magic)))
  ------------------
  |  Branch (91:6): [True: 2.80k, False: 0]
  ------------------
   92|  2.80k|		return (0);
   93|       |
   94|      0|	return (sizeof(grzip_magic) * 8);
   95|  2.80k|}

archive_read_support_filter_gzip:
  101|  2.49k|{
  102|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
  103|       |
  104|  2.49k|	if (__archive_read_register_bidder(a, NULL, "gzip",
  ------------------
  |  Branch (104:6): [True: 0, False: 2.49k]
  ------------------
  105|  2.49k|				&gzip_bidder_vtable) != ARCHIVE_OK)
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  106|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  107|       |
  108|       |	/* Signal the extent of gzip support with the return value here. */
  109|  2.49k|#if HAVE_ZLIB_H
  110|  2.49k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  111|       |#else
  112|       |	archive_set_error(_a, ARCHIVE_ERRNO_MISC,
  113|       |	    "Using external gzip program");
  114|       |	return (ARCHIVE_WARN);
  115|       |#endif
  116|  2.49k|}
archive_read_support_filter_gzip.c:gzip_bidder_bid:
  246|  2.86k|{
  247|  2.86k|	int bits_checked;
  248|       |
  249|  2.86k|	(void)self; /* UNUSED */
  250|       |
  251|  2.86k|	if (peek_at_header(filter, &bits_checked, NULL))
  ------------------
  |  Branch (251:6): [True: 141, False: 2.72k]
  ------------------
  252|    141|		return (bits_checked);
  253|  2.72k|	return (0);
  254|  2.86k|}
archive_read_support_filter_gzip.c:peek_at_header:
  135|  3.12k|{
  136|  3.12k|	const unsigned char *p;
  137|  3.12k|	ssize_t avail, len;
  138|  3.12k|	int bits = 0;
  139|  3.12k|	int header_flags;
  140|       |#ifndef HAVE_ZLIB_H
  141|       |	(void)state; /* UNUSED */
  142|       |#endif
  143|       |
  144|       |	/* Start by looking at the first ten bytes of the header, which
  145|       |	 * is all fixed layout. */
  146|  3.12k|	len = 10;
  147|  3.12k|	p = __archive_read_filter_ahead(filter, len, &avail);
  148|  3.12k|	if (p == NULL || avail == 0)
  ------------------
  |  Branch (148:6): [True: 85, False: 3.04k]
  |  Branch (148:19): [True: 0, False: 3.04k]
  ------------------
  149|     85|		return (0);
  150|       |	/* We only support deflation- third byte must be 0x08. */
  151|  3.04k|	if (memcmp(p, "\x1F\x8B\x08", 3) != 0)
  ------------------
  |  Branch (151:6): [True: 2.73k, False: 304]
  ------------------
  152|  2.73k|		return (0);
  153|    304|	bits += 24;
  154|    304|	if ((p[3] & 0xE0)!= 0)	/* No reserved flags set. */
  ------------------
  |  Branch (154:6): [True: 2, False: 302]
  ------------------
  155|      2|		return (0);
  156|    302|	bits += 3;
  157|    302|	header_flags = p[3];
  158|       |	/* Bytes 4-7 are mod time in little endian. */
  159|    302|#ifdef HAVE_ZLIB_H
  160|    302|	if (state)
  ------------------
  |  Branch (160:6): [True: 161, False: 141]
  ------------------
  161|    161|		state->mtime = archive_le32dec(p + 4);
  162|    302|#endif
  163|       |	/* Byte 8 is deflate flags. */
  164|       |	/* XXXX TODO: return deflate flags back to consume_header for use
  165|       |	   in initializing the decompressor. */
  166|       |	/* Byte 9 is OS. */
  167|       |
  168|       |	/* Optional extra data:  2 byte length plus variable body. */
  169|    302|	if (header_flags & 4) {
  ------------------
  |  Branch (169:6): [True: 0, False: 302]
  ------------------
  170|      0|		p = __archive_read_filter_ahead(filter, len + 2, &avail);
  171|      0|		if (p == NULL)
  ------------------
  |  Branch (171:7): [True: 0, False: 0]
  ------------------
  172|      0|			return (0);
  173|      0|		len += ((int)p[len + 1] << 8) | (int)p[len];
  174|      0|		len += 2;
  175|      0|	}
  176|       |
  177|       |	/* Null-terminated optional filename. */
  178|    302|	if (header_flags & 8) {
  ------------------
  |  Branch (178:6): [True: 10, False: 292]
  ------------------
  179|     10|#ifdef HAVE_ZLIB_H
  180|     10|		ssize_t file_start = len;
  181|     10|#endif
  182|     78|		do {
  183|     78|			++len;
  184|     78|			if (avail < len) {
  ------------------
  |  Branch (184:8): [True: 6, False: 72]
  ------------------
  185|      6|				if (avail > MAX_FILENAME_LENGTH) {
  ------------------
  |  |  125|      6|#define MAX_FILENAME_LENGTH (1024 * 1024L)
  ------------------
  |  Branch (185:9): [True: 0, False: 6]
  ------------------
  186|      0|					return (0);
  187|      0|				}
  188|      6|				p = __archive_read_filter_ahead(filter,
  189|      6|				    len, &avail);
  190|      6|			}
  191|     78|			if (p == NULL)
  ------------------
  |  Branch (191:8): [True: 0, False: 78]
  ------------------
  192|      0|				return (0);
  193|     78|		} while (p[len - 1] != 0);
  ------------------
  |  Branch (193:12): [True: 68, False: 10]
  ------------------
  194|       |
  195|     10|#ifdef HAVE_ZLIB_H
  196|     10|		if (state) {
  ------------------
  |  Branch (196:7): [True: 5, False: 5]
  ------------------
  197|       |			/* Reset the name in case of repeat header reads. */
  198|      5|			free(state->name);
  199|      5|			state->name = strdup((const char *)&p[file_start]);
  200|      5|		}
  201|     10|#endif
  202|     10|	}
  203|       |
  204|       |	/* Null-terminated optional comment. */
  205|    302|	if (header_flags & 16) {
  ------------------
  |  Branch (205:6): [True: 10, False: 292]
  ------------------
  206|     80|		do {
  207|     80|			++len;
  208|     80|			if (avail < len) {
  ------------------
  |  Branch (208:8): [True: 30, False: 50]
  ------------------
  209|     30|				if (avail > MAX_COMMENT_LENGTH) {
  ------------------
  |  |  126|     30|#define MAX_COMMENT_LENGTH (1024 * 1024L)
  ------------------
  |  Branch (209:9): [True: 0, False: 30]
  ------------------
  210|      0|					return (0);
  211|      0|				}
  212|     30|				p = __archive_read_filter_ahead(filter,
  213|     30|				    len, &avail);
  214|     30|			}
  215|     80|			if (p == NULL)
  ------------------
  |  Branch (215:8): [True: 0, False: 80]
  ------------------
  216|      0|				return (0);
  217|     80|		} while (p[len - 1] != 0);
  ------------------
  |  Branch (217:12): [True: 70, False: 10]
  ------------------
  218|     10|	}
  219|       |
  220|       |	/* Optional header CRC */
  221|    302|	if ((header_flags & 2)) {
  ------------------
  |  Branch (221:6): [True: 10, False: 292]
  ------------------
  222|     10|		p = __archive_read_filter_ahead(filter, len + 2, &avail);
  223|     10|		if (p == NULL)
  ------------------
  |  Branch (223:7): [True: 0, False: 10]
  ------------------
  224|      0|			return (0);
  225|       |#if 0
  226|       |	int hcrc = ((int)p[len + 1] << 8) | (int)p[len];
  227|       |	int crc = /* XXX TODO: Compute header CRC. */;
  228|       |	if (crc != hcrc)
  229|       |		return (0);
  230|       |	bits += 16;
  231|       |#endif
  232|     10|		len += 2;
  233|     10|	}
  234|       |
  235|    302|	if (pbits != NULL)
  ------------------
  |  Branch (235:6): [True: 141, False: 161]
  ------------------
  236|    141|		*pbits = bits;
  237|    302|	return (len);
  238|    302|}
archive_read_support_filter_gzip.c:gzip_bidder_init:
  311|    141|{
  312|    141|	struct private_data *state;
  313|    141|	static const size_t out_block_size = 64 * 1024;
  314|    141|	void *out_block;
  315|       |
  316|    141|	self->code = ARCHIVE_FILTER_GZIP;
  ------------------
  |  |  310|    141|#define	ARCHIVE_FILTER_GZIP	1
  ------------------
  317|    141|	self->name = "gzip";
  318|       |
  319|    141|	state = calloc(1, sizeof(*state));
  320|    141|	out_block = malloc(out_block_size);
  321|    141|	if (state == NULL || out_block == NULL) {
  ------------------
  |  Branch (321:6): [True: 0, False: 141]
  |  Branch (321:23): [True: 0, False: 141]
  ------------------
  322|      0|		free(out_block);
  323|      0|		free(state);
  324|      0|		archive_set_error(&self->archive->archive, ENOMEM,
  325|      0|		    "Can't allocate data for gzip decompression");
  326|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  327|      0|	}
  328|       |
  329|    141|	self->data = state;
  330|    141|	state->out_block_size = out_block_size;
  331|    141|	state->out_block = out_block;
  332|    141|	self->vtable = &gzip_reader_vtable;
  333|       |
  334|    141|	state->in_stream = 0; /* We're not actually within a stream yet. */
  335|       |
  336|    141|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    141|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  337|    141|}
archive_read_support_filter_gzip.c:gzip_filter_read:
  444|  3.59k|{
  445|  3.59k|	struct private_data *state;
  446|  3.59k|	size_t decompressed;
  447|  3.59k|	ssize_t avail_in, max_in;
  448|  3.59k|	int ret;
  449|       |
  450|  3.59k|	state = (struct private_data *)self->data;
  451|       |
  452|       |	/* Empty our output buffer. */
  453|  3.59k|	state->stream.next_out = state->out_block;
  454|  3.59k|	state->stream.avail_out = (uInt)state->out_block_size;
  455|       |
  456|       |	/* Try to fill the output buffer. */
  457|  7.10k|	while (state->stream.avail_out > 0 && !state->eof) {
  ------------------
  |  Branch (457:9): [True: 3.75k, False: 3.35k]
  |  Branch (457:40): [True: 3.64k, False: 101]
  ------------------
  458|       |		/* If we're not in a stream, read a header
  459|       |		 * and initialize the decompression library. */
  460|  3.64k|		if (!state->in_stream) {
  ------------------
  |  Branch (460:7): [True: 262, False: 3.38k]
  ------------------
  461|    262|			ret = consume_header(self);
  462|    262|			if (ret == ARCHIVE_EOF) {
  ------------------
  |  |  232|    262|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (462:8): [True: 101, False: 161]
  ------------------
  463|    101|				state->eof = 1;
  464|    101|				break;
  465|    101|			}
  466|    161|			if (ret < ARCHIVE_OK)
  ------------------
  |  |  233|    161|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (466:8): [True: 0, False: 161]
  ------------------
  467|      0|				return (ret);
  468|    161|		}
  469|       |
  470|       |		/* Peek at the next available data. */
  471|       |		/* ZLib treats stream.next_in as const but doesn't declare
  472|       |		 * it so, hence this ugly cast. */
  473|  3.54k|		state->stream.next_in = (unsigned char *)(uintptr_t)
  474|  3.54k|		    __archive_read_filter_ahead(self->upstream, 1, &avail_in);
  475|  3.54k|		if (state->stream.next_in == NULL) {
  ------------------
  |  Branch (475:7): [True: 38, False: 3.51k]
  ------------------
  476|     38|			archive_set_error(&self->archive->archive,
  477|     38|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     38|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  478|     38|			    "truncated gzip input");
  479|     38|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     38|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  480|     38|		}
  481|  3.51k|		if (UINT_MAX >= SSIZE_MAX)
  ------------------
  |  Branch (481:7): [Folded, False: 3.51k]
  ------------------
  482|      0|			max_in = SSIZE_MAX;
  483|  3.51k|		else
  484|  3.51k|			max_in = UINT_MAX;
  485|  3.51k|		if (avail_in > max_in)
  ------------------
  |  Branch (485:7): [True: 0, False: 3.51k]
  ------------------
  486|      0|			avail_in = max_in;
  487|  3.51k|		state->stream.avail_in = (uInt)avail_in;
  488|       |
  489|       |		/* Decompress and consume some of that data. */
  490|  3.51k|		ret = inflate(&(state->stream), 0);
  491|  3.51k|		switch (ret) {
  492|  3.38k|		case Z_OK: /* Decompressor made some progress. */
  ------------------
  |  Branch (492:3): [True: 3.38k, False: 121]
  ------------------
  493|  3.38k|			__archive_read_filter_consume(self->upstream,
  494|  3.38k|			    avail_in - state->stream.avail_in);
  495|  3.38k|			break;
  496|    121|		case Z_STREAM_END: /* Found end of stream. */
  ------------------
  |  Branch (496:3): [True: 121, False: 3.38k]
  ------------------
  497|    121|			__archive_read_filter_consume(self->upstream,
  498|    121|			    avail_in - state->stream.avail_in);
  499|       |			/* Consume the stream trailer; release the
  500|       |			 * decompression library. */
  501|    121|			ret = consume_trailer(self);
  502|    121|			if (ret < ARCHIVE_OK)
  ------------------
  |  |  233|    121|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (502:8): [True: 0, False: 121]
  ------------------
  503|      0|				return (ret);
  504|    121|			break;
  505|    121|		default:
  ------------------
  |  Branch (505:3): [True: 0, False: 3.51k]
  ------------------
  506|       |			/* Return an error. */
  507|      0|			archive_set_error(&self->archive->archive,
  508|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  509|      0|			    "gzip decompression failed");
  510|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  511|  3.51k|		}
  512|  3.51k|	}
  513|       |
  514|       |	/* We've read as much as we can. */
  515|  3.55k|	decompressed = state->stream.next_out - state->out_block;
  516|  3.55k|	if (decompressed == 0)
  ------------------
  |  Branch (516:6): [True: 101, False: 3.45k]
  ------------------
  517|    101|		*p = NULL;
  518|  3.45k|	else
  519|  3.45k|		*p = state->out_block;
  520|  3.55k|	return (decompressed);
  521|  3.59k|}
archive_read_support_filter_gzip.c:consume_header:
  341|    262|{
  342|    262|	struct private_data *state;
  343|    262|	ssize_t avail, max_in;
  344|    262|	size_t len;
  345|    262|	int ret;
  346|       |
  347|    262|	state = (struct private_data *)self->data;
  348|       |
  349|       |	/* If this is a real header, consume it. */
  350|    262|	len = peek_at_header(self->upstream, NULL, state);
  351|    262|	if (len == 0)
  ------------------
  |  Branch (351:6): [True: 101, False: 161]
  ------------------
  352|    101|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|    101|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  353|    161|	__archive_read_filter_consume(self->upstream, len);
  354|       |
  355|       |	/* Initialize CRC accumulator. */
  356|    161|	state->crc = crc32(0L, NULL, 0);
  357|       |
  358|       |	/* Initialize compression library. */
  359|    161|	state->stream.next_in = (unsigned char *)(uintptr_t)
  360|    161|	    __archive_read_filter_ahead(self->upstream, 1, &avail);
  361|    161|	if (avail < 0) {
  ------------------
  |  Branch (361:6): [True: 0, False: 161]
  ------------------
  362|      0|		archive_set_error(&self->archive->archive,
  363|      0|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  364|      0|		    "Failed to read gzip input");
  365|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  366|      0|	}
  367|    161|	if (UINT_MAX >= SSIZE_MAX)
  ------------------
  |  Branch (367:6): [Folded, False: 161]
  ------------------
  368|      0|		max_in = SSIZE_MAX;
  369|    161|	else
  370|    161|		max_in = UINT_MAX;
  371|    161|	if (avail > max_in)
  ------------------
  |  Branch (371:6): [True: 0, False: 161]
  ------------------
  372|      0|		avail = max_in;
  373|    161|	state->stream.avail_in = (uInt)avail;
  374|    161|	ret = inflateInit2(&(state->stream),
  375|    161|	    -15 /* Don't check for zlib header */);
  376|       |
  377|       |	/* Decipher the error code. */
  378|    161|	switch (ret) {
  379|    161|	case Z_OK:
  ------------------
  |  Branch (379:2): [True: 161, False: 0]
  ------------------
  380|    161|		state->in_stream = 1;
  381|    161|		return (ARCHIVE_OK);
  ------------------
  |  |  233|    161|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  382|      0|	case Z_STREAM_ERROR:
  ------------------
  |  Branch (382:2): [True: 0, False: 161]
  ------------------
  383|      0|		archive_set_error(&self->archive->archive,
  384|      0|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  385|      0|		    "Internal error initializing compression library: "
  386|      0|		    "invalid setup parameter");
  387|      0|		break;
  388|      0|	case Z_MEM_ERROR:
  ------------------
  |  Branch (388:2): [True: 0, False: 161]
  ------------------
  389|      0|		archive_set_error(&self->archive->archive, ENOMEM,
  390|      0|		    "Internal error initializing compression library: "
  391|      0|		    "out of memory");
  392|      0|		break;
  393|      0|	case Z_VERSION_ERROR:
  ------------------
  |  Branch (393:2): [True: 0, False: 161]
  ------------------
  394|      0|		archive_set_error(&self->archive->archive,
  395|      0|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  396|      0|		    "Internal error initializing compression library: "
  397|      0|		    "invalid library version");
  398|      0|		break;
  399|      0|	default:
  ------------------
  |  Branch (399:2): [True: 0, False: 161]
  ------------------
  400|      0|		archive_set_error(&self->archive->archive,
  401|      0|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  402|      0|		    "Internal error initializing compression library: "
  403|      0|		    " Zlib error %d", ret);
  404|      0|		break;
  405|    161|	}
  406|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  407|    161|}
archive_read_support_filter_gzip.c:consume_trailer:
  411|    121|{
  412|    121|	struct private_data *state;
  413|    121|	const unsigned char *p;
  414|    121|	ssize_t avail;
  415|       |
  416|    121|	state = (struct private_data *)self->data;
  417|       |
  418|    121|	state->in_stream = 0;
  419|    121|	switch (inflateEnd(&(state->stream))) {
  420|    121|	case Z_OK:
  ------------------
  |  Branch (420:2): [True: 121, False: 0]
  ------------------
  421|    121|		break;
  422|      0|	default:
  ------------------
  |  Branch (422:2): [True: 0, False: 121]
  ------------------
  423|      0|		archive_set_error(&self->archive->archive,
  424|      0|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  425|      0|		    "Failed to clean up gzip decompressor");
  426|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  427|    121|	}
  428|       |
  429|       |	/* GZip trailer is a fixed 8 byte structure. */
  430|    121|	p = __archive_read_filter_ahead(self->upstream, 8, &avail);
  431|    121|	if (p == NULL || avail == 0)
  ------------------
  |  Branch (431:6): [True: 0, False: 121]
  |  Branch (431:19): [True: 0, False: 121]
  ------------------
  432|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  433|       |
  434|       |	/* XXX TODO: Verify the length and CRC. */
  435|       |
  436|       |	/* We've verified the trailer, so consume it now. */
  437|    121|	__archive_read_filter_consume(self->upstream, 8);
  438|       |
  439|    121|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    121|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  440|    121|}
archive_read_support_filter_gzip.c:gzip_filter_close:
  528|    141|{
  529|    141|	struct private_data *state;
  530|    141|	int ret;
  531|       |
  532|    141|	state = (struct private_data *)self->data;
  533|    141|	ret = ARCHIVE_OK;
  ------------------
  |  |  233|    141|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  534|       |
  535|    141|	if (state->in_stream) {
  ------------------
  |  Branch (535:6): [True: 40, False: 101]
  ------------------
  536|     40|		switch (inflateEnd(&(state->stream))) {
  537|     40|		case Z_OK:
  ------------------
  |  Branch (537:3): [True: 40, False: 0]
  ------------------
  538|     40|			break;
  539|      0|		default:
  ------------------
  |  Branch (539:3): [True: 0, False: 40]
  ------------------
  540|      0|			archive_set_error(&(self->archive->archive),
  541|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  542|      0|			    "Failed to clean up gzip compressor");
  543|      0|			ret = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  544|     40|		}
  545|     40|	}
  546|       |
  547|    141|	free(state->name);
  548|    141|	free(state->out_block);
  549|    141|	free(state);
  550|    141|	return (ret);
  551|    141|}
archive_read_support_filter_gzip.c:gzip_read_header:
  281|      1|{
  282|      1|	struct private_data *state;
  283|       |
  284|      1|	state = (struct private_data *)self->data;
  285|       |
  286|       |	/* A mtime of 0 is considered invalid/missing. */
  287|      1|	if (state->mtime != 0)
  ------------------
  |  Branch (287:6): [True: 1, False: 0]
  ------------------
  288|      1|		archive_entry_set_mtime(entry, state->mtime, 0);
  289|       |
  290|       |	/* If the name is available, extract it. */
  291|      1|	if (state->name)
  ------------------
  |  Branch (291:6): [True: 0, False: 1]
  ------------------
  292|      0|		archive_entry_set_pathname(entry, state->name);
  293|       |
  294|      1|	return (ARCHIVE_OK);
  ------------------
  |  |  233|      1|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  295|      1|}

archive_read_support_filter_lrzip:
   61|  2.49k|{
   62|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
   63|       |
   64|  2.49k|	if (__archive_read_register_bidder(a, NULL, "lrzip",
  ------------------
  |  Branch (64:6): [True: 0, False: 2.49k]
  ------------------
   65|  2.49k|				&lrzip_bidder_vtable) != ARCHIVE_OK)
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
   66|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
   67|       |
   68|       |	/* This filter always uses an external program. */
   69|  2.49k|	archive_set_error(_a, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|  2.49k|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
   70|  2.49k|	    "Using external lrzip program for lrzip decompression");
   71|  2.49k|	return (ARCHIVE_WARN);
  ------------------
  |  |  235|  2.49k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
   72|  2.49k|}
archive_read_support_filter_lrzip.c:lrzip_bidder_bid:
   80|  2.86k|{
   81|  2.86k|	const unsigned char *p;
   82|  2.86k|	ssize_t avail, len;
   83|  2.86k|	int i;
   84|       |
   85|  2.86k|	(void)self; /* UNUSED */
   86|       |	/* Start by looking at the first six bytes of the header, which
   87|       |	 * is all fixed layout. */
   88|  2.86k|	len = 6;
   89|  2.86k|	p = __archive_read_filter_ahead(filter, len, &avail);
   90|  2.86k|	if (p == NULL || avail == 0)
  ------------------
  |  Branch (90:6): [True: 62, False: 2.80k]
  |  Branch (90:19): [True: 0, False: 2.80k]
  ------------------
   91|     62|		return (0);
   92|       |
   93|  2.80k|	if (memcmp(p, LRZIP_HEADER_MAGIC, LRZIP_HEADER_MAGIC_LEN))
  ------------------
  |  |   45|  2.80k|#define LRZIP_HEADER_MAGIC "LRZI"
  ------------------
              	if (memcmp(p, LRZIP_HEADER_MAGIC, LRZIP_HEADER_MAGIC_LEN))
  ------------------
  |  |   46|  2.80k|#define LRZIP_HEADER_MAGIC_LEN 4
  ------------------
  |  Branch (93:6): [True: 2.80k, False: 0]
  ------------------
   94|  2.80k|		return (0);
   95|       |
   96|       |	/* current major version is always 0, verify this */
   97|      0|	if (p[LRZIP_HEADER_MAGIC_LEN])
  ------------------
  |  |   46|      0|#define LRZIP_HEADER_MAGIC_LEN 4
  ------------------
  |  Branch (97:6): [True: 0, False: 0]
  ------------------
   98|      0|		return 0;
   99|       |	/* support only v0.6+ lrzip for sanity */
  100|      0|	i = p[LRZIP_HEADER_MAGIC_LEN + 1];
  ------------------
  |  |   46|      0|#define LRZIP_HEADER_MAGIC_LEN 4
  ------------------
  101|      0|	if ((i < 6) || (i > 10))
  ------------------
  |  Branch (101:6): [True: 0, False: 0]
  |  Branch (101:17): [True: 0, False: 0]
  ------------------
  102|      0|		return 0;
  103|       |
  104|      0|	return (int)len;
  105|      0|}

archive_read_support_filter_lz4:
  118|  2.49k|{
  119|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
  120|       |
  121|  2.49k|	if (__archive_read_register_bidder(a, NULL, "lz4",
  ------------------
  |  Branch (121:6): [True: 0, False: 2.49k]
  ------------------
  122|  2.49k|				&lz4_bidder_vtable) != ARCHIVE_OK)
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  123|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  124|       |
  125|  2.49k|#if defined(HAVE_LIBLZ4)
  126|  2.49k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  127|       |#else
  128|       |	archive_set_error(_a, ARCHIVE_ERRNO_MISC,
  129|       |	    "Using external lz4 program");
  130|       |	return (ARCHIVE_WARN);
  131|       |#endif
  132|  2.49k|}
archive_read_support_filter_lz4.c:lz4_reader_bid:
  144|  2.86k|{
  145|  2.86k|	const unsigned char *buffer;
  146|  2.86k|	ssize_t avail;
  147|  2.86k|	int bits_checked = 0;
  148|  2.86k|	ssize_t min_lz4_archive_size = 11;
  149|       |
  150|       |	// LZ4 skippable frames contain a 4 byte magic number followed by
  151|       |	// a 4 byte frame data size, then that number of bytes of data. Regular
  152|       |	// frames contain a 4 byte magic number followed by a 2-14 byte frame
  153|       |	// header, some data, and a 3 byte end marker.
  154|  2.86k|	ssize_t min_lz4_frame_size = 8;
  155|       |
  156|  2.86k|	ssize_t offset_in_buffer = 0;
  157|  2.86k|	ssize_t max_lookahead = 64 * 1024;
  158|       |
  159|  2.86k|	(void)self; // UNUSED
  160|       |
  161|       |	// Zstd and LZ4 skippable frame magic numbers are identical. To
  162|       |	// differentiate these two, we need to look for a non-skippable
  163|       |	// frame.
  164|       |
  165|       |	// Minimal lz4 archive is 11 bytes.
  166|  2.86k|	buffer = __archive_read_filter_ahead(filter, min_lz4_archive_size, &avail);
  167|  2.86k|	if (buffer == NULL)
  ------------------
  |  Branch (167:6): [True: 62, False: 2.80k]
  ------------------
  168|     62|		return (0);
  169|       |
  170|  2.80k|	uint32_t magic_number = archive_le32dec(buffer);
  171|       |
  172|  2.80k|	while ((magic_number & LZ4_SKIPPABLE_MASK) == LZ4_SKIPPABLE_START) {
  ------------------
  |  |   56|  2.80k|#define LZ4_SKIPPABLE_MASK 0xFFFFFFF0
  ------------------
              	while ((magic_number & LZ4_SKIPPABLE_MASK) == LZ4_SKIPPABLE_START) {
  ------------------
  |  |   55|  2.80k|#define LZ4_SKIPPABLE_START 0x184D2A50
  ------------------
  |  Branch (172:9): [True: 0, False: 2.80k]
  ------------------
  173|       |
  174|      0|		offset_in_buffer += 4; // Skip over the magic number
  175|       |
  176|       |		// Ensure that we can read another 4 bytes.
  177|      0|		if (offset_in_buffer + 4 > avail) {
  ------------------
  |  Branch (177:7): [True: 0, False: 0]
  ------------------
  178|      0|			buffer = __archive_read_filter_ahead(filter, offset_in_buffer + 4, &avail);
  179|      0|			if (buffer == NULL)
  ------------------
  |  Branch (179:8): [True: 0, False: 0]
  ------------------
  180|      0|				return (0);
  181|      0|		}
  182|       |
  183|      0|		uint32_t frame_data_size = archive_le32dec(buffer + offset_in_buffer);
  184|       |
  185|       |		// Skip over the 4 frame data size bytes, plus the value stored there.
  186|      0|		offset_in_buffer += 4 + frame_data_size;
  187|       |
  188|       |		// There should be at least one more frame if this is LZ4 data.
  189|      0|		if (offset_in_buffer + min_lz4_frame_size > avail) { // TODO: should this be >= ?
  ------------------
  |  Branch (189:7): [True: 0, False: 0]
  ------------------
  190|      0|			if (offset_in_buffer + min_lz4_frame_size > max_lookahead)
  ------------------
  |  Branch (190:8): [True: 0, False: 0]
  ------------------
  191|      0|				return (0); 
  192|       |
  193|      0|			buffer = __archive_read_filter_ahead(filter, offset_in_buffer + min_lz4_frame_size, &avail);
  194|      0|			if (buffer == NULL)
  ------------------
  |  Branch (194:8): [True: 0, False: 0]
  ------------------
  195|      0|				return (0); 
  196|      0|		}
  197|       |
  198|      0|		magic_number = archive_le32dec(buffer + offset_in_buffer);
  199|      0|	}
  200|       |
  201|       |	// We have skipped over any skippable frames. Either a regular LZ4 frame
  202|       |	// follows, or this isn't LZ4 data.
  203|       |
  204|  2.80k|	bits_checked = offset_in_buffer;
  205|  2.80k|	buffer = buffer + offset_in_buffer;
  206|       |
  207|  2.80k|	if (magic_number == LZ4_MAGICNUMBER) {
  ------------------
  |  |   51|  2.80k|#define LZ4_MAGICNUMBER		0x184d2204
  ------------------
  |  Branch (207:6): [True: 16, False: 2.78k]
  ------------------
  208|     16|		unsigned char flag, BD;
  209|       |
  210|     16|		bits_checked += 32;
  211|       |		/* Next follows a stream descriptor. */
  212|       |		/* Descriptor Flags. */
  213|     16|		flag = buffer[4];
  214|       |		/* A version number must be "01". */
  215|     16|		if (((flag & 0xc0) >> 6) != 1)
  ------------------
  |  Branch (215:7): [True: 0, False: 16]
  ------------------
  216|      0|			return (0);
  217|       |		/* A reserved bit must be "0". */
  218|     16|		if (flag & 2)
  ------------------
  |  Branch (218:7): [True: 0, False: 16]
  ------------------
  219|      0|			return (0);
  220|     16|		bits_checked += 8;
  221|     16|		BD = buffer[5];
  222|       |		/* A block maximum size should be more than 3. */
  223|     16|		if (((BD & 0x70) >> 4) < 4)
  ------------------
  |  Branch (223:7): [True: 0, False: 16]
  ------------------
  224|      0|			return (0);
  225|       |		/* Reserved bits must be "0". */
  226|     16|		if (BD & ~0x70)
  ------------------
  |  Branch (226:7): [True: 0, False: 16]
  ------------------
  227|      0|			return (0);
  228|     16|		bits_checked += 8;
  229|       |
  230|     16|		return (bits_checked);
  231|     16|	}
  232|       |
  233|  2.78k|	if (magic_number == LZ4_LEGACY) {
  ------------------
  |  |   52|  2.78k|#define LZ4_LEGACY		0x184c2102
  ------------------
  |  Branch (233:6): [True: 0, False: 2.78k]
  ------------------
  234|      0|		bits_checked += 32;
  235|      0|		return (bits_checked);
  236|      0|	}
  237|       |
  238|  2.78k|	return (0);
  239|  2.78k|}
archive_read_support_filter_lz4.c:lz4_reader_init:
  276|     16|{
  277|     16|	struct private_data *state;
  278|       |
  279|     16|	self->code = ARCHIVE_FILTER_LZ4;
  ------------------
  |  |  322|     16|#define	ARCHIVE_FILTER_LZ4	13
  ------------------
  280|     16|	self->name = "lz4";
  281|       |
  282|     16|	state = calloc(1, sizeof(*state));
  283|     16|	if (state == NULL) {
  ------------------
  |  Branch (283:6): [True: 0, False: 16]
  ------------------
  284|      0|		archive_set_error(&self->archive->archive, ENOMEM,
  285|      0|		    "Can't allocate data for lz4 decompression");
  286|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  287|      0|	}
  288|       |
  289|     16|	self->data = state;
  290|     16|	state->stage = SELECT_STREAM;
  291|     16|	self->vtable = &lz4_reader_vtable;
  292|       |
  293|     16|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     16|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  294|     16|}
archive_read_support_filter_lz4.c:lz4_filter_read:
  347|  2.23k|{
  348|  2.23k|	struct private_data *state = (struct private_data *)self->data;
  349|  2.23k|	ssize_t ret;
  350|       |
  351|  2.23k|	if (state->eof) {
  ------------------
  |  Branch (351:6): [True: 0, False: 2.23k]
  ------------------
  352|      0|		*p = NULL;
  353|      0|		return (0);
  354|      0|	}
  355|       |
  356|  2.23k|	__archive_read_filter_consume(self->upstream, state->unconsumed);
  357|  2.23k|	state->unconsumed = 0;
  358|       |
  359|  2.23k|	switch (state->stage) {
  360|     16|	case SELECT_STREAM:
  ------------------
  |  Branch (360:2): [True: 16, False: 2.22k]
  ------------------
  361|     16|		break;
  362|      0|	case READ_DEFAULT_STREAM:
  ------------------
  |  Branch (362:2): [True: 0, False: 2.23k]
  ------------------
  363|      0|	case READ_LEGACY_STREAM:
  ------------------
  |  Branch (363:2): [True: 0, False: 2.23k]
  ------------------
  364|       |		/* Reading a lz4 stream already failed. */
  365|      0|		archive_set_error(&self->archive->archive,
  366|      0|		    ARCHIVE_ERRNO_MISC, "Invalid sequence");
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  367|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  368|  2.22k|	case READ_DEFAULT_BLOCK:
  ------------------
  |  Branch (368:2): [True: 2.22k, False: 16]
  ------------------
  369|  2.22k|		ret = lz4_filter_read_default_stream(self, p);
  370|  2.22k|		if (ret != 0 || state->stage != SELECT_STREAM)
  ------------------
  |  Branch (370:7): [True: 1.83k, False: 384]
  |  Branch (370:19): [True: 0, False: 384]
  ------------------
  371|  1.83k|			return ret;
  372|    384|		break;
  373|    384|	case READ_LEGACY_BLOCK:
  ------------------
  |  Branch (373:2): [True: 0, False: 2.23k]
  ------------------
  374|      0|		ret = lz4_filter_read_legacy_stream(self, p);
  375|      0|		if (ret != 0 || state->stage != SELECT_STREAM)
  ------------------
  |  Branch (375:7): [True: 0, False: 0]
  |  Branch (375:19): [True: 0, False: 0]
  ------------------
  376|      0|			return ret;
  377|      0|		break;
  378|      0|	default:
  ------------------
  |  Branch (378:2): [True: 0, False: 2.23k]
  ------------------
  379|      0|		archive_set_error(&self->archive->archive,
  380|      0|		    ARCHIVE_ERRNO_MISC, "Program error");
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  381|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  382|  2.23k|	}
  383|       |
  384|    400|	while (state->stage == SELECT_STREAM) {
  ------------------
  |  Branch (384:9): [True: 400, False: 0]
  ------------------
  385|    400|		const char *read_buf;
  386|       |
  387|       |		/* Read a magic number. */
  388|    400|		read_buf = __archive_read_filter_ahead(self->upstream, 4,
  389|    400|				NULL);
  390|    400|		if (read_buf == NULL) {
  ------------------
  |  Branch (390:7): [True: 0, False: 400]
  ------------------
  391|      0|			state->eof = 1;
  392|      0|			*p = NULL;
  393|      0|			return (0);
  394|      0|		}
  395|    400|		uint32_t number = archive_le32dec(read_buf);
  396|    400|		__archive_read_filter_consume(self->upstream, 4);
  397|    400|		if (number == LZ4_MAGICNUMBER)
  ------------------
  |  |   51|    400|#define LZ4_MAGICNUMBER		0x184d2204
  ------------------
  |  Branch (397:7): [True: 400, False: 0]
  ------------------
  398|    400|			return lz4_filter_read_default_stream(self, p);
  399|      0|		else if (number == LZ4_LEGACY)
  ------------------
  |  |   52|      0|#define LZ4_LEGACY		0x184c2102
  ------------------
  |  Branch (399:12): [True: 0, False: 0]
  ------------------
  400|      0|			return lz4_filter_read_legacy_stream(self, p);
  401|      0|		else if ((number & LZ4_SKIPPABLE_MASK) == LZ4_SKIPPABLE_START) {
  ------------------
  |  |   56|      0|#define LZ4_SKIPPABLE_MASK 0xFFFFFFF0
  ------------------
              		else if ((number & LZ4_SKIPPABLE_MASK) == LZ4_SKIPPABLE_START) {
  ------------------
  |  |   55|      0|#define LZ4_SKIPPABLE_START 0x184D2A50
  ------------------
  |  Branch (401:12): [True: 0, False: 0]
  ------------------
  402|      0|			read_buf = __archive_read_filter_ahead(
  403|      0|				self->upstream, 4, NULL);
  404|      0|			if (read_buf == NULL) {
  ------------------
  |  Branch (404:8): [True: 0, False: 0]
  ------------------
  405|      0|				archive_set_error(
  406|      0|				    &self->archive->archive,
  407|      0|		    		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  408|      0|				    "Malformed lz4 data");
  409|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  410|      0|			}
  411|      0|			uint32_t skip_bytes = archive_le32dec(read_buf);
  412|      0|			__archive_read_filter_consume(self->upstream,
  413|      0|				4 + skip_bytes);
  414|      0|		} else {
  415|       |			/* Ignore following unrecognized data. */
  416|      0|			state->eof = 1;
  417|      0|			*p = NULL;
  418|      0|			return (0);
  419|      0|		}
  420|    400|	}
  421|      0|	state->eof = 1;
  422|       |	*p = NULL;
  423|      0|	return (0);
  424|    400|}
archive_read_support_filter_lz4.c:lz4_filter_read_default_stream:
  673|  2.62k|{
  674|  2.62k|	struct private_data *state = (struct private_data *)self->data;
  675|  2.62k|	const char *read_buf;
  676|  2.62k|	ssize_t bytes_remaining;
  677|  2.62k|	ssize_t ret;
  678|       |
  679|  2.62k|	if (state->stage == SELECT_STREAM) {
  ------------------
  |  Branch (679:6): [True: 400, False: 2.22k]
  ------------------
  680|    400|		state->stage = READ_DEFAULT_STREAM;
  681|       |		/* First, read a descriptor. */
  682|    400|		if((ret = lz4_filter_read_descriptor(self)) != ARCHIVE_OK)
  ------------------
  |  |  233|    400|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (682:6): [True: 1, False: 399]
  ------------------
  683|      1|			return (ret);
  684|    399|		state->stage = READ_DEFAULT_BLOCK;
  685|    399|	}
  686|       |	/* Decompress a block. */
  687|  2.61k|	ret = lz4_filter_read_data_block(self, p);
  688|       |
  689|       |	/* If the end of block is detected, change the filter status
  690|       |	   to read next stream. */
  691|  2.61k|	if (ret == 0 && *p == NULL)
  ------------------
  |  Branch (691:6): [True: 384, False: 2.23k]
  |  Branch (691:18): [True: 384, False: 0]
  ------------------
  692|    384|		state->stage = SELECT_STREAM;
  693|       |
  694|       |	/* Optional processing, checking a stream sum. */
  695|  2.61k|	if (state->flags.stream_checksum) {
  ------------------
  |  Branch (695:6): [True: 2.37k, False: 245]
  ------------------
  696|  2.37k|		if (state->stage == SELECT_STREAM) {
  ------------------
  |  Branch (696:7): [True: 263, False: 2.11k]
  ------------------
  697|    263|			unsigned int checksum;
  698|    263|			unsigned int checksum_stream;
  699|    263|			read_buf = __archive_read_filter_ahead(self->upstream,
  700|    263|			    4, &bytes_remaining);
  701|    263|			if (read_buf == NULL) {
  ------------------
  |  Branch (701:8): [True: 0, False: 263]
  ------------------
  702|      0|				archive_set_error(&self->archive->archive,
  703|      0|				    ARCHIVE_ERRNO_MISC, "truncated lz4 input");
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  704|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  705|      0|			}
  706|    263|			checksum = archive_le32dec(read_buf);
  707|    263|			__archive_read_filter_consume(self->upstream, 4);
  708|    263|			checksum_stream = __archive_xxhash.XXH32_digest(
  709|    263|			    state->xxh32_state);
  710|    263|			state->xxh32_state = NULL;
  711|    263|			if (checksum != checksum_stream) {
  ------------------
  |  Branch (711:8): [True: 263, False: 0]
  ------------------
  712|       |#ifndef DONT_FAIL_ON_CRC_ERROR
  713|       |				archive_set_error(&self->archive->archive,
  714|       |				    ARCHIVE_ERRNO_MISC,
  715|       |				    "lz4 stream checksum error");
  716|       |				return (ARCHIVE_FATAL);
  717|       |#endif
  718|    263|			}
  719|  2.11k|		} else if (ret > 0)
  ------------------
  |  Branch (719:14): [True: 2.09k, False: 13]
  ------------------
  720|  2.09k|			__archive_xxhash.XXH32_update(state->xxh32_state,
  721|  2.09k|			    *p, (int)ret);
  722|  2.37k|	}
  723|  2.61k|	return (ret);
  724|  2.61k|}
archive_read_support_filter_lz4.c:lz4_filter_read_descriptor:
  428|    400|{
  429|    400|	struct private_data *state = (struct private_data *)self->data;
  430|    400|	const char *read_buf;
  431|    400|	ssize_t bytes_remaining;
  432|    400|	ssize_t descriptor_bytes;
  433|    400|	unsigned char flag, bd;
  434|    400|	unsigned int chsum, chsum_verifier;
  435|       |
  436|       |	/* Make sure we have 2 bytes for flags. */
  437|    400|	read_buf = __archive_read_filter_ahead(self->upstream, 2,
  438|    400|	    &bytes_remaining);
  439|    400|	if (read_buf == NULL) {
  ------------------
  |  Branch (439:6): [True: 1, False: 399]
  ------------------
  440|      1|		archive_set_error(&self->archive->archive,
  441|      1|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  442|      1|		    "truncated lz4 input");
  443|      1|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  444|      1|	}
  445|       |
  446|       |	/*
  447|       |	   Parse flags.
  448|       |	 */
  449|    399|	flag = (unsigned char)read_buf[0];
  450|       |	/* Verify version number. */
  451|    399|	if ((flag & 0xc0) != 1<<6)
  ------------------
  |  Branch (451:6): [True: 0, False: 399]
  ------------------
  452|      0|		goto malformed_error;
  453|       |	/* A reserved bit must be zero. */
  454|    399|	if (flag & 0x02)
  ------------------
  |  Branch (454:6): [True: 0, False: 399]
  ------------------
  455|      0|		goto malformed_error;
  456|    399|	state->flags.block_independence = (flag & 0x20) != 0;
  457|    399|	state->flags.block_checksum = (flag & 0x10)?4:0;
  ------------------
  |  Branch (457:32): [True: 5, False: 394]
  ------------------
  458|    399|	state->flags.stream_size = (flag & 0x08) != 0;
  459|    399|	state->flags.stream_checksum = (flag & 0x04) != 0;
  460|    399|	state->flags.preset_dictionary = (flag & 0x01) != 0;
  461|       |
  462|       |	/* BD */
  463|    399|	bd = (unsigned char)read_buf[1];
  464|       |	/* Reserved bits must be zero. */
  465|    399|	if (bd & 0x8f)
  ------------------
  |  Branch (465:6): [True: 0, False: 399]
  ------------------
  466|      0|		goto malformed_error;
  467|       |	/* Get a maximum block size. */
  468|    399|	switch (read_buf[1] >> 4) {
  469|     11|	case 4: /* 64 KB */
  ------------------
  |  Branch (469:2): [True: 11, False: 388]
  ------------------
  470|     11|		state->flags.block_maximum_size = 64 * 1024;
  471|     11|		break;
  472|    266|	case 5: /* 256 KB */
  ------------------
  |  Branch (472:2): [True: 266, False: 133]
  ------------------
  473|    266|		state->flags.block_maximum_size = 256 * 1024;
  474|    266|		break;
  475|      0|	case 6: /* 1 MB */
  ------------------
  |  Branch (475:2): [True: 0, False: 399]
  ------------------
  476|      0|		state->flags.block_maximum_size = 1024 * 1024;
  477|      0|		break;
  478|    122|	case 7: /* 4 MB */
  ------------------
  |  Branch (478:2): [True: 122, False: 277]
  ------------------
  479|    122|		state->flags.block_maximum_size = 4 * 1024 * 1024;
  480|    122|		break;
  481|      0|	default:
  ------------------
  |  Branch (481:2): [True: 0, False: 399]
  ------------------
  482|      0|		goto malformed_error;
  483|    399|	}
  484|       |
  485|       |	/* Read the whole descriptor in a stream block. */
  486|    399|	descriptor_bytes = 3;
  487|    399|	if (state->flags.stream_size)
  ------------------
  |  Branch (487:6): [True: 0, False: 399]
  ------------------
  488|      0|		descriptor_bytes += 8;
  489|    399|	if (state->flags.preset_dictionary)
  ------------------
  |  Branch (489:6): [True: 0, False: 399]
  ------------------
  490|      0|		descriptor_bytes += 4;
  491|    399|	if (bytes_remaining < descriptor_bytes) {
  ------------------
  |  Branch (491:6): [True: 0, False: 399]
  ------------------
  492|      0|		read_buf = __archive_read_filter_ahead(self->upstream,
  493|      0|		    descriptor_bytes, &bytes_remaining);
  494|      0|		if (read_buf == NULL) {
  ------------------
  |  Branch (494:7): [True: 0, False: 0]
  ------------------
  495|      0|			archive_set_error(&self->archive->archive,
  496|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  497|      0|			    "truncated lz4 input");
  498|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  499|      0|		}
  500|      0|	}
  501|       |	/* Check if a descriptor is corrupted */
  502|    399|	chsum = __archive_xxhash.XXH32(read_buf, (int)descriptor_bytes -1, 0);
  503|    399|	chsum = (chsum >> 8) & 0xff;
  504|    399|	chsum_verifier = read_buf[descriptor_bytes-1] & 0xff;
  505|       |#ifndef DONT_FAIL_ON_CRC_ERROR
  506|       |	if (chsum != chsum_verifier)
  507|       |		goto malformed_error;
  508|       |#endif
  509|       |
  510|    399|	__archive_read_filter_consume(self->upstream, descriptor_bytes);
  511|       |
  512|       |	/* Make sure we have a large enough buffer for uncompressed data. */
  513|    399|	if (lz4_allocate_out_block(self) != ARCHIVE_OK)
  ------------------
  |  |  233|    399|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (513:6): [True: 0, False: 399]
  ------------------
  514|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  515|    399|	if (state->flags.stream_checksum)
  ------------------
  |  Branch (515:6): [True: 276, False: 123]
  ------------------
  516|    276|		state->xxh32_state = __archive_xxhash.XXH32_init(0);
  517|       |
  518|    399|	state->decoded_size = 0;
  519|       |	/* Success */
  520|    399|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    399|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  521|      0|malformed_error:
  522|      0|	archive_set_error(&self->archive->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  523|      0|	    "malformed lz4 data");
  524|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  525|    399|}
archive_read_support_filter_lz4.c:lz4_allocate_out_block:
  298|    399|{
  299|    399|	struct private_data *state = (struct private_data *)self->data;
  300|    399|	size_t out_block_size = state->flags.block_maximum_size;
  301|    399|	void *out_block;
  302|       |
  303|    399|	if (!state->flags.block_independence)
  ------------------
  |  Branch (303:6): [True: 272, False: 127]
  ------------------
  304|    272|		out_block_size += 64 * 1024;
  305|    399|	if (state->out_block_size < out_block_size) {
  ------------------
  |  Branch (305:6): [True: 16, False: 383]
  ------------------
  306|     16|		free(state->out_block);
  307|     16|		out_block = malloc(out_block_size);
  308|     16|		state->out_block_size = out_block_size;
  309|     16|		if (out_block == NULL) {
  ------------------
  |  Branch (309:7): [True: 0, False: 16]
  ------------------
  310|      0|			archive_set_error(&self->archive->archive, ENOMEM,
  311|      0|			    "Can't allocate data for lz4 decompression");
  312|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  313|      0|		}
  314|     16|		state->out_block = out_block;
  315|     16|	}
  316|    399|	if (!state->flags.block_independence)
  ------------------
  |  Branch (316:6): [True: 272, False: 127]
  ------------------
  317|    272|		memset(state->out_block, 0, 64 * 1024);
  318|    399|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    399|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  319|    399|}
archive_read_support_filter_lz4.c:lz4_filter_read_data_block:
  529|  2.61k|{
  530|  2.61k|	struct private_data *state = (struct private_data *)self->data;
  531|  2.61k|	ssize_t compressed_size;
  532|  2.61k|	const char *read_buf;
  533|  2.61k|	ssize_t bytes_remaining;
  534|  2.61k|	int checksum_size;
  535|  2.61k|	ssize_t uncompressed_size;
  536|  2.61k|	size_t prefix64k;
  537|       |
  538|  2.61k|	*p = NULL;
  539|       |
  540|       |	/* Make sure we have 4 bytes for a block size. */
  541|  2.61k|	read_buf = __archive_read_filter_ahead(self->upstream, 4,
  542|  2.61k|	    &bytes_remaining);
  543|  2.61k|	if (read_buf == NULL)
  ------------------
  |  Branch (543:6): [True: 2, False: 2.61k]
  ------------------
  544|      2|		goto truncated_error;
  545|  2.61k|	compressed_size = archive_le32dec(read_buf);
  546|  2.61k|	if ((compressed_size & 0x7fffffff) > state->flags.block_maximum_size)
  ------------------
  |  Branch (546:6): [True: 8, False: 2.60k]
  ------------------
  547|      8|		goto malformed_error;
  548|       |	/* A compressed size == 0 means the end of stream blocks. */
  549|  2.60k|	if (compressed_size == 0) {
  ------------------
  |  Branch (549:6): [True: 384, False: 2.22k]
  ------------------
  550|    384|		__archive_read_filter_consume(self->upstream, 4);
  551|    384|		return 0;
  552|    384|	}
  553|       |
  554|  2.22k|	checksum_size = state->flags.block_checksum;
  555|       |	/* Check if the block is uncompressed. */
  556|  2.22k|	if (compressed_size & 0x80000000U) {
  ------------------
  |  Branch (556:6): [True: 2.22k, False: 4]
  ------------------
  557|  2.22k|		compressed_size &= 0x7fffffff;
  558|  2.22k|		uncompressed_size = compressed_size;
  559|  2.22k|	} else
  560|      4|		uncompressed_size = 0;/* Unknown yet. */
  561|       |
  562|       |	/*
  563|       |	  Unfortunately, lz4 decompression API requires a whole block
  564|       |	  for its decompression speed, so we read a whole block and allocate
  565|       |	  a huge buffer used for decoded data.
  566|       |	*/
  567|  2.22k|	read_buf = __archive_read_filter_ahead(self->upstream,
  568|  2.22k|	    4 + compressed_size + checksum_size, &bytes_remaining);
  569|  2.22k|	if (read_buf == NULL)
  ------------------
  |  Branch (569:6): [True: 1, False: 2.22k]
  ------------------
  570|      1|		goto truncated_error;
  571|       |
  572|       |	/* Optional processing, checking a block sum. */
  573|  2.22k|	if (checksum_size) {
  ------------------
  |  Branch (573:6): [True: 363, False: 1.86k]
  ------------------
  574|    363|		unsigned int chsum = __archive_xxhash.XXH32(
  575|    363|			read_buf + 4, (int)compressed_size, 0);
  576|    363|		unsigned int chsum_block =
  577|    363|		    archive_le32dec(read_buf + 4 + compressed_size);
  578|       |#ifndef DONT_FAIL_ON_CRC_ERROR
  579|       |		if (chsum != chsum_block)
  580|       |			goto malformed_error;
  581|       |#endif
  582|    363|	}
  583|       |
  584|       |
  585|       |	/* If the block is uncompressed, there is nothing to do. */
  586|  2.22k|	if (uncompressed_size) {
  ------------------
  |  Branch (586:6): [True: 2.22k, False: 4]
  ------------------
  587|       |		/* Prepare a prefix 64k block for next block. */
  588|  2.22k|		if (!state->flags.block_independence) {
  ------------------
  |  Branch (588:7): [True: 629, False: 1.59k]
  ------------------
  589|    629|			prefix64k = 64 * 1024;
  590|    629|			if (uncompressed_size < (ssize_t)prefix64k) {
  ------------------
  |  Branch (590:8): [True: 629, False: 0]
  ------------------
  591|    629|				memcpy(state->out_block
  592|    629|					+ prefix64k - uncompressed_size,
  593|    629|				    read_buf + 4,
  594|    629|				    uncompressed_size);
  595|    629|				memset(state->out_block, 0,
  596|    629|				    prefix64k - uncompressed_size);
  597|    629|			} else {
  598|      0|				memcpy(state->out_block,
  599|      0|				    read_buf + 4
  600|      0|					+ uncompressed_size - prefix64k,
  601|      0|				    prefix64k);
  602|      0|			}
  603|    629|			state->decoded_size = 0;
  604|    629|		}
  605|  2.22k|		state->unconsumed = 4 + uncompressed_size + checksum_size;
  606|  2.22k|		*p = read_buf + 4;
  607|  2.22k|		return uncompressed_size;
  608|  2.22k|	}
  609|       |
  610|       |	/*
  611|       |	   Decompress a block data.
  612|       |	 */
  613|      4|	if (state->flags.block_independence) {
  ------------------
  |  Branch (613:6): [True: 1, False: 3]
  ------------------
  614|      1|		prefix64k = 0;
  615|      1|		uncompressed_size = LZ4_decompress_safe(read_buf + 4,
  616|      1|		    state->out_block, (int)compressed_size,
  617|      1|		    state->flags.block_maximum_size);
  618|      3|	} else {
  619|      3|		prefix64k = 64 * 1024;
  620|      3|		if (state->decoded_size) {
  ------------------
  |  Branch (620:7): [True: 0, False: 3]
  ------------------
  621|      0|			if (state->decoded_size < prefix64k) {
  ------------------
  |  Branch (621:8): [True: 0, False: 0]
  ------------------
  622|      0|				memmove(state->out_block
  623|      0|					+ prefix64k - state->decoded_size,
  624|      0|				    state->out_block + prefix64k,
  625|      0|				    state->decoded_size);
  626|      0|				memset(state->out_block, 0,
  627|      0|				    prefix64k - state->decoded_size);
  628|      0|			} else {
  629|      0|				memmove(state->out_block,
  630|      0|				    state->out_block + state->decoded_size,
  631|      0|				    prefix64k);
  632|      0|			}
  633|      0|		}
  634|      3|#if LZ4_VERSION_MAJOR >= 1 && LZ4_VERSION_MINOR >= 7
  635|      3|		uncompressed_size = LZ4_decompress_safe_usingDict(
  636|      3|		    read_buf + 4,
  637|      3|		    state->out_block + prefix64k, (int)compressed_size,
  638|      3|		    state->flags.block_maximum_size,
  639|      3|		    state->out_block,
  640|      3|		    (int)prefix64k);
  641|       |#else
  642|       |		uncompressed_size = LZ4_decompress_safe_withPrefix64k(
  643|       |		    read_buf + 4,
  644|       |		    state->out_block + prefix64k, (int)compressed_size,
  645|       |		    state->flags.block_maximum_size);
  646|       |#endif
  647|      3|	}
  648|       |
  649|       |	/* Check if an error occurred in the decompression process. */
  650|      4|	if (uncompressed_size < 0) {
  ------------------
  |  Branch (650:6): [True: 4, False: 0]
  ------------------
  651|      4|		archive_set_error(&(self->archive->archive),
  652|      4|		    ARCHIVE_ERRNO_MISC, "lz4 decompression failed");
  ------------------
  |  |  204|      4|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  653|      4|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  654|      4|	}
  655|       |
  656|      0|	state->unconsumed = 4 + compressed_size + checksum_size;
  657|      0|	*p = state->out_block + prefix64k;
  658|      0|	state->decoded_size = uncompressed_size;
  659|      0|	return uncompressed_size;
  660|       |
  661|      8|malformed_error:
  662|      8|	archive_set_error(&self->archive->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      8|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  663|      8|	    "malformed lz4 data");
  664|      8|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      8|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  665|      3|truncated_error:
  666|      3|	archive_set_error(&self->archive->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      3|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  667|      3|	    "truncated lz4 input");
  668|      3|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      3|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  669|      4|}
archive_read_support_filter_lz4.c:lz4_filter_close:
  784|     16|{
  785|     16|	struct private_data *state;
  786|     16|	int ret = ARCHIVE_OK;
  ------------------
  |  |  233|     16|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  787|       |
  788|     16|	state = (struct private_data *)self->data;
  789|     16|	free(state->xxh32_state);
  790|     16|	free(state->out_block);
  791|     16|	free(state);
  792|     16|	return (ret);
  793|     16|}

archive_read_support_filter_lzop:
  109|  2.49k|{
  110|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
  111|       |
  112|  2.49k|	if (__archive_read_register_bidder(a, NULL, "lzop",
  ------------------
  |  Branch (112:6): [True: 0, False: 2.49k]
  ------------------
  113|  2.49k|				&lzop_bidder_vtable) != ARCHIVE_OK)
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  114|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  115|       |
  116|       |	/* Signal the extent of lzop support with the return value here. */
  117|       |#if defined(HAVE_LZO_LZOCONF_H) && defined(HAVE_LZO_LZO1X_H)
  118|       |	return (ARCHIVE_OK);
  119|       |#else
  120|       |	/* Return ARCHIVE_WARN since this always uses an external program. */
  121|  2.49k|	archive_set_error(_a, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|  2.49k|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  122|  2.49k|	    "Using external lzop program for lzop decompression");
  123|  2.49k|	return (ARCHIVE_WARN);
  ------------------
  |  |  235|  2.49k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  124|  2.49k|#endif
  125|  2.49k|}
archive_read_support_filter_lzop.c:lzop_bidder_bid:
  133|  2.86k|{
  134|  2.86k|	const unsigned char *p;
  135|  2.86k|	ssize_t avail;
  136|       |
  137|  2.86k|	(void)self; /* UNUSED */
  138|       |
  139|  2.86k|	p = __archive_read_filter_ahead(filter, LZOP_HEADER_MAGIC_LEN, &avail);
  ------------------
  |  |   68|  2.86k|#define LZOP_HEADER_MAGIC_LEN 9
  ------------------
  140|  2.86k|	if (p == NULL || avail == 0)
  ------------------
  |  Branch (140:6): [True: 62, False: 2.80k]
  |  Branch (140:19): [True: 0, False: 2.80k]
  ------------------
  141|     62|		return (0);
  142|       |
  143|  2.80k|	if (memcmp(p, LZOP_HEADER_MAGIC, LZOP_HEADER_MAGIC_LEN))
  ------------------
  |  |   67|  2.80k|#define LZOP_HEADER_MAGIC "\x89\x4c\x5a\x4f\x00\x0d\x0a\x1a\x0a"
  ------------------
              	if (memcmp(p, LZOP_HEADER_MAGIC, LZOP_HEADER_MAGIC_LEN))
  ------------------
  |  |   68|  2.80k|#define LZOP_HEADER_MAGIC_LEN 9
  ------------------
  |  Branch (143:6): [True: 2.80k, False: 0]
  ------------------
  144|  2.80k|		return (0);
  145|       |
  146|      0|	return (LZOP_HEADER_MAGIC_LEN * 8);
  ------------------
  |  |   68|      0|#define LZOP_HEADER_MAGIC_LEN 9
  ------------------
  147|  2.80k|}

archive_read_support_filter_rpm:
   86|  2.49k|{
   87|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
   88|       |
   89|       |	return __archive_read_register_bidder(a, NULL, "rpm",
   90|  2.49k|			&rpm_bidder_vtable);
   91|  2.49k|}
archive_read_support_filter_rpm.c:rpm_bidder_bid:
   96|  2.86k|{
   97|  2.86k|	const unsigned char *b;
   98|  2.86k|	ssize_t avail;
   99|  2.86k|	int bits_checked;
  100|       |
  101|  2.86k|	(void)self; /* UNUSED */
  102|       |
  103|  2.86k|	b = __archive_read_filter_ahead(filter, 8, &avail);
  104|  2.86k|	if (b == NULL)
  ------------------
  |  Branch (104:6): [True: 62, False: 2.80k]
  ------------------
  105|     62|		return (0);
  106|       |
  107|  2.80k|	bits_checked = 0;
  108|       |	/*
  109|       |	 * Verify Header Magic Bytes : 0XED 0XAB 0XEE 0XDB
  110|       |	 */
  111|  2.80k|	if (memcmp(b, "\xED\xAB\xEE\xDB", 4) != 0)
  ------------------
  |  Branch (111:6): [True: 2.72k, False: 79]
  ------------------
  112|  2.72k|		return (0);
  113|     79|	bits_checked += 32;
  114|       |	/*
  115|       |	 * Check major version.
  116|       |	 */
  117|     79|	if (b[4] != 3 && b[4] != 4)
  ------------------
  |  Branch (117:6): [True: 79, False: 0]
  |  Branch (117:19): [True: 0, False: 79]
  ------------------
  118|      0|		return (0);
  119|     79|	bits_checked += 8;
  120|       |	/*
  121|       |	 * Check package type; binary or source.
  122|       |	 */
  123|     79|	if (b[6] != 0)
  ------------------
  |  Branch (123:6): [True: 0, False: 79]
  ------------------
  124|      0|		return (0);
  125|     79|	bits_checked += 8;
  126|     79|	if (b[7] != 0 && b[7] != 1)
  ------------------
  |  Branch (126:6): [True: 41, False: 38]
  |  Branch (126:19): [True: 0, False: 41]
  ------------------
  127|      0|		return (0);
  128|     79|	bits_checked += 8;
  129|       |
  130|     79|	return (bits_checked);
  131|     79|}
archive_read_support_filter_rpm.c:rpm_bidder_init:
  141|     79|{
  142|     79|	struct rpm   *rpm;
  143|       |
  144|     79|	self->code = ARCHIVE_FILTER_RPM;
  ------------------
  |  |  317|     79|#define	ARCHIVE_FILTER_RPM	8
  ------------------
  145|     79|	self->name = "rpm";
  146|       |
  147|     79|	rpm = calloc(1, sizeof(*rpm));
  148|     79|	if (rpm == NULL) {
  ------------------
  |  Branch (148:6): [True: 0, False: 79]
  ------------------
  149|      0|		archive_set_error(&self->archive->archive, ENOMEM,
  150|      0|		    "Can't allocate data for rpm");
  151|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  152|      0|	}
  153|       |
  154|     79|	self->data = rpm;
  155|     79|	rpm->state = ST_LEAD;
  156|     79|	self->vtable = &rpm_reader_vtable;
  157|       |
  158|     79|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     79|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  159|     79|}
archive_read_support_filter_rpm.c:rpm_filter_read:
  169|    208|{
  170|    208|	struct rpm *rpm;
  171|    208|	const unsigned char *b;
  172|    208|	ssize_t avail_in, total, used;
  173|    208|	size_t n;
  174|    208|	uint64_t section;
  175|    208|	uint64_t bytes;
  176|       |
  177|    208|	rpm = (struct rpm *)self->data;
  178|    208|	*buff = NULL;
  179|    208|	total = avail_in = 0;
  180|    208|	b = NULL;
  181|    208|	used = 0;
  182|    522|	do {
  183|    522|		if (b == NULL) {
  ------------------
  |  Branch (183:7): [True: 210, False: 312]
  ------------------
  184|    210|			b = __archive_read_filter_ahead(self->upstream, 1,
  185|    210|			    &avail_in);
  186|    210|			if (b == NULL) {
  ------------------
  |  Branch (186:8): [True: 54, False: 156]
  ------------------
  187|     54|				if (avail_in < 0)
  ------------------
  |  Branch (187:9): [True: 0, False: 54]
  ------------------
  188|      0|					return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  189|     54|				else
  190|     54|					break;
  191|     54|			}
  192|    210|		}
  193|       |
  194|    468|		switch (rpm->state) {
  ------------------
  |  Branch (194:11): [True: 468, False: 0]
  ------------------
  195|     79|		case ST_LEAD:
  ------------------
  |  Branch (195:3): [True: 79, False: 389]
  ------------------
  196|     79|			if (rpm->total_in + avail_in < RPM_LEAD_SIZE)
  ------------------
  |  |   56|     79|#define RPM_LEAD_SIZE		96	/* Size of 'Lead' section. */
  ------------------
  |  Branch (196:8): [True: 0, False: 79]
  ------------------
  197|      0|				used += avail_in;
  198|     79|			else {
  199|     79|				n = (size_t)(RPM_LEAD_SIZE - rpm->total_in);
  ------------------
  |  |   56|     79|#define RPM_LEAD_SIZE		96	/* Size of 'Lead' section. */
  ------------------
  200|     79|				used += n;
  201|     79|				b += n;
  202|     79|				rpm->state = ST_HEADER;
  203|     79|				rpm->hpos = 0;
  204|     79|				rpm->hlen = 0;
  205|     79|				rpm->first_header = 1;
  206|     79|			}
  207|     79|			break;
  208|    156|		case ST_HEADER:
  ------------------
  |  Branch (208:3): [True: 156, False: 312]
  ------------------
  209|    156|			n = rpm_limit_bytes(RPM_MIN_HEAD_SIZE - rpm->hpos,
  ------------------
  |  |   57|    156|#define RPM_MIN_HEAD_SIZE	16	/* Minimum size of 'Head'. */
  ------------------
  210|    156|			    avail_in - used);
  211|    156|			memcpy(rpm->header+rpm->hpos, b, n);
  212|    156|			b += n;
  213|    156|			used += n;
  214|    156|			rpm->hpos += n;
  215|       |
  216|    156|			if (rpm->hpos == RPM_MIN_HEAD_SIZE) {
  ------------------
  |  |   57|    156|#define RPM_MIN_HEAD_SIZE	16	/* Minimum size of 'Head'. */
  ------------------
  |  Branch (216:8): [True: 156, False: 0]
  ------------------
  217|    156|				if (rpm->header[0] != 0x8e ||
  ------------------
  |  Branch (217:9): [True: 77, False: 79]
  ------------------
  218|     79|				    rpm->header[1] != 0xad ||
  ------------------
  |  Branch (218:9): [True: 0, False: 79]
  ------------------
  219|     79|				    rpm->header[2] != 0xe8 ||
  ------------------
  |  Branch (219:9): [True: 0, False: 79]
  ------------------
  220|     79|				    rpm->header[3] != 0x01) {
  ------------------
  |  Branch (220:9): [True: 0, False: 79]
  ------------------
  221|     77|					if (rpm->first_header) {
  ------------------
  |  Branch (221:10): [True: 0, False: 77]
  ------------------
  222|      0|						archive_set_error(
  223|      0|						    &self->archive->archive,
  224|      0|						    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  225|      0|						    "Unrecognized rpm header");
  226|      0|						return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  227|      0|					}
  228|     77|					rpm->state = ST_ARCHIVE;
  229|     77|					*buff = rpm->header;
  230|     77|					total = RPM_MIN_HEAD_SIZE;
  ------------------
  |  |   57|     77|#define RPM_MIN_HEAD_SIZE	16	/* Minimum size of 'Head'. */
  ------------------
  231|     77|					break;
  232|     77|				}
  233|       |				/* Calculate 'Header' length. */
  234|     79|				section = archive_be32dec(rpm->header+8);
  235|     79|				bytes = archive_be32dec(rpm->header+12);
  236|     79|				rpm->hlen = rpm->hpos + section * 16 + bytes;
  237|     79|				rpm->state = ST_HEADER_DATA;
  238|     79|				rpm->first_header = 0;
  239|     79|			}
  240|     79|			break;
  241|     79|		case ST_HEADER_DATA:
  ------------------
  |  Branch (241:3): [True: 79, False: 389]
  ------------------
  242|     79|			n = rpm_limit_bytes(rpm->hlen - rpm->hpos,
  243|     79|			    avail_in - used);
  244|     79|			b += n;
  245|     79|			used += n;
  246|     79|			rpm->hpos += n;
  247|     79|			if (rpm->hpos == rpm->hlen)
  ------------------
  |  Branch (247:8): [True: 77, False: 2]
  ------------------
  248|     77|				rpm->state = ST_PADDING;
  249|     79|			break;
  250|     77|		case ST_PADDING:
  ------------------
  |  Branch (250:3): [True: 77, False: 391]
  ------------------
  251|  1.22k|			while (used < avail_in) {
  ------------------
  |  Branch (251:11): [True: 1.22k, False: 0]
  ------------------
  252|  1.22k|				if (*b != 0) {
  ------------------
  |  Branch (252:9): [True: 77, False: 1.14k]
  ------------------
  253|       |					/* Read next header. */
  254|     77|					rpm->state = ST_HEADER;
  255|     77|					rpm->hpos = 0;
  256|     77|					rpm->hlen = 0;
  257|     77|					break;
  258|     77|				}
  259|  1.14k|				b++;
  260|  1.14k|				used++;
  261|  1.14k|			}
  262|     77|			break;
  263|     77|		case ST_ARCHIVE:
  ------------------
  |  Branch (263:3): [True: 77, False: 391]
  ------------------
  264|     77|			*buff = b;
  265|     77|			total = avail_in;
  266|     77|			used = avail_in;
  267|     77|			break;
  268|    468|		}
  269|    468|		if (used == avail_in) {
  ------------------
  |  Branch (269:7): [True: 79, False: 389]
  ------------------
  270|     79|			rpm->total_in += used;
  271|     79|			__archive_read_filter_consume(self->upstream, used);
  272|     79|			b = NULL;
  273|     79|			used = 0;
  274|     79|		}
  275|    468|	} while (total == 0 && avail_in > 0);
  ------------------
  |  Branch (275:11): [True: 314, False: 154]
  |  Branch (275:25): [True: 314, False: 0]
  ------------------
  276|       |
  277|    208|	if (used > 0 && b != NULL) {
  ------------------
  |  Branch (277:6): [True: 77, False: 131]
  |  Branch (277:18): [True: 77, False: 0]
  ------------------
  278|     77|		rpm->total_in += used;
  279|     77|		__archive_read_filter_consume(self->upstream, used);
  280|     77|	}
  281|    208|	return (total);
  282|    208|}
archive_read_support_filter_rpm.c:rpm_limit_bytes:
  163|    235|{
  164|    235|	return (bytes > max ? max : (size_t)bytes);
  ------------------
  |  Branch (164:10): [True: 2, False: 233]
  ------------------
  165|    235|}
archive_read_support_filter_rpm.c:rpm_filter_close:
  286|     79|{
  287|     79|	struct rpm *rpm;
  288|       |
  289|     79|	rpm = (struct rpm *)self->data;
  290|     79|	free(rpm);
  291|       |
  292|     79|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     79|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  293|     79|}

archive_read_support_filter_uu:
   94|  2.49k|{
   95|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
   96|       |
   97|       |	return __archive_read_register_bidder(a, NULL, "uu",
   98|  2.49k|			&uudecode_bidder_vtable);
   99|  2.49k|}
archive_read_support_filter_uu.c:uudecode_bidder_bid:
  265|  2.86k|{
  266|  2.86k|	const unsigned char *b;
  267|  2.86k|	ssize_t avail, ravail;
  268|  2.86k|	ssize_t len, nl;
  269|  2.86k|	int l;
  270|  2.86k|	int firstline;
  271|  2.86k|	size_t nbytes_read;
  272|       |
  273|  2.86k|	(void)self; /* UNUSED */
  274|       |
  275|  2.86k|	b = __archive_read_filter_ahead(filter, 1, &avail);
  276|  2.86k|	if (b == NULL)
  ------------------
  |  Branch (276:6): [True: 39, False: 2.82k]
  ------------------
  277|     39|		return (0);
  278|       |
  279|  2.82k|	firstline = 20;
  280|  2.82k|	ravail = avail;
  281|  2.82k|	nbytes_read = avail;
  282|  79.9k|	for (;;) {
  283|  79.9k|		len = bid_get_line(filter, &b, &avail, &ravail, &nl, &nbytes_read);
  284|  79.9k|		if (len < 0 || nl == 0)
  ------------------
  |  Branch (284:7): [True: 2.74k, False: 77.1k]
  |  Branch (284:18): [True: 16, False: 77.1k]
  ------------------
  285|  2.76k|			return (0); /* No match found. */
  286|  77.1k|		if (len - nl >= 11 && memcmp(b, "begin ", 6) == 0)
  ------------------
  |  Branch (286:7): [True: 3.50k, False: 73.6k]
  |  Branch (286:25): [True: 1.52k, False: 1.98k]
  ------------------
  287|  1.52k|			l = 6;
  288|  75.6k|		else if (len -nl >= 18 && memcmp(b, "begin-base64 ", 13) == 0)
  ------------------
  |  Branch (288:12): [True: 749, False: 74.9k]
  |  Branch (288:29): [True: 126, False: 623]
  ------------------
  289|    126|			l = 13;
  290|  75.5k|		else
  291|  75.5k|			l = 0;
  292|       |
  293|  77.1k|		if (l > 0 && (b[l] < '0' || b[l] > '7' ||
  ------------------
  |  Branch (293:7): [True: 1.64k, False: 75.5k]
  |  Branch (293:17): [True: 0, False: 1.64k]
  |  Branch (293:31): [True: 103, False: 1.54k]
  ------------------
  294|  1.54k|		    b[l+1] < '0' || b[l+1] > '7' ||
  ------------------
  |  Branch (294:7): [True: 1, False: 1.54k]
  |  Branch (294:23): [True: 691, False: 853]
  ------------------
  295|    853|		    b[l+2] < '0' || b[l+2] > '7' || b[l+3] != ' '))
  ------------------
  |  Branch (295:7): [True: 0, False: 853]
  |  Branch (295:23): [True: 486, False: 367]
  |  Branch (295:39): [True: 317, False: 50]
  ------------------
  296|  1.59k|			l = 0;
  297|       |
  298|  77.1k|		b += len;
  299|  77.1k|		avail -= len;
  300|  77.1k|		if (l)
  ------------------
  |  Branch (300:7): [True: 50, False: 77.1k]
  ------------------
  301|     50|			break;
  302|  77.1k|		firstline = 0;
  303|       |
  304|       |		/* Do not read more than UUENCODE_BID_MAX_READ bytes */
  305|  77.1k|		if (nbytes_read >= UUENCODE_BID_MAX_READ)
  ------------------
  |  |   44|  77.1k|#define UUENCODE_BID_MAX_READ 128*1024 /* in bytes */
  ------------------
  |  Branch (305:7): [True: 14, False: 77.1k]
  ------------------
  306|     14|			return (0);
  307|  77.1k|	}
  308|     50|	if (!avail)
  ------------------
  |  Branch (308:6): [True: 0, False: 50]
  ------------------
  309|      0|		return (0);
  310|     50|	len = bid_get_line(filter, &b, &avail, &ravail, &nl, &nbytes_read);
  311|     50|	if (len < 0 || nl == 0)
  ------------------
  |  Branch (311:6): [True: 0, False: 50]
  |  Branch (311:17): [True: 0, False: 50]
  ------------------
  312|      0|		return (0);/* There are non-ascii characters. */
  313|     50|	avail -= len;
  314|       |
  315|     50|	if (l == 6) {
  ------------------
  |  Branch (315:6): [True: 20, False: 30]
  ------------------
  316|       |		/* "begin " */
  317|     20|		if (!uuchar[*b])
  ------------------
  |  Branch (317:7): [True: 0, False: 20]
  ------------------
  318|      0|			return (0);
  319|       |		/* Get a length of decoded bytes. */
  320|     20|		l = UUDECODE(*b++); len--;
  ------------------
  |  |  260|     20|#define UUDECODE(c) (((c) - 0x20) & 0x3f)
  ------------------
  321|     20|		if (l > 45)
  ------------------
  |  Branch (321:7): [True: 0, False: 20]
  ------------------
  322|       |			/* Normally, maximum length is 45(character 'M'). */
  323|      0|			return (0);
  324|     20|		if (l > len - nl)
  ------------------
  |  Branch (324:7): [True: 0, False: 20]
  ------------------
  325|      0|			return (0); /* Line too short. */
  326|     39|		while (l) {
  ------------------
  |  Branch (326:10): [True: 19, False: 20]
  ------------------
  327|     19|			if (!uuchar[*b++])
  ------------------
  |  Branch (327:8): [True: 0, False: 19]
  ------------------
  328|      0|				return (0);
  329|     19|			--len;
  330|     19|			--l;
  331|     19|		}
  332|     20|		if (len-nl == 1 &&
  ------------------
  |  Branch (332:7): [True: 15, False: 5]
  ------------------
  333|     15|		    (uuchar[*b] ||		 /* Check sum. */
  ------------------
  |  Branch (333:8): [True: 15, False: 0]
  ------------------
  334|     15|		     (*b >= 'a' && *b <= 'z'))) {/* Padding data(MINIX). */
  ------------------
  |  Branch (334:9): [True: 0, False: 0]
  |  Branch (334:22): [True: 0, False: 0]
  ------------------
  335|     15|			++b;
  336|     15|			--len;
  337|     15|		}
  338|     20|		b += nl;
  339|     20|		if (avail && uuchar[*b])
  ------------------
  |  Branch (339:7): [True: 20, False: 0]
  |  Branch (339:16): [True: 20, False: 0]
  ------------------
  340|     20|			return (firstline+30);
  341|     30|	} else if (l == 13) {
  ------------------
  |  Branch (341:13): [True: 30, False: 0]
  ------------------
  342|       |		/* "begin-base64 " */
  343|     97|		while (len-nl > 0) {
  ------------------
  |  Branch (343:10): [True: 67, False: 30]
  ------------------
  344|     67|			if (!base64[*b++])
  ------------------
  |  Branch (344:8): [True: 0, False: 67]
  ------------------
  345|      0|				return (0);
  346|     67|			--len;
  347|     67|		}
  348|     30|		b += nl;
  349|       |
  350|     30|		if (avail >= 5 && memcmp(b, "====\n", 5) == 0)
  ------------------
  |  Branch (350:7): [True: 29, False: 1]
  |  Branch (350:21): [True: 0, False: 29]
  ------------------
  351|      0|			return (firstline+40);
  352|     30|		if (avail >= 6 && memcmp(b, "====\r\n", 6) == 0)
  ------------------
  |  Branch (352:7): [True: 29, False: 1]
  |  Branch (352:21): [True: 0, False: 29]
  ------------------
  353|      0|			return (firstline+40);
  354|     30|		if (avail > 0 && base64[*b])
  ------------------
  |  Branch (354:7): [True: 30, False: 0]
  |  Branch (354:20): [True: 30, False: 0]
  ------------------
  355|     30|			return (firstline+30);
  356|     30|	}
  357|       |
  358|      0|	return (0);
  359|     50|}
archive_read_support_filter_uu.c:bid_get_line:
  215|  79.9k|{
  216|  79.9k|	ssize_t len;
  217|  79.9k|	int quit;
  218|       |	
  219|  79.9k|	quit = 0;
  220|  79.9k|	if (*avail == 0) {
  ------------------
  |  Branch (220:6): [True: 5, False: 79.9k]
  ------------------
  221|      5|		*nl = 0;
  222|      5|		len = 0;
  223|      5|	} else
  224|  79.9k|		len = get_line(*b, *avail, nl);
  225|       |
  226|       |	/*
  227|       |	 * Read bytes more while it does not reach the end of line.
  228|       |	 */
  229|  80.0k|	while (*nl == 0 && len == *avail && !quit &&
  ------------------
  |  Branch (229:9): [True: 2.81k, False: 77.2k]
  |  Branch (229:21): [True: 72, False: 2.74k]
  |  Branch (229:38): [True: 71, False: 1]
  ------------------
  230|     71|	    *nbytes_read < UUENCODE_BID_MAX_READ) {
  ------------------
  |  |   44|     71|#define UUENCODE_BID_MAX_READ 128*1024 /* in bytes */
  ------------------
  |  Branch (230:6): [True: 68, False: 3]
  ------------------
  231|     68|		ssize_t diff = *ravail - *avail;
  232|     68|		size_t nbytes_req = (*ravail+1023) & ~1023U;
  233|     68|		ssize_t tested;
  234|       |
  235|       |		/* Increase reading bytes if it is not enough for at least
  236|       |		 * two new lines. */
  237|     68|		if (nbytes_req < (size_t)*ravail + 160)
  ------------------
  |  Branch (237:7): [True: 27, False: 41]
  ------------------
  238|     27|			nbytes_req <<= 1;
  239|       |
  240|     68|		*b = __archive_read_filter_ahead(filter, nbytes_req, avail);
  241|     68|		if (*b == NULL) {
  ------------------
  |  Branch (241:7): [True: 15, False: 53]
  ------------------
  242|     15|			if (*ravail >= *avail)
  ------------------
  |  Branch (242:8): [True: 12, False: 3]
  ------------------
  243|     12|				return (0);
  244|       |			/* Reading bytes reaches the end of a stream. */
  245|      3|			*b = __archive_read_filter_ahead(filter, *avail, avail);
  246|      3|			quit = 1;
  247|      3|		}
  248|     56|		*nbytes_read = *avail;
  249|     56|		*ravail = *avail;
  250|     56|		*b += diff;
  251|     56|		*avail -= diff;
  252|     56|		tested = len;/* Skip some bytes we already determined. */
  253|     56|		len = get_line(*b + tested, *avail - tested, nl);
  254|     56|		if (len >= 0)
  ------------------
  |  Branch (254:7): [True: 55, False: 1]
  ------------------
  255|     55|			len += tested;
  256|     56|	}
  257|  79.9k|	return (len);
  258|  79.9k|}
archive_read_support_filter_uu.c:get_line:
  179|   104k|{
  180|   104k|	ssize_t len;
  181|       |
  182|   104k|	len = 0;
  183|  3.00M|	while (len < avail) {
  ------------------
  |  Branch (183:9): [True: 3.00M, False: 641]
  ------------------
  184|  3.00M|		switch (ascii[*b]) {
  ------------------
  |  Branch (184:11): [True: 3.00M, False: 0]
  ------------------
  185|  2.76k|		case 0:	/* Non-ascii character or control character. */
  ------------------
  |  Branch (185:3): [True: 2.76k, False: 3.00M]
  ------------------
  186|  2.76k|			if (nlsize != NULL)
  ------------------
  |  Branch (186:8): [True: 2.76k, False: 0]
  ------------------
  187|  2.76k|				*nlsize = 0;
  188|  2.76k|			return (-1);
  189|  85.2k|		case '\r':
  ------------------
  |  Branch (189:3): [True: 85.2k, False: 2.92M]
  ------------------
  190|  85.2k|			if (avail-len > 1 && b[1] == '\n') {
  ------------------
  |  Branch (190:8): [True: 85.2k, False: 59]
  |  Branch (190:25): [True: 1.30k, False: 83.9k]
  ------------------
  191|  1.30k|				if (nlsize != NULL)
  ------------------
  |  Branch (191:9): [True: 1.30k, False: 0]
  ------------------
  192|  1.30k|					*nlsize = 2;
  193|  1.30k|				return (len+2);
  194|  1.30k|			}
  195|       |			/* FALL THROUGH */
  196|  99.3k|		case '\n':
  ------------------
  |  Branch (196:3): [True: 15.3k, False: 2.99M]
  ------------------
  197|  99.3k|			if (nlsize != NULL)
  ------------------
  |  Branch (197:8): [True: 99.3k, False: 0]
  ------------------
  198|  99.3k|				*nlsize = 1;
  199|  99.3k|			return (len+1);
  200|  2.90M|		case 1:
  ------------------
  |  Branch (200:3): [True: 2.90M, False: 103k]
  ------------------
  201|  2.90M|			b++;
  202|  2.90M|			len++;
  203|  2.90M|			break;
  204|  3.00M|		}
  205|  3.00M|	}
  206|    641|	if (nlsize != NULL)
  ------------------
  |  Branch (206:6): [True: 641, False: 0]
  ------------------
  207|    641|		*nlsize = 0;
  208|    641|	return (avail);
  209|   104k|}
archive_read_support_filter_uu.c:uudecode_bidder_init:
  370|     50|{
  371|     50|	struct uudecode   *uudecode;
  372|     50|	void *out_buff;
  373|     50|	void *in_buff;
  374|       |
  375|     50|	self->code = ARCHIVE_FILTER_UU;
  ------------------
  |  |  316|     50|#define	ARCHIVE_FILTER_UU	7
  ------------------
  376|     50|	self->name = "uu";
  377|       |
  378|     50|	uudecode = calloc(1, sizeof(*uudecode));
  379|     50|	out_buff = malloc(OUT_BUFF_SIZE);
  ------------------
  |  |   55|     50|#define OUT_BUFF_SIZE	(64 * 1024)
  ------------------
  380|     50|	in_buff = malloc(IN_BUFF_SIZE);
  ------------------
  |  |   51|     50|#define IN_BUFF_SIZE	(1024)
  ------------------
  381|     50|	if (uudecode == NULL || out_buff == NULL || in_buff == NULL) {
  ------------------
  |  Branch (381:6): [True: 0, False: 50]
  |  Branch (381:26): [True: 0, False: 50]
  |  Branch (381:46): [True: 0, False: 50]
  ------------------
  382|      0|		archive_set_error(&self->archive->archive, ENOMEM,
  383|      0|		    "Can't allocate data for uudecode");
  384|      0|		free(uudecode);
  385|      0|		free(out_buff);
  386|      0|		free(in_buff);
  387|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  388|      0|	}
  389|       |
  390|     50|	self->data = uudecode;
  391|     50|	uudecode->in_buff = in_buff;
  392|     50|	uudecode->in_cnt = 0;
  393|     50|	uudecode->in_allocated = IN_BUFF_SIZE;
  ------------------
  |  |   51|     50|#define IN_BUFF_SIZE	(1024)
  ------------------
  394|     50|	uudecode->out_buff = out_buff;
  395|     50|	uudecode->state = ST_FIND_HEAD;
  ------------------
  |  |   57|     50|#define ST_FIND_HEAD	0
  ------------------
  396|     50|	uudecode->mode_set = 0;
  397|     50|	uudecode->name = NULL;
  398|     50|	self->vtable = &uudecode_reader_vtable;
  399|       |
  400|     50|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     50|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  401|     50|}
archive_read_support_filter_uu.c:uudecode_filter_read:
  461|    444|{
  462|    444|	struct uudecode *uudecode;
  463|    444|	const unsigned char *b, *d;
  464|    444|	unsigned char *out;
  465|    444|	ssize_t avail_in, ravail;
  466|    444|	ssize_t used;
  467|    444|	ssize_t total;
  468|    444|	ssize_t len, llen, nl, namelen;
  469|       |
  470|    444|	uudecode = (struct uudecode *)self->data;
  471|       |
  472|    674|read_more:
  473|    674|	d = __archive_read_filter_ahead(self->upstream, 1, &avail_in);
  474|    674|	if (d == NULL && avail_in < 0)
  ------------------
  |  Branch (474:6): [True: 19, False: 655]
  |  Branch (474:19): [True: 1, False: 18]
  ------------------
  475|      1|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  476|       |	/* Quiet a code analyzer; make sure avail_in must be zero
  477|       |	 * when d is NULL. */
  478|    673|	if (d == NULL)
  ------------------
  |  Branch (478:6): [True: 18, False: 655]
  ------------------
  479|     18|		avail_in = 0;
  480|    673|	used = 0;
  481|    673|	total = 0;
  482|    673|	out = uudecode->out_buff;
  483|    673|	ravail = avail_in;
  484|    673|	if (uudecode->state == ST_IGNORE) {
  ------------------
  |  |   61|    673|#define ST_IGNORE	4
  ------------------
  |  Branch (484:6): [True: 0, False: 673]
  ------------------
  485|      0|		used = avail_in;
  486|      0|		goto finish;
  487|      0|	}
  488|    673|	if (uudecode->in_cnt) {
  ------------------
  |  Branch (488:6): [True: 563, False: 110]
  ------------------
  489|    563|		if (uudecode->in_cnt > UUENCODE_MAX_LINE_LENGTH) {
  ------------------
  |  |   46|    563|#define UUENCODE_MAX_LINE_LENGTH 34*1024 /* in bytes */
  ------------------
  |  Branch (489:7): [True: 7, False: 556]
  ------------------
  490|      7|			archive_set_error(&self->archive->archive,
  491|      7|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      7|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  492|      7|			    "Invalid format data");
  493|      7|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      7|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  494|      7|		}
  495|       |		/*
  496|       |		 * If there is remaining data which is saved by
  497|       |		 * a previous call, use it first.
  498|       |		 */
  499|    556|		if (ensure_in_buff_size(self, uudecode,
  ------------------
  |  Branch (499:7): [True: 0, False: 556]
  ------------------
  500|    556|		    avail_in + uudecode->in_cnt) != ARCHIVE_OK)
  ------------------
  |  |  233|    556|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  501|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  502|    556|		memcpy(uudecode->in_buff + uudecode->in_cnt,
  503|    556|		    d, avail_in);
  504|    556|		d = uudecode->in_buff;
  505|    556|		avail_in += uudecode->in_cnt;
  506|    556|		uudecode->in_cnt = 0;
  507|    556|	}
  508|  24.0k|	for (;used < avail_in; d += llen, used += llen) {
  ------------------
  |  Branch (508:8): [True: 23.9k, False: 62]
  ------------------
  509|  23.9k|		ssize_t l, body;
  510|       |
  511|  23.9k|		b = d;
  512|  23.9k|		len = get_line(b, avail_in - used, &nl);
  513|  23.9k|		if (len < 0) {
  ------------------
  |  Branch (513:7): [True: 19, False: 23.9k]
  ------------------
  514|       |			/* Non-ascii character is found. */
  515|     19|			if (uudecode->state == ST_FIND_HEAD &&
  ------------------
  |  |   57|     38|#define ST_FIND_HEAD	0
  ------------------
  |  Branch (515:8): [True: 15, False: 4]
  ------------------
  516|     15|			    (uudecode->total > 0 || total > 0)) {
  ------------------
  |  Branch (516:9): [True: 15, False: 0]
  |  Branch (516:32): [True: 0, False: 0]
  ------------------
  517|     15|				uudecode->state = ST_IGNORE;
  ------------------
  |  |   61|     15|#define ST_IGNORE	4
  ------------------
  518|     15|				used = avail_in;
  519|     15|				goto finish;
  520|     15|			}
  521|      4|			archive_set_error(&self->archive->archive,
  522|      4|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      4|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  523|      4|			    "Insufficient compressed data");
  524|      4|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  525|     19|		}
  526|  23.9k|		llen = len;
  527|  23.9k|		if ((nl == 0) && (uudecode->state != ST_UUEND)) {
  ------------------
  |  |   59|    574|#define ST_UUEND	2
  ------------------
  |  Branch (527:7): [True: 574, False: 23.3k]
  |  Branch (527:20): [True: 574, False: 0]
  ------------------
  528|    574|			if (total == 0 && ravail <= 0) {
  ------------------
  |  Branch (528:8): [True: 241, False: 333]
  |  Branch (528:22): [True: 11, False: 230]
  ------------------
  529|       |				/* There is nothing more to read, fail */
  530|     11|				archive_set_error(&self->archive->archive,
  531|     11|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     11|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  532|     11|				    "Missing format data");
  533|     11|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     11|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  534|     11|			}
  535|       |			/*
  536|       |			 * Save remaining data which does not contain
  537|       |			 * NL('\n','\r').
  538|       |			 */
  539|    563|			if (ensure_in_buff_size(self, uudecode, len)
  ------------------
  |  Branch (539:8): [True: 0, False: 563]
  ------------------
  540|    563|			    != ARCHIVE_OK)
  ------------------
  |  |  233|    563|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  541|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  542|    563|			if (uudecode->in_buff != b)
  ------------------
  |  Branch (542:8): [True: 391, False: 172]
  ------------------
  543|    391|				memmove(uudecode->in_buff, b, len);
  544|    563|			uudecode->in_cnt = len;
  545|    563|			if (total == 0) {
  ------------------
  |  Branch (545:8): [True: 230, False: 333]
  ------------------
  546|       |				/* Do not return 0; it means end-of-file.
  547|       |				 * We should try to read bytes more. */
  548|    230|				__archive_read_filter_consume(
  549|    230|				    self->upstream, ravail);
  550|    230|				goto read_more;
  551|    230|			}
  552|    333|			used += len;
  553|    333|			break;
  554|    563|		}
  555|  23.3k|		switch (uudecode->state) {
  556|      0|		default:
  ------------------
  |  Branch (556:3): [True: 0, False: 23.3k]
  ------------------
  557|  19.6k|		case ST_FIND_HEAD:
  ------------------
  |  |   57|  19.6k|#define ST_FIND_HEAD	0
  ------------------
  |  Branch (557:3): [True: 19.6k, False: 3.76k]
  ------------------
  558|       |			/* Do not read more than UUENCODE_BID_MAX_READ bytes */
  559|  19.6k|			if (total + len >= UUENCODE_BID_MAX_READ) {
  ------------------
  |  |   44|  19.6k|#define UUENCODE_BID_MAX_READ 128*1024 /* in bytes */
  ------------------
  |  Branch (559:8): [True: 0, False: 19.6k]
  ------------------
  560|      0|				archive_set_error(&self->archive->archive,
  561|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  562|      0|				    "Invalid format data");
  563|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  564|      0|			}
  565|  19.6k|			if (len - nl >= 11 && memcmp(b, "begin ", 6) == 0)
  ------------------
  |  Branch (565:8): [True: 6.86k, False: 12.7k]
  |  Branch (565:26): [True: 5.22k, False: 1.64k]
  ------------------
  566|  5.22k|				l = 6;
  567|  14.3k|			else if (len - nl >= 18 &&
  ------------------
  |  Branch (567:13): [True: 1.63k, False: 12.7k]
  ------------------
  568|  1.63k|			    memcmp(b, "begin-base64 ", 13) == 0)
  ------------------
  |  Branch (568:8): [True: 377, False: 1.26k]
  ------------------
  569|    377|				l = 13;
  570|  14.0k|			else
  571|  14.0k|				l = 0;
  572|  19.6k|			if (l != 0 && b[l] >= '0' && b[l] <= '7' &&
  ------------------
  |  Branch (572:8): [True: 5.60k, False: 14.0k]
  |  Branch (572:18): [True: 5.60k, False: 0]
  |  Branch (572:33): [True: 5.24k, False: 355]
  ------------------
  573|  5.24k|			    b[l+1] >= '0' && b[l+1] <= '7' &&
  ------------------
  |  Branch (573:8): [True: 5.24k, False: 0]
  |  Branch (573:25): [True: 2.80k, False: 2.43k]
  ------------------
  574|  2.80k|			    b[l+2] >= '0' && b[l+2] <= '7' && b[l+3] == ' ') {
  ------------------
  |  Branch (574:8): [True: 2.80k, False: 0]
  |  Branch (574:25): [True: 1.12k, False: 1.68k]
  |  Branch (574:42): [True: 50, False: 1.07k]
  ------------------
  575|     50|				if (l == 6)
  ------------------
  |  Branch (575:9): [True: 20, False: 30]
  ------------------
  576|     20|					uudecode->state = ST_READ_UU;
  ------------------
  |  |   58|     20|#define ST_READ_UU	1
  ------------------
  577|     30|				else
  578|     30|					uudecode->state = ST_READ_BASE64;
  ------------------
  |  |   60|     30|#define ST_READ_BASE64	3
  ------------------
  579|     50|				uudecode->mode = (mode_t)(
  580|     50|				    ((int)(b[l] - '0') * 64) +
  581|     50|				    ((int)(b[l+1] - '0') * 8) +
  582|     50|				     (int)(b[l+2] - '0'));
  583|     50|				uudecode->mode_set = 1;
  584|     50|				namelen = len - nl - 4 - l;
  585|     50|				if (namelen > 1) {
  ------------------
  |  Branch (585:9): [True: 23, False: 27]
  ------------------
  586|     23|					if (uudecode->name != NULL)
  ------------------
  |  Branch (586:10): [True: 0, False: 23]
  ------------------
  587|      0|						free(uudecode->name);
  588|     23|					uudecode->name = malloc(namelen + 1);
  589|     23|			                if (uudecode->name == NULL) {
  ------------------
  |  Branch (589:24): [True: 0, False: 23]
  ------------------
  590|      0|					archive_set_error(
  591|      0|					    &self->archive->archive,
  592|      0|					    ENOMEM,
  593|      0|					    "Can't allocate data for uudecode");
  594|      0|						return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  595|      0|					}
  596|     23|					strncpy(uudecode->name,
  597|     23|					    (const char *)(b + l + 4),
  598|     23|					    namelen);
  599|     23|					uudecode->name[namelen] = '\0';
  600|     23|				}
  601|     50|			}
  602|  19.6k|			break;
  603|  19.6k|		case ST_READ_UU:
  ------------------
  |  |   58|     28|#define ST_READ_UU	1
  ------------------
  |  Branch (603:3): [True: 28, False: 23.3k]
  ------------------
  604|     28|			if (total + len * 2 > OUT_BUFF_SIZE)
  ------------------
  |  |   55|     28|#define OUT_BUFF_SIZE	(64 * 1024)
  ------------------
  |  Branch (604:8): [True: 3, False: 25]
  ------------------
  605|      3|				goto finish;
  606|     25|			body = len - nl;
  607|     25|			if (!uuchar[*b] || body <= 0) {
  ------------------
  |  Branch (607:8): [True: 0, False: 25]
  |  Branch (607:23): [True: 0, False: 25]
  ------------------
  608|      0|				archive_set_error(&self->archive->archive,
  609|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  610|      0|				    "Insufficient compressed data");
  611|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  612|      0|			}
  613|       |			/* Get length of undecoded bytes of current line. */
  614|     25|			l = UUDECODE(*b++);
  ------------------
  |  |  260|     25|#define UUDECODE(c) (((c) - 0x20) & 0x3f)
  ------------------
  615|     25|			body--;
  616|     25|			if (l > body) {
  ------------------
  |  Branch (616:8): [True: 0, False: 25]
  ------------------
  617|      0|				archive_set_error(&self->archive->archive,
  618|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  619|      0|				    "Insufficient compressed data");
  620|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  621|      0|			}
  622|     25|			if (l == 0) {
  ------------------
  |  Branch (622:8): [True: 1, False: 24]
  ------------------
  623|      1|				uudecode->state = ST_UUEND;
  ------------------
  |  |   59|      1|#define ST_UUEND	2
  ------------------
  624|      1|				break;
  625|      1|			}
  626|     49|			while (l > 0) {
  ------------------
  |  Branch (626:11): [True: 29, False: 20]
  ------------------
  627|     29|				int n = 0;
  628|       |
  629|     29|				if (!uuchar[b[0]] || !uuchar[b[1]])
  ------------------
  |  Branch (629:9): [True: 0, False: 29]
  |  Branch (629:26): [True: 0, False: 29]
  ------------------
  630|      0|					break;
  631|     29|				n = UUDECODE(*b++) << 18;
  ------------------
  |  |  260|     29|#define UUDECODE(c) (((c) - 0x20) & 0x3f)
  ------------------
  632|     29|				n |= UUDECODE(*b++) << 12;
  ------------------
  |  |  260|     29|#define UUDECODE(c) (((c) - 0x20) & 0x3f)
  ------------------
  633|     29|				*out++ = n >> 16; total++;
  634|     29|				--l;
  635|       |
  636|     29|				if (l > 0) {
  ------------------
  |  Branch (636:9): [True: 10, False: 19]
  ------------------
  637|     10|					if (!uuchar[b[0]])
  ------------------
  |  Branch (637:10): [True: 0, False: 10]
  ------------------
  638|      0|						break;
  639|     10|					n |= UUDECODE(*b++) << 6;
  ------------------
  |  |  260|     10|#define UUDECODE(c) (((c) - 0x20) & 0x3f)
  ------------------
  640|     10|					*out++ = (n >> 8) & 0xFF; total++;
  641|     10|					--l;
  642|     10|				}
  643|     29|				if (l > 0) {
  ------------------
  |  Branch (643:9): [True: 9, False: 20]
  ------------------
  644|      9|					if (!uuchar[b[0]])
  ------------------
  |  Branch (644:10): [True: 4, False: 5]
  ------------------
  645|      4|						break;
  646|      5|					n |= UUDECODE(*b++);
  ------------------
  |  |  260|      5|#define UUDECODE(c) (((c) - 0x20) & 0x3f)
  ------------------
  647|      5|					*out++ = n & 0xFF; total++;
  648|      5|					--l;
  649|      5|				}
  650|     29|			}
  651|     24|			if (l) {
  ------------------
  |  Branch (651:8): [True: 4, False: 20]
  ------------------
  652|      4|				archive_set_error(&self->archive->archive,
  653|      4|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      4|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  654|      4|				    "Insufficient compressed data");
  655|      4|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  656|      4|			}
  657|     20|			break;
  658|     20|		case ST_UUEND:
  ------------------
  |  |   59|      0|#define ST_UUEND	2
  ------------------
  |  Branch (658:3): [True: 0, False: 23.3k]
  ------------------
  659|      0|			if (len - nl == 3 && memcmp(b, "end ", 3) == 0)
  ------------------
  |  Branch (659:8): [True: 0, False: 0]
  |  Branch (659:25): [True: 0, False: 0]
  ------------------
  660|      0|				uudecode->state = ST_FIND_HEAD;
  ------------------
  |  |   57|      0|#define ST_FIND_HEAD	0
  ------------------
  661|      0|			else {
  662|      0|				archive_set_error(&self->archive->archive,
  663|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  664|      0|				    "Insufficient compressed data");
  665|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  666|      0|			}
  667|      0|			break;
  668|  3.73k|		case ST_READ_BASE64:
  ------------------
  |  |   60|  3.73k|#define ST_READ_BASE64	3
  ------------------
  |  Branch (668:3): [True: 3.73k, False: 19.6k]
  ------------------
  669|  3.73k|			if (total + len * 2 > OUT_BUFF_SIZE)
  ------------------
  |  |   55|  3.73k|#define OUT_BUFF_SIZE	(64 * 1024)
  ------------------
  |  Branch (669:8): [True: 3, False: 3.73k]
  ------------------
  670|      3|				goto finish;
  671|  3.73k|			l = len - nl;
  672|  3.73k|			if (l >= 3 && b[0] == '=' && b[1] == '=' &&
  ------------------
  |  Branch (672:8): [True: 2.78k, False: 952]
  |  Branch (672:18): [True: 2.59k, False: 194]
  |  Branch (672:33): [True: 868, False: 1.72k]
  ------------------
  673|    868|			    b[2] == '=') {
  ------------------
  |  Branch (673:8): [True: 23, False: 845]
  ------------------
  674|     23|				uudecode->state = ST_FIND_HEAD;
  ------------------
  |  |   57|     23|#define ST_FIND_HEAD	0
  ------------------
  675|     23|				break;
  676|     23|			}
  677|  10.8k|			while (l > 0) {
  ------------------
  |  Branch (677:11): [True: 10.4k, False: 440]
  ------------------
  678|  10.4k|				int n = 0;
  679|       |
  680|  10.4k|				if (!base64[b[0]] || !base64[b[1]])
  ------------------
  |  Branch (680:9): [True: 0, False: 10.4k]
  |  Branch (680:26): [True: 861, False: 9.57k]
  ------------------
  681|    861|					break;
  682|  9.57k|				n = base64num[*b++] << 18;
  683|  9.57k|				n |= base64num[*b++] << 12;
  684|  9.57k|				*out++ = n >> 16; total++;
  685|  9.57k|				l -= 2;
  686|       |
  687|  9.57k|				if (l > 0) {
  ------------------
  |  Branch (687:9): [True: 9.29k, False: 278]
  ------------------
  688|  9.29k|					if (*b == '=')
  ------------------
  |  Branch (688:10): [True: 1.14k, False: 8.15k]
  ------------------
  689|  1.14k|						break;
  690|  8.15k|					if (!base64[*b])
  ------------------
  |  Branch (690:10): [True: 0, False: 8.15k]
  ------------------
  691|      0|						break;
  692|  8.15k|					n |= base64num[*b++] << 6;
  693|  8.15k|					*out++ = (n >> 8) & 0xFF; total++;
  694|  8.15k|					--l;
  695|  8.15k|				}
  696|  8.42k|				if (l > 0) {
  ------------------
  |  Branch (696:9): [True: 8.04k, False: 385]
  ------------------
  697|  8.04k|					if (*b == '=')
  ------------------
  |  Branch (697:10): [True: 1.26k, False: 6.78k]
  ------------------
  698|  1.26k|						break;
  699|  6.78k|					if (!base64[*b])
  ------------------
  |  Branch (699:10): [True: 1, False: 6.77k]
  ------------------
  700|      1|						break;
  701|  6.77k|					n |= base64num[*b++];
  702|  6.77k|					*out++ = n & 0xFF; total++;
  703|  6.77k|					--l;
  704|  6.77k|				}
  705|  8.42k|			}
  706|  3.71k|			if (l && *b != '=') {
  ------------------
  |  Branch (706:8): [True: 3.27k, False: 440]
  |  Branch (706:13): [True: 1, False: 3.27k]
  ------------------
  707|      1|				archive_set_error(&self->archive->archive,
  708|      1|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  709|      1|				    "Insufficient compressed data");
  710|      1|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  711|      1|			}
  712|  3.71k|			break;
  713|  23.3k|		}
  714|  23.3k|	}
  715|    416|finish:
  716|    416|	if (ravail < avail_in)
  ------------------
  |  Branch (716:6): [True: 371, False: 45]
  ------------------
  717|    371|		used -= avail_in - ravail;
  718|    416|	__archive_read_filter_consume(self->upstream, used);
  719|       |
  720|    416|	*buff = uudecode->out_buff;
  721|    416|	uudecode->total += total;
  722|    416|	return (total);
  723|    666|}
archive_read_support_filter_uu.c:ensure_in_buff_size:
  406|  1.11k|{
  407|       |
  408|  1.11k|	if (size > uudecode->in_allocated) {
  ------------------
  |  Branch (408:6): [True: 34, False: 1.08k]
  ------------------
  409|     34|		unsigned char *ptr;
  410|     34|		size_t newsize;
  411|       |
  412|       |		/*
  413|       |		 * Calculate a new buffer size for in_buff.
  414|       |		 * Increase its value until it is enough for our needs.
  415|       |		 */
  416|     34|		newsize = uudecode->in_allocated;
  417|  1.10k|		do {
  418|  1.10k|			if (newsize < IN_BUFF_SIZE*32)
  ------------------
  |  |   51|  1.10k|#define IN_BUFF_SIZE	(1024)
  ------------------
  |  Branch (418:8): [True: 156, False: 950]
  ------------------
  419|    156|				newsize <<= 1;
  420|    950|			else
  421|    950|				newsize += IN_BUFF_SIZE;
  ------------------
  |  |   51|    950|#define IN_BUFF_SIZE	(1024)
  ------------------
  422|  1.10k|		} while (size > newsize);
  ------------------
  |  Branch (422:12): [True: 1.07k, False: 34]
  ------------------
  423|       |		/* Allocate the new buffer. */
  424|     34|		ptr = malloc(newsize);
  425|     34|		if (ptr == NULL) {
  ------------------
  |  Branch (425:7): [True: 0, False: 34]
  ------------------
  426|      0|			free(ptr);
  427|      0|			archive_set_error(&self->archive->archive,
  428|      0|			    ENOMEM,
  429|      0|    			    "Can't allocate data for uudecode");
  430|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  431|      0|		}
  432|       |		/* Move the remaining data in in_buff into the new buffer. */
  433|     34|		if (uudecode->in_cnt)
  ------------------
  |  Branch (433:7): [True: 22, False: 12]
  ------------------
  434|     22|			memmove(ptr, uudecode->in_buff, uudecode->in_cnt);
  435|       |		/* Replace in_buff with the new buffer. */
  436|     34|		free(uudecode->in_buff);
  437|     34|		uudecode->in_buff = ptr;
  438|     34|		uudecode->in_allocated = newsize;
  439|     34|	}
  440|  1.11k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.11k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  441|  1.11k|}
archive_read_support_filter_uu.c:uudecode_filter_close:
  727|     50|{
  728|     50|	struct uudecode *uudecode;
  729|       |
  730|     50|	uudecode = (struct uudecode *)self->data;
  731|     50|	free(uudecode->in_buff);
  732|     50|	free(uudecode->out_buff);
  733|     50|	free(uudecode->name);
  734|     50|	free(uudecode);
  735|       |
  736|     50|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     50|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  737|     50|}
archive_read_support_filter_uu.c:uudecode_read_header:
  445|     22|{
  446|       |
  447|     22|	struct uudecode *uudecode;
  448|     22|	uudecode = (struct uudecode *)self->data;
  449|       |
  450|     22|	if (uudecode->mode_set != 0)
  ------------------
  |  Branch (450:6): [True: 22, False: 0]
  ------------------
  451|     22|		archive_entry_set_mode(entry, S_IFREG | uudecode->mode);
  452|       |
  453|     22|	if (uudecode->name != NULL)
  ------------------
  |  Branch (453:6): [True: 20, False: 2]
  ------------------
  454|     20|		archive_entry_set_pathname(entry, uudecode->name);
  455|       |
  456|     22|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     22|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  457|     22|}

archive_read_support_filter_xz:
  116|  2.49k|{
  117|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
  118|       |
  119|  2.49k|	if (__archive_read_register_bidder(a, NULL, "xz",
  ------------------
  |  Branch (119:6): [True: 0, False: 2.49k]
  ------------------
  120|  2.49k|				&xz_bidder_vtable) != ARCHIVE_OK)
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  121|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  122|       |
  123|  2.49k|#if HAVE_LZMA_H && HAVE_LIBLZMA
  124|  2.49k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  125|       |#else
  126|       |	archive_set_error(_a, ARCHIVE_ERRNO_MISC,
  127|       |	    "Using external xz program for xz decompression");
  128|       |	return (ARCHIVE_WARN);
  129|       |#endif
  130|  2.49k|}
archive_read_support_filter_lzma:
  148|  2.49k|{
  149|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
  150|       |
  151|  2.49k|	if (__archive_read_register_bidder(a, NULL, "lzma",
  ------------------
  |  Branch (151:6): [True: 0, False: 2.49k]
  ------------------
  152|  2.49k|				&lzma_bidder_vtable) != ARCHIVE_OK)
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  153|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  154|       |
  155|  2.49k|#if HAVE_LZMA_H && HAVE_LIBLZMA
  156|  2.49k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  157|       |#else
  158|       |	archive_set_error(_a, ARCHIVE_ERRNO_MISC,
  159|       |	    "Using external lzma program for lzma decompression");
  160|       |	return (ARCHIVE_WARN);
  161|       |#endif
  162|  2.49k|}
archive_read_support_filter_lzip:
  181|  2.49k|{
  182|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
  183|       |
  184|  2.49k|	if (__archive_read_register_bidder(a, NULL, "lzip",
  ------------------
  |  Branch (184:6): [True: 0, False: 2.49k]
  ------------------
  185|  2.49k|				&lzip_bidder_vtable) != ARCHIVE_OK)
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  186|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  187|       |
  188|  2.49k|#if HAVE_LZMA_H && HAVE_LIBLZMA
  189|  2.49k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  190|       |#else
  191|       |	archive_set_error(_a, ARCHIVE_ERRNO_MISC,
  192|       |	    "Using external lzip program for lzip decompression");
  193|       |	return (ARCHIVE_WARN);
  194|       |#endif
  195|  2.49k|}
archive_read_support_filter_xz.c:xz_bidder_bid:
  203|  2.86k|{
  204|  2.86k|	const unsigned char *buffer;
  205|  2.86k|	ssize_t avail;
  206|       |
  207|  2.86k|	(void)self; /* UNUSED */
  208|       |
  209|  2.86k|	buffer = __archive_read_filter_ahead(filter, 6, &avail);
  210|  2.86k|	if (buffer == NULL)
  ------------------
  |  Branch (210:6): [True: 60, False: 2.80k]
  ------------------
  211|     60|		return (0);
  212|       |
  213|       |	/*
  214|       |	 * Verify Header Magic Bytes : FD 37 7A 58 5A 00
  215|       |	 */
  216|  2.80k|	if (memcmp(buffer, "\xFD\x37\x7A\x58\x5A\x00", 6) != 0)
  ------------------
  |  Branch (216:6): [True: 2.80k, False: 0]
  ------------------
  217|  2.80k|		return (0);
  218|       |
  219|      0|	return (48);
  220|  2.80k|}
archive_read_support_filter_xz.c:xz_lzma_bidder_init:
  472|      3|{
  473|      3|	static const size_t out_block_size = 64 * 1024;
  474|      3|	void *out_block;
  475|      3|	struct private_data *state;
  476|      3|	int ret;
  477|       |
  478|      3|	state = calloc(1, sizeof(*state));
  479|      3|	out_block = malloc(out_block_size);
  480|      3|	if (state == NULL || out_block == NULL) {
  ------------------
  |  Branch (480:6): [True: 0, False: 3]
  |  Branch (480:23): [True: 0, False: 3]
  ------------------
  481|      0|		archive_set_error(&self->archive->archive, ENOMEM,
  482|      0|		    "Can't allocate data for xz decompression");
  483|      0|		free(out_block);
  484|      0|		free(state);
  485|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  486|      0|	}
  487|       |
  488|      3|	self->data = state;
  489|      3|	state->out_block_size = out_block_size;
  490|      3|	state->out_block = out_block;
  491|      3|	self->vtable = &xz_lzma_reader_vtable;
  492|       |
  493|      3|	state->stream.avail_in = 0;
  494|       |
  495|      3|	state->stream.next_out = state->out_block;
  496|      3|	state->stream.avail_out = state->out_block_size;
  497|       |
  498|      3|	state->crc32 = 0;
  499|      3|	if (self->code == ARCHIVE_FILTER_LZIP) {
  ------------------
  |  |  318|      3|#define	ARCHIVE_FILTER_LZIP	9
  ------------------
  |  Branch (499:6): [True: 2, False: 1]
  ------------------
  500|       |		/*
  501|       |		 * We have to read a lzip header and use it to initialize
  502|       |		 * compression library, thus we cannot initialize the
  503|       |		 * library for lzip here.
  504|       |		 */
  505|      2|		state->in_stream = 0;
  506|      2|		return (ARCHIVE_OK);
  ------------------
  |  |  233|      2|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  507|      2|	} else
  508|      1|		state->in_stream = 1;
  509|       |
  510|       |	/* Initialize compression library. */
  511|      1|	if (self->code == ARCHIVE_FILTER_XZ)
  ------------------
  |  |  315|      1|#define	ARCHIVE_FILTER_XZ	6
  ------------------
  |  Branch (511:6): [True: 0, False: 1]
  ------------------
  512|      0|		ret = lzma_stream_decoder(&(state->stream),
  513|      0|		    LZMA_MEMLIMIT,/* memlimit */
  ------------------
  |  |   69|      0|#define LZMA_MEMLIMIT	UINT64_MAX
  ------------------
  514|      0|		    LZMA_CONCATENATED);
  515|      1|	else
  516|      1|		ret = lzma_alone_decoder(&(state->stream),
  517|      1|		    LZMA_MEMLIMIT);/* memlimit */
  ------------------
  |  |   69|      1|#define LZMA_MEMLIMIT	UINT64_MAX
  ------------------
  518|       |
  519|      1|	if (ret == LZMA_OK)
  ------------------
  |  Branch (519:6): [True: 1, False: 0]
  ------------------
  520|      1|		return (ARCHIVE_OK);
  ------------------
  |  |  233|      1|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  521|       |
  522|       |	/* Library setup failed: Choose an error message and clean up. */
  523|      0|	set_error(self, ret);
  524|       |
  525|      0|	free(state->out_block);
  526|      0|	free(state);
  527|      0|	self->data = NULL;
  528|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  529|      1|}
archive_read_support_filter_xz.c:xz_filter_read:
  652|    736|{
  653|    736|	struct private_data *state;
  654|    736|	size_t decompressed;
  655|    736|	ssize_t avail_in;
  656|    736|	int64_t member_in;
  657|    736|	int ret;
  658|       |
  659|    736|	state = (struct private_data *)self->data;
  660|       |
  661|    736|	redo:
  662|       |	/* Empty our output buffer. */
  663|    736|	state->stream.next_out = state->out_block;
  664|    736|	state->stream.avail_out = state->out_block_size;
  665|    736|	member_in = state->member_in;
  666|       |
  667|       |	/* Try to fill the output buffer. */
  668|  1.47k|	while (state->stream.avail_out > 0 && !state->eof) {
  ------------------
  |  Branch (668:9): [True: 738, False: 733]
  |  Branch (668:40): [True: 736, False: 2]
  ------------------
  669|    736|		if (!state->in_stream) {
  ------------------
  |  Branch (669:7): [True: 2, False: 734]
  ------------------
  670|       |			/*
  671|       |			 * Initialize liblzma for lzip
  672|       |			 */
  673|      2|			ret = lzip_init(self);
  674|      2|			if (ret != ARCHIVE_OK)
  ------------------
  |  |  233|      2|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (674:8): [True: 0, False: 2]
  ------------------
  675|      0|				return (ret);
  676|      2|			state->in_stream = 1;
  677|      2|		}
  678|    736|		state->stream.next_in =
  679|    736|		    __archive_read_filter_ahead(self->upstream, 1, &avail_in);
  680|    736|		if (state->stream.next_in == NULL && avail_in < 0) {
  ------------------
  |  Branch (680:7): [True: 0, False: 736]
  |  Branch (680:40): [True: 0, False: 0]
  ------------------
  681|      0|			archive_set_error(&self->archive->archive,
  682|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  683|      0|			    "truncated input");
  684|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  685|      0|		}
  686|    736|		state->stream.avail_in = avail_in;
  687|       |
  688|       |		/* Decompress as much as we can in one pass. */
  689|    736|		ret = lzma_code(&(state->stream),
  690|    736|		    (state->stream.avail_in == 0)? LZMA_FINISH: LZMA_RUN);
  ------------------
  |  Branch (690:7): [True: 0, False: 736]
  ------------------
  691|    736|		switch (ret) {
  692|      2|		case LZMA_STREAM_END: /* Found end of stream. */
  ------------------
  |  Branch (692:3): [True: 2, False: 734]
  ------------------
  693|      2|			state->eof = 1;
  694|       |			/* FALL THROUGH */
  695|    735|		case LZMA_OK: /* Decompressor made some progress. */
  ------------------
  |  Branch (695:3): [True: 733, False: 3]
  ------------------
  696|    735|			__archive_read_filter_consume(self->upstream,
  697|    735|			    avail_in - state->stream.avail_in);
  698|    735|			state->member_in +=
  699|    735|			    avail_in - state->stream.avail_in;
  700|    735|			break;
  701|      1|		default:
  ------------------
  |  Branch (701:3): [True: 1, False: 735]
  ------------------
  702|      1|			set_error(self, ret);
  703|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  704|    736|		}
  705|    736|	}
  706|       |
  707|    735|	decompressed = state->stream.next_out - state->out_block;
  708|    735|	state->member_out += decompressed;
  709|    735|	if (decompressed == 0) {
  ------------------
  |  Branch (709:6): [True: 0, False: 735]
  ------------------
  710|      0|		if (member_in != state->member_in &&
  ------------------
  |  Branch (710:7): [True: 0, False: 0]
  ------------------
  711|      0|		    self->code == ARCHIVE_FILTER_LZIP &&
  ------------------
  |  |  318|      0|#define	ARCHIVE_FILTER_LZIP	9
  ------------------
  |  Branch (711:7): [True: 0, False: 0]
  ------------------
  712|      0|		    state->eof) {
  ------------------
  |  Branch (712:7): [True: 0, False: 0]
  ------------------
  713|      0|			ret = lzip_tail(self);
  714|      0|			if (ret != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (714:8): [True: 0, False: 0]
  ------------------
  715|      0|				return (ret);
  716|      0|			if (!state->eof)
  ------------------
  |  Branch (716:8): [True: 0, False: 0]
  ------------------
  717|      0|				goto redo;
  718|      0|		}
  719|      0|		*p = NULL;
  720|    735|	} else {
  721|    735|		*p = state->out_block;
  722|    735|		if (self->code == ARCHIVE_FILTER_LZIP) {
  ------------------
  |  |  318|    735|#define	ARCHIVE_FILTER_LZIP	9
  ------------------
  |  Branch (722:7): [True: 2, False: 733]
  ------------------
  723|      2|			state->crc32 = lzma_crc32(state->out_block,
  724|      2|			    decompressed, state->crc32);
  725|      2|			if (state->eof) {
  ------------------
  |  Branch (725:8): [True: 2, False: 0]
  ------------------
  726|      2|				ret = lzip_tail(self);
  727|      2|				if (ret != ARCHIVE_OK)
  ------------------
  |  |  233|      2|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (727:9): [True: 2, False: 0]
  ------------------
  728|      2|					return (ret);
  729|      2|			}
  730|      2|		}
  731|    735|	}
  732|    733|	return (decompressed);
  733|    735|}
archive_read_support_filter_xz.c:lzip_init:
  533|      2|{
  534|      2|	struct private_data *state;
  535|      2|	const unsigned char *h;
  536|      2|	lzma_filter filters[2];
  537|      2|	unsigned char props[5];
  538|      2|	ssize_t avail_in;
  539|      2|	uint32_t dicsize;
  540|      2|	int log2dic, ret;
  541|       |
  542|      2|	state = (struct private_data *)self->data;
  543|      2|	h = __archive_read_filter_ahead(self->upstream, 6, &avail_in);
  544|      2|	if (h == NULL)
  ------------------
  |  Branch (544:6): [True: 0, False: 2]
  ------------------
  545|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  546|       |
  547|       |	/* Get a version number. */
  548|      2|	state->lzip_ver = h[4];
  549|       |
  550|       |	/*
  551|       |	 * Setup lzma property.
  552|       |	 */
  553|      2|	props[0] = 0x5d;
  554|       |
  555|       |	/* Get dictionary size. */
  556|      2|	log2dic = h[5] & 0x1f;
  557|      2|	if (log2dic < 12 || log2dic > 29)
  ------------------
  |  Branch (557:6): [True: 0, False: 2]
  |  Branch (557:22): [True: 0, False: 2]
  ------------------
  558|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  559|      2|	dicsize = 1U << log2dic;
  560|      2|	if (log2dic > 12)
  ------------------
  |  Branch (560:6): [True: 2, False: 0]
  ------------------
  561|      2|		dicsize -= (dicsize / 16) * (h[5] >> 5);
  562|      2|	archive_le32enc(props+1, dicsize);
  563|       |
  564|       |	/* Consume lzip header. */
  565|      2|	__archive_read_filter_consume(self->upstream, 6);
  566|      2|	state->member_in = 6;
  567|       |
  568|      2|	filters[0].id = LZMA_FILTER_LZMA1;
  569|      2|	filters[0].options = NULL;
  570|      2|	filters[1].id = LZMA_VLI_UNKNOWN;
  571|      2|	filters[1].options = NULL;
  572|       |
  573|      2|	ret = lzma_properties_decode(&filters[0], NULL, props, sizeof(props));
  574|      2|	if (ret != LZMA_OK) {
  ------------------
  |  Branch (574:6): [True: 0, False: 2]
  ------------------
  575|      0|		set_error(self, ret);
  576|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  577|      0|	}
  578|      2|	ret = lzma_raw_decoder(&(state->stream), filters);
  579|      2|	free(filters[0].options);
  580|      2|	if (ret != LZMA_OK) {
  ------------------
  |  Branch (580:6): [True: 0, False: 2]
  ------------------
  581|      0|		set_error(self, ret);
  582|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  583|      0|	}
  584|      2|	return (ARCHIVE_OK);
  ------------------
  |  |  233|      2|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  585|      2|}
archive_read_support_filter_xz.c:lzip_tail:
  589|      2|{
  590|      2|	struct private_data *state;
  591|      2|	const unsigned char *f;
  592|      2|	ssize_t avail_in;
  593|      2|	int tail;
  594|       |
  595|      2|	state = (struct private_data *)self->data;
  596|      2|	if (state->lzip_ver == 0)
  ------------------
  |  Branch (596:6): [True: 1, False: 1]
  ------------------
  597|      1|		tail = 12;
  598|      1|	else
  599|      1|		tail = 20;
  600|      2|	f = __archive_read_filter_ahead(self->upstream, tail, &avail_in);
  601|      2|	if (f == NULL && avail_in < 0)
  ------------------
  |  Branch (601:6): [True: 0, False: 2]
  |  Branch (601:19): [True: 0, False: 0]
  ------------------
  602|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  603|      2|	if (f == NULL || avail_in < tail) {
  ------------------
  |  Branch (603:6): [True: 0, False: 2]
  |  Branch (603:19): [True: 0, False: 2]
  ------------------
  604|      0|		archive_set_error(&self->archive->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  605|      0|		    "Lzip: Remaining data is less bytes");
  606|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  607|      0|	}
  608|       |
  609|       |	/* Check the crc32 value of the uncompressed data of the current
  610|       |	 * member */
  611|      2|	if (state->crc32 != archive_le32dec(f)) {
  ------------------
  |  Branch (611:6): [True: 2, False: 0]
  ------------------
  612|       |#ifndef DONT_FAIL_ON_CRC_ERROR
  613|       |		archive_set_error(&self->archive->archive, ARCHIVE_ERRNO_MISC,
  614|       |		    "Lzip: CRC32 error");
  615|       |		return (ARCHIVE_FAILED);
  616|       |#endif
  617|      2|	}
  618|       |
  619|       |	/* Check the uncompressed size of the current member */
  620|      2|	if ((uint64_t)state->member_out != archive_le64dec(f + 4)) {
  ------------------
  |  Branch (620:6): [True: 2, False: 0]
  ------------------
  621|      2|		archive_set_error(&self->archive->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      2|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  622|      2|		    "Lzip: Uncompressed size error");
  623|      2|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      2|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  624|      2|	}
  625|       |
  626|       |	/* Check the total size of the current member */
  627|      0|	if (state->lzip_ver == 1 &&
  ------------------
  |  Branch (627:6): [True: 0, False: 0]
  ------------------
  628|      0|	    (uint64_t)state->member_in + tail != archive_le64dec(f + 12)) {
  ------------------
  |  Branch (628:6): [True: 0, False: 0]
  ------------------
  629|      0|		archive_set_error(&self->archive->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  630|      0|		    "Lzip: Member size error");
  631|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  632|      0|	}
  633|      0|	__archive_read_filter_consume(self->upstream, tail);
  634|       |
  635|       |	/* If current lzip data consists of multi member, try decompressing
  636|       |	 * a next member. */
  637|      0|	if (lzip_has_member(self->upstream) != 0) {
  ------------------
  |  Branch (637:6): [True: 0, False: 0]
  ------------------
  638|      0|		state->in_stream = 0;
  639|      0|		state->crc32 = 0;
  640|      0|		state->member_out = 0;
  641|      0|		state->member_in = 0;
  642|      0|		state->eof = 0;
  643|      0|	}
  644|      0|	return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  645|      0|}
archive_read_support_filter_xz.c:lzip_has_member:
  343|  2.86k|{
  344|  2.86k|	const unsigned char *buffer;
  345|  2.86k|	ssize_t avail;
  346|  2.86k|	int bits_checked;
  347|  2.86k|	int log2dic;
  348|       |
  349|  2.86k|	buffer = __archive_read_filter_ahead(filter, 6, &avail);
  350|  2.86k|	if (buffer == NULL)
  ------------------
  |  Branch (350:6): [True: 60, False: 2.80k]
  ------------------
  351|     60|		return (0);
  352|       |
  353|       |	/*
  354|       |	 * Verify Header Magic Bytes : 4C 5A 49 50 (`LZIP')
  355|       |	 */
  356|  2.80k|	bits_checked = 0;
  357|  2.80k|	if (memcmp(buffer, "LZIP", 4) != 0)
  ------------------
  |  Branch (357:6): [True: 2.80k, False: 2]
  ------------------
  358|  2.80k|		return (0);
  359|      2|	bits_checked += 32;
  360|       |
  361|       |	/* A version number must be 0 or 1 */
  362|      2|	if (buffer[4] != 0 && buffer[4] != 1)
  ------------------
  |  Branch (362:6): [True: 1, False: 1]
  |  Branch (362:24): [True: 0, False: 1]
  ------------------
  363|      0|		return (0);
  364|      2|	bits_checked += 8;
  365|       |
  366|       |	/* Dictionary size. */
  367|      2|	log2dic = buffer[5] & 0x1f;
  368|      2|	if (log2dic < 12 || log2dic > 29)
  ------------------
  |  Branch (368:6): [True: 0, False: 2]
  |  Branch (368:22): [True: 0, False: 2]
  ------------------
  369|      0|		return (0);
  370|      2|	bits_checked += 8;
  371|       |
  372|      2|	return (bits_checked);
  373|      2|}
archive_read_support_filter_xz.c:xz_filter_close:
  740|      3|{
  741|      3|	struct private_data *state;
  742|       |
  743|      3|	state = (struct private_data *)self->data;
  744|      3|	lzma_end(&(state->stream));
  745|      3|	free(state->out_block);
  746|      3|	free(state);
  747|      3|	return (ARCHIVE_OK);
  ------------------
  |  |  233|      3|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  748|      3|}
archive_read_support_filter_xz.c:set_error:
  418|      1|{
  419|       |
  420|      1|	switch (ret) {
  421|      0|	case LZMA_STREAM_END: /* Found end of stream. */
  ------------------
  |  Branch (421:2): [True: 0, False: 1]
  ------------------
  422|      0|	case LZMA_OK: /* Decompressor made some progress. */
  ------------------
  |  Branch (422:2): [True: 0, False: 1]
  ------------------
  423|      0|		break;
  424|      0|	case LZMA_MEM_ERROR:
  ------------------
  |  Branch (424:2): [True: 0, False: 1]
  ------------------
  425|      0|		archive_set_error(&self->archive->archive, ENOMEM,
  426|      0|		    "Lzma library error: Cannot allocate memory");
  427|      0|		break;
  428|      0|	case LZMA_MEMLIMIT_ERROR:
  ------------------
  |  Branch (428:2): [True: 0, False: 1]
  ------------------
  429|      0|		archive_set_error(&self->archive->archive, ENOMEM,
  430|      0|		    "Lzma library error: Out of memory");
  431|      0|		break;
  432|      0|	case LZMA_FORMAT_ERROR:
  ------------------
  |  Branch (432:2): [True: 0, False: 1]
  ------------------
  433|      0|		archive_set_error(&self->archive->archive,
  434|      0|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  435|      0|		    "Lzma library error: format not recognized");
  436|      0|		break;
  437|      0|	case LZMA_OPTIONS_ERROR:
  ------------------
  |  Branch (437:2): [True: 0, False: 1]
  ------------------
  438|      0|		archive_set_error(&self->archive->archive,
  439|      0|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  440|      0|		    "Lzma library error: Invalid options");
  441|      0|		break;
  442|      1|	case LZMA_DATA_ERROR:
  ------------------
  |  Branch (442:2): [True: 1, False: 0]
  ------------------
  443|      1|		archive_set_error(&self->archive->archive,
  444|      1|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  445|      1|		    "Lzma library error: Corrupted input data");
  446|      1|		break;
  447|      0|	case LZMA_BUF_ERROR:
  ------------------
  |  Branch (447:2): [True: 0, False: 1]
  ------------------
  448|      0|		archive_set_error(&self->archive->archive,
  449|      0|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  450|      0|		    "Lzma library error:  No progress is possible");
  451|      0|		break;
  452|      0|	default:
  ------------------
  |  Branch (452:2): [True: 0, False: 1]
  ------------------
  453|       |		/* Return an error. */
  454|      0|		archive_set_error(&self->archive->archive,
  455|      0|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  456|      0|		    "Lzma decompression failed:  Unknown error");
  457|      0|		break;
  458|      1|	}
  459|      1|}
archive_read_support_filter_xz.c:lzma_bidder_bid:
  237|  2.86k|{
  238|  2.86k|	const unsigned char *buffer;
  239|  2.86k|	ssize_t avail;
  240|  2.86k|	uint32_t dicsize;
  241|  2.86k|	uint64_t uncompressed_size;
  242|  2.86k|	int bits_checked;
  243|       |
  244|  2.86k|	(void)self; /* UNUSED */
  245|       |
  246|  2.86k|	buffer = __archive_read_filter_ahead(filter, 14, &avail);
  247|  2.86k|	if (buffer == NULL)
  ------------------
  |  Branch (247:6): [True: 60, False: 2.80k]
  ------------------
  248|     60|		return (0);
  249|       |
  250|       |	/* First byte of raw LZMA stream is commonly 0x5d.
  251|       |	 * The first byte is a special number, which consists of
  252|       |	 * three parameters of LZMA compression, a number of literal
  253|       |	 * context bits(which is from 0 to 8, default is 3), a number
  254|       |	 * of literal pos bits(which is from 0 to 4, default is 0),
  255|       |	 * a number of pos bits(which is from 0 to 4, default is 2).
  256|       |	 * The first byte is made by
  257|       |	 * (pos bits * 5 + literal pos bit) * 9 + * literal contest bit,
  258|       |	 * and so the default value in this field is
  259|       |	 * (2 * 5 + 0) * 9 + 3 = 0x5d.
  260|       |	 * lzma of LZMA SDK has options to change those parameters.
  261|       |	 * It means a range of this field is from 0 to 224. And lzma of
  262|       |	 * XZ Utils with option -e records 0x5e in this field. */
  263|       |	/* NOTE: If this checking of the first byte increases false
  264|       |	 * recognition, we should allow only 0x5d and 0x5e for the first
  265|       |	 * byte of LZMA stream. */
  266|  2.80k|	bits_checked = 0;
  267|  2.80k|	if (buffer[0] > (4 * 5 + 4) * 9 + 8)
  ------------------
  |  Branch (267:6): [True: 83, False: 2.72k]
  ------------------
  268|     83|		return (0);
  269|       |	/* Most likely value in the first byte of LZMA stream. */
  270|  2.72k|	if (buffer[0] == 0x5d || buffer[0] == 0x5e)
  ------------------
  |  Branch (270:6): [True: 0, False: 2.72k]
  |  Branch (270:27): [True: 0, False: 2.72k]
  ------------------
  271|      0|		bits_checked += 8;
  272|       |
  273|       |	/* Sixth through fourteenth bytes are uncompressed size,
  274|       |	 * stored in little-endian order. `-1' means uncompressed
  275|       |	 * size is unknown and lzma of XZ Utils always records `-1'
  276|       |	 * in this field. */
  277|  2.72k|	uncompressed_size = archive_le64dec(buffer+5);
  278|  2.72k|	if (uncompressed_size == (uint64_t)ARCHIVE_LITERAL_LL(-1))
  ------------------
  |  |  179|  2.72k|# define	ARCHIVE_LITERAL_LL(x)	x##ll
  ------------------
  |  Branch (278:6): [True: 0, False: 2.72k]
  ------------------
  279|      0|		bits_checked += 64;
  280|       |
  281|       |	/* Second through fifth bytes are dictionary size, stored in
  282|       |	 * little-endian order. The minimum dictionary size is
  283|       |	 * 1 << 12(4KiB) which the lzma of LZMA SDK uses with option
  284|       |	 * -d12 and the maximum dictionary size is 1 << 29(512MiB)
  285|       |	 * which the one uses with option -d29.
  286|       |	 * NOTE: A comment of LZMA SDK source code says this dictionary
  287|       |	 * range is from 1 << 12 to 1 << 30. */
  288|  2.72k|	dicsize = archive_le32dec(buffer+1);
  289|  2.72k|	switch (dicsize) {
  290|      0|	case 0x00001000:/* lzma of LZMA SDK option -d12. */
  ------------------
  |  Branch (290:2): [True: 0, False: 2.72k]
  ------------------
  291|      0|	case 0x00002000:/* lzma of LZMA SDK option -d13. */
  ------------------
  |  Branch (291:2): [True: 0, False: 2.72k]
  ------------------
  292|      0|	case 0x00004000:/* lzma of LZMA SDK option -d14. */
  ------------------
  |  Branch (292:2): [True: 0, False: 2.72k]
  ------------------
  293|      0|	case 0x00008000:/* lzma of LZMA SDK option -d15. */
  ------------------
  |  Branch (293:2): [True: 0, False: 2.72k]
  ------------------
  294|      1|	case 0x00010000:/* lzma of XZ Utils option -0 and -1.
  ------------------
  |  Branch (294:2): [True: 1, False: 2.72k]
  ------------------
  295|       |			 * lzma of LZMA SDK option -d16. */
  296|      1|	case 0x00020000:/* lzma of LZMA SDK option -d17. */
  ------------------
  |  Branch (296:2): [True: 0, False: 2.72k]
  ------------------
  297|      1|	case 0x00040000:/* lzma of LZMA SDK option -d18. */
  ------------------
  |  Branch (297:2): [True: 0, False: 2.72k]
  ------------------
  298|      1|	case 0x00080000:/* lzma of XZ Utils option -2.
  ------------------
  |  Branch (298:2): [True: 0, False: 2.72k]
  ------------------
  299|       |			 * lzma of LZMA SDK option -d19. */
  300|      1|	case 0x00100000:/* lzma of XZ Utils option -3.
  ------------------
  |  Branch (300:2): [True: 0, False: 2.72k]
  ------------------
  301|       |			 * lzma of LZMA SDK option -d20. */
  302|      1|	case 0x00200000:/* lzma of XZ Utils option -4.
  ------------------
  |  Branch (302:2): [True: 0, False: 2.72k]
  ------------------
  303|       |			 * lzma of LZMA SDK option -d21. */
  304|      1|	case 0x00400000:/* lzma of XZ Utils option -5.
  ------------------
  |  Branch (304:2): [True: 0, False: 2.72k]
  ------------------
  305|       |			 * lzma of LZMA SDK option -d22. */
  306|      1|	case 0x00800000:/* lzma of XZ Utils option -6.
  ------------------
  |  Branch (306:2): [True: 0, False: 2.72k]
  ------------------
  307|       |			 * lzma of LZMA SDK option -d23. */
  308|      1|	case 0x01000000:/* lzma of XZ Utils option -7.
  ------------------
  |  Branch (308:2): [True: 0, False: 2.72k]
  ------------------
  309|       |			 * lzma of LZMA SDK option -d24. */
  310|      1|	case 0x02000000:/* lzma of XZ Utils option -8.
  ------------------
  |  Branch (310:2): [True: 0, False: 2.72k]
  ------------------
  311|       |			 * lzma of LZMA SDK option -d25. */
  312|      1|	case 0x04000000:/* lzma of XZ Utils option -9.
  ------------------
  |  Branch (312:2): [True: 0, False: 2.72k]
  ------------------
  313|       |			 * lzma of LZMA SDK option -d26. */
  314|      1|	case 0x08000000:/* lzma of LZMA SDK option -d27. */
  ------------------
  |  Branch (314:2): [True: 0, False: 2.72k]
  ------------------
  315|      1|		bits_checked += 32;
  316|      1|		break;
  317|  2.72k|	default:
  ------------------
  |  Branch (317:2): [True: 2.72k, False: 1]
  ------------------
  318|       |		/* If a memory usage for encoding was not enough on
  319|       |		 * the platform where LZMA stream was made, lzma of
  320|       |		 * XZ Utils automatically decreased the dictionary
  321|       |		 * size to enough memory for encoding by 1Mi bytes
  322|       |		 * (1 << 20).*/
  323|  2.72k|		if (dicsize <= 0x03F00000 && dicsize >= 0x00300000 &&
  ------------------
  |  Branch (323:7): [True: 501, False: 2.22k]
  |  Branch (323:32): [True: 163, False: 338]
  ------------------
  324|    163|		    (dicsize & ((1 << 20)-1)) == 0 &&
  ------------------
  |  Branch (324:7): [True: 0, False: 163]
  ------------------
  325|      0|		    bits_checked == 8 + 64) {
  ------------------
  |  Branch (325:7): [True: 0, False: 0]
  ------------------
  326|      0|			bits_checked += 32;
  327|      0|			break;
  328|      0|		}
  329|       |		/* Otherwise dictionary size is unlikely. But it is
  330|       |		 * possible that someone makes lzma stream with
  331|       |		 * liblzma/LZMA SDK in one's dictionary size. */
  332|  2.72k|		return (0);
  333|  2.72k|	}
  334|       |
  335|       |	/* TODO: The above test is still very weak.  It would be
  336|       |	 * good to do better. */
  337|       |
  338|      1|	return (bits_checked);
  339|  2.72k|}
archive_read_support_filter_xz.c:lzma_bidder_init:
  399|      1|{
  400|      1|	self->code = ARCHIVE_FILTER_LZMA;
  ------------------
  |  |  314|      1|#define	ARCHIVE_FILTER_LZMA	5
  ------------------
  401|      1|	self->name = "lzma";
  402|      1|	return (xz_lzma_bidder_init(self));
  403|      1|}
archive_read_support_filter_xz.c:lzip_bidder_bid:
  378|  2.86k|{
  379|       |
  380|  2.86k|	(void)self; /* UNUSED */
  381|  2.86k|	return (lzip_has_member(filter));
  382|  2.86k|}
archive_read_support_filter_xz.c:lzip_bidder_init:
  407|      2|{
  408|      2|	self->code = ARCHIVE_FILTER_LZIP;
  ------------------
  |  |  318|      2|#define	ARCHIVE_FILTER_LZIP	9
  ------------------
  409|      2|	self->name = "lzip";
  410|      2|	return (xz_lzma_bidder_init(self));
  411|      2|}

archive_read_support_filter_zstd:
   87|  2.49k|{
   88|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
   89|       |
   90|  2.49k|	if (__archive_read_register_bidder(a, NULL, "zstd",
  ------------------
  |  Branch (90:6): [True: 0, False: 2.49k]
  ------------------
   91|  2.49k|				&zstd_bidder_vtable) != ARCHIVE_OK)
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
   92|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
   93|       |
   94|       |#if HAVE_ZSTD_H && HAVE_LIBZSTD
   95|       |	return (ARCHIVE_OK);
   96|       |#else
   97|  2.49k|	archive_set_error(_a, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|  2.49k|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
   98|  2.49k|	    "Using external zstd program for zstd decompression");
   99|  2.49k|	return (ARCHIVE_WARN);
  ------------------
  |  |  235|  2.49k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  100|  2.49k|#endif
  101|  2.49k|}
archive_read_support_filter_zstd.c:zstd_bidder_bid:
  109|  2.86k|{
  110|  2.86k|	const unsigned char *buffer;
  111|  2.86k|	ssize_t avail;
  112|       |
  113|       |	// Zstandard skippable frames contain a 4 byte magic number followed by
  114|       |	// a 4 byte frame data size, then that number of bytes of data. Regular
  115|       |	// frames contain a 4 byte magic number followed by a 2-14 byte frame
  116|       |	// header, some data, and a 3 byte end marker.
  117|  2.86k|	ssize_t min_zstd_frame_size = 8;
  118|       |
  119|  2.86k|	ssize_t offset_in_buffer = 0;
  120|  2.86k|	ssize_t max_lookahead = 64 * 1024;
  121|       |
  122|       |	// Zstd regular frame magic number.
  123|  2.86k|	uint32_t zstd_magic = 0xFD2FB528U;
  124|       |
  125|       |	// Note: Zstd and LZ4 skippable frame magic numbers are identical.
  126|       |	// To differentiate these two, we need to look for a non-skippable
  127|       |	// frame.
  128|  2.86k|	uint32_t zstd_magic_skippable_start = 0x184D2A50;
  129|  2.86k|	uint32_t zstd_magic_skippable_mask  = 0xFFFFFFF0;
  130|       |
  131|  2.86k|	(void) self; // UNUSED
  132|       |
  133|  2.86k|	buffer = __archive_read_filter_ahead(filter, min_zstd_frame_size, &avail);
  134|  2.86k|	if (buffer == NULL)
  ------------------
  |  Branch (134:6): [True: 62, False: 2.80k]
  ------------------
  135|     62|		return (0);
  136|       |
  137|  2.80k|	uint32_t magic_number = archive_le32dec(buffer);
  138|       |
  139|  2.80k|	while ((magic_number & zstd_magic_skippable_mask) == zstd_magic_skippable_start) {
  ------------------
  |  Branch (139:9): [True: 0, False: 2.80k]
  ------------------
  140|       |
  141|      0|		offset_in_buffer += 4; // Skip over the magic number
  142|       |
  143|       |		// Ensure that we can read another 4 bytes.
  144|      0|		if (offset_in_buffer + 4 > avail) {
  ------------------
  |  Branch (144:7): [True: 0, False: 0]
  ------------------
  145|      0|			buffer = __archive_read_filter_ahead(filter, offset_in_buffer + 4, &avail);
  146|      0|			if (buffer == NULL)
  ------------------
  |  Branch (146:8): [True: 0, False: 0]
  ------------------
  147|      0|				return (0);
  148|      0|		}
  149|       |
  150|      0|		uint32_t frame_data_size = archive_le32dec(buffer + offset_in_buffer);
  151|       |
  152|       |		// Skip over the 4 frame data size bytes, plus the value stored there.
  153|      0|		offset_in_buffer += 4 + frame_data_size;
  154|       |
  155|       |		// There should be at least one more frame if this is zstd data.
  156|      0|		if (offset_in_buffer + min_zstd_frame_size > avail) {
  ------------------
  |  Branch (156:7): [True: 0, False: 0]
  ------------------
  157|      0|			if (offset_in_buffer + min_zstd_frame_size > max_lookahead)
  ------------------
  |  Branch (157:8): [True: 0, False: 0]
  ------------------
  158|      0|				return (0);
  159|       |
  160|      0|			buffer = __archive_read_filter_ahead(filter, offset_in_buffer + min_zstd_frame_size, &avail);
  161|      0|			if (buffer == NULL)
  ------------------
  |  Branch (161:8): [True: 0, False: 0]
  ------------------
  162|      0|				return (0);
  163|      0|		}
  164|       |
  165|      0|		magic_number = archive_le32dec(buffer + offset_in_buffer);
  166|      0|	}
  167|       |
  168|       |	// We have skipped over any skippable frames. Either a regular zstd frame
  169|       |	// follows, or this isn't zstd data.
  170|       |
  171|  2.80k|	if (magic_number == zstd_magic)
  ------------------
  |  Branch (171:6): [True: 0, False: 2.80k]
  ------------------
  172|      0|		return (offset_in_buffer + 4);
  173|       |
  174|  2.80k|	return (0);
  175|  2.80k|}

archive_read_support_format_7zip:
  472|  2.49k|{
  473|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
  474|  2.49k|	struct _7zip *zip;
  475|  2.49k|	int r;
  476|       |
  477|  2.49k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  151|  2.49k|	do { \
  |  |  152|  2.49k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|  2.49k|			(allowed_states), (function_name)); \
  |  |  154|  2.49k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  2.49k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 2.49k]
  |  |  ------------------
  |  |  155|  2.49k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|  2.49k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 2.49k]
  |  |  ------------------
  ------------------
  478|  2.49k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_7zip");
  479|       |
  480|  2.49k|	zip = calloc(1, sizeof(*zip));
  481|  2.49k|	if (zip == NULL) {
  ------------------
  |  Branch (481:6): [True: 0, False: 2.49k]
  ------------------
  482|      0|		archive_set_error(&a->archive, ENOMEM,
  483|      0|		    "Can't allocate 7zip data");
  484|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  485|      0|	}
  486|       |
  487|       |	/*
  488|       |	 * Until enough data has been read, we cannot tell about
  489|       |	 * any encrypted entries yet.
  490|       |	 */
  491|  2.49k|	zip->has_encrypted_entries = ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW;
  ------------------
  |  |  411|  2.49k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  492|       |
  493|       |
  494|  2.49k|	r = __archive_read_register_format(a,
  495|  2.49k|	    zip,
  496|  2.49k|	    "7zip",
  497|  2.49k|	    archive_read_format_7zip_bid,
  498|  2.49k|	    NULL,
  499|  2.49k|	    archive_read_format_7zip_read_header,
  500|  2.49k|	    archive_read_format_7zip_read_data,
  501|  2.49k|	    archive_read_format_7zip_read_data_skip,
  502|  2.49k|	    NULL,
  503|  2.49k|	    archive_read_format_7zip_cleanup,
  504|  2.49k|	    archive_read_support_format_7zip_capabilities,
  505|  2.49k|	    archive_read_format_7zip_has_encrypted_entries);
  506|       |
  507|  2.49k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (507:6): [True: 0, False: 2.49k]
  ------------------
  508|      0|		free(zip);
  509|  2.49k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  510|  2.49k|}
archive_read_support_format_7zip.c:archive_read_support_format_7zip_capabilities:
  514|    214|{
  515|    214|	(void)a; /* UNUSED */
  516|    214|	return (ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA |
  ------------------
  |  |  398|    214|#define ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA (1<<0)  /* reader can detect encrypted data */
  ------------------
  517|    214|			ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA);
  ------------------
  |  |  399|    214|#define ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA (1<<1)  /* reader can detect encryptable metadata (pathname, mtime, etc.) */
  ------------------
  518|    214|}
archive_read_support_format_7zip.c:archive_read_format_7zip_has_encrypted_entries:
  523|    107|{
  524|    107|	if (_a && _a->format) {
  ------------------
  |  Branch (524:6): [True: 107, False: 0]
  |  Branch (524:12): [True: 107, False: 0]
  ------------------
  525|    107|		struct _7zip * zip = (struct _7zip *)_a->format->data;
  526|    107|		if (zip) {
  ------------------
  |  Branch (526:7): [True: 107, False: 0]
  ------------------
  527|    107|			return zip->has_encrypted_entries;
  528|    107|		}
  529|    107|	}
  530|      0|	return ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW;
  ------------------
  |  |  411|      0|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  531|    107|}
archive_read_support_format_7zip.c:archive_read_format_7zip_bid:
  602|  2.46k|{
  603|  2.46k|	int64_t data_offset;
  604|       |
  605|       |	/* If someone has already bid more than 32, then avoid
  606|       |	   trashing the look-ahead buffers with a seek. */
  607|  2.46k|	if (best_bid > 32)
  ------------------
  |  Branch (607:6): [True: 799, False: 1.66k]
  ------------------
  608|    799|		return (-1);
  609|       |
  610|  1.66k|	if (get_data_offset(a, &data_offset) < 0)
  ------------------
  |  Branch (610:6): [True: 1.55k, False: 107]
  ------------------
  611|  1.55k|		return (0);
  612|       |
  613|    107|	return (48);
  614|  1.66k|}
archive_read_support_format_7zip.c:get_data_offset:
  535|  1.76k|{
  536|  1.76k|	const unsigned char *p;
  537|  1.76k|	int64_t offset, sfx_offset;
  538|  1.76k|	int r, window;
  539|       |
  540|  1.76k|	if ((p = __archive_read_ahead(a, 6, NULL)) == NULL) {
  ------------------
  |  Branch (540:6): [True: 29, False: 1.73k]
  ------------------
  541|     29|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     29|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  542|     29|		    "Truncated 7-Zip file body");
  543|     29|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     29|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  544|     29|	}
  545|       |
  546|       |	/* If first six bytes are the 7-Zip signature,
  547|       |	 * return the offset right now. */
  548|  1.73k|	if (memcmp(p, _7ZIP_SIGNATURE, 6) == 0) {
  ------------------
  |  |   66|  1.73k|#define _7ZIP_SIGNATURE	"7z\xBC\xAF\x27\x1C"
  ------------------
  |  Branch (548:6): [True: 206, False: 1.53k]
  ------------------
  549|    206|		*data_offset = 0;
  550|    206|		return (ARCHIVE_OK);
  ------------------
  |  |  233|    206|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  551|    206|	}
  552|       |
  553|       |	/*
  554|       |	 * It may be a 7-Zip SFX archive file. If first two bytes are
  555|       |	 * 'M' and 'Z' (PE, Windows) or first four bytes are
  556|       |	 * "\x7F\x45LF" (ELF, Posix-like systems), seek the 7-Zip
  557|       |	 * signature. While get_pe_sfx_offset can be performed without
  558|       |	 * performing a seek, get_elf_sfx_offset requires one,
  559|       |	 * thus a performance difference between the two is expected. 
  560|       |	 */
  561|  1.53k|	if ((p[0] == 'M' && p[1] == 'Z'))
  ------------------
  |  Branch (561:7): [True: 101, False: 1.43k]
  |  Branch (561:22): [True: 74, False: 27]
  ------------------
  562|     74|		r = get_pe_sfx_offset(a, &sfx_offset);
  563|  1.45k|	else if (memcmp(p, "\x7F\x45LF", 4) == 0)
  ------------------
  |  Branch (563:11): [True: 23, False: 1.43k]
  ------------------
  564|     23|		r = get_elf_sfx_offset(a, &sfx_offset);
  565|  1.43k|	else
  566|  1.43k|		r = ARCHIVE_FATAL;
  ------------------
  |  |  239|  1.43k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  567|  1.53k|	if (r < ARCHIVE_WARN || sfx_offset > SFX_MAX_SEEK)
  ------------------
  |  |  235|  3.06k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
              	if (r < ARCHIVE_WARN || sfx_offset > SFX_MAX_SEEK)
  ------------------
  |  |   70|     42|#define SFX_MAX_SEEK	0x800000
  ------------------
  |  Branch (567:6): [True: 1.49k, False: 42]
  |  Branch (567:26): [True: 6, False: 36]
  ------------------
  568|  1.49k|		goto fail;
  569|       |
  570|     36|	offset = sfx_offset;
  571|     36|	window = 4096;
  572|    206|	while (offset + window <= (sfx_offset + SFX_MAX_OFFSET)) {
  ------------------
  |  |   69|    206|#define SFX_MAX_OFFSET	(SFX_MAX_ADDR - SFX_MIN_ADDR)
  |  |  ------------------
  |  |  |  |   68|    206|#define SFX_MAX_ADDR	0x60000
  |  |  ------------------
  |  |               #define SFX_MAX_OFFSET	(SFX_MAX_ADDR - SFX_MIN_ADDR)
  |  |  ------------------
  |  |  |  |   67|    206|#define SFX_MIN_ADDR	0x27000
  |  |  ------------------
  ------------------
  |  Branch (572:9): [True: 204, False: 2]
  ------------------
  573|    204|		ssize_t bytes_avail;
  574|    204|		const unsigned char *buff = __archive_read_ahead(a,
  575|    204|				offset + window, &bytes_avail);
  576|    204|		if (buff == NULL) {
  ------------------
  |  Branch (576:7): [True: 190, False: 14]
  ------------------
  577|       |			/* Remaining bytes are less than window. */
  578|    190|			window >>= 1;
  579|    190|			if (window < 0x40)
  ------------------
  |  Branch (579:8): [True: 26, False: 164]
  ------------------
  580|     26|				goto fail;
  581|    164|			continue;
  582|    190|		}
  583|     14|		p = buff + offset;
  584|   194k|		while (p + 32 < buff + bytes_avail) {
  ------------------
  |  Branch (584:10): [True: 194k, False: 6]
  ------------------
  585|   194k|			int step = check_7zip_header_in_sfx(p);
  586|   194k|			if (step == 0) {
  ------------------
  |  Branch (586:8): [True: 8, False: 194k]
  ------------------
  587|      8|				*data_offset = p - buff;
  588|      8|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      8|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  589|      8|			}
  590|   194k|			p += step;
  591|   194k|		}
  592|      6|		offset = p - buff;
  593|      6|	}
  594|  1.52k|fail:
  595|  1.52k|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  1.52k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  596|  1.52k|	    "Couldn't find out 7-Zip header");
  597|  1.52k|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|  1.52k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  598|     36|}
archive_read_support_format_7zip.c:get_pe_sfx_offset:
  643|     74|{
  644|     74|	const char *h;
  645|     74|	int64_t max_offset, offset;
  646|     74|	ssize_t bytes;
  647|     74|	uint16_t opt_hdr_sz, sec_cnt;
  648|       |
  649|       |	/*
  650|       |	 * If encounter any weirdness, revert to old brute-force style search
  651|       |	 */
  652|     74|	*sfx_offset = SFX_MIN_ADDR;
  ------------------
  |  |   67|     74|#define SFX_MIN_ADDR	0x27000
  ------------------
  653|       |
  654|     74|	for (;;) {
  655|       |		/*
  656|       |		 * Read Dos header to find e_lfanew
  657|       |		 */
  658|     74|		h = __archive_read_ahead(a, PE_DOS_HDR_LEN, &bytes);
  ------------------
  |  |   75|     74|#define PE_DOS_HDR_LEN				0x40
  ------------------
  659|     74|		if (h == NULL) {
  ------------------
  |  Branch (659:7): [True: 0, False: 74]
  ------------------
  660|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  661|      0|		}
  662|     74|		if (h[0] != 'M' || h[1] != 'Z') {
  ------------------
  |  Branch (662:7): [True: 0, False: 74]
  |  Branch (662:22): [True: 0, False: 74]
  ------------------
  663|      0|			break;
  664|      0|		}
  665|     74|		offset = archive_le32dec(h + PE_DOS_HDR_ELFANEW_OFFSET);
  ------------------
  |  |   76|     74|#define PE_DOS_HDR_ELFANEW_OFFSET	0x3c
  ------------------
  666|     74|		if (offset > SFX_MAX_SEEK) {
  ------------------
  |  |   70|     74|#define SFX_MAX_SEEK	0x800000
  ------------------
  |  Branch (666:7): [True: 46, False: 28]
  ------------------
  667|     46|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     46|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  668|     46|		}
  669|       |
  670|       |		/*
  671|       |		 * Read COFF header to find opt header size and sec cnt
  672|       |		 */
  673|     28|		if (bytes < offset + PE_COFF_HDR_LEN) {
  ------------------
  |  |   77|     28|#define PE_COFF_HDR_LEN				0x18
  ------------------
  |  Branch (673:7): [True: 0, False: 28]
  ------------------
  674|      0|			h = __archive_read_ahead(a, offset + PE_COFF_HDR_LEN,
  ------------------
  |  |   77|      0|#define PE_COFF_HDR_LEN				0x18
  ------------------
  675|      0|			    &bytes);
  676|      0|			if (h == NULL) {
  ------------------
  |  Branch (676:8): [True: 0, False: 0]
  ------------------
  677|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  678|      0|			}
  679|      0|			if (h[offset] != 'P' || h[offset + 1] != 'E') {
  ------------------
  |  Branch (679:8): [True: 0, False: 0]
  |  Branch (679:28): [True: 0, False: 0]
  ------------------
  680|      0|				break;
  681|      0|			}
  682|      0|		}
  683|     28|		sec_cnt = archive_le16dec(
  684|     28|		    h + offset + PE_COFF_HDR_SEC_CNT_OFFSET);
  ------------------
  |  |   78|     28|#define PE_COFF_HDR_SEC_CNT_OFFSET	0x6
  ------------------
  685|     28|		opt_hdr_sz = archive_le16dec(
  686|     28|		    h + offset + PE_COFF_HDR_OPT_SZ_OFFSET);
  ------------------
  |  |   79|     28|#define PE_COFF_HDR_OPT_SZ_OFFSET	0x14
  ------------------
  687|       |
  688|       |		/*
  689|       |		 * Skip optional header
  690|       |		 */
  691|     28|		if (opt_hdr_sz != 0) {
  ------------------
  |  Branch (691:7): [True: 20, False: 8]
  ------------------
  692|     20|			offset += PE_COFF_HDR_LEN + opt_hdr_sz;
  ------------------
  |  |   77|     20|#define PE_COFF_HDR_LEN				0x18
  ------------------
  693|     20|		} else {
  694|      8|			break;
  695|      8|		}
  696|       |
  697|     20|		if (offset + sec_cnt * PE_SEC_HDR_LEN > SFX_MAX_SEEK) {
  ------------------
  |  |   80|     20|#define PE_SEC_HDR_LEN 				0x28
  ------------------
              		if (offset + sec_cnt * PE_SEC_HDR_LEN > SFX_MAX_SEEK) {
  ------------------
  |  |   70|     20|#define SFX_MAX_SEEK	0x800000
  ------------------
  |  Branch (697:7): [True: 0, False: 20]
  ------------------
  698|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  699|      0|		}
  700|       |
  701|       |		/*
  702|       |		 * Traverse sec table to find max raw offset (i.e., overlay)
  703|       |		 */
  704|     20|		if (bytes < offset + sec_cnt * PE_SEC_HDR_LEN) {
  ------------------
  |  |   80|     20|#define PE_SEC_HDR_LEN 				0x28
  ------------------
  |  Branch (704:7): [True: 3, False: 17]
  ------------------
  705|      3|			h = __archive_read_ahead(a,
  706|      3|			    offset + sec_cnt * PE_SEC_HDR_LEN, NULL);
  ------------------
  |  |   80|      3|#define PE_SEC_HDR_LEN 				0x28
  ------------------
  707|      3|			if (h == NULL) {
  ------------------
  |  Branch (707:8): [True: 3, False: 0]
  ------------------
  708|      3|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      3|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  709|      3|			}
  710|      3|		}
  711|     17|		max_offset = offset;
  712|  17.0k|		while (sec_cnt > 0) {
  ------------------
  |  Branch (712:10): [True: 16.9k, False: 17]
  ------------------
  713|  16.9k|			uint32_t sec_end;
  714|       |
  715|  16.9k|			sec_end = archive_le32dec(
  716|  16.9k|				      h + offset + PE_SEC_HDR_RAW_SZ_OFFSET) +
  ------------------
  |  |   82|  16.9k|#define PE_SEC_HDR_RAW_SZ_OFFSET	0x10
  ------------------
  717|  16.9k|			    archive_le32dec(
  718|  16.9k|				h + offset + PE_SEC_HDR_RAW_ADDR_OFFSET);
  ------------------
  |  |   81|  16.9k|#define PE_SEC_HDR_RAW_ADDR_OFFSET	0x14
  ------------------
  719|  16.9k|			if (sec_end > max_offset) {
  ------------------
  |  Branch (719:8): [True: 8.36k, False: 8.62k]
  ------------------
  720|  8.36k|				max_offset = sec_end;
  721|  8.36k|			}
  722|  16.9k|			offset += PE_SEC_HDR_LEN;
  ------------------
  |  |   80|  16.9k|#define PE_SEC_HDR_LEN 				0x28
  ------------------
  723|  16.9k|			sec_cnt--;
  724|  16.9k|		}
  725|     17|		*sfx_offset = max_offset;
  726|     17|		break;
  727|     20|	}
  728|       |
  729|     25|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     25|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  730|     74|}
archive_read_support_format_7zip.c:get_elf_sfx_offset:
  734|     23|{
  735|     23|	int64_t r;
  736|     23|	const char *h;
  737|     23|	char big_endian, format_64;
  738|     23|	ssize_t bytes;
  739|     23|	size_t request;
  740|     23|	uint64_t e_shoff, strtab_offset, strtab_size;
  741|     23|	uint16_t e_shentsize, e_shnum, e_shstrndx;
  742|     23|	uint16_t (*dec16)(const void *);
  743|     23|	uint32_t (*dec32)(const void *);
  744|     23|	uint64_t (*dec64)(const void *);
  745|       |
  746|       |	/*
  747|       |	 * If encounter any weirdness, revert to old brute-force style search
  748|       |	 */
  749|     23|	*sfx_offset = SFX_MIN_ADDR;
  ------------------
  |  |   67|     23|#define SFX_MIN_ADDR	0x27000
  ------------------
  750|       |
  751|     23|	for (;;) {
  752|       |		/*
  753|       |		 * Read Elf header to find bitness & endianness
  754|       |		 */
  755|     23|		h = __archive_read_ahead(a, ELF_HDR_MIN_LEN, &bytes);
  ------------------
  |  |   87|     23|#define ELF_HDR_MIN_LEN 0x40 /* sizeof(Elf64_Ehdr) */
  ------------------
  756|     23|		if (h == NULL) {
  ------------------
  |  Branch (756:7): [True: 0, False: 23]
  ------------------
  757|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  758|      0|		}
  759|     23|		if (memcmp(h, "\x7F\x45LF", 4) != 0) {
  ------------------
  |  Branch (759:7): [True: 0, False: 23]
  ------------------
  760|      0|			break;
  761|      0|		}
  762|     23|		format_64 = h[ELF_HDR_EI_CLASS_OFFSET] == 0x2;
  ------------------
  |  |   88|     23|#define ELF_HDR_EI_CLASS_OFFSET 0x04
  ------------------
  763|     23|		big_endian = h[ELF_HDR_EI_DATA_OFFSET] == 0x2;
  ------------------
  |  |   89|     23|#define ELF_HDR_EI_DATA_OFFSET 0x05
  ------------------
  764|     23|		if (big_endian) {
  ------------------
  |  Branch (764:7): [True: 3, False: 20]
  ------------------
  765|      3|			dec16 = &archive_be16dec;
  766|      3|			dec32 = &archive_be32dec;
  767|      3|			dec64 = &archive_be64dec;
  768|     20|		} else {
  769|     20|			dec16 = &archive_le16dec;
  770|     20|			dec32 = &archive_le32dec;
  771|     20|			dec64 = &archive_le64dec;
  772|     20|		}
  773|       |
  774|       |		/*
  775|       |		 * Read section header table info
  776|       |		 */
  777|     23|		if (format_64) {
  ------------------
  |  Branch (777:7): [True: 4, False: 19]
  ------------------
  778|      4|			e_shoff = (*dec64)(h + 0x28);
  779|      4|			e_shentsize = (*dec16)(h + 0x3A);
  780|      4|			e_shnum = (*dec16)(h + 0x3C);
  781|      4|			e_shstrndx = (*dec16)(h + 0x3E);
  782|      4|			if (e_shnum < e_shstrndx || e_shentsize < 0x28)
  ------------------
  |  Branch (782:8): [True: 2, False: 2]
  |  Branch (782:32): [True: 0, False: 2]
  ------------------
  783|      2|				break;
  784|       |
  785|     19|		} else {
  786|     19|			e_shoff = (*dec32)(h + 0x20);
  787|     19|			e_shentsize = (*dec16)(h + 0x2E);
  788|     19|			e_shnum = (*dec16)(h + 0x30);
  789|     19|			e_shstrndx = (*dec16)(h + 0x32);
  790|     19|			if (e_shnum < e_shstrndx || e_shentsize < 0x18)
  ------------------
  |  Branch (790:8): [True: 9, False: 10]
  |  Branch (790:32): [True: 0, False: 10]
  ------------------
  791|      9|				break;
  792|     19|		}
  793|       |
  794|     12|		if ((int64_t)e_shoff < 0) {
  ------------------
  |  Branch (794:7): [True: 1, False: 11]
  ------------------
  795|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  796|      1|		}
  797|       |
  798|       |		/*
  799|       |		 * Reading the section table to find strtab section
  800|       |		 */
  801|     11|		if (__archive_read_seek(a, e_shoff, SEEK_SET) < 0) {
  ------------------
  |  Branch (801:7): [True: 2, False: 9]
  ------------------
  802|      2|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Seek error");
  ------------------
  |  |  204|      2|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  803|      2|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  804|      2|		}
  805|      9|		if (format_64) {
  ------------------
  |  Branch (805:7): [True: 1, False: 8]
  ------------------
  806|      1|			request = (size_t)e_shnum * e_shentsize + 0x28;
  807|      8|		} else {
  808|      8|			request = (size_t)e_shnum * e_shentsize + 0x18;
  809|      8|		}
  810|      9|		if (request > SFX_MAX_SEEK) {
  ------------------
  |  |   70|      9|#define SFX_MAX_SEEK	0x800000
  ------------------
  |  Branch (810:7): [True: 1, False: 8]
  ------------------
  811|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  812|      1|		}
  813|      8|		h = __archive_read_ahead(a, request, &bytes);
  814|      8|		if (h == NULL) {
  ------------------
  |  Branch (814:7): [True: 0, False: 8]
  ------------------
  815|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  816|      0|		}
  817|      8|		if (format_64) {
  ------------------
  |  Branch (817:7): [True: 1, False: 7]
  ------------------
  818|      1|			strtab_offset = (*dec64)(
  819|      1|			    h + e_shstrndx * e_shentsize + 0x18);
  820|      1|			strtab_size = (*dec64)(
  821|      1|			    h + e_shstrndx * e_shentsize + 0x20);
  822|      7|		} else {
  823|      7|			strtab_offset = (*dec32)(
  824|      7|			    h + e_shstrndx * e_shentsize + 0x10);
  825|      7|			strtab_size = (*dec32)(
  826|      7|			    h + e_shstrndx * e_shentsize + 0x14);
  827|      7|		}
  828|      8|		if ((int64_t)strtab_offset < 0 || strtab_size < 6 ||
  ------------------
  |  Branch (828:7): [True: 0, False: 8]
  |  Branch (828:37): [True: 1, False: 7]
  ------------------
  829|      7|		    strtab_size > SFX_MAX_SEEK)
  ------------------
  |  |   70|      7|#define SFX_MAX_SEEK	0x800000
  ------------------
  |  Branch (829:7): [True: 1, False: 6]
  ------------------
  830|      2|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  831|       |
  832|       |		/*
  833|       |		 * Read the STRTAB section to find the .data offset
  834|       |		 */
  835|      6|		if (__archive_read_seek(a, strtab_offset, SEEK_SET) < 0) {
  ------------------
  |  Branch (835:7): [True: 0, False: 6]
  ------------------
  836|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Seek error");
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  837|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  838|      0|		}
  839|      6|		h = __archive_read_ahead(a, strtab_size, NULL);
  840|      6|		if (h == NULL) {
  ------------------
  |  Branch (840:7): [True: 0, False: 6]
  ------------------
  841|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  842|      0|		}
  843|      6|		size_t data_sym_offset = strtab_size;
  844|  5.51k|		for (size_t offset = 0; offset < strtab_size - 6; offset++) {
  ------------------
  |  Branch (844:27): [True: 5.51k, False: 2]
  ------------------
  845|  5.51k|			if (memcmp(h + offset, ".data\00", 6) == 0) {
  ------------------
  |  Branch (845:8): [True: 4, False: 5.50k]
  ------------------
  846|      4|				data_sym_offset = offset;
  847|      4|				break;
  848|      4|			}
  849|  5.51k|		}
  850|      6|		if (data_sym_offset == strtab_size) {
  ------------------
  |  Branch (850:7): [True: 2, False: 4]
  ------------------
  851|      2|			break;
  852|      2|		}
  853|       |
  854|       |		/*
  855|       |		 * Find the section with the .data name
  856|       |		 */
  857|      4|		if (__archive_read_seek(a, e_shoff, SEEK_SET) < 0) {
  ------------------
  |  Branch (857:7): [True: 0, False: 4]
  ------------------
  858|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Seek error");
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  859|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  860|      0|		}
  861|      4|		h = __archive_read_ahead(a, (size_t)e_shnum * e_shentsize, NULL);
  862|      4|		if (h == NULL) {
  ------------------
  |  Branch (862:7): [True: 0, False: 4]
  ------------------
  863|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  864|      0|		}
  865|      4|		size_t sec_tbl_offset = 0;
  866|    216|		while (e_shnum > 0) {
  ------------------
  |  Branch (866:10): [True: 213, False: 3]
  ------------------
  867|    213|			uint32_t name_offset;
  868|       |
  869|    213|			name_offset = (*dec32)(h + sec_tbl_offset);
  870|    213|			if (name_offset == data_sym_offset) {
  ------------------
  |  Branch (870:8): [True: 1, False: 212]
  ------------------
  871|      1|				int64_t sel_offset;
  872|       |
  873|      1|				if (format_64) {
  ------------------
  |  Branch (873:9): [True: 0, False: 1]
  ------------------
  874|      0|					sel_offset = (*dec64)(
  875|      0|					    h + sec_tbl_offset + 0x18);
  876|      1|				} else {
  877|      1|					sel_offset = (*dec32)(
  878|      1|					    h + sec_tbl_offset + 0x10);
  879|      1|				}
  880|      1|				if (sel_offset >= 0)
  ------------------
  |  Branch (880:9): [True: 1, False: 0]
  ------------------
  881|      1|					*sfx_offset = sel_offset;
  882|      1|				break;
  883|      1|			}
  884|    212|			sec_tbl_offset += e_shentsize;
  885|    212|			e_shnum--;
  886|    212|		}
  887|      4|		break;
  888|      4|	}
  889|       |
  890|     17|	r = __archive_read_seek(a, 0, SEEK_SET);
  891|     17|	if (r < 0)
  ------------------
  |  Branch (891:6): [True: 0, False: 17]
  ------------------
  892|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Seek error");
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  893|     17|	return (int)r;
  894|     23|}
archive_read_support_format_7zip.c:check_7zip_header_in_sfx:
  618|   194k|{
  619|   194k|	switch (p[5]) {
  620|    110|	case 0x1C:
  ------------------
  |  Branch (620:2): [True: 110, False: 194k]
  ------------------
  621|    110|		if (memcmp(p, _7ZIP_SIGNATURE, 6) != 0)
  ------------------
  |  |   66|    110|#define _7ZIP_SIGNATURE	"7z\xBC\xAF\x27\x1C"
  ------------------
  |  Branch (621:7): [True: 72, False: 38]
  ------------------
  622|     72|			return (6);
  623|       |		/*
  624|       |		 * Test the CRC because its extraction code has 7-Zip
  625|       |		 * Magic Code, so we should do this in order not to
  626|       |		 * make a mis-detection.
  627|       |		 */
  628|     38|		if (crc32(0, p + 12, 20) != archive_le32dec(p + 8))
  ------------------
  |  Branch (628:7): [True: 30, False: 8]
  ------------------
  629|     30|			return (6);
  630|       |		/* Hit the header! */
  631|      8|		return (0);
  632|     25|	case 0x37: return (5);
  ------------------
  |  Branch (632:2): [True: 25, False: 194k]
  ------------------
  633|      5|	case 0x7A: return (4);
  ------------------
  |  Branch (633:2): [True: 5, False: 194k]
  ------------------
  634|     20|	case 0xBC: return (3);
  ------------------
  |  Branch (634:2): [True: 20, False: 194k]
  ------------------
  635|    151|	case 0xAF: return (2);
  ------------------
  |  Branch (635:2): [True: 151, False: 194k]
  ------------------
  636|     12|	case 0x27: return (1);
  ------------------
  |  Branch (636:2): [True: 12, False: 194k]
  ------------------
  637|   194k|	default: return (6);
  ------------------
  |  Branch (637:2): [True: 194k, False: 323]
  ------------------
  638|   194k|	}
  639|   194k|}
archive_read_support_format_7zip.c:archive_read_format_7zip_read_header:
  899|  1.13k|{
  900|  1.13k|	struct _7zip *zip = (struct _7zip *)a->format->data;
  901|  1.13k|	struct _7zip_entry *zip_entry;
  902|  1.13k|	int r, ret = ARCHIVE_OK;
  ------------------
  |  |  233|  1.13k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  903|  1.13k|	struct _7z_folder *folder = 0;
  904|  1.13k|	uint64_t fidx = 0;
  905|       |
  906|       |	/*
  907|       |	 * It should be sufficient to call archive_read_next_header() for
  908|       |	 * a reader to determine if an entry is encrypted or not. If the
  909|       |	 * encryption of an entry is only detectable when calling
  910|       |	 * archive_read_data(), so be it. We'll do the same check there
  911|       |	 * as well.
  912|       |	 */
  913|  1.13k|	if (zip->has_encrypted_entries == ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW) {
  ------------------
  |  |  411|  1.13k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  |  Branch (913:6): [True: 107, False: 1.03k]
  ------------------
  914|    107|		zip->has_encrypted_entries = 0;
  915|    107|	}
  916|       |
  917|  1.13k|	a->archive.archive_format = ARCHIVE_FORMAT_7ZIP;
  ------------------
  |  |  385|  1.13k|#define	ARCHIVE_FORMAT_7ZIP			0xE0000
  ------------------
  918|  1.13k|	if (a->archive.archive_format_name == NULL)
  ------------------
  |  Branch (918:6): [True: 107, False: 1.03k]
  ------------------
  919|    107|		a->archive.archive_format_name = "7-Zip";
  920|       |
  921|  1.13k|	if (zip->entries == NULL) {
  ------------------
  |  Branch (921:6): [True: 107, False: 1.03k]
  ------------------
  922|    107|		struct _7z_header_info header;
  923|       |
  924|    107|		memset(&header, 0, sizeof(header));
  925|    107|		r = slurp_central_directory(a, zip, &header);
  926|    107|		free_Header(&header);
  927|    107|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    107|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (927:7): [True: 88, False: 19]
  ------------------
  928|     88|			return (r);
  929|     19|		zip->entries_remaining = (size_t)zip->numFiles;
  930|     19|		zip->entry = zip->entries;
  931|  1.03k|	} else {
  932|  1.03k|		++zip->entry;
  933|  1.03k|	}
  934|  1.05k|	zip_entry = zip->entry;
  935|       |
  936|  1.05k|	if (zip->entries_remaining <= 0 || zip_entry == NULL)
  ------------------
  |  Branch (936:6): [True: 15, False: 1.03k]
  |  Branch (936:37): [True: 0, False: 1.03k]
  ------------------
  937|     15|		return ARCHIVE_EOF;
  ------------------
  |  |  232|     15|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  938|  1.03k|	--zip->entries_remaining;
  939|       |
  940|  1.03k|	zip->entry_offset = 0;
  941|  1.03k|	zip->end_of_entry = 0;
  942|  1.03k|	zip->entry_crc32 = crc32(0, NULL, 0);
  943|       |
  944|       |	/* Setup a string conversion for a filename. */
  945|  1.03k|	if (zip->sconv == NULL) {
  ------------------
  |  Branch (945:6): [True: 19, False: 1.01k]
  ------------------
  946|     19|		zip->sconv = archive_string_conversion_from_charset(
  947|     19|		    &a->archive, "UTF-16LE", 1);
  948|     19|		if (zip->sconv == NULL)
  ------------------
  |  Branch (948:7): [True: 0, False: 19]
  ------------------
  949|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  950|     19|	}
  951|       |
  952|       |	/* Figure out if the entry is encrypted by looking at the folder
  953|       |	   that is associated to the current 7zip entry. If the folder
  954|       |	   has a coder with a _7Z_CRYPTO codec then the folder is encrypted.
  955|       |	   Hence the entry must also be encrypted. */
  956|  1.03k|	if (zip_entry && zip_entry->folderIndex < zip->si.ci.numFolders) {
  ------------------
  |  Branch (956:6): [True: 1.03k, False: 0]
  |  Branch (956:19): [True: 45, False: 990]
  ------------------
  957|     45|		folder = &(zip->si.ci.folders[zip_entry->folderIndex]);
  958|     90|		for (fidx=0; folder && fidx<folder->numCoders; fidx++) {
  ------------------
  |  Branch (958:16): [True: 90, False: 0]
  |  Branch (958:26): [True: 45, False: 45]
  ------------------
  959|     45|			switch(folder->coders[fidx].codec) {
  ------------------
  |  Branch (959:11): [True: 0, False: 45]
  ------------------
  960|      0|				case _7Z_CRYPTO_MAIN_ZIP:
  ------------------
  |  |  101|      0|#define _7Z_CRYPTO_MAIN_ZIP			0x06F10101 /* Main Zip crypto algo */
  ------------------
  |  Branch (960:5): [True: 0, False: 45]
  ------------------
  961|      0|				case _7Z_CRYPTO_RAR_29:
  ------------------
  |  |  102|      0|#define _7Z_CRYPTO_RAR_29			0x06F10303 /* Rar29 AES-128 + (modified SHA-1) */
  ------------------
  |  Branch (961:5): [True: 0, False: 45]
  ------------------
  962|      0|				case _7Z_CRYPTO_AES_256_SHA_256: {
  ------------------
  |  |  103|      0|#define _7Z_CRYPTO_AES_256_SHA_256	0x06F10701 /* AES-256 + SHA-256 */
  ------------------
  |  Branch (962:5): [True: 0, False: 45]
  ------------------
  963|      0|					archive_entry_set_is_data_encrypted(entry, 1);
  964|      0|					zip->has_encrypted_entries = 1;
  965|      0|					break;
  966|      0|				}
  967|     45|			}
  968|     45|		}
  969|     45|	}
  970|       |
  971|       |	/* Now that we've checked for encryption, if there were still no
  972|       |	 * encrypted entries found we can say for sure that there are none.
  973|       |	 */
  974|  1.03k|	if (zip->has_encrypted_entries == ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW) {
  ------------------
  |  |  411|  1.03k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  |  Branch (974:6): [True: 0, False: 1.03k]
  ------------------
  975|      0|		zip->has_encrypted_entries = 0;
  976|      0|	}
  977|       |
  978|  1.03k|	if (archive_entry_copy_pathname_l(entry,
  ------------------
  |  |   80|  1.03k|#define archive_entry_copy_pathname_l	_archive_entry_copy_pathname_l
  ------------------
  |  Branch (978:6): [True: 441, False: 594]
  ------------------
  979|  1.03k|	    (const char *)zip_entry->utf16name,
  980|  1.03k|	    zip_entry->name_len, zip->sconv) != 0) {
  981|    441|		if (errno == ENOMEM) {
  ------------------
  |  Branch (981:7): [True: 0, False: 441]
  ------------------
  982|      0|			archive_set_error(&a->archive, ENOMEM,
  983|      0|			    "Can't allocate memory for Pathname");
  984|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  985|      0|		}
  986|    441|		archive_set_error(&a->archive,
  987|    441|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    441|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  988|    441|		    "Pathname cannot be converted "
  989|    441|		    "from %s to current locale",
  990|    441|		    archive_string_conversion_charset_name(zip->sconv));
  991|    441|		ret = ARCHIVE_WARN;
  ------------------
  |  |  235|    441|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  992|    441|	}
  993|       |
  994|       |	/* Populate some additional entry fields: */
  995|  1.03k|	archive_entry_set_mode(entry, zip_entry->mode);
  996|  1.03k|	if (zip_entry->flg & MTIME_IS_SET)
  ------------------
  |  |  248|  1.03k|#define MTIME_IS_SET	(1<<0)
  ------------------
  |  Branch (996:6): [True: 0, False: 1.03k]
  ------------------
  997|      0|		archive_entry_set_mtime(entry, zip_entry->mtime,
  998|      0|			zip_entry->mtime_ns);
  999|  1.03k|	if (zip_entry->flg & CTIME_IS_SET)
  ------------------
  |  |  250|  1.03k|#define CTIME_IS_SET	(1<<2)
  ------------------
  |  Branch (999:6): [True: 0, False: 1.03k]
  ------------------
 1000|      0|		archive_entry_set_ctime(entry, zip_entry->ctime,
 1001|      0|		    zip_entry->ctime_ns);
 1002|  1.03k|	if (zip_entry->flg & ATIME_IS_SET)
  ------------------
  |  |  249|  1.03k|#define ATIME_IS_SET	(1<<1)
  ------------------
  |  Branch (1002:6): [True: 0, False: 1.03k]
  ------------------
 1003|      0|		archive_entry_set_atime(entry, zip_entry->atime,
 1004|      0|		    zip_entry->atime_ns);
 1005|  1.03k|	if (zip_entry->ssIndex != (uint32_t)-1) {
  ------------------
  |  Branch (1005:6): [True: 31, False: 1.00k]
  ------------------
 1006|     31|		zip->entry_bytes_remaining =
 1007|     31|		    zip->si.ss.unpackSizes[zip_entry->ssIndex];
 1008|     31|		archive_entry_set_size(entry, zip->entry_bytes_remaining);
 1009|  1.00k|	} else {
 1010|  1.00k|		zip->entry_bytes_remaining = 0;
 1011|  1.00k|		archive_entry_set_size(entry, 0);
 1012|  1.00k|	}
 1013|       |
 1014|       |	// These attributes are supported by the windows implementation of archive_write_disk.
 1015|  1.03k|	const int supported_attrs = FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM;
  ------------------
  |  |  149|  1.03k|#define FILE_ATTRIBUTE_READONLY 0x00000001
  ------------------
              	const int supported_attrs = FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM;
  ------------------
  |  |  153|  1.03k|#define FILE_ATTRIBUTE_HIDDEN 0x00000002
  ------------------
              	const int supported_attrs = FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM;
  ------------------
  |  |  157|  1.03k|#define FILE_ATTRIBUTE_SYSTEM 0x00000004
  ------------------
 1016|       |
 1017|  1.03k|	if (zip_entry->attr & supported_attrs) {
  ------------------
  |  Branch (1017:6): [True: 0, False: 1.03k]
  ------------------
 1018|      0|		char *fflags_text, *ptr;
 1019|       |		/* allocate for ",rdonly,hidden,system" */
 1020|      0|		fflags_text = malloc(22 * sizeof(*fflags_text));
 1021|      0|		if (fflags_text != NULL) {
  ------------------
  |  Branch (1021:7): [True: 0, False: 0]
  ------------------
 1022|      0|			ptr = fflags_text;
 1023|      0|			if (zip_entry->attr & FILE_ATTRIBUTE_READONLY) {
  ------------------
  |  |  149|      0|#define FILE_ATTRIBUTE_READONLY 0x00000001
  ------------------
  |  Branch (1023:8): [True: 0, False: 0]
  ------------------
 1024|      0|				strcpy(ptr, ",rdonly");
 1025|      0|				ptr = ptr + 7;
 1026|      0|			}
 1027|      0|			if (zip_entry->attr & FILE_ATTRIBUTE_HIDDEN) {
  ------------------
  |  |  153|      0|#define FILE_ATTRIBUTE_HIDDEN 0x00000002
  ------------------
  |  Branch (1027:8): [True: 0, False: 0]
  ------------------
 1028|      0|				strcpy(ptr, ",hidden");
 1029|      0|				ptr = ptr + 7;
 1030|      0|			}
 1031|      0|			if (zip_entry->attr & FILE_ATTRIBUTE_SYSTEM) {
  ------------------
  |  |  157|      0|#define FILE_ATTRIBUTE_SYSTEM 0x00000004
  ------------------
  |  Branch (1031:8): [True: 0, False: 0]
  ------------------
 1032|      0|				strcpy(ptr, ",system");
 1033|      0|				ptr = ptr + 7;
 1034|      0|			}
 1035|      0|			if (ptr > fflags_text) {
  ------------------
  |  Branch (1035:8): [True: 0, False: 0]
  ------------------
 1036|      0|				archive_entry_copy_fflags_text(entry,
 1037|      0|				    fflags_text + 1);
 1038|      0|			}
 1039|      0|			free(fflags_text);
 1040|      0|		}
 1041|      0|	}
 1042|       |
 1043|       |	/* If there's no body, force read_data() to return EOF immediately. */
 1044|  1.03k|	if (zip->entry_bytes_remaining < 1)
  ------------------
  |  Branch (1044:6): [True: 1.02k, False: 9]
  ------------------
 1045|  1.02k|		zip->end_of_entry = 1;
 1046|       |
 1047|  1.03k|	if ((zip_entry->mode & AE_IFMT) == AE_IFLNK) {
  ------------------
  |  |  215|  1.03k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              	if ((zip_entry->mode & AE_IFMT) == AE_IFLNK) {
  ------------------
  |  |  217|  1.03k|#define AE_IFLNK	((__LA_MODE_T)0120000)
  ------------------
  |  Branch (1047:6): [True: 0, False: 1.03k]
  ------------------
 1048|      0|		unsigned char *symname = NULL;
 1049|      0|		size_t symsize = 0;
 1050|       |
 1051|      0|		if (zip->entry_bytes_remaining > 1024 * 1024) {
  ------------------
  |  Branch (1051:7): [True: 0, False: 0]
  ------------------
 1052|      0|			archive_set_error(&a->archive, ENOMEM,
 1053|      0|			    "Rejecting malformed 7zip archive: "
 1054|      0|			    "symlink contents exceed 1 megabyte");
 1055|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1056|      0|		}
 1057|       |
 1058|       |		/*
 1059|       |		 * Symbolic-name is recorded as its contents. We have to
 1060|       |		 * read the contents at this time.
 1061|       |		 */
 1062|      0|		while (zip->entry_bytes_remaining > 0) {
  ------------------
  |  Branch (1062:10): [True: 0, False: 0]
  ------------------
 1063|      0|			const void *buff;
 1064|      0|			unsigned char *mem;
 1065|      0|			size_t size;
 1066|      0|			int64_t offset;
 1067|       |
 1068|      0|			r = archive_read_format_7zip_read_data(a, &buff,
 1069|      0|				&size, &offset);
 1070|      0|			if (r < ARCHIVE_WARN) {
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (1070:8): [True: 0, False: 0]
  ------------------
 1071|      0|				free(symname);
 1072|      0|				return (r);
 1073|      0|			}
 1074|      0|			mem = realloc(symname, symsize + size + 1);
 1075|      0|			if (mem == NULL) {
  ------------------
  |  Branch (1075:8): [True: 0, False: 0]
  ------------------
 1076|      0|				free(symname);
 1077|      0|				archive_set_error(&a->archive, ENOMEM,
 1078|      0|				    "Can't allocate memory for Symname");
 1079|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1080|      0|			}
 1081|      0|			symname = mem;
 1082|      0|			memcpy(symname+symsize, buff, size);
 1083|      0|			symsize += size;
 1084|      0|		}
 1085|      0|		if (symsize == 0) {
  ------------------
  |  Branch (1085:7): [True: 0, False: 0]
  ------------------
 1086|       |			/* If there is no symname, handle it as a regular
 1087|       |			 * file. */
 1088|      0|			zip_entry->mode &= ~AE_IFMT;
  ------------------
  |  |  215|      0|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
 1089|      0|			zip_entry->mode |= AE_IFREG;
  ------------------
  |  |  216|      0|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1090|      0|			archive_entry_set_mode(entry, zip_entry->mode);
 1091|      0|		} else {
 1092|      0|			struct archive_string_conv* utf8_conv;
 1093|       |
 1094|      0|			symname[symsize] = '\0';
 1095|       |
 1096|       |			/* Symbolic links are embedded as UTF-8 strings */
 1097|      0|			utf8_conv = archive_string_conversion_from_charset(&a->archive,
 1098|      0|			    "UTF-8", 1);
 1099|      0|			if (utf8_conv == NULL) {
  ------------------
  |  Branch (1099:8): [True: 0, False: 0]
  ------------------
 1100|      0|				free(symname);
 1101|      0|				return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1102|      0|			}
 1103|       |
 1104|      0|			archive_entry_copy_symlink_l(entry, (const char*)symname, symsize,
  ------------------
  |  |   83|      0|#define archive_entry_copy_symlink_l	_archive_entry_copy_symlink_l
  ------------------
 1105|      0|			    utf8_conv);
 1106|      0|		}
 1107|      0|		free(symname);
 1108|      0|		archive_entry_set_size(entry, 0);
 1109|      0|	}
 1110|       |
 1111|       |	/* Set up a more descriptive format name. */
 1112|  1.03k|	snprintf(zip->format_name, sizeof(zip->format_name), "7-Zip");
 1113|  1.03k|	a->archive.archive_format_name = zip->format_name;
 1114|       |
 1115|  1.03k|	return (ret);
 1116|  1.03k|}
archive_read_support_format_7zip.c:slurp_central_directory:
 3263|    107|{
 3264|    107|	const unsigned char *p;
 3265|    107|	uint64_t next_header_offset;
 3266|    107|	uint64_t next_header_size;
 3267|    107|	uint32_t next_header_crc;
 3268|    107|	ssize_t bytes_avail;
 3269|    107|	int64_t data_offset;
 3270|    107|	int check_header_crc, r;
 3271|       |
 3272|    107|	if (get_data_offset(a, &data_offset) < 0)
  ------------------
  |  Branch (3272:6): [True: 0, False: 107]
  ------------------
 3273|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3274|    107|	if (__archive_read_consume(a, data_offset) < 0) {
  ------------------
  |  Branch (3274:6): [True: 0, False: 107]
  ------------------
 3275|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Seek error");
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3276|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3277|      0|	}
 3278|    107|	if ((p = __archive_read_ahead(a, 32, &bytes_avail)) == NULL) {
  ------------------
  |  Branch (3278:6): [True: 0, False: 107]
  ------------------
 3279|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3280|      0|		    "Truncated 7-Zip file header");
 3281|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3282|      0|	}
 3283|       |
 3284|    107|	zip->seek_base = (uint64_t)data_offset + 32;
 3285|       |
 3286|    107|	if (memcmp(p, _7ZIP_SIGNATURE, 6) != 0) {
  ------------------
  |  |   66|    107|#define _7ZIP_SIGNATURE	"7z\xBC\xAF\x27\x1C"
  ------------------
  |  Branch (3286:6): [True: 0, False: 107]
  ------------------
 3287|      0|		archive_set_error(&a->archive, -1, "Not 7-Zip archive file");
 3288|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3289|      0|	}
 3290|       |
 3291|       |	/* CRC check. */
 3292|    107|	if (crc32(0, p + 12, 20)
  ------------------
  |  Branch (3292:6): [True: 103, False: 4]
  ------------------
 3293|    107|	    != archive_le32dec(p + 8)) {
 3294|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 3295|       |		archive_set_error(&a->archive, -1, "Header CRC error");
 3296|       |		return (ARCHIVE_FATAL);
 3297|       |#endif
 3298|    103|	}
 3299|       |
 3300|    107|	next_header_offset = archive_le64dec(p + 12);
 3301|    107|	next_header_size = archive_le64dec(p + 20);
 3302|    107|	next_header_crc = archive_le32dec(p + 28);
 3303|       |
 3304|    107|	if (next_header_size == 0)
  ------------------
  |  Branch (3304:6): [True: 0, False: 107]
  ------------------
 3305|       |		/* There is no entry in an archive file. */
 3306|      0|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3307|       |
 3308|    107|	if (((int64_t)next_header_offset) < 0) {
  ------------------
  |  Branch (3308:6): [True: 0, False: 107]
  ------------------
 3309|      0|		archive_set_error(&a->archive, -1, "Malformed 7-Zip archive");
 3310|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3311|      0|	}
 3312|    107|	__archive_read_consume(a, 32);
 3313|    107|	if (next_header_offset != 0) {
  ------------------
  |  Branch (3313:6): [True: 105, False: 2]
  ------------------
 3314|    105|		if (bytes_avail >= (ssize_t)next_header_offset)
  ------------------
  |  Branch (3314:7): [True: 103, False: 2]
  ------------------
 3315|    103|			__archive_read_consume(a, next_header_offset);
 3316|      2|		else if (__archive_read_seek(a,
  ------------------
  |  Branch (3316:12): [True: 2, False: 0]
  ------------------
 3317|      2|		    next_header_offset + zip->seek_base, SEEK_SET) < 0) {
 3318|      2|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Seek error");
  ------------------
  |  |  204|      2|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3319|      2|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3320|      2|		}
 3321|    105|	}
 3322|    105|	zip->stream_offset = next_header_offset;
 3323|    105|	zip->header_offset = next_header_offset;
 3324|    105|	zip->header_bytes_remaining = next_header_size;
 3325|    105|	zip->header_crc32 = 0;
 3326|    105|	zip->header_is_encoded = 0;
 3327|    105|	zip->header_is_being_read = 1;
 3328|    105|	zip->has_encrypted_entries = 0;
 3329|    105|	check_header_crc = 1;
 3330|       |
 3331|    105|	if ((p = header_bytes(a, 1)) == NULL) {
  ------------------
  |  Branch (3331:6): [True: 0, False: 105]
  ------------------
 3332|      0|		archive_set_error(&a->archive,
 3333|      0|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3334|      0|		    "Truncated 7-Zip file body");
 3335|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3336|      0|	}
 3337|       |	/* Parse ArchiveProperties. */
 3338|    105|	switch (p[0]) {
 3339|     65|	case kEncodedHeader:
  ------------------
  |  |  143|     65|#define kEncodedHeader		0x17
  ------------------
  |  Branch (3339:2): [True: 65, False: 40]
  ------------------
 3340|       |		/*
 3341|       |		 * The archive has an encoded header and we have to decode it
 3342|       |		 * in order to parse the header correctly.
 3343|       |		 */
 3344|     65|		r = decode_encoded_header_info(a, &(zip->si));
 3345|       |
 3346|       |		/* Check the EncodedHeader CRC.*/
 3347|     65|		if (r == 0 && zip->header_crc32 != next_header_crc) {
  ------------------
  |  Branch (3347:7): [True: 64, False: 1]
  |  Branch (3347:17): [True: 64, False: 0]
  ------------------
 3348|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 3349|       |			archive_set_error(&a->archive, -1,
 3350|       |			    "Damaged 7-Zip archive");
 3351|       |			r = -1;
 3352|       |#endif
 3353|     64|		}
 3354|     65|		if (r == 0) {
  ------------------
  |  Branch (3354:7): [True: 64, False: 1]
  ------------------
 3355|     64|			if (zip->si.ci.folders[0].digest_defined)
  ------------------
  |  Branch (3355:8): [True: 17, False: 47]
  ------------------
 3356|     17|				next_header_crc = zip->si.ci.folders[0].digest;
 3357|     47|			else
 3358|     47|				check_header_crc = 0;
 3359|     64|			if (zip->pack_stream_bytes_unconsumed)
  ------------------
  |  Branch (3359:8): [True: 64, False: 0]
  ------------------
 3360|     64|				read_consume(a);
 3361|     64|			r = setup_decode_folder(a, zip->si.ci.folders, 1);
 3362|     64|			if (r == 0) {
  ------------------
  |  Branch (3362:8): [True: 64, False: 0]
  ------------------
 3363|     64|				zip->header_bytes_remaining =
 3364|     64|					zip->folder_outbytes_remaining;
 3365|     64|				r = seek_pack(a);
 3366|     64|			}
 3367|     64|		}
 3368|       |		/* Clean up StreamsInfo. */
 3369|     65|		free_StreamsInfo(&(zip->si));
 3370|     65|		memset(&(zip->si), 0, sizeof(zip->si));
 3371|     65|		if (r < 0)
  ------------------
  |  Branch (3371:7): [True: 1, False: 64]
  ------------------
 3372|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3373|     64|		zip->header_is_encoded = 1;
 3374|     64|		zip->header_crc32 = 0;
 3375|       |		/* FALL THROUGH */
 3376|    100|	case kHeader:
  ------------------
  |  |  122|    100|#define kHeader			0x01
  ------------------
  |  Branch (3376:2): [True: 36, False: 69]
  ------------------
 3377|       |		/*
 3378|       |		 * Parse the header.
 3379|       |		 */
 3380|    100|		errno = 0;
 3381|    100|		r = read_Header(a, header, zip->header_is_encoded);
 3382|    100|		if (r < 0) {
  ------------------
  |  Branch (3382:7): [True: 81, False: 19]
  ------------------
 3383|     81|			if (errno == ENOMEM)
  ------------------
  |  Branch (3383:8): [True: 0, False: 81]
  ------------------
 3384|      0|				archive_set_error(&a->archive, -1,
 3385|      0|				    "Couldn't allocate memory");
 3386|     81|			else
 3387|     81|				archive_set_error(&a->archive, -1,
 3388|     81|				    "Damaged 7-Zip archive");
 3389|     81|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     81|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3390|     81|		}
 3391|       |
 3392|       |		/*
 3393|       |		 *  Must be kEnd.
 3394|       |		 */
 3395|     19|		if ((p = header_bytes(a, 1)) == NULL ||*p != kEnd) {
  ------------------
  |  |  121|     19|#define kEnd			0x00
  ------------------
  |  Branch (3395:7): [True: 0, False: 19]
  |  Branch (3395:42): [True: 0, False: 19]
  ------------------
 3396|      0|			archive_set_error(&a->archive, -1,
 3397|      0|			    "Malformed 7-Zip archive");
 3398|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3399|      0|		}
 3400|       |
 3401|       |		/* Check the Header CRC.*/
 3402|     19|		if (check_header_crc && zip->header_crc32 != next_header_crc) {
  ------------------
  |  Branch (3402:7): [True: 19, False: 0]
  |  Branch (3402:27): [True: 19, False: 0]
  ------------------
 3403|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 3404|       |			archive_set_error(&a->archive, -1,
 3405|       |			    "Malformed 7-Zip archive");
 3406|       |			return (ARCHIVE_FATAL);
 3407|       |#endif
 3408|     19|		}
 3409|     19|		break;
 3410|      4|	default:
  ------------------
  |  Branch (3410:2): [True: 4, False: 101]
  ------------------
 3411|      4|		archive_set_error(&a->archive, -1,
 3412|      4|		    "Unexpected Property ID = %X", p[0]);
 3413|      4|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3414|    105|	}
 3415|       |
 3416|       |	/* Clean up variables be used for decoding the archive header */
 3417|     19|	zip->pack_stream_remaining = 0;
 3418|     19|	zip->pack_stream_index = 0;
 3419|     19|	zip->folder_outbytes_remaining = 0;
 3420|     19|	zip->uncompressed_buffer_bytes_remaining = 0;
 3421|     19|	zip->pack_stream_bytes_unconsumed = 0;
 3422|     19|	zip->header_is_being_read = 0;
 3423|       |
 3424|     19|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     19|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3425|    105|}
archive_read_support_format_7zip.c:header_bytes:
 3229|  66.8k|{
 3230|  66.8k|	struct _7zip *zip = (struct _7zip *)a->format->data;
 3231|  66.8k|	const unsigned char *p;
 3232|       |
 3233|  66.8k|	if (zip->header_bytes_remaining < rbytes)
  ------------------
  |  Branch (3233:6): [True: 0, False: 66.8k]
  ------------------
 3234|      0|		return (NULL);
 3235|  66.8k|	if (zip->pack_stream_bytes_unconsumed)
  ------------------
  |  Branch (3235:6): [True: 66.5k, False: 243]
  ------------------
 3236|  66.5k|		read_consume(a);
 3237|       |
 3238|  66.8k|	if (zip->header_is_encoded == 0) {
  ------------------
  |  Branch (3238:6): [True: 66.7k, False: 64]
  ------------------
 3239|  66.7k|		p = __archive_read_ahead(a, rbytes, NULL);
 3240|  66.7k|		if (p == NULL)
  ------------------
  |  Branch (3240:7): [True: 7, False: 66.7k]
  ------------------
 3241|      7|			return (NULL);
 3242|  66.7k|		zip->header_bytes_remaining -= rbytes;
 3243|  66.7k|		zip->pack_stream_bytes_unconsumed = rbytes;
 3244|  66.7k|	} else {
 3245|     64|		const void *buff;
 3246|     64|		ssize_t bytes;
 3247|       |
 3248|     64|		bytes = read_stream(a, &buff, rbytes, rbytes);
 3249|     64|		if (bytes <= 0)
  ------------------
  |  Branch (3249:7): [True: 64, False: 0]
  ------------------
 3250|     64|			return (NULL);
 3251|      0|		zip->header_bytes_remaining -= bytes;
 3252|      0|		p = buff;
 3253|      0|	}
 3254|       |
 3255|       |	/* Update checksum */
 3256|  66.7k|	zip->header_crc32 = crc32(zip->header_crc32, p, (unsigned)rbytes);
 3257|  66.7k|	return (p);
 3258|  66.8k|}
archive_read_support_format_7zip.c:read_stream:
 3671|     73|{
 3672|     73|	struct _7zip *zip = (struct _7zip *)a->format->data;
 3673|     73|	uint64_t skip_bytes = 0;
 3674|     73|	ssize_t r;
 3675|       |
 3676|     73|	if (zip->uncompressed_buffer_bytes_remaining == 0) {
  ------------------
  |  Branch (3676:6): [True: 73, False: 0]
  ------------------
 3677|     73|		if (zip->pack_stream_inbytes_remaining > 0) {
  ------------------
  |  Branch (3677:7): [True: 64, False: 9]
  ------------------
 3678|     64|			r = extract_pack_stream(a, 0);
 3679|     64|			if (r < 0)
  ------------------
  |  Branch (3679:8): [True: 64, False: 0]
  ------------------
 3680|     64|				return (r);
 3681|      0|			return (get_uncompressed_data(a, buff, size, minimum));
 3682|     64|		} else if (zip->folder_outbytes_remaining > 0) {
  ------------------
  |  Branch (3682:14): [True: 0, False: 9]
  ------------------
 3683|       |			/* Extract a remaining pack stream. */
 3684|      0|			r = extract_pack_stream(a, 0);
 3685|      0|			if (r < 0)
  ------------------
  |  Branch (3685:8): [True: 0, False: 0]
  ------------------
 3686|      0|				return (r);
 3687|      0|			return (get_uncompressed_data(a, buff, size, minimum));
 3688|      0|		}
 3689|     73|	} else
 3690|      0|		return (get_uncompressed_data(a, buff, size, minimum));
 3691|       |
 3692|       |	/*
 3693|       |	 * Current pack stream has been consumed.
 3694|       |	 */
 3695|      9|	if (zip->pack_stream_remaining == 0) {
  ------------------
  |  Branch (3695:6): [True: 9, False: 0]
  ------------------
 3696|      9|		if (zip->header_is_being_read) {
  ------------------
  |  Branch (3696:7): [True: 0, False: 9]
  ------------------
 3697|       |			/* Invalid sequence. This might happen when
 3698|       |			 * reading a malformed archive. */
 3699|      0|			archive_set_error(&(a->archive),
 3700|      0|			    ARCHIVE_ERRNO_MISC, "Malformed 7-Zip archive");
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3701|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3702|      0|		}
 3703|       |
 3704|       |		/*
 3705|       |		 * All current folder's pack streams have been
 3706|       |		 * consumed. Switch to next folder.
 3707|       |		 */
 3708|      9|		if (zip->folder_index == 0 &&
  ------------------
  |  Branch (3708:7): [True: 9, False: 0]
  ------------------
 3709|      9|		    (zip->si.ci.folders[zip->entry->folderIndex].skipped_bytes
  ------------------
  |  Branch (3709:8): [True: 0, False: 9]
  ------------------
 3710|      9|		     || zip->folder_index != zip->entry->folderIndex)) {
  ------------------
  |  Branch (3710:11): [True: 0, False: 9]
  ------------------
 3711|      0|			zip->folder_index = zip->entry->folderIndex;
 3712|      0|			skip_bytes =
 3713|      0|			    zip->si.ci.folders[zip->folder_index].skipped_bytes;
 3714|      0|		}
 3715|       |
 3716|      9|		if (zip->folder_index >= zip->si.ci.numFolders) {
  ------------------
  |  Branch (3716:7): [True: 0, False: 9]
  ------------------
 3717|       |			/*
 3718|       |			 * We have consumed all folders and its pack streams.
 3719|       |			 */
 3720|      0|			*buff = NULL;
 3721|      0|			return (0);
 3722|      0|		}
 3723|      9|		r = setup_decode_folder(a,
 3724|      9|			&(zip->si.ci.folders[zip->folder_index]), 0);
 3725|      9|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|      9|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3725:7): [True: 0, False: 9]
  ------------------
 3726|      0|			return (r);
 3727|       |
 3728|      9|		zip->folder_index++;
 3729|      9|	}
 3730|       |
 3731|       |	/*
 3732|       |	 * Switch to next pack stream.
 3733|       |	 */
 3734|      9|	r = seek_pack(a);
 3735|      9|	if (r < 0)
  ------------------
  |  Branch (3735:6): [True: 0, False: 9]
  ------------------
 3736|      0|		return (r);
 3737|       |
 3738|       |	/* Extract a new pack stream. */
 3739|      9|	r = extract_pack_stream(a, 0);
 3740|      9|	if (r < 0)
  ------------------
  |  Branch (3740:6): [True: 0, False: 9]
  ------------------
 3741|      0|		return (r);
 3742|       |
 3743|       |	/*
 3744|       |	 * Skip the bytes we already has skipped in skip_stream().
 3745|       |	 */
 3746|      9|	while (1) {
  ------------------
  |  Branch (3746:9): [True: 9, Folded]
  ------------------
 3747|      9|		ssize_t skipped;
 3748|       |
 3749|      9|		if (zip->uncompressed_buffer_bytes_remaining == 0) {
  ------------------
  |  Branch (3749:7): [True: 4, False: 5]
  ------------------
 3750|      4|			if (zip->pack_stream_inbytes_remaining > 0) {
  ------------------
  |  Branch (3750:8): [True: 0, False: 4]
  ------------------
 3751|      0|				r = extract_pack_stream(a, 0);
 3752|      0|				if (r < 0)
  ------------------
  |  Branch (3752:9): [True: 0, False: 0]
  ------------------
 3753|      0|					return (r);
 3754|      4|			} else if (zip->folder_outbytes_remaining > 0) {
  ------------------
  |  Branch (3754:15): [True: 4, False: 0]
  ------------------
 3755|       |				/* Extract a remaining pack stream. */
 3756|      4|				r = extract_pack_stream(a, 0);
 3757|      4|				if (r < 0)
  ------------------
  |  Branch (3757:9): [True: 0, False: 4]
  ------------------
 3758|      0|					return (r);
 3759|      4|			} else {
 3760|      0|				archive_set_error(&a->archive,
 3761|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3762|      0|				    "Truncated 7-Zip file body");
 3763|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3764|      0|			}
 3765|      4|		}
 3766|       |
 3767|      9|		if (!skip_bytes)
  ------------------
  |  Branch (3767:7): [True: 9, False: 0]
  ------------------
 3768|      9|			break;
 3769|       |
 3770|      0|		skipped = get_uncompressed_data(
 3771|      0|			a, buff, (size_t)skip_bytes, 0);
 3772|      0|		if (skipped < 0)
  ------------------
  |  Branch (3772:7): [True: 0, False: 0]
  ------------------
 3773|      0|			return (skipped);
 3774|      0|		skip_bytes -= skipped;
 3775|      0|		if (zip->pack_stream_bytes_unconsumed)
  ------------------
  |  Branch (3775:7): [True: 0, False: 0]
  ------------------
 3776|      0|			read_consume(a);
 3777|      0|	}
 3778|       |
 3779|      9|	return (get_uncompressed_data(a, buff, size, minimum));
 3780|      9|}
archive_read_support_format_7zip.c:extract_pack_stream:
 3482|     77|{
 3483|     77|	struct _7zip *zip = (struct _7zip *)a->format->data;
 3484|     77|	ssize_t bytes_avail;
 3485|     77|	int r;
 3486|       |
 3487|     77|	if (zip->codec == _7Z_COPY && zip->codec2 == (unsigned long)-1) {
  ------------------
  |  |   94|    154|#define _7Z_COPY	0
  ------------------
  |  Branch (3487:6): [True: 13, False: 64]
  |  Branch (3487:32): [True: 13, False: 0]
  ------------------
 3488|     13|		if (minimum == 0)
  ------------------
  |  Branch (3488:7): [True: 13, False: 0]
  ------------------
 3489|     13|			minimum = 1;
 3490|     13|		if (__archive_read_ahead(a, minimum, &bytes_avail) == NULL
  ------------------
  |  Branch (3490:7): [True: 0, False: 13]
  ------------------
 3491|     13|		    || bytes_avail <= 0) {
  ------------------
  |  Branch (3491:10): [True: 0, False: 13]
  ------------------
 3492|      0|			archive_set_error(&a->archive,
 3493|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3494|      0|			    "Truncated 7-Zip file body");
 3495|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3496|      0|		}
 3497|     13|		if ((uint64_t)bytes_avail > zip->pack_stream_inbytes_remaining)
  ------------------
  |  Branch (3497:7): [True: 13, False: 0]
  ------------------
 3498|     13|			bytes_avail = (ssize_t)zip->pack_stream_inbytes_remaining;
 3499|     13|		zip->pack_stream_inbytes_remaining -= bytes_avail;
 3500|     13|		if ((uint64_t)bytes_avail > zip->folder_outbytes_remaining)
  ------------------
  |  Branch (3500:7): [True: 5, False: 8]
  ------------------
 3501|      5|			bytes_avail = (ssize_t)zip->folder_outbytes_remaining;
 3502|     13|		zip->folder_outbytes_remaining -= bytes_avail;
 3503|     13|		zip->uncompressed_buffer_bytes_remaining = bytes_avail;
 3504|     13|		return (ARCHIVE_OK);
  ------------------
  |  |  233|     13|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3505|     13|	}
 3506|       |
 3507|       |	/* If the buffer hasn't been allocated, allocate it now. */
 3508|     64|	if (zip->uncompressed_buffer == NULL) {
  ------------------
  |  Branch (3508:6): [True: 64, False: 0]
  ------------------
 3509|     64|		zip->uncompressed_buffer_size = UBUFF_SIZE;
  ------------------
  |  |  296|     64|#define UBUFF_SIZE	(64 * 1024)
  ------------------
 3510|     64|		if (zip->uncompressed_buffer_size < minimum) {
  ------------------
  |  Branch (3510:7): [True: 0, False: 64]
  ------------------
 3511|      0|			zip->uncompressed_buffer_size = minimum + 1023;
 3512|      0|			zip->uncompressed_buffer_size &= ~0x3ff;
 3513|      0|		}
 3514|     64|		zip->uncompressed_buffer =
 3515|     64|		    malloc(zip->uncompressed_buffer_size);
 3516|     64|		if (zip->uncompressed_buffer == NULL) {
  ------------------
  |  Branch (3516:7): [True: 0, False: 64]
  ------------------
 3517|      0|			archive_set_error(&a->archive, ENOMEM,
 3518|      0|			    "No memory for 7-Zip decompression");
 3519|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3520|      0|		}
 3521|     64|		zip->uncompressed_buffer_bytes_remaining = 0;
 3522|     64|	} else if (zip->uncompressed_buffer_size < minimum ||
  ------------------
  |  Branch (3522:13): [True: 0, False: 0]
  ------------------
 3523|      0|	    zip->uncompressed_buffer_bytes_remaining < minimum) {
  ------------------
  |  Branch (3523:6): [True: 0, False: 0]
  ------------------
 3524|       |		/*
 3525|       |		 * Make sure the uncompressed buffer can have bytes
 3526|       |		 * at least `minimum' bytes.
 3527|       |		 * NOTE: This case happen when reading the header.
 3528|       |		 */
 3529|      0|		size_t used;
 3530|      0|		if (zip->uncompressed_buffer_pointer != 0)
  ------------------
  |  Branch (3530:7): [True: 0, False: 0]
  ------------------
 3531|      0|			used = zip->uncompressed_buffer_pointer -
 3532|      0|				zip->uncompressed_buffer;
 3533|      0|		else
 3534|      0|			used = 0;
 3535|      0|		if (zip->uncompressed_buffer_size < minimum) {
  ------------------
  |  Branch (3535:7): [True: 0, False: 0]
  ------------------
 3536|       |			/*
 3537|       |			 * Expand the uncompressed buffer up to
 3538|       |			 * the minimum size.
 3539|       |			 */
 3540|      0|			void *p;
 3541|      0|			size_t new_size;
 3542|       |
 3543|      0|			new_size = minimum + 1023;
 3544|      0|			new_size &= ~0x3ff;
 3545|      0|			p = realloc(zip->uncompressed_buffer, new_size);
 3546|      0|			if (p == NULL) {
  ------------------
  |  Branch (3546:8): [True: 0, False: 0]
  ------------------
 3547|      0|				archive_set_error(&a->archive, ENOMEM,
 3548|      0|				    "No memory for 7-Zip decompression");
 3549|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3550|      0|			}
 3551|      0|			zip->uncompressed_buffer = (unsigned char *)p;
 3552|      0|			zip->uncompressed_buffer_size = new_size;
 3553|      0|		}
 3554|       |		/*
 3555|       |		 * Move unconsumed bytes to the head.
 3556|       |		 */
 3557|      0|		if (used) {
  ------------------
  |  Branch (3557:7): [True: 0, False: 0]
  ------------------
 3558|      0|			memmove(zip->uncompressed_buffer,
 3559|      0|				zip->uncompressed_buffer + used,
 3560|      0|				zip->uncompressed_buffer_bytes_remaining);
 3561|      0|		}
 3562|      0|	} else
 3563|      0|		zip->uncompressed_buffer_bytes_remaining = 0;
 3564|     64|	zip->uncompressed_buffer_pointer = NULL;
 3565|    437|	for (;;) {
 3566|    437|		size_t bytes_in, bytes_out;
 3567|    437|		const void *buff_in;
 3568|    437|		unsigned char *buff_out;
 3569|    437|		int end_of_data;
 3570|       |
 3571|       |		/*
 3572|       |		 * Note: '1' here is a performance optimization.
 3573|       |		 * Recall that the decompression layer returns a count of
 3574|       |		 * available bytes; asking for more than that forces the
 3575|       |		 * decompressor to combine reads by copying data.
 3576|       |		 */
 3577|    437|		buff_in = __archive_read_ahead(a, 1, &bytes_avail);
 3578|    437|		if (bytes_avail <= 0) {
  ------------------
  |  Branch (3578:7): [True: 18, False: 419]
  ------------------
 3579|     18|			archive_set_error(&a->archive,
 3580|     18|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     18|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3581|     18|			    "Truncated 7-Zip file body");
 3582|     18|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     18|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3583|     18|		}
 3584|       |
 3585|    419|		buff_out = zip->uncompressed_buffer
 3586|    419|			+ zip->uncompressed_buffer_bytes_remaining;
 3587|    419|		bytes_out = zip->uncompressed_buffer_size
 3588|    419|			- zip->uncompressed_buffer_bytes_remaining;
 3589|    419|		bytes_in = bytes_avail;
 3590|    419|		if (bytes_in > zip->pack_stream_inbytes_remaining)
  ------------------
  |  Branch (3590:7): [True: 108, False: 311]
  ------------------
 3591|    108|			bytes_in = (size_t)zip->pack_stream_inbytes_remaining;
 3592|       |		/* Drive decompression. */
 3593|    419|		r = decompress(a, zip, buff_out, &bytes_out,
 3594|    419|			buff_in, &bytes_in);
 3595|    419|		switch (r) {
 3596|    373|		case ARCHIVE_OK:
  ------------------
  |  |  233|    373|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3596:3): [True: 373, False: 46]
  ------------------
 3597|    373|			end_of_data = 0;
 3598|    373|			break;
 3599|      0|		case ARCHIVE_EOF:
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (3599:3): [True: 0, False: 419]
  ------------------
 3600|      0|			end_of_data = 1;
 3601|      0|			break;
 3602|     46|		default:
  ------------------
  |  Branch (3602:3): [True: 46, False: 373]
  ------------------
 3603|     46|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     46|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3604|    419|		}
 3605|    373|		zip->pack_stream_inbytes_remaining -= bytes_in;
 3606|    373|		if (bytes_out > zip->folder_outbytes_remaining)
  ------------------
  |  Branch (3606:7): [True: 329, False: 44]
  ------------------
 3607|    329|			bytes_out = (size_t)zip->folder_outbytes_remaining;
 3608|    373|		zip->folder_outbytes_remaining -= bytes_out;
 3609|    373|		zip->uncompressed_buffer_bytes_remaining += bytes_out;
 3610|    373|		zip->pack_stream_bytes_unconsumed = bytes_in;
 3611|       |
 3612|       |		/*
 3613|       |		 * Continue decompression until uncompressed_buffer is full.
 3614|       |		 */
 3615|    373|		if (zip->uncompressed_buffer_bytes_remaining ==
  ------------------
  |  Branch (3615:7): [True: 0, False: 373]
  ------------------
 3616|    373|		    zip->uncompressed_buffer_size)
 3617|      0|			break;
 3618|    373|		if (zip->codec2 == _7Z_X86 && zip->odd_bcj_size &&
  ------------------
  |  |  106|    746|#define _7Z_X86		0x03030103
  ------------------
  |  Branch (3618:7): [True: 0, False: 373]
  |  Branch (3618:33): [True: 0, False: 0]
  ------------------
 3619|      0|		    zip->uncompressed_buffer_bytes_remaining + 5 >
  ------------------
  |  Branch (3619:7): [True: 0, False: 0]
  ------------------
 3620|      0|		    zip->uncompressed_buffer_size)
 3621|      0|			break;
 3622|    373|		if (zip->pack_stream_inbytes_remaining == 0 &&
  ------------------
  |  Branch (3622:7): [True: 44, False: 329]
  ------------------
 3623|     44|		    zip->folder_outbytes_remaining == 0)
  ------------------
  |  Branch (3623:7): [True: 0, False: 44]
  ------------------
 3624|      0|			break;
 3625|    373|		if (end_of_data || (bytes_in == 0 && bytes_out == 0)) {
  ------------------
  |  Branch (3625:7): [True: 0, False: 373]
  |  Branch (3625:23): [True: 0, False: 373]
  |  Branch (3625:40): [True: 0, False: 0]
  ------------------
 3626|      0|			archive_set_error(&(a->archive),
 3627|      0|			    ARCHIVE_ERRNO_MISC, "Damaged 7-Zip archive");
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3628|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3629|      0|		}
 3630|    373|		read_consume(a);
 3631|    373|	}
 3632|      0|	if (zip->uncompressed_buffer_bytes_remaining < minimum) {
  ------------------
  |  Branch (3632:6): [True: 0, False: 0]
  ------------------
 3633|      0|		archive_set_error(&(a->archive),
 3634|      0|		    ARCHIVE_ERRNO_MISC, "Damaged 7-Zip archive");
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3635|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3636|      0|	}
 3637|      0|	zip->uncompressed_buffer_pointer = zip->uncompressed_buffer;
 3638|      0|	return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3639|      0|}
archive_read_support_format_7zip.c:decompress:
 1697|    419|{
 1698|    419|	const uint8_t *t_next_in;
 1699|    419|	uint8_t *t_next_out;
 1700|    419|	size_t o_avail_in, o_avail_out;
 1701|    419|	size_t t_avail_in, t_avail_out;
 1702|    419|	uint8_t *bcj2_next_out;
 1703|    419|	size_t bcj2_avail_out;
 1704|    419|	int r, ret = ARCHIVE_OK;
  ------------------
  |  |  233|    419|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1705|       |
 1706|    419|	t_avail_in = o_avail_in = *used;
 1707|    419|	t_avail_out = o_avail_out = *outbytes;
 1708|    419|	t_next_in = b;
 1709|    419|	t_next_out = buff;
 1710|       |
 1711|    419|	if (zip->codec != _7Z_LZMA2 && zip->codec2 == _7Z_X86) {
  ------------------
  |  |   96|    838|#define _7Z_LZMA2	0x21
  ------------------
              	if (zip->codec != _7Z_LZMA2 && zip->codec2 == _7Z_X86) {
  ------------------
  |  |  106|    419|#define _7Z_X86		0x03030103
  ------------------
  |  Branch (1711:6): [True: 419, False: 0]
  |  Branch (1711:33): [True: 0, False: 419]
  ------------------
 1712|      0|		int i;
 1713|       |
 1714|       |		/* Do not copy out the BCJ remaining bytes when the output
 1715|       |		 * buffer size is less than five bytes. */
 1716|      0|		if (o_avail_in != 0 && t_avail_out < 5 && zip->odd_bcj_size) {
  ------------------
  |  Branch (1716:7): [True: 0, False: 0]
  |  Branch (1716:26): [True: 0, False: 0]
  |  Branch (1716:45): [True: 0, False: 0]
  ------------------
 1717|      0|			*used = 0;
 1718|      0|			*outbytes = 0;
 1719|      0|			return (ret);
 1720|      0|		}
 1721|      0|		for (i = 0; zip->odd_bcj_size > 0 && t_avail_out; i++) {
  ------------------
  |  Branch (1721:15): [True: 0, False: 0]
  |  Branch (1721:40): [True: 0, False: 0]
  ------------------
 1722|      0|			*t_next_out++ = zip->odd_bcj[i];
 1723|      0|			t_avail_out--;
 1724|      0|			zip->odd_bcj_size--;
 1725|      0|		}
 1726|      0|		if (o_avail_in == 0 || t_avail_out == 0) {
  ------------------
  |  Branch (1726:7): [True: 0, False: 0]
  |  Branch (1726:26): [True: 0, False: 0]
  ------------------
 1727|      0|			*used = o_avail_in - t_avail_in;
 1728|      0|			*outbytes = o_avail_out - t_avail_out;
 1729|      0|			if (o_avail_in == 0)
  ------------------
  |  Branch (1729:8): [True: 0, False: 0]
  ------------------
 1730|      0|				ret = ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1731|      0|			return (ret);
 1732|      0|		}
 1733|      0|	}
 1734|       |
 1735|    419|	bcj2_next_out = t_next_out;
 1736|    419|	bcj2_avail_out = t_avail_out;
 1737|    419|	if (zip->codec2 == _7Z_X86_BCJ2) {
  ------------------
  |  |  107|    419|#define _7Z_X86_BCJ2	0x0303011B
  ------------------
  |  Branch (1737:6): [True: 0, False: 419]
  ------------------
 1738|       |		/*
 1739|       |		 * Decord a remaining decompressed main stream for BCJ2.
 1740|       |		 */
 1741|      0|		if (zip->tmp_stream_bytes_remaining) {
  ------------------
  |  Branch (1741:7): [True: 0, False: 0]
  ------------------
 1742|      0|			ssize_t bytes;
 1743|      0|			size_t remaining = zip->tmp_stream_bytes_remaining;
 1744|      0|			bytes = Bcj2_Decode(zip, t_next_out, t_avail_out);
 1745|      0|			if (bytes < 0) {
  ------------------
  |  Branch (1745:8): [True: 0, False: 0]
  ------------------
 1746|      0|				archive_set_error(&(a->archive),
 1747|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1748|      0|				    "BCJ2 conversion failed");
 1749|      0|				return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1750|      0|			}
 1751|      0|			zip->main_stream_bytes_remaining -=
 1752|      0|			    remaining - zip->tmp_stream_bytes_remaining;
 1753|      0|			t_avail_out -= bytes;
 1754|      0|			if (o_avail_in == 0 || t_avail_out == 0) {
  ------------------
  |  Branch (1754:8): [True: 0, False: 0]
  |  Branch (1754:27): [True: 0, False: 0]
  ------------------
 1755|      0|				*used = 0;
 1756|      0|				*outbytes = o_avail_out - t_avail_out;
 1757|      0|				if (o_avail_in == 0 &&
  ------------------
  |  Branch (1757:9): [True: 0, False: 0]
  ------------------
 1758|      0|				    zip->tmp_stream_bytes_remaining)
  ------------------
  |  Branch (1758:9): [True: 0, False: 0]
  ------------------
 1759|      0|					ret = ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1760|      0|				return (ret);
 1761|      0|			}
 1762|      0|			t_next_out += bytes;
 1763|      0|			bcj2_next_out = t_next_out;
 1764|      0|			bcj2_avail_out = t_avail_out;
 1765|      0|		}
 1766|      0|		t_next_out = zip->tmp_stream_buff;
 1767|      0|		t_avail_out = zip->tmp_stream_buff_size;
 1768|      0|	}
 1769|       |
 1770|    419|	switch (zip->codec) {
 1771|      0|	case _7Z_COPY:
  ------------------
  |  |   94|      0|#define _7Z_COPY	0
  ------------------
  |  Branch (1771:2): [True: 0, False: 419]
  ------------------
 1772|      0|	{
 1773|      0|		size_t bytes =
 1774|      0|		    (t_avail_in > t_avail_out)?t_avail_out:t_avail_in;
  ------------------
  |  Branch (1774:7): [True: 0, False: 0]
  ------------------
 1775|       |
 1776|      0|		memcpy(t_next_out, t_next_in, bytes);
 1777|      0|		t_avail_in -= bytes;
 1778|      0|		t_avail_out -= bytes;
 1779|      0|		if (o_avail_in == 0)
  ------------------
  |  Branch (1779:7): [True: 0, False: 0]
  ------------------
 1780|      0|			ret = ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1781|      0|		break;
 1782|      0|	}
 1783|      0|#ifdef HAVE_LZMA_H
 1784|      0|	case _7Z_LZMA: case _7Z_LZMA2:
  ------------------
  |  |   95|      0|#define _7Z_LZMA	0x030101
  ------------------
              	case _7Z_LZMA: case _7Z_LZMA2:
  ------------------
  |  |   96|      0|#define _7Z_LZMA2	0x21
  ------------------
  |  Branch (1784:2): [True: 0, False: 419]
  |  Branch (1784:17): [True: 0, False: 419]
  ------------------
 1785|      0|		zip->lzstream.next_in = t_next_in;
 1786|      0|		zip->lzstream.avail_in = t_avail_in;
 1787|      0|		zip->lzstream.next_out = t_next_out;
 1788|      0|		zip->lzstream.avail_out = t_avail_out;
 1789|       |
 1790|      0|		r = lzma_code(&(zip->lzstream), LZMA_RUN);
 1791|      0|		switch (r) {
 1792|      0|		case LZMA_STREAM_END: /* Found end of stream. */
  ------------------
  |  Branch (1792:3): [True: 0, False: 0]
  ------------------
 1793|      0|			lzma_end(&(zip->lzstream));
 1794|      0|			zip->lzstream_valid = 0;
 1795|      0|			ret = ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1796|      0|			break;
 1797|      0|		case LZMA_OK: /* Decompressor made some progress. */
  ------------------
  |  Branch (1797:3): [True: 0, False: 0]
  ------------------
 1798|      0|			break;
 1799|      0|		default:
  ------------------
  |  Branch (1799:3): [True: 0, False: 0]
  ------------------
 1800|      0|			archive_set_error(&(a->archive),
 1801|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1802|      0|				"Decompression failed (%d)",
 1803|      0|			    r);
 1804|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1805|      0|		}
 1806|      0|		t_avail_in = zip->lzstream.avail_in;
 1807|      0|		t_avail_out = zip->lzstream.avail_out;
 1808|      0|		break;
 1809|      0|#endif
 1810|      0|#if defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR)
 1811|      0|	case _7Z_BZ2:
  ------------------
  |  |   98|      0|#define _7Z_BZ2		0x040202
  ------------------
  |  Branch (1811:2): [True: 0, False: 419]
  ------------------
 1812|      0|		zip->bzstream.next_in = (char *)(uintptr_t)t_next_in;
 1813|      0|		zip->bzstream.avail_in = (uint32_t)t_avail_in;
 1814|      0|		zip->bzstream.next_out = (char *)(uintptr_t)t_next_out;
 1815|      0|		zip->bzstream.avail_out = (uint32_t)t_avail_out;
 1816|      0|		r = BZ2_bzDecompress(&(zip->bzstream));
 1817|      0|		switch (r) {
 1818|      0|		case BZ_STREAM_END: /* Found end of stream. */
  ------------------
  |  Branch (1818:3): [True: 0, False: 0]
  ------------------
 1819|      0|			switch (BZ2_bzDecompressEnd(&(zip->bzstream))) {
 1820|      0|			case BZ_OK:
  ------------------
  |  Branch (1820:4): [True: 0, False: 0]
  ------------------
 1821|      0|				break;
 1822|      0|			default:
  ------------------
  |  Branch (1822:4): [True: 0, False: 0]
  ------------------
 1823|      0|				archive_set_error(&(a->archive),
 1824|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1825|      0|				    "Failed to clean up decompressor");
 1826|      0|				return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1827|      0|			}
 1828|      0|			zip->bzstream_valid = 0;
 1829|      0|			ret = ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1830|      0|			break;
 1831|      0|		case BZ_OK: /* Decompressor made some progress. */
  ------------------
  |  Branch (1831:3): [True: 0, False: 0]
  ------------------
 1832|      0|			break;
 1833|      0|		default:
  ------------------
  |  Branch (1833:3): [True: 0, False: 0]
  ------------------
 1834|      0|			archive_set_error(&(a->archive),
 1835|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1836|      0|			    "bzip decompression failed");
 1837|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1838|      0|		}
 1839|      0|		t_avail_in = zip->bzstream.avail_in;
 1840|      0|		t_avail_out = zip->bzstream.avail_out;
 1841|      0|		break;
 1842|      0|#endif
 1843|      0|#ifdef HAVE_ZLIB_H
 1844|      0|	case _7Z_DEFLATE:
  ------------------
  |  |   97|      0|#define _7Z_DEFLATE	0x040108
  ------------------
  |  Branch (1844:2): [True: 0, False: 419]
  ------------------
 1845|      0|		zip->stream.next_in = (Bytef *)(uintptr_t)t_next_in;
 1846|      0|		zip->stream.avail_in = (uInt)t_avail_in;
 1847|      0|		zip->stream.next_out = t_next_out;
 1848|      0|		zip->stream.avail_out = (uInt)t_avail_out;
 1849|      0|		r = inflate(&(zip->stream), 0);
 1850|      0|		switch (r) {
 1851|      0|		case Z_STREAM_END: /* Found end of stream. */
  ------------------
  |  Branch (1851:3): [True: 0, False: 0]
  ------------------
 1852|      0|			ret = ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1853|      0|			break;
 1854|      0|		case Z_OK: /* Decompressor made some progress.*/
  ------------------
  |  Branch (1854:3): [True: 0, False: 0]
  ------------------
 1855|      0|			break;
 1856|      0|		default:
  ------------------
  |  Branch (1856:3): [True: 0, False: 0]
  ------------------
 1857|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1858|      0|			    "File decompression failed (%d)", r);
 1859|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1860|      0|		}
 1861|      0|		t_avail_in = zip->stream.avail_in;
 1862|      0|		t_avail_out = zip->stream.avail_out;
 1863|      0|		break;
 1864|      0|#endif
 1865|       |#ifdef HAVE_ZSTD_H
 1866|       |	case _7Z_ZSTD:
 1867|       |	{
 1868|       |		ZSTD_inBuffer input = { t_next_in, t_avail_in, 0 }; // src, size, pos
 1869|       |		ZSTD_outBuffer output = { t_next_out, t_avail_out, 0 }; // dst, size, pos
 1870|       |
 1871|       |		size_t const zret = ZSTD_decompressStream(zip->zstd_dstream, &output, &input);
 1872|       |		if (ZSTD_isError(zret)) {
 1873|       |			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Zstd decompression failed: %s", ZSTD_getErrorName(zret));
 1874|       |			return ARCHIVE_FAILED;
 1875|       |		}
 1876|       |		t_avail_in -= input.pos;
 1877|       |		t_avail_out -= output.pos;
 1878|       |		break;
 1879|       |	}
 1880|       |#endif
 1881|    419|	case _7Z_PPMD:
  ------------------
  |  |   99|    419|#define _7Z_PPMD	0x030401
  ------------------
  |  Branch (1881:2): [True: 419, False: 0]
  ------------------
 1882|    419|	{
 1883|    419|		uint64_t flush_bytes;
 1884|       |
 1885|    419|		if (!zip->ppmd7_valid || zip->ppmd7_stat < 0 ||
  ------------------
  |  Branch (1885:7): [True: 0, False: 419]
  |  Branch (1885:28): [True: 0, False: 419]
  ------------------
 1886|    419|		    t_avail_out <= 0) {
  ------------------
  |  Branch (1886:7): [True: 0, False: 419]
  ------------------
 1887|      0|			archive_set_error(&(a->archive),
 1888|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1889|      0|			    "Decompression internal error");
 1890|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1891|      0|		}
 1892|    419|		zip->ppstream.next_in = t_next_in;
 1893|    419|		zip->ppstream.avail_in = t_avail_in;
 1894|    419|		zip->ppstream.stream_in = 0;
 1895|    419|		zip->ppstream.next_out = t_next_out;
 1896|    419|		zip->ppstream.avail_out = t_avail_out;
 1897|    419|		if (zip->ppmd7_stat == 0) {
  ------------------
  |  Branch (1897:7): [True: 64, False: 355]
  ------------------
 1898|     64|			zip->bytein.a = a;
 1899|     64|			zip->bytein.Read = &ppmd_read;
 1900|     64|			zip->range_dec.Stream = &zip->bytein;
 1901|     64|			r = __archive_ppmd7_functions.Ppmd7z_RangeDec_Init(
 1902|     64|				&(zip->range_dec));
 1903|     64|			if (r == 0) {
  ------------------
  |  Branch (1903:8): [True: 0, False: 64]
  ------------------
 1904|      0|				zip->ppmd7_stat = -1;
 1905|      0|				archive_set_error(&a->archive,
 1906|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1907|      0|				    "Failed to initialize PPMd range decoder");
 1908|      0|				return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1909|      0|			}
 1910|     64|			if (zip->ppstream.overconsumed) {
  ------------------
  |  Branch (1910:8): [True: 0, False: 64]
  ------------------
 1911|      0|				zip->ppmd7_stat = -1;
 1912|      0|				return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1913|      0|			}
 1914|     64|			zip->ppmd7_stat = 1;
 1915|     64|		}
 1916|       |
 1917|    419|		if (t_avail_in == 0)
  ------------------
  |  Branch (1917:7): [True: 44, False: 375]
  ------------------
 1918|       |			/* XXX Flush out remaining decoded data XXX */
 1919|     44|			flush_bytes = zip->folder_outbytes_remaining;
 1920|    375|		else
 1921|    375|			flush_bytes = 0;
 1922|       |
 1923|  22.2M|		do {
 1924|  22.2M|			int sym;
 1925|       |
 1926|  22.2M|			sym = __archive_ppmd7_functions.Ppmd7_DecodeSymbol(
 1927|  22.2M|				&(zip->ppmd7_context), &(zip->range_dec.p));
 1928|  22.2M|			if (sym < 0) {
  ------------------
  |  Branch (1928:8): [True: 13, False: 22.2M]
  ------------------
 1929|     13|				zip->ppmd7_stat = -1;
 1930|     13|				archive_set_error(&a->archive,
 1931|     13|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     13|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1932|     13|				    "Failed to decode PPMd");
 1933|     13|				return (ARCHIVE_FAILED);
  ------------------
  |  |  237|     13|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1934|     13|			}
 1935|  22.2M|			if (zip->ppstream.overconsumed) {
  ------------------
  |  Branch (1935:8): [True: 33, False: 22.2M]
  ------------------
 1936|     33|				zip->ppmd7_stat = -1;
 1937|     33|				return (ARCHIVE_FAILED);
  ------------------
  |  |  237|     33|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1938|     33|			}
 1939|  22.2M|			*zip->ppstream.next_out++ = (unsigned char)sym;
 1940|  22.2M|			zip->ppstream.avail_out--;
 1941|  22.2M|			zip->ppstream.total_out++;
 1942|  22.2M|			if (flush_bytes)
  ------------------
  |  Branch (1942:8): [True: 165k, False: 22.0M]
  ------------------
 1943|   165k|				flush_bytes--;
 1944|  22.2M|		} while (zip->ppstream.avail_out &&
  ------------------
  |  Branch (1944:12): [True: 22.2M, False: 311]
  ------------------
 1945|  22.2M|			(zip->ppstream.avail_in || flush_bytes));
  ------------------
  |  Branch (1945:5): [True: 22.2M, False: 67]
  |  Branch (1945:31): [True: 5, False: 62]
  ------------------
 1946|       |
 1947|    373|		t_avail_in = (size_t)zip->ppstream.avail_in;
 1948|    373|		t_avail_out = (size_t)zip->ppstream.avail_out;
 1949|    373|		break;
 1950|    419|	}
 1951|      0|	default:
  ------------------
  |  Branch (1951:2): [True: 0, False: 419]
  ------------------
 1952|      0|		archive_set_error(&(a->archive), ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1953|      0|		    "Decompression internal error");
 1954|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1955|    419|	}
 1956|    373|	if (ret != ARCHIVE_OK && ret != ARCHIVE_EOF)
  ------------------
  |  |  233|    746|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
              	if (ret != ARCHIVE_OK && ret != ARCHIVE_EOF)
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (1956:6): [True: 0, False: 373]
  |  Branch (1956:27): [True: 0, False: 0]
  ------------------
 1957|      0|		return (ret);
 1958|       |
 1959|    373|	*used = o_avail_in - t_avail_in;
 1960|    373|	*outbytes = o_avail_out - t_avail_out;
 1961|       |
 1962|       |	/*
 1963|       |	 * Decord BCJ.
 1964|       |	 */
 1965|    373|	if (zip->codec != _7Z_LZMA2) {
  ------------------
  |  |   96|    373|#define _7Z_LZMA2	0x21
  ------------------
  |  Branch (1965:6): [True: 373, False: 0]
  ------------------
 1966|    373|		if (zip->codec2 == _7Z_X86) {
  ------------------
  |  |  106|    373|#define _7Z_X86		0x03030103
  ------------------
  |  Branch (1966:7): [True: 0, False: 373]
  ------------------
 1967|      0|			size_t l = x86_Convert(zip, buff, *outbytes);
 1968|       |
 1969|      0|			zip->odd_bcj_size = *outbytes - l;
 1970|      0|			if (zip->odd_bcj_size > 0 && zip->odd_bcj_size <= 4 &&
  ------------------
  |  Branch (1970:8): [True: 0, False: 0]
  |  Branch (1970:33): [True: 0, False: 0]
  ------------------
 1971|      0|		    	o_avail_in && ret != ARCHIVE_EOF) {
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (1971:8): [True: 0, False: 0]
  |  Branch (1971:22): [True: 0, False: 0]
  ------------------
 1972|      0|				memcpy(zip->odd_bcj, ((unsigned char *)buff) + l,
 1973|      0|			    	zip->odd_bcj_size);
 1974|      0|				*outbytes = l;
 1975|      0|			} else
 1976|      0|				zip->odd_bcj_size = 0;
 1977|    373|		} else if (zip->codec2 == _7Z_ARM) {
  ------------------
  |  |  110|    373|#define _7Z_ARM		0x03030501
  ------------------
  |  Branch (1977:14): [True: 0, False: 373]
  ------------------
 1978|      0|			*outbytes = arm_Convert(zip, buff, *outbytes);
 1979|    373|		} else if (zip->codec2 == _7Z_ARM64) {
  ------------------
  |  |  112|    373|#define _7Z_ARM64	0xa
  ------------------
  |  Branch (1979:14): [True: 0, False: 373]
  ------------------
 1980|      0|			*outbytes = arm64_Convert(zip, buff, *outbytes);
 1981|    373|		} else if (zip->codec2 == _7Z_SPARC) {
  ------------------
  |  |  114|    373|#define _7Z_SPARC	0x03030805
  ------------------
  |  Branch (1981:14): [True: 0, False: 373]
  ------------------
 1982|      0|			*outbytes = sparc_Convert(zip, buff, *outbytes);
 1983|    373|		} else if (zip->codec2 == _7Z_POWERPC) {
  ------------------
  |  |  108|    373|#define _7Z_POWERPC	0x03030205
  ------------------
  |  Branch (1983:14): [True: 0, False: 373]
  ------------------
 1984|      0|			*outbytes = powerpc_Convert(zip, buff, *outbytes);
 1985|      0|		}
 1986|    373|	}
 1987|       |
 1988|       |	/*
 1989|       |	 * Decord BCJ2 with a decompressed main stream.
 1990|       |	 */
 1991|    373|	if (zip->codec2 == _7Z_X86_BCJ2) {
  ------------------
  |  |  107|    373|#define _7Z_X86_BCJ2	0x0303011B
  ------------------
  |  Branch (1991:6): [True: 0, False: 373]
  ------------------
 1992|      0|		ssize_t bytes;
 1993|       |
 1994|      0|		zip->tmp_stream_bytes_avail =
 1995|      0|		    zip->tmp_stream_buff_size - t_avail_out;
 1996|      0|		if (zip->tmp_stream_bytes_avail >
  ------------------
  |  Branch (1996:7): [True: 0, False: 0]
  ------------------
 1997|      0|		      zip->main_stream_bytes_remaining)
 1998|      0|			zip->tmp_stream_bytes_avail =
 1999|      0|			    zip->main_stream_bytes_remaining;
 2000|      0|		zip->tmp_stream_bytes_remaining = zip->tmp_stream_bytes_avail;
 2001|      0|		bytes = Bcj2_Decode(zip, bcj2_next_out, bcj2_avail_out);
 2002|      0|		if (bytes < 0) {
  ------------------
  |  Branch (2002:7): [True: 0, False: 0]
  ------------------
 2003|      0|			archive_set_error(&(a->archive),
 2004|      0|			    ARCHIVE_ERRNO_MISC, "BCJ2 conversion failed");
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2005|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2006|      0|		}
 2007|      0|		zip->main_stream_bytes_remaining -=
 2008|      0|		    zip->tmp_stream_bytes_avail
 2009|      0|		      - zip->tmp_stream_bytes_remaining;
 2010|      0|		bcj2_avail_out -= bytes;
 2011|      0|		*outbytes = o_avail_out - bcj2_avail_out;
 2012|      0|	}
 2013|       |
 2014|    373|	return (ret);
 2015|    373|}
archive_read_support_format_7zip.c:ppmd_read:
 1320|  1.68M|{
 1321|  1.68M|	struct archive_read *a = ((IByteIn*)p)->a;
 1322|  1.68M|	struct _7zip *zip = (struct _7zip *)(a->format->data);
 1323|  1.68M|	Byte b;
 1324|       |
 1325|  1.68M|	if (zip->ppstream.avail_in <= 0) {
  ------------------
  |  Branch (1325:6): [True: 837k, False: 842k]
  ------------------
 1326|       |		/*
 1327|       |		 * Ppmd7_DecodeSymbol might require reading multiple bytes
 1328|       |		 * and we are on boundary;
 1329|       |		 * last resort to read using __archive_read_ahead.
 1330|       |		 */
 1331|   837k|		ssize_t bytes_avail = 0;
 1332|   837k|		const uint8_t* data = __archive_read_ahead(a,
 1333|   837k|		    (size_t)zip->ppstream.stream_in+1, &bytes_avail);
 1334|   837k|		if(data == NULL || bytes_avail < zip->ppstream.stream_in+1) {
  ------------------
  |  Branch (1334:6): [True: 40, False: 837k]
  |  Branch (1334:22): [True: 0, False: 837k]
  ------------------
 1335|     40|			archive_set_error(&a->archive,
 1336|     40|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     40|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1337|     40|			    "Truncated 7z file data");
 1338|     40|			zip->ppstream.overconsumed = 1;
 1339|     40|			return (0);
 1340|     40|		}
 1341|   837k|		zip->ppstream.next_in++;
 1342|   837k|		b = data[zip->ppstream.stream_in];
 1343|   842k|	} else {
 1344|   842k|		b = *zip->ppstream.next_in++;
 1345|   842k|	}
 1346|  1.68M|	zip->ppstream.avail_in--;
 1347|  1.68M|	zip->ppstream.total_in++;
 1348|  1.68M|	zip->ppstream.stream_in++;
 1349|  1.68M|	return (b);
 1350|  1.68M|}
archive_read_support_format_7zip.c:get_uncompressed_data:
 3430|      9|{
 3431|      9|	struct _7zip *zip = (struct _7zip *)a->format->data;
 3432|      9|	ssize_t bytes_avail;
 3433|       |
 3434|      9|	if (zip->codec == _7Z_COPY && zip->codec2 == (unsigned long)-1) {
  ------------------
  |  |   94|     18|#define _7Z_COPY	0
  ------------------
  |  Branch (3434:6): [True: 9, False: 0]
  |  Branch (3434:32): [True: 9, False: 0]
  ------------------
 3435|       |		/* Copy mode. */
 3436|       |
 3437|      9|		*buff = __archive_read_ahead(a, minimum, &bytes_avail);
 3438|      9|		if (*buff == NULL) {
  ------------------
  |  Branch (3438:7): [True: 0, False: 9]
  ------------------
 3439|      0|			archive_set_error(&a->archive,
 3440|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3441|      0|			    "Truncated 7-Zip file data");
 3442|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3443|      0|		}
 3444|      9|		if ((size_t)bytes_avail >
  ------------------
  |  Branch (3444:7): [True: 9, False: 0]
  ------------------
 3445|      9|		    zip->uncompressed_buffer_bytes_remaining)
 3446|      9|			bytes_avail = (ssize_t)
 3447|      9|			    zip->uncompressed_buffer_bytes_remaining;
 3448|      9|		if ((size_t)bytes_avail > size)
  ------------------
  |  Branch (3448:7): [True: 0, False: 9]
  ------------------
 3449|      0|			bytes_avail = (ssize_t)size;
 3450|       |
 3451|      9|		zip->pack_stream_bytes_unconsumed = bytes_avail;
 3452|      9|	} else if (zip->uncompressed_buffer_pointer == NULL) {
  ------------------
  |  Branch (3452:13): [True: 0, False: 0]
  ------------------
 3453|       |		/* Decompression has failed. */
 3454|      0|		archive_set_error(&(a->archive),
 3455|      0|		    ARCHIVE_ERRNO_MISC, "Damaged 7-Zip archive");
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3456|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3457|      0|	} else {
 3458|       |		/* Packed mode. */
 3459|      0|		if (minimum > zip->uncompressed_buffer_bytes_remaining) {
  ------------------
  |  Branch (3459:7): [True: 0, False: 0]
  ------------------
 3460|       |			/*
 3461|       |			 * If remaining uncompressed data size is less than
 3462|       |			 * the minimum size, fill the buffer up to the
 3463|       |			 * minimum size.
 3464|       |			 */
 3465|      0|			if (extract_pack_stream(a, minimum) < 0)
  ------------------
  |  Branch (3465:8): [True: 0, False: 0]
  ------------------
 3466|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3467|      0|		}
 3468|      0|		if (size > zip->uncompressed_buffer_bytes_remaining)
  ------------------
  |  Branch (3468:7): [True: 0, False: 0]
  ------------------
 3469|      0|			bytes_avail = (ssize_t)
 3470|      0|			    zip->uncompressed_buffer_bytes_remaining;
 3471|      0|		else
 3472|      0|			bytes_avail = (ssize_t)size;
 3473|      0|		*buff = zip->uncompressed_buffer_pointer;
 3474|      0|		zip->uncompressed_buffer_pointer += bytes_avail;
 3475|      0|	}
 3476|      9|	zip->uncompressed_buffer_bytes_remaining -= bytes_avail;
 3477|      9|	return (bytes_avail);
 3478|      9|}
archive_read_support_format_7zip.c:decode_encoded_header_info:
 3198|     65|{
 3199|     65|	struct _7zip *zip = (struct _7zip *)a->format->data;
 3200|       |
 3201|     65|	errno = 0;
 3202|     65|	if (read_StreamsInfo(a, si) < 0) {
  ------------------
  |  Branch (3202:6): [True: 1, False: 64]
  ------------------
 3203|      1|		if (errno == ENOMEM)
  ------------------
  |  Branch (3203:7): [True: 0, False: 1]
  ------------------
 3204|      0|			archive_set_error(&a->archive, -1,
 3205|      0|			    "Couldn't allocate memory");
 3206|      1|		else
 3207|      1|			archive_set_error(&a->archive, -1,
 3208|      1|			    "Malformed 7-Zip archive");
 3209|      1|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3210|      1|	}
 3211|       |
 3212|     64|	if (si->pi.numPackStreams == 0 || si->ci.numFolders == 0) {
  ------------------
  |  Branch (3212:6): [True: 0, False: 64]
  |  Branch (3212:36): [True: 0, False: 64]
  ------------------
 3213|      0|		archive_set_error(&a->archive, -1, "Malformed 7-Zip archive");
 3214|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3215|      0|	}
 3216|       |
 3217|     64|	if (zip->header_offset < si->pi.pos + si->pi.sizes[0] ||
  ------------------
  |  Branch (3217:6): [True: 0, False: 64]
  ------------------
 3218|     64|	    (int64_t)(si->pi.pos + si->pi.sizes[0]) < 0 ||
  ------------------
  |  Branch (3218:6): [True: 0, False: 64]
  ------------------
 3219|     64|	    si->pi.sizes[0] == 0 || (int64_t)si->pi.pos < 0) {
  ------------------
  |  Branch (3219:6): [True: 0, False: 64]
  |  Branch (3219:30): [True: 0, False: 64]
  ------------------
 3220|      0|		archive_set_error(&a->archive, -1, "Malformed Header offset");
 3221|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3222|      0|	}
 3223|       |
 3224|     64|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     64|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3225|     64|}
archive_read_support_format_7zip.c:read_StreamsInfo:
 2687|     89|{
 2688|     89|	struct _7zip *zip = (struct _7zip *)a->format->data;
 2689|     89|	const unsigned char *p;
 2690|     89|	unsigned i;
 2691|       |
 2692|     89|	memset(si, 0, sizeof(*si));
 2693|       |
 2694|     89|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2694:6): [True: 0, False: 89]
  ------------------
 2695|      0|		return (-1);
 2696|     89|	if (*p == kPackInfo) {
  ------------------
  |  |  127|     89|#define kPackInfo		0x06
  ------------------
  |  Branch (2696:6): [True: 89, False: 0]
  ------------------
 2697|     89|		uint64_t packPos;
 2698|       |
 2699|     89|		if (read_PackInfo(a, &(si->pi)) < 0)
  ------------------
  |  Branch (2699:7): [True: 1, False: 88]
  ------------------
 2700|      1|			return (-1);
 2701|       |
 2702|     88|		if (si->pi.positions == NULL || si->pi.sizes == NULL)
  ------------------
  |  Branch (2702:7): [True: 0, False: 88]
  |  Branch (2702:35): [True: 0, False: 88]
  ------------------
 2703|      0|			return (-1);
 2704|       |		/*
 2705|       |		 * Calculate packed stream positions.
 2706|       |		 */
 2707|     88|		packPos = si->pi.pos;
 2708|    176|		for (i = 0; i < si->pi.numPackStreams; i++) {
  ------------------
  |  Branch (2708:15): [True: 88, False: 88]
  ------------------
 2709|     88|			si->pi.positions[i] = packPos;
 2710|     88|			if (packPos > UINT64_MAX - si->pi.sizes[i])
  ------------------
  |  Branch (2710:8): [True: 0, False: 88]
  ------------------
 2711|      0|				return (-1);
 2712|     88|			packPos += si->pi.sizes[i];
 2713|     88|			if (packPos > zip->header_offset)
  ------------------
  |  Branch (2713:8): [True: 0, False: 88]
  ------------------
 2714|      0|				return (-1);
 2715|     88|		}
 2716|     88|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2716:7): [True: 0, False: 88]
  ------------------
 2717|      0|			return (-1);
 2718|     88|	}
 2719|     88|	if (*p == kUnPackInfo) {
  ------------------
  |  |  128|     88|#define kUnPackInfo		0x07
  ------------------
  |  Branch (2719:6): [True: 88, False: 0]
  ------------------
 2720|     88|		uint32_t packIndex;
 2721|     88|		struct _7z_folder *f;
 2722|       |
 2723|     88|		if (read_CodersInfo(a, &(si->ci)) < 0)
  ------------------
  |  Branch (2723:7): [True: 6, False: 82]
  ------------------
 2724|      6|			return (-1);
 2725|       |
 2726|       |		/*
 2727|       |		 * Calculate packed stream indexes.
 2728|       |		 */
 2729|     82|		packIndex = 0;
 2730|     82|		f = si->ci.folders;
 2731|    164|		for (i = 0; i < si->ci.numFolders; i++) {
  ------------------
  |  Branch (2731:15): [True: 82, False: 82]
  ------------------
 2732|     82|			f[i].packIndex = packIndex;
 2733|     82|			if (f[i].numPackedStreams > UINT32_MAX)
  ------------------
  |  Branch (2733:8): [True: 0, False: 82]
  ------------------
 2734|      0|				return (-1);
 2735|     82|			if (packIndex > UINT32_MAX - (uint32_t)f[i].numPackedStreams)
  ------------------
  |  Branch (2735:8): [True: 0, False: 82]
  ------------------
 2736|      0|				return (-1);
 2737|     82|			packIndex += (uint32_t)f[i].numPackedStreams;
 2738|     82|			if (packIndex > si->pi.numPackStreams)
  ------------------
  |  Branch (2738:8): [True: 0, False: 82]
  ------------------
 2739|      0|				return (-1);
 2740|     82|		}
 2741|     82|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2741:7): [True: 0, False: 82]
  ------------------
 2742|      0|			return (-1);
 2743|     82|	}
 2744|       |
 2745|     82|	if (*p == kSubStreamsInfo) {
  ------------------
  |  |  129|     82|#define kSubStreamsInfo		0x08
  ------------------
  |  Branch (2745:6): [True: 18, False: 64]
  ------------------
 2746|     18|		if (read_SubStreamsInfo(a, &(si->ss),
  ------------------
  |  Branch (2746:7): [True: 6, False: 12]
  ------------------
 2747|     18|		    si->ci.folders, (size_t)si->ci.numFolders) < 0)
 2748|      6|			return (-1);
 2749|     12|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2749:7): [True: 0, False: 12]
  ------------------
 2750|      0|			return (-1);
 2751|     12|	}
 2752|       |
 2753|       |	/*
 2754|       |	 *  Must be kEnd.
 2755|       |	 */
 2756|     76|	if (*p != kEnd)
  ------------------
  |  |  121|     76|#define kEnd			0x00
  ------------------
  |  Branch (2756:6): [True: 0, False: 76]
  ------------------
 2757|      0|		return (-1);
 2758|     76|	return (0);
 2759|     76|}
archive_read_support_format_7zip.c:read_PackInfo:
 2165|     89|{
 2166|     89|	const unsigned char *p;
 2167|     89|	unsigned i;
 2168|       |
 2169|     89|	memset(pi, 0, sizeof(*pi));
 2170|       |
 2171|       |	/*
 2172|       |	 * Read PackPos.
 2173|       |	 */
 2174|     89|	if (parse_7zip_uint64(a, &(pi->pos)) < 0)
  ------------------
  |  Branch (2174:6): [True: 0, False: 89]
  ------------------
 2175|      0|		return (-1);
 2176|       |
 2177|       |	/*
 2178|       |	 * Read NumPackStreams.
 2179|       |	 */
 2180|     89|	if (parse_7zip_uint64(a, &(pi->numPackStreams)) < 0)
  ------------------
  |  Branch (2180:6): [True: 0, False: 89]
  ------------------
 2181|      0|		return (-1);
 2182|     89|	if (pi->numPackStreams == 0)
  ------------------
  |  Branch (2182:6): [True: 0, False: 89]
  ------------------
 2183|      0|		return (-1);
 2184|     89|	if (UMAX_ENTRY < pi->numPackStreams)
  ------------------
  |  |  400|     89|#define UMAX_ENTRY	ARCHIVE_LITERAL_ULL(100000000)
  |  |  ------------------
  |  |  |  |  180|     89|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  ------------------
  ------------------
  |  Branch (2184:6): [True: 1, False: 88]
  ------------------
 2185|      1|		return (-1);
 2186|       |
 2187|       |	/*
 2188|       |	 * Read PackSizes[num]
 2189|       |	 */
 2190|     88|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2190:6): [True: 0, False: 88]
  ------------------
 2191|      0|		return (-1);
 2192|     88|	if (*p == kEnd)
  ------------------
  |  |  121|     88|#define kEnd			0x00
  ------------------
  |  Branch (2192:6): [True: 0, False: 88]
  ------------------
 2193|       |		/* PackSizes[num] are not present. */
 2194|      0|		return (0);
 2195|     88|	if (*p != kSize)
  ------------------
  |  |  130|     88|#define kSize			0x09
  ------------------
  |  Branch (2195:6): [True: 0, False: 88]
  ------------------
 2196|      0|		return (-1);
 2197|     88|	pi->sizes = calloc((size_t)pi->numPackStreams, sizeof(uint64_t));
 2198|     88|	pi->positions = calloc((size_t)pi->numPackStreams, sizeof(uint64_t));
 2199|     88|	if (pi->sizes == NULL || pi->positions == NULL)
  ------------------
  |  Branch (2199:6): [True: 0, False: 88]
  |  Branch (2199:27): [True: 0, False: 88]
  ------------------
 2200|      0|		return (-1);
 2201|       |
 2202|    176|	for (i = 0; i < pi->numPackStreams; i++) {
  ------------------
  |  Branch (2202:14): [True: 88, False: 88]
  ------------------
 2203|     88|		if (parse_7zip_uint64(a, &(pi->sizes[i])) < 0)
  ------------------
  |  Branch (2203:7): [True: 0, False: 88]
  ------------------
 2204|      0|			return (-1);
 2205|     88|	}
 2206|       |
 2207|       |	/*
 2208|       |	 * Read PackStreamDigests[num]
 2209|       |	 */
 2210|     88|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2210:6): [True: 0, False: 88]
  ------------------
 2211|      0|		return (-1);
 2212|     88|	if (*p == kEnd) {
  ------------------
  |  |  121|     88|#define kEnd			0x00
  ------------------
  |  Branch (2212:6): [True: 88, False: 0]
  ------------------
 2213|       |		/* PackStreamDigests[num] are not present. */
 2214|     88|		pi->digest.defineds =
 2215|     88|		    calloc((size_t)pi->numPackStreams, sizeof(*pi->digest.defineds));
 2216|     88|		pi->digest.digests =
 2217|     88|		    calloc((size_t)pi->numPackStreams, sizeof(*pi->digest.digests));
 2218|     88|		if (pi->digest.defineds == NULL || pi->digest.digests == NULL)
  ------------------
  |  Branch (2218:7): [True: 0, False: 88]
  |  Branch (2218:38): [True: 0, False: 88]
  ------------------
 2219|      0|			return (-1);
 2220|     88|		return (0);
 2221|     88|	}
 2222|       |
 2223|      0|	if (*p != kCRC)
  ------------------
  |  |  131|      0|#define kCRC			0x0A
  ------------------
  |  Branch (2223:6): [True: 0, False: 0]
  ------------------
 2224|      0|		return (-1);
 2225|       |
 2226|      0|	if (read_Digests(a, &(pi->digest), (size_t)pi->numPackStreams) < 0)
  ------------------
  |  Branch (2226:6): [True: 0, False: 0]
  ------------------
 2227|      0|		return (-1);
 2228|       |
 2229|       |	/*
 2230|       |	 *  Must be marked by kEnd.
 2231|       |	 */
 2232|      0|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2232:6): [True: 0, False: 0]
  ------------------
 2233|      0|		return (-1);
 2234|      0|	if (*p != kEnd)
  ------------------
  |  |  121|      0|#define kEnd			0x00
  ------------------
  |  Branch (2234:6): [True: 0, False: 0]
  ------------------
 2235|      0|		return (-1);
 2236|      0|	return (0);
 2237|      0|}
archive_read_support_format_7zip.c:parse_7zip_uint64:
 2066|  28.5k|{
 2067|  28.5k|	const unsigned char *p;
 2068|  28.5k|	unsigned char avail, mask;
 2069|  28.5k|	int i;
 2070|       |
 2071|  28.5k|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2071:6): [True: 4, False: 28.5k]
  ------------------
 2072|      4|		return (-1);
 2073|  28.5k|	avail = *p;
 2074|  28.5k|	mask = 0x80;
 2075|  28.5k|	*val = 0;
 2076|  59.0k|	for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (2076:14): [True: 58.4k, False: 597]
  ------------------
 2077|  58.4k|		if (avail & mask) {
  ------------------
  |  Branch (2077:7): [True: 30.5k, False: 27.9k]
  ------------------
 2078|  30.5k|			if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2078:8): [True: 1, False: 30.5k]
  ------------------
 2079|      1|				return (-1);
 2080|  30.5k|			*val |= ((uint64_t)*p) << (8 * i);
 2081|  30.5k|			mask >>= 1;
 2082|  30.5k|			continue;
 2083|  30.5k|		}
 2084|  27.9k|		*val += ((uint64_t)(avail & (mask -1))) << (8 * i);
 2085|  27.9k|		break;
 2086|  58.4k|	}
 2087|  28.5k|	return (0);
 2088|  28.5k|}
archive_read_support_format_7zip.c:read_Digests:
 2118|     49|{
 2119|     49|	const unsigned char *p;
 2120|     49|	unsigned i;
 2121|       |
 2122|     49|	if (num == 0)
  ------------------
  |  Branch (2122:6): [True: 0, False: 49]
  ------------------
 2123|      0|		return (-1);
 2124|     49|	memset(d, 0, sizeof(*d));
 2125|       |
 2126|     49|	d->defineds = malloc(num);
 2127|     49|	if (d->defineds == NULL)
  ------------------
  |  Branch (2127:6): [True: 0, False: 49]
  ------------------
 2128|      0|		return (-1);
 2129|       |	/*
 2130|       |	 * Read Bools.
 2131|       |	 */
 2132|     49|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2132:6): [True: 0, False: 49]
  ------------------
 2133|      0|		return (-1);
 2134|     49|	if (*p == 0) {
  ------------------
  |  Branch (2134:6): [True: 21, False: 28]
  ------------------
 2135|     21|		if (read_Bools(a, d->defineds, num) < 0)
  ------------------
  |  Branch (2135:7): [True: 0, False: 21]
  ------------------
 2136|      0|			return (-1);
 2137|     21|	} else
 2138|       |		/* All are defined */
 2139|     28|		memset(d->defineds, 1, num);
 2140|       |
 2141|     49|	d->digests = calloc(num, sizeof(*d->digests));
 2142|     49|	if (d->digests == NULL)
  ------------------
  |  Branch (2142:6): [True: 0, False: 49]
  ------------------
 2143|      0|		return (-1);
 2144|     98|	for (i = 0; i < num; i++) {
  ------------------
  |  Branch (2144:14): [True: 49, False: 49]
  ------------------
 2145|     49|		if (d->defineds[i]) {
  ------------------
  |  Branch (2145:7): [True: 28, False: 21]
  ------------------
 2146|     28|			if ((p = header_bytes(a, 4)) == NULL)
  ------------------
  |  Branch (2146:8): [True: 0, False: 28]
  ------------------
 2147|      0|				return (-1);
 2148|     28|			d->digests[i] = archive_le32dec(p);
 2149|     28|		}
 2150|     49|	}
 2151|       |
 2152|     49|	return (0);
 2153|     49|}
archive_read_support_format_7zip.c:read_Bools:
 2092|     53|{
 2093|     53|	const unsigned char *p;
 2094|     53|	unsigned i, mask = 0, avail = 0;
 2095|       |
 2096|  1.24k|	for (i = 0; i < num; i++) {
  ------------------
  |  Branch (2096:14): [True: 1.18k, False: 53]
  ------------------
 2097|  1.18k|		if (mask == 0) {
  ------------------
  |  Branch (2097:7): [True: 191, False: 998]
  ------------------
 2098|    191|			if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2098:8): [True: 0, False: 191]
  ------------------
 2099|      0|				return (-1);
 2100|    191|			avail = *p;
 2101|    191|			mask = 0x80;
 2102|    191|		}
 2103|  1.18k|		data[i] = (avail & mask)?1:0;
  ------------------
  |  Branch (2103:13): [True: 1.03k, False: 153]
  ------------------
 2104|  1.18k|		mask >>= 1;
 2105|  1.18k|	}
 2106|     53|	return (0);
 2107|     53|}
archive_read_support_format_7zip.c:read_CodersInfo:
 2415|     88|{
 2416|     88|	const unsigned char *p;
 2417|     88|	struct _7z_digests digest;
 2418|     88|	unsigned i;
 2419|       |
 2420|     88|	memset(ci, 0, sizeof(*ci));
 2421|     88|	memset(&digest, 0, sizeof(digest));
 2422|       |
 2423|     88|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2423:6): [True: 0, False: 88]
  ------------------
 2424|      0|		goto failed;
 2425|     88|	if (*p != kFolder)
  ------------------
  |  |  132|     88|#define kFolder			0x0B
  ------------------
  |  Branch (2425:6): [True: 0, False: 88]
  ------------------
 2426|      0|		goto failed;
 2427|       |
 2428|       |	/*
 2429|       |	 * Read NumFolders.
 2430|       |	 */
 2431|     88|	if (parse_7zip_uint64(a, &(ci->numFolders)) < 0)
  ------------------
  |  Branch (2431:6): [True: 0, False: 88]
  ------------------
 2432|      0|		goto failed;
 2433|     88|	if (UMAX_ENTRY < ci->numFolders)
  ------------------
  |  |  400|     88|#define UMAX_ENTRY	ARCHIVE_LITERAL_ULL(100000000)
  |  |  ------------------
  |  |  |  |  180|     88|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  ------------------
  ------------------
  |  Branch (2433:6): [True: 1, False: 87]
  ------------------
 2434|      1|		return (-1);
 2435|       |
 2436|       |	/*
 2437|       |	 * Read External.
 2438|       |	 */
 2439|     87|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2439:6): [True: 0, False: 87]
  ------------------
 2440|      0|		goto failed;
 2441|     87|	switch (*p) {
 2442|     87|	case 0:
  ------------------
  |  Branch (2442:2): [True: 87, False: 0]
  ------------------
 2443|     87|		ci->folders =
 2444|     87|			calloc((size_t)ci->numFolders, sizeof(*ci->folders));
 2445|     87|		if (ci->folders == NULL)
  ------------------
  |  Branch (2445:7): [True: 0, False: 87]
  ------------------
 2446|      0|			return (-1);
 2447|    169|		for (i = 0; i < ci->numFolders; i++) {
  ------------------
  |  Branch (2447:15): [True: 87, False: 82]
  ------------------
 2448|     87|			if (read_Folder(a, &(ci->folders[i])) < 0)
  ------------------
  |  Branch (2448:8): [True: 5, False: 82]
  ------------------
 2449|      5|				goto failed;
 2450|     87|		}
 2451|     82|		break;
 2452|     82|	case 1:
  ------------------
  |  Branch (2452:2): [True: 0, False: 87]
  ------------------
 2453|      0|		if (parse_7zip_uint64(a, &(ci->dataStreamIndex)) < 0)
  ------------------
  |  Branch (2453:7): [True: 0, False: 0]
  ------------------
 2454|      0|			return (-1);
 2455|      0|		if (UMAX_ENTRY < ci->dataStreamIndex)
  ------------------
  |  |  400|      0|#define UMAX_ENTRY	ARCHIVE_LITERAL_ULL(100000000)
  |  |  ------------------
  |  |  |  |  180|      0|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  ------------------
  ------------------
  |  Branch (2455:7): [True: 0, False: 0]
  ------------------
 2456|      0|			return (-1);
 2457|      0|		if (ci->numFolders > 0) {
  ------------------
  |  Branch (2457:7): [True: 0, False: 0]
  ------------------
 2458|      0|			archive_set_error(&a->archive, -1,
 2459|      0|			    "Malformed 7-Zip archive");
 2460|      0|			goto failed;
 2461|      0|		}
 2462|      0|		break;
 2463|      0|	default:
  ------------------
  |  Branch (2463:2): [True: 0, False: 87]
  ------------------
 2464|      0|		archive_set_error(&a->archive, -1,
 2465|      0|		    "Malformed 7-Zip archive");
 2466|      0|		goto failed;
 2467|     87|	}
 2468|       |
 2469|     82|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2469:6): [True: 0, False: 82]
  ------------------
 2470|      0|		goto failed;
 2471|     82|	if (*p != kCodersUnPackSize)
  ------------------
  |  |  133|     82|#define kCodersUnPackSize	0x0C
  ------------------
  |  Branch (2471:6): [True: 0, False: 82]
  ------------------
 2472|      0|		goto failed;
 2473|       |
 2474|    164|	for (i = 0; i < ci->numFolders; i++) {
  ------------------
  |  Branch (2474:14): [True: 82, False: 82]
  ------------------
 2475|     82|		struct _7z_folder *folder = &(ci->folders[i]);
 2476|     82|		unsigned j;
 2477|       |
 2478|     82|		folder->unPackSize =
 2479|     82|		    calloc((size_t)folder->numOutStreams, sizeof(*folder->unPackSize));
 2480|     82|		if (folder->unPackSize == NULL)
  ------------------
  |  Branch (2480:7): [True: 0, False: 82]
  ------------------
 2481|      0|			goto failed;
 2482|    164|		for (j = 0; j < folder->numOutStreams; j++) {
  ------------------
  |  Branch (2482:15): [True: 82, False: 82]
  ------------------
 2483|     82|			if (parse_7zip_uint64(a, &(folder->unPackSize[j])) < 0)
  ------------------
  |  Branch (2483:8): [True: 0, False: 82]
  ------------------
 2484|      0|				goto failed;
 2485|     82|		}
 2486|     82|	}
 2487|       |
 2488|       |	/*
 2489|       |	 * Read CRCs.
 2490|       |	 */
 2491|     82|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2491:6): [True: 0, False: 82]
  ------------------
 2492|      0|		goto failed;
 2493|     82|	if (*p == kEnd)
  ------------------
  |  |  121|     82|#define kEnd			0x00
  ------------------
  |  Branch (2493:6): [True: 44, False: 38]
  ------------------
 2494|     44|		return (0);
 2495|     38|	if (*p != kCRC)
  ------------------
  |  |  131|     38|#define kCRC			0x0A
  ------------------
  |  Branch (2495:6): [True: 0, False: 38]
  ------------------
 2496|      0|		goto failed;
 2497|     38|	if (read_Digests(a, &digest, (size_t)ci->numFolders) < 0)
  ------------------
  |  Branch (2497:6): [True: 0, False: 38]
  ------------------
 2498|      0|		goto failed;
 2499|     76|	for (i = 0; i < ci->numFolders; i++) {
  ------------------
  |  Branch (2499:14): [True: 38, False: 38]
  ------------------
 2500|     38|		ci->folders[i].digest_defined = digest.defineds[i];
 2501|     38|		ci->folders[i].digest = digest.digests[i];
 2502|     38|	}
 2503|       |
 2504|       |	/*
 2505|       |	 *  Must be kEnd.
 2506|       |	 */
 2507|     38|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2507:6): [True: 0, False: 38]
  ------------------
 2508|      0|		goto failed;
 2509|     38|	if (*p != kEnd)
  ------------------
  |  |  121|     38|#define kEnd			0x00
  ------------------
  |  Branch (2509:6): [True: 0, False: 38]
  ------------------
 2510|      0|		goto failed;
 2511|     38|	free_Digest(&digest);
 2512|     38|	return (0);
 2513|      5|failed:
 2514|      5|	free_Digest(&digest);
 2515|      5|	return (-1);
 2516|     38|}
archive_read_support_format_7zip.c:read_Folder:
 2257|     87|{
 2258|     87|	struct _7zip *zip = (struct _7zip *)a->format->data;
 2259|     87|	const unsigned char *p;
 2260|     87|	uint64_t numInStreamsTotal = 0;
 2261|     87|	uint64_t numOutStreamsTotal = 0;
 2262|     87|	unsigned i;
 2263|       |
 2264|     87|	memset(f, 0, sizeof(*f));
 2265|       |
 2266|       |	/*
 2267|       |	 * Read NumCoders.
 2268|       |	 */
 2269|     87|	if (parse_7zip_uint64(a, &(f->numCoders)) < 0)
  ------------------
  |  Branch (2269:6): [True: 0, False: 87]
  ------------------
 2270|      0|		return (-1);
 2271|     87|	if (f->numCoders > 4)
  ------------------
  |  Branch (2271:6): [True: 0, False: 87]
  ------------------
 2272|       |		/* Too many coders. */
 2273|      0|		return (-1);
 2274|       |
 2275|     87|	f->coders = calloc((size_t)f->numCoders, sizeof(*f->coders));
 2276|     87|	if (f->coders == NULL)
  ------------------
  |  Branch (2276:6): [True: 0, False: 87]
  ------------------
 2277|      0|		return (-1);
 2278|    175|	for (i = 0; i< f->numCoders; i++) {
  ------------------
  |  Branch (2278:14): [True: 89, False: 86]
  ------------------
 2279|     89|		size_t codec_size;
 2280|     89|		int simple, attr;
 2281|       |
 2282|     89|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2282:7): [True: 0, False: 89]
  ------------------
 2283|      0|			return (-1);
 2284|       |		/*
 2285|       |		 * 0:3 CodecIdSize
 2286|       |		 * 4:  0 - IsSimple
 2287|       |		 *     1 - Is not Simple
 2288|       |		 * 5:  0 - No Attributes
 2289|       |		 *     1 - There are Attributes;
 2290|       |		 * 7:  Must be zero.
 2291|       |		 */
 2292|     89|		codec_size = *p & 0xf;
 2293|     89|		simple = (*p & 0x10)?0:1;
  ------------------
  |  Branch (2293:12): [True: 5, False: 84]
  ------------------
 2294|     89|		attr = *p & 0x20;
 2295|     89|		if (*p & 0x80)
  ------------------
  |  Branch (2295:7): [True: 0, False: 89]
  ------------------
 2296|      0|			return (-1);/* Not supported. */
 2297|       |
 2298|       |		/*
 2299|       |		 * Read Decompression Method IDs.
 2300|       |		 */
 2301|     89|		if ((p = header_bytes(a, codec_size)) == NULL)
  ------------------
  |  Branch (2301:7): [True: 0, False: 89]
  ------------------
 2302|      0|			return (-1);
 2303|       |
 2304|     89|		if (decode_codec_id(p, codec_size, &f->coders[i].codec) < 0)
  ------------------
  |  Branch (2304:7): [True: 0, False: 89]
  ------------------
 2305|      0|			return (-1);
 2306|       |
 2307|     89|		if (simple) {
  ------------------
  |  Branch (2307:7): [True: 84, False: 5]
  ------------------
 2308|     84|			f->coders[i].numInStreams = 1;
 2309|     84|			f->coders[i].numOutStreams = 1;
 2310|     84|		} else {
 2311|      5|			if (parse_7zip_uint64(
  ------------------
  |  Branch (2311:8): [True: 0, False: 5]
  ------------------
 2312|      5|			    a, &(f->coders[i].numInStreams)) < 0)
 2313|      0|				return (-1);
 2314|      5|			if (UMAX_ENTRY < f->coders[i].numInStreams)
  ------------------
  |  |  400|      5|#define UMAX_ENTRY	ARCHIVE_LITERAL_ULL(100000000)
  |  |  ------------------
  |  |  |  |  180|      5|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  ------------------
  ------------------
  |  Branch (2314:8): [True: 0, False: 5]
  ------------------
 2315|      0|				return (-1);
 2316|      5|			if (parse_7zip_uint64(
  ------------------
  |  Branch (2316:8): [True: 0, False: 5]
  ------------------
 2317|      5|			    a, &(f->coders[i].numOutStreams)) < 0)
 2318|      0|				return (-1);
 2319|      5|			if (UMAX_ENTRY < f->coders[i].numOutStreams)
  ------------------
  |  |  400|      5|#define UMAX_ENTRY	ARCHIVE_LITERAL_ULL(100000000)
  |  |  ------------------
  |  |  |  |  180|      5|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  ------------------
  ------------------
  |  Branch (2319:8): [True: 1, False: 4]
  ------------------
 2320|      1|				return (-1);
 2321|      5|		}
 2322|       |
 2323|     88|		if (attr) {
  ------------------
  |  Branch (2323:7): [True: 85, False: 3]
  ------------------
 2324|     85|			if (parse_7zip_uint64(
  ------------------
  |  Branch (2324:8): [True: 0, False: 85]
  ------------------
 2325|     85|			    a, &(f->coders[i].propertiesSize)) < 0)
 2326|      0|				return (-1);
 2327|     85|			if (UMAX_ENTRY < f->coders[i].propertiesSize)
  ------------------
  |  |  400|     85|#define UMAX_ENTRY	ARCHIVE_LITERAL_ULL(100000000)
  |  |  ------------------
  |  |  |  |  180|     85|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  ------------------
  ------------------
  |  Branch (2327:8): [True: 0, False: 85]
  ------------------
 2328|      0|				return (-1);
 2329|     85|			if ((p = header_bytes(
  ------------------
  |  Branch (2329:8): [True: 0, False: 85]
  ------------------
 2330|     85|			    a, (size_t)f->coders[i].propertiesSize)) == NULL)
 2331|      0|				return (-1);
 2332|     85|			f->coders[i].properties =
 2333|     85|			    malloc((size_t)f->coders[i].propertiesSize);
 2334|     85|			if (f->coders[i].properties == NULL)
  ------------------
  |  Branch (2334:8): [True: 0, False: 85]
  ------------------
 2335|      0|				return (-1);
 2336|     85|			memcpy(f->coders[i].properties, p,
 2337|     85|			    (size_t)f->coders[i].propertiesSize);
 2338|     85|		}
 2339|       |
 2340|     88|		numInStreamsTotal += f->coders[i].numInStreams;
 2341|     88|		numOutStreamsTotal += f->coders[i].numOutStreams;
 2342|     88|	}
 2343|       |
 2344|     86|	if (numOutStreamsTotal == 0 ||
  ------------------
  |  Branch (2344:6): [True: 0, False: 86]
  ------------------
 2345|     86|	    numInStreamsTotal < numOutStreamsTotal-1)
  ------------------
  |  Branch (2345:6): [True: 0, False: 86]
  ------------------
 2346|      0|		return (-1);
 2347|       |
 2348|     86|	f->numBindPairs = numOutStreamsTotal - 1;
 2349|     86|	if (zip->header_bytes_remaining < f->numBindPairs)
  ------------------
  |  Branch (2349:6): [True: 0, False: 86]
  ------------------
 2350|      0|			return (-1);
 2351|     86|	if (f->numBindPairs > 0) {
  ------------------
  |  Branch (2351:6): [True: 4, False: 82]
  ------------------
 2352|      4|		f->bindPairs =
 2353|      4|			calloc((size_t)f->numBindPairs, sizeof(*f->bindPairs));
 2354|      4|		if (f->bindPairs == NULL)
  ------------------
  |  Branch (2354:7): [True: 0, False: 4]
  ------------------
 2355|      0|			return (-1);
 2356|      4|	} else
 2357|     82|		f->bindPairs = NULL;
 2358|    147|	for (i = 0; i < f->numBindPairs; i++) {
  ------------------
  |  Branch (2358:14): [True: 64, False: 83]
  ------------------
 2359|     64|		if (parse_7zip_uint64(a, &(f->bindPairs[i].inIndex)) < 0)
  ------------------
  |  Branch (2359:7): [True: 0, False: 64]
  ------------------
 2360|      0|			return (-1);
 2361|     64|		if (UMAX_ENTRY < f->bindPairs[i].inIndex)
  ------------------
  |  |  400|     64|#define UMAX_ENTRY	ARCHIVE_LITERAL_ULL(100000000)
  |  |  ------------------
  |  |  |  |  180|     64|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  ------------------
  ------------------
  |  Branch (2361:7): [True: 2, False: 62]
  ------------------
 2362|      2|			return (-1);
 2363|     62|		if (parse_7zip_uint64(a, &(f->bindPairs[i].outIndex)) < 0)
  ------------------
  |  Branch (2363:7): [True: 0, False: 62]
  ------------------
 2364|      0|			return (-1);
 2365|     62|		if (UMAX_ENTRY < f->bindPairs[i].outIndex)
  ------------------
  |  |  400|     62|#define UMAX_ENTRY	ARCHIVE_LITERAL_ULL(100000000)
  |  |  ------------------
  |  |  |  |  180|     62|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  ------------------
  ------------------
  |  Branch (2365:7): [True: 1, False: 61]
  ------------------
 2366|      1|			return (-1);
 2367|     62|	}
 2368|       |
 2369|     83|	f->numPackedStreams = numInStreamsTotal - f->numBindPairs;
 2370|     83|	f->packedStreams =
 2371|     83|	    calloc((size_t)f->numPackedStreams, sizeof(*f->packedStreams));
 2372|     83|	if (f->packedStreams == NULL)
  ------------------
  |  Branch (2372:6): [True: 0, False: 83]
  ------------------
 2373|      0|		return (-1);
 2374|     83|	if (f->numPackedStreams == 1) {
  ------------------
  |  Branch (2374:6): [True: 82, False: 1]
  ------------------
 2375|     82|		for (i = 0; i < numInStreamsTotal; i++) {
  ------------------
  |  Branch (2375:15): [True: 82, False: 0]
  ------------------
 2376|     82|			unsigned j;
 2377|     82|			for (j = 0; j < f->numBindPairs; j++) {
  ------------------
  |  Branch (2377:16): [True: 0, False: 82]
  ------------------
 2378|      0|				if (f->bindPairs[j].inIndex == i)
  ------------------
  |  Branch (2378:9): [True: 0, False: 0]
  ------------------
 2379|      0|					break;
 2380|      0|			}
 2381|     82|			if (j == f->numBindPairs)
  ------------------
  |  Branch (2381:8): [True: 82, False: 0]
  ------------------
 2382|     82|				break;
 2383|     82|		}
 2384|     82|		if (i == numInStreamsTotal)
  ------------------
  |  Branch (2384:7): [True: 0, False: 82]
  ------------------
 2385|      0|			return (-1);
 2386|     82|		f->packedStreams[0] = i;
 2387|     82|	} else {
 2388|  2.71k|		for (i = 0; i < f->numPackedStreams; i++) {
  ------------------
  |  Branch (2388:15): [True: 2.71k, False: 0]
  ------------------
 2389|  2.71k|			if (parse_7zip_uint64(a, &(f->packedStreams[i])) < 0)
  ------------------
  |  Branch (2389:8): [True: 1, False: 2.71k]
  ------------------
 2390|      1|				return (-1);
 2391|  2.71k|			if (UMAX_ENTRY < f->packedStreams[i])
  ------------------
  |  |  400|  2.71k|#define UMAX_ENTRY	ARCHIVE_LITERAL_ULL(100000000)
  |  |  ------------------
  |  |  |  |  180|  2.71k|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  ------------------
  ------------------
  |  Branch (2391:8): [True: 0, False: 2.71k]
  ------------------
 2392|      0|				return (-1);
 2393|  2.71k|		}
 2394|      1|	}
 2395|     82|	f->numInStreams = numInStreamsTotal;
 2396|     82|	f->numOutStreams = numOutStreamsTotal;
 2397|       |
 2398|     82|	return (0);
 2399|     83|}
archive_read_support_format_7zip.c:decode_codec_id:
 1304|     89|{
 1305|     89|	unsigned i;
 1306|     89|	uint64_t v = 0;
 1307|       |
 1308|    323|	for (i = 0; i < id_size; i++) {
  ------------------
  |  Branch (1308:14): [True: 234, False: 89]
  ------------------
 1309|    234|		if (v > (uint64_t)INT64_MAX / 256)
  ------------------
  |  Branch (1309:7): [True: 0, False: 234]
  ------------------
 1310|      0|			return (-1);
 1311|    234|		v <<= 8;
 1312|    234|		v += codecId[i];
 1313|    234|	}
 1314|     89|	*id = v;
 1315|     89|	return (0);
 1316|     89|}
archive_read_support_format_7zip.c:free_Digest:
 2111|  2.61k|{
 2112|  2.61k|	free(d->defineds);
 2113|  2.61k|	free(d->digests);
 2114|  2.61k|}
archive_read_support_format_7zip.c:read_SubStreamsInfo:
 2547|     18|{
 2548|     18|	const unsigned char *p;
 2549|     18|	uint64_t *usizes;
 2550|     18|	size_t unpack_streams;
 2551|     18|	int type;
 2552|     18|	unsigned i;
 2553|     18|	uint32_t numDigests;
 2554|       |
 2555|     18|	memset(ss, 0, sizeof(*ss));
 2556|       |
 2557|     36|	for (i = 0; i < numFolders; i++)
  ------------------
  |  Branch (2557:14): [True: 18, False: 18]
  ------------------
 2558|     18|		f[i].numUnpackStreams = 1;
 2559|       |
 2560|     18|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2560:6): [True: 0, False: 18]
  ------------------
 2561|      0|		return (-1);
 2562|     18|	type = *p;
 2563|       |
 2564|     18|	if (type == kNumUnPackStream) {
  ------------------
  |  |  134|     18|#define kNumUnPackStream	0x0D
  ------------------
  |  Branch (2564:6): [True: 7, False: 11]
  ------------------
 2565|      7|		unpack_streams = 0;
 2566|     14|		for (i = 0; i < numFolders; i++) {
  ------------------
  |  Branch (2566:15): [True: 7, False: 7]
  ------------------
 2567|      7|			if (parse_7zip_uint64(a, &(f[i].numUnpackStreams)) < 0)
  ------------------
  |  Branch (2567:8): [True: 0, False: 7]
  ------------------
 2568|      0|				return (-1);
 2569|      7|			if (UMAX_ENTRY < f[i].numUnpackStreams)
  ------------------
  |  |  400|      7|#define UMAX_ENTRY	ARCHIVE_LITERAL_ULL(100000000)
  |  |  ------------------
  |  |  |  |  180|      7|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  ------------------
  ------------------
  |  Branch (2569:8): [True: 0, False: 7]
  ------------------
 2570|      0|				return (-1);
 2571|      7|			if (unpack_streams > SIZE_MAX - UMAX_ENTRY) {
  ------------------
  |  |  400|      7|#define UMAX_ENTRY	ARCHIVE_LITERAL_ULL(100000000)
  |  |  ------------------
  |  |  |  |  180|      7|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  ------------------
  ------------------
  |  Branch (2571:8): [True: 0, False: 7]
  ------------------
 2572|      0|				return (-1);
 2573|      0|			}
 2574|      7|			unpack_streams += (size_t)f[i].numUnpackStreams;
 2575|      7|		}
 2576|      7|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2576:7): [True: 0, False: 7]
  ------------------
 2577|      0|			return (-1);
 2578|      7|		type = *p;
 2579|      7|	} else
 2580|     11|		unpack_streams = numFolders;
 2581|       |
 2582|     18|	ss->unpack_streams = unpack_streams;
 2583|     18|	if (unpack_streams) {
  ------------------
  |  Branch (2583:6): [True: 18, False: 0]
  ------------------
 2584|     18|		ss->unpackSizes = calloc(unpack_streams,
 2585|     18|		    sizeof(*ss->unpackSizes));
 2586|     18|		ss->digestsDefined = calloc(unpack_streams,
 2587|     18|		    sizeof(*ss->digestsDefined));
 2588|     18|		ss->digests = calloc(unpack_streams,
 2589|     18|		    sizeof(*ss->digests));
 2590|     18|		if (ss->unpackSizes == NULL || ss->digestsDefined == NULL ||
  ------------------
  |  Branch (2590:7): [True: 0, False: 18]
  |  Branch (2590:34): [True: 0, False: 18]
  ------------------
 2591|     18|		    ss->digests == NULL)
  ------------------
  |  Branch (2591:7): [True: 0, False: 18]
  ------------------
 2592|      0|			return (-1);
 2593|     18|	}
 2594|       |
 2595|     18|	usizes = ss->unpackSizes;
 2596|     30|	for (i = 0; i < numFolders; i++) {
  ------------------
  |  Branch (2596:14): [True: 18, False: 12]
  ------------------
 2597|     18|		unsigned pack;
 2598|     18|		uint64_t size, sum;
 2599|       |
 2600|     18|		if (f[i].numUnpackStreams == 0)
  ------------------
  |  Branch (2600:7): [True: 0, False: 18]
  ------------------
 2601|      0|			continue;
 2602|       |
 2603|     18|		sum = 0;
 2604|     18|		if (type == kSize) {
  ------------------
  |  |  130|     18|#define kSize			0x09
  ------------------
  |  Branch (2604:7): [True: 6, False: 12]
  ------------------
 2605|  22.8k|			for (pack = 1; pack < f[i].numUnpackStreams; pack++) {
  ------------------
  |  Branch (2605:19): [True: 22.8k, False: 1]
  ------------------
 2606|  22.8k|				if (parse_7zip_uint64(a, usizes) < 0)
  ------------------
  |  Branch (2606:9): [True: 3, False: 22.8k]
  ------------------
 2607|      3|					return (-1);
 2608|  22.8k|				if (*usizes > UINT64_MAX - sum)
  ------------------
  |  Branch (2608:9): [True: 2, False: 22.8k]
  ------------------
 2609|      2|					return (-1);
 2610|  22.8k|				sum += *usizes++;
 2611|  22.8k|			}
 2612|      6|		}
 2613|     13|		size = folder_uncompressed_size(&f[i]);
 2614|     13|		if (size < sum)
  ------------------
  |  Branch (2614:7): [True: 1, False: 12]
  ------------------
 2615|      1|			return (-1);
 2616|     12|		*usizes++ = size - sum;
 2617|     12|	}
 2618|       |
 2619|     12|	if (type == kSize) {
  ------------------
  |  |  130|     12|#define kSize			0x09
  ------------------
  |  Branch (2619:6): [True: 0, False: 12]
  ------------------
 2620|      0|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2620:7): [True: 0, False: 0]
  ------------------
 2621|      0|			return (-1);
 2622|      0|		type = *p;
 2623|      0|	}
 2624|       |
 2625|    118|	for (i = 0; i < unpack_streams; i++) {
  ------------------
  |  Branch (2625:14): [True: 106, False: 12]
  ------------------
 2626|    106|		ss->digestsDefined[i] = 0;
 2627|    106|		ss->digests[i] = 0;
 2628|    106|	}
 2629|       |
 2630|     12|	numDigests = 0;
 2631|     24|	for (i = 0; i < numFolders; i++) {
  ------------------
  |  Branch (2631:14): [True: 12, False: 12]
  ------------------
 2632|     12|		if (f[i].numUnpackStreams != 1 || !f[i].digest_defined)
  ------------------
  |  Branch (2632:7): [True: 1, False: 11]
  |  Branch (2632:37): [True: 11, False: 0]
  ------------------
 2633|     12|			numDigests += (uint32_t)f[i].numUnpackStreams;
 2634|     12|	}
 2635|       |
 2636|     12|	if (type == kCRC) {
  ------------------
  |  |  131|     12|#define kCRC			0x0A
  ------------------
  |  Branch (2636:6): [True: 11, False: 1]
  ------------------
 2637|     11|		struct _7z_digests tmpDigests;
 2638|     11|		unsigned char *digestsDefined = ss->digestsDefined;
 2639|     11|		uint32_t * digests = ss->digests;
 2640|     11|		int di = 0;
 2641|       |
 2642|     11|		memset(&tmpDigests, 0, sizeof(tmpDigests));
 2643|     11|		if (read_Digests(a, &(tmpDigests), numDigests) < 0) {
  ------------------
  |  Branch (2643:7): [True: 0, False: 11]
  ------------------
 2644|      0|			free_Digest(&tmpDigests);
 2645|      0|			return (-1);
 2646|      0|		}
 2647|     22|		for (i = 0; i < numFolders; i++) {
  ------------------
  |  Branch (2647:15): [True: 11, False: 11]
  ------------------
 2648|     11|			if (f[i].numUnpackStreams == 1 && f[i].digest_defined) {
  ------------------
  |  Branch (2648:8): [True: 11, False: 0]
  |  Branch (2648:38): [True: 0, False: 11]
  ------------------
 2649|      0|				*digestsDefined++ = 1;
 2650|      0|				*digests++ = f[i].digest;
 2651|     11|			} else {
 2652|     11|				unsigned j;
 2653|       |
 2654|     22|				for (j = 0; j < f[i].numUnpackStreams;
  ------------------
  |  Branch (2654:17): [True: 11, False: 11]
  ------------------
 2655|     11|				    j++, di++) {
 2656|     11|					*digestsDefined++ =
 2657|     11|					    tmpDigests.defineds[di];
 2658|     11|					*digests++ =
 2659|     11|					    tmpDigests.digests[di];
 2660|     11|				}
 2661|     11|			}
 2662|     11|		}
 2663|     11|		free_Digest(&tmpDigests);
 2664|     11|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2664:7): [True: 0, False: 11]
  ------------------
 2665|      0|			return (-1);
 2666|     11|		type = *p;
 2667|     11|	}
 2668|       |
 2669|       |	/*
 2670|       |	 *  Must be kEnd.
 2671|       |	 */
 2672|     12|	if (type != kEnd)
  ------------------
  |  |  121|     12|#define kEnd			0x00
  ------------------
  |  Branch (2672:6): [True: 0, False: 12]
  ------------------
 2673|      0|		return (-1);
 2674|     12|	return (0);
 2675|     12|}
archive_read_support_format_7zip.c:folder_uncompressed_size:
 2520|     86|{
 2521|     86|	int n = (int)f->numOutStreams;
 2522|     86|	unsigned pairs = (unsigned)f->numBindPairs;
 2523|       |
 2524|     86|	while (--n >= 0) {
  ------------------
  |  Branch (2524:9): [True: 86, False: 0]
  ------------------
 2525|     86|		unsigned i;
 2526|     86|		for (i = 0; i < pairs; i++) {
  ------------------
  |  Branch (2526:15): [True: 0, False: 86]
  ------------------
 2527|      0|			if (f->bindPairs[i].outIndex == (uint64_t)n)
  ------------------
  |  Branch (2527:8): [True: 0, False: 0]
  ------------------
 2528|      0|				break;
 2529|      0|		}
 2530|     86|		if (i >= pairs)
  ------------------
  |  Branch (2530:7): [True: 86, False: 0]
  ------------------
 2531|     86|			return (f->unPackSize[n]);
 2532|     86|	}
 2533|      0|	return (0);
 2534|     86|}
archive_read_support_format_7zip.c:read_consume:
 1240|  67.0k|{
 1241|  67.0k|	struct _7zip *zip = (struct _7zip *)a->format->data;
 1242|       |
 1243|  67.0k|	if (zip->pack_stream_bytes_unconsumed) {
  ------------------
  |  Branch (1243:6): [True: 67.0k, False: 0]
  ------------------
 1244|  67.0k|		__archive_read_consume(a, zip->pack_stream_bytes_unconsumed);
 1245|  67.0k|		zip->stream_offset += zip->pack_stream_bytes_unconsumed;
 1246|  67.0k|		zip->pack_stream_bytes_unconsumed = 0;
 1247|  67.0k|	}
 1248|  67.0k|}
archive_read_support_format_7zip.c:setup_decode_folder:
 3785|     73|{
 3786|     73|	struct _7zip *zip = (struct _7zip *)a->format->data;
 3787|     73|	const struct _7z_coder *coder1, *coder2;
 3788|     73|	const char *cname = (header)?"archive header":"file content";
  ------------------
  |  Branch (3788:22): [True: 64, False: 9]
  ------------------
 3789|     73|	unsigned i;
 3790|     73|	int r, found_bcj2 = 0;
 3791|       |
 3792|       |	/*
 3793|       |	 * Release the memory which the previous folder used for BCJ2.
 3794|       |	 */
 3795|    292|	for (i = 0; i < 3; i++) {
  ------------------
  |  Branch (3795:14): [True: 219, False: 73]
  ------------------
 3796|    219|		free(zip->sub_stream_buff[i]);
 3797|    219|		zip->sub_stream_buff[i] = NULL;
 3798|    219|	}
 3799|       |
 3800|       |	/*
 3801|       |	 * Check coder types before modifying any stream-reader state, so that
 3802|       |	 * an early return leaves zip unchanged (avoids partially-initialized
 3803|       |	 * state that callers would have to reason about).
 3804|       |	 */
 3805|    146|	for (i = 0; i < folder->numCoders; i++) {
  ------------------
  |  Branch (3805:14): [True: 73, False: 73]
  ------------------
 3806|     73|		switch(folder->coders[i].codec) {
  ------------------
  |  Branch (3806:10): [True: 0, False: 73]
  ------------------
 3807|      0|			case _7Z_CRYPTO_MAIN_ZIP:
  ------------------
  |  |  101|      0|#define _7Z_CRYPTO_MAIN_ZIP			0x06F10101 /* Main Zip crypto algo */
  ------------------
  |  Branch (3807:4): [True: 0, False: 73]
  ------------------
 3808|      0|			case _7Z_CRYPTO_RAR_29:
  ------------------
  |  |  102|      0|#define _7Z_CRYPTO_RAR_29			0x06F10303 /* Rar29 AES-128 + (modified SHA-1) */
  ------------------
  |  Branch (3808:4): [True: 0, False: 73]
  ------------------
 3809|      0|			case _7Z_CRYPTO_AES_256_SHA_256: {
  ------------------
  |  |  103|      0|#define _7Z_CRYPTO_AES_256_SHA_256	0x06F10701 /* AES-256 + SHA-256 */
  ------------------
  |  Branch (3809:4): [True: 0, False: 73]
  ------------------
 3810|       |				/* For entry that is associated with this folder, mark
 3811|       |				   it as encrypted (data+metadata). */
 3812|      0|				zip->has_encrypted_entries = 1;
 3813|      0|				if (a->entry) {
  ------------------
  |  Branch (3813:9): [True: 0, False: 0]
  ------------------
 3814|      0|					archive_entry_set_is_data_encrypted(a->entry, 1);
 3815|      0|					archive_entry_set_is_metadata_encrypted(a->entry, 1);
 3816|      0|				}
 3817|      0|				archive_set_error(&(a->archive),
 3818|      0|					ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3819|      0|					"The %s is encrypted, "
 3820|      0|					"but currently not supported", cname);
 3821|      0|				return (header ? ARCHIVE_FATAL : ARCHIVE_FAILED);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
              				return (header ? ARCHIVE_FATAL : ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (3821:13): [True: 0, False: 0]
  ------------------
 3822|      0|			}
 3823|      0|			case _7Z_X86_BCJ2: {
  ------------------
  |  |  107|      0|#define _7Z_X86_BCJ2	0x0303011B
  ------------------
  |  Branch (3823:4): [True: 0, False: 73]
  ------------------
 3824|      0|				found_bcj2++;
 3825|      0|				break;
 3826|      0|			}
 3827|     73|		}
 3828|     73|	}
 3829|       |	/* Now that we've checked for encryption, if there were still no
 3830|       |	 * encrypted entries found we can say for sure that there are none.
 3831|       |	 */
 3832|     73|	if (zip->has_encrypted_entries == ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW) {
  ------------------
  |  |  411|     73|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  |  Branch (3832:6): [True: 0, False: 73]
  ------------------
 3833|      0|		zip->has_encrypted_entries = 0;
 3834|      0|	}
 3835|       |
 3836|     73|	if ((folder->numCoders > 2 && !found_bcj2) || found_bcj2 > 1) {
  ------------------
  |  Branch (3836:7): [True: 0, False: 73]
  |  Branch (3836:32): [True: 0, False: 0]
  |  Branch (3836:48): [True: 0, False: 73]
  ------------------
 3837|      0|		archive_set_error(&(a->archive),
 3838|      0|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3839|      0|		    "The %s is encoded with many filters, "
 3840|      0|		    "but currently not supported", cname);
 3841|      0|		return (header ? ARCHIVE_FATAL : ARCHIVE_FAILED);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
              		return (header ? ARCHIVE_FATAL : ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (3841:11): [True: 0, False: 0]
  ------------------
 3842|      0|	}
 3843|       |
 3844|       |	/*
 3845|       |	 * Initialize a stream reader.
 3846|       |	 */
 3847|     73|	zip->pack_stream_remaining = (unsigned)folder->numPackedStreams;
 3848|     73|	zip->pack_stream_index = (unsigned)folder->packIndex;
 3849|     73|	zip->folder_outbytes_remaining = folder_uncompressed_size(folder);
 3850|     73|	zip->uncompressed_buffer_bytes_remaining = 0;
 3851|     73|	coder1 = &(folder->coders[0]);
 3852|     73|	if (folder->numCoders == 2)
  ------------------
  |  Branch (3852:6): [True: 0, False: 73]
  ------------------
 3853|      0|		coder2 = &(folder->coders[1]);
 3854|     73|	else
 3855|     73|		coder2 = NULL;
 3856|       |
 3857|     73|	if (found_bcj2) {
  ------------------
  |  Branch (3857:6): [True: 0, False: 73]
  ------------------
 3858|       |		/*
 3859|       |		 * Preparation to decode BCJ2.
 3860|       |		 * Decoding BCJ2 requires four sources. Those are at least,
 3861|       |		 * as far as I know, two types of the storage form.
 3862|       |		 */
 3863|      0|		const struct _7z_coder *fc = folder->coders;
 3864|      0|		static const struct _7z_coder coder_copy = {0, 1, 1, 0, NULL};
 3865|      0|		const struct _7z_coder *scoder[3] =
 3866|      0|			{&coder_copy, &coder_copy, &coder_copy};
 3867|      0|		const void *buff;
 3868|      0|		ssize_t bytes;
 3869|      0|		unsigned char *b[3] = {NULL, NULL, NULL};
 3870|      0|		uint64_t sunpack[3] ={-1, -1, -1};
 3871|      0|		uint64_t remaining;
 3872|      0|		size_t s[3] = {0, 0, 0};
 3873|      0|		int idx[3] = {0, 1, 2};
 3874|       |
 3875|      0|		if (folder->numCoders == 4 && fc[3].codec == _7Z_X86_BCJ2 &&
  ------------------
  |  |  107|      0|#define _7Z_X86_BCJ2	0x0303011B
  ------------------
  |  Branch (3875:7): [True: 0, False: 0]
  |  Branch (3875:33): [True: 0, False: 0]
  ------------------
 3876|      0|		    folder->numInStreams == 7 && folder->numOutStreams == 4 &&
  ------------------
  |  Branch (3876:7): [True: 0, False: 0]
  |  Branch (3876:36): [True: 0, False: 0]
  ------------------
 3877|      0|		    zip->pack_stream_remaining == 4) {
  ------------------
  |  Branch (3877:7): [True: 0, False: 0]
  ------------------
 3878|       |			/* Source type 1 made by 7zr or 7z with -m options. */
 3879|      0|			if (folder->bindPairs[0].inIndex == 5) {
  ------------------
  |  Branch (3879:8): [True: 0, False: 0]
  ------------------
 3880|       |				/* The form made by 7zr */
 3881|      0|				idx[0] = 1; idx[1] = 2; idx[2] = 0;
 3882|      0|				scoder[1] = &(fc[1]);
 3883|      0|				scoder[2] = &(fc[0]);
 3884|      0|				sunpack[1] = folder->unPackSize[1];
 3885|      0|				sunpack[2] = folder->unPackSize[0];
 3886|      0|				coder1 = &(fc[2]);
 3887|      0|			} else {
 3888|       |				/*
 3889|       |				 * NOTE: Some patterns do not work.
 3890|       |				 * work:
 3891|       |				 *  7z a -m0=BCJ2 -m1=COPY -m2=COPY
 3892|       |				 *       -m3=(any)
 3893|       |				 *  7z a -m0=BCJ2 -m1=COPY -m2=(any)
 3894|       |				 *       -m3=COPY
 3895|       |				 *  7z a -m0=BCJ2 -m1=(any) -m2=COPY
 3896|       |				 *       -m3=COPY
 3897|       |				 * not work:
 3898|       |				 *  other patterns.
 3899|       |				 *
 3900|       |				 * We have to handle this like `pipe' or
 3901|       |				 * our libarchive7s filter frame work,
 3902|       |				 * decoding the BCJ2 main stream sequentially,
 3903|       |				 * m3 -> m2 -> m1 -> BCJ2.
 3904|       |				 *
 3905|       |				 */
 3906|      0|				if (fc[0].codec == _7Z_COPY &&
  ------------------
  |  |   94|      0|#define _7Z_COPY	0
  ------------------
  |  Branch (3906:9): [True: 0, False: 0]
  ------------------
 3907|      0|				    fc[1].codec == _7Z_COPY)
  ------------------
  |  |   94|      0|#define _7Z_COPY	0
  ------------------
  |  Branch (3907:9): [True: 0, False: 0]
  ------------------
 3908|      0|					coder1 = &(folder->coders[2]);
 3909|      0|				else if (fc[0].codec == _7Z_COPY &&
  ------------------
  |  |   94|      0|#define _7Z_COPY	0
  ------------------
  |  Branch (3909:14): [True: 0, False: 0]
  ------------------
 3910|      0|				    fc[2].codec == _7Z_COPY)
  ------------------
  |  |   94|      0|#define _7Z_COPY	0
  ------------------
  |  Branch (3910:9): [True: 0, False: 0]
  ------------------
 3911|      0|					coder1 = &(folder->coders[1]);
 3912|      0|				else if (fc[1].codec == _7Z_COPY &&
  ------------------
  |  |   94|      0|#define _7Z_COPY	0
  ------------------
  |  Branch (3912:14): [True: 0, False: 0]
  ------------------
 3913|      0|				    fc[2].codec == _7Z_COPY)
  ------------------
  |  |   94|      0|#define _7Z_COPY	0
  ------------------
  |  Branch (3913:9): [True: 0, False: 0]
  ------------------
 3914|      0|					coder1 = &(folder->coders[0]);
 3915|      0|				else {
 3916|      0|					archive_set_error(&(a->archive),
 3917|      0|					    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3918|      0|					    "Unsupported form of "
 3919|      0|					    "BCJ2 streams");
 3920|      0|					return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3921|      0|				}
 3922|      0|			}
 3923|      0|			coder2 = &(fc[3]);
 3924|      0|			zip->main_stream_bytes_remaining =
 3925|      0|				(size_t)folder->unPackSize[2];
 3926|      0|			remaining = folder->unPackSize[2];
 3927|      0|		} else if (coder2 != NULL && coder2->codec == _7Z_X86_BCJ2 &&
  ------------------
  |  |  107|      0|#define _7Z_X86_BCJ2	0x0303011B
  ------------------
  |  Branch (3927:14): [True: 0, False: 0]
  |  Branch (3927:32): [True: 0, False: 0]
  ------------------
 3928|      0|		    zip->pack_stream_remaining == 4 &&
  ------------------
  |  Branch (3928:7): [True: 0, False: 0]
  ------------------
 3929|      0|		    folder->numInStreams == 5 && folder->numOutStreams == 2) {
  ------------------
  |  Branch (3929:7): [True: 0, False: 0]
  |  Branch (3929:36): [True: 0, False: 0]
  ------------------
 3930|       |			/* Source type 0 made by 7z */
 3931|      0|			zip->main_stream_bytes_remaining =
 3932|      0|				(size_t)folder->unPackSize[0];
 3933|      0|			remaining = folder->unPackSize[0];
 3934|      0|		} else {
 3935|       |			/* We got an unexpected form. */
 3936|      0|			archive_set_error(&(a->archive),
 3937|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3938|      0|			    "Unsupported form of BCJ2 streams");
 3939|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3940|      0|		}
 3941|      0|		if (remaining > SIZE_MAX) {
  ------------------
  |  Branch (3941:7): [True: 0, False: 0]
  ------------------
 3942|      0|			archive_set_error(&(a->archive),
 3943|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3944|      0|			    "7-Zip sub-stream size exceeds "
 3945|      0|			    "platform maximum");
 3946|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3947|      0|		}
 3948|      0|		zip->main_stream_bytes_remaining = remaining;
 3949|       |
 3950|       |
 3951|       |		/* Skip the main stream at this time. */
 3952|      0|		if ((r = seek_pack(a)) < 0)
  ------------------
  |  Branch (3952:7): [True: 0, False: 0]
  ------------------
 3953|      0|			return (r);
 3954|      0|		zip->pack_stream_bytes_unconsumed =
 3955|      0|		    (size_t)zip->pack_stream_inbytes_remaining;
 3956|      0|		read_consume(a);
 3957|       |
 3958|       |		/* Read following three sub streams. */
 3959|      0|		for (i = 0; i < 3; i++) {
  ------------------
  |  Branch (3959:15): [True: 0, False: 0]
  ------------------
 3960|      0|			const struct _7z_coder *coder = scoder[i];
 3961|       |
 3962|      0|			if ((r = seek_pack(a)) < 0) {
  ------------------
  |  Branch (3962:8): [True: 0, False: 0]
  ------------------
 3963|      0|				free(b[0]); free(b[1]); free(b[2]);
 3964|      0|				return (r);
 3965|      0|			}
 3966|       |
 3967|      0|			if (sunpack[i] == (uint64_t)-1)
  ------------------
  |  Branch (3967:8): [True: 0, False: 0]
  ------------------
 3968|      0|				zip->folder_outbytes_remaining =
 3969|      0|				    zip->pack_stream_inbytes_remaining;
 3970|      0|			else
 3971|      0|				zip->folder_outbytes_remaining = sunpack[i];
 3972|       |
 3973|      0|			r = init_decompression(a, zip, coder, NULL);
 3974|      0|			if (r != ARCHIVE_OK) {
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3974:8): [True: 0, False: 0]
  ------------------
 3975|      0|				free(b[0]); free(b[1]); free(b[2]);
 3976|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3977|      0|			}
 3978|       |
 3979|       |			/* Allocate memory for the decoded data of a sub
 3980|       |			 * stream. */
 3981|      0|			if (zip->folder_outbytes_remaining > SIZE_MAX) {
  ------------------
  |  Branch (3981:8): [True: 0, False: 0]
  ------------------
 3982|      0|				free(b[0]); free(b[1]); free(b[2]);
 3983|      0|				archive_set_error(&a->archive,
 3984|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3985|      0|				    "7-Zip sub-stream size exceeds "
 3986|      0|				    "platform maximum");
 3987|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3988|      0|			}
 3989|      0|			b[i] = malloc((size_t)zip->folder_outbytes_remaining);
 3990|      0|			if (b[i] == NULL) {
  ------------------
  |  Branch (3990:8): [True: 0, False: 0]
  ------------------
 3991|      0|				free(b[0]); free(b[1]); free(b[2]);
 3992|      0|				archive_set_error(&a->archive, ENOMEM,
 3993|      0|				    "No memory for 7-Zip decompression");
 3994|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3995|      0|			}
 3996|       |
 3997|       |			/* Extract a sub stream. */
 3998|      0|			while (zip->pack_stream_inbytes_remaining > 0) {
  ------------------
  |  Branch (3998:11): [True: 0, False: 0]
  ------------------
 3999|      0|				r = (int)extract_pack_stream(a, 0);
 4000|      0|				if (r < 0) {
  ------------------
  |  Branch (4000:9): [True: 0, False: 0]
  ------------------
 4001|      0|					free(b[0]); free(b[1]); free(b[2]);
 4002|      0|					return (r);
 4003|      0|				}
 4004|      0|				bytes = get_uncompressed_data(a, &buff,
 4005|      0|				    zip->uncompressed_buffer_bytes_remaining,
 4006|      0|				    0);
 4007|      0|				if (bytes < 0) {
  ------------------
  |  Branch (4007:9): [True: 0, False: 0]
  ------------------
 4008|      0|					free(b[0]); free(b[1]); free(b[2]);
 4009|      0|					return ((int)bytes);
 4010|      0|				}
 4011|      0|				memcpy(b[i]+s[i], buff, bytes);
 4012|      0|				s[i] += bytes;
 4013|      0|				if (zip->pack_stream_bytes_unconsumed)
  ------------------
  |  Branch (4013:9): [True: 0, False: 0]
  ------------------
 4014|      0|					read_consume(a);
 4015|      0|			}
 4016|      0|		}
 4017|       |
 4018|       |		/* Set the sub streams to the right place. */
 4019|      0|		for (i = 0; i < 3; i++) {
  ------------------
  |  Branch (4019:15): [True: 0, False: 0]
  ------------------
 4020|      0|			zip->sub_stream_buff[i] = b[idx[i]];
 4021|      0|			zip->sub_stream_size[i] = s[idx[i]];
 4022|      0|			zip->sub_stream_bytes_remaining[i] = s[idx[i]];
 4023|      0|		}
 4024|       |
 4025|       |		/* Allocate memory used for decoded main stream bytes. */
 4026|      0|		if (zip->tmp_stream_buff == NULL) {
  ------------------
  |  Branch (4026:7): [True: 0, False: 0]
  ------------------
 4027|      0|			zip->tmp_stream_buff_size = 32 * 1024;
 4028|      0|			zip->tmp_stream_buff =
 4029|      0|			    malloc(zip->tmp_stream_buff_size);
 4030|      0|			if (zip->tmp_stream_buff == NULL) {
  ------------------
  |  Branch (4030:8): [True: 0, False: 0]
  ------------------
 4031|      0|				archive_set_error(&a->archive, ENOMEM,
 4032|      0|				    "No memory for 7-Zip decompression");
 4033|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4034|      0|			}
 4035|      0|		}
 4036|      0|		zip->tmp_stream_bytes_avail = 0;
 4037|      0|		zip->tmp_stream_bytes_remaining = 0;
 4038|      0|		zip->odd_bcj_size = 0;
 4039|      0|		zip->bcj2_outPos = 0;
 4040|       |
 4041|       |		/*
 4042|       |		 * Reset a stream reader in order to read the main stream
 4043|       |		 * of BCJ2.
 4044|       |		 */
 4045|      0|		zip->pack_stream_remaining = 1;
 4046|      0|		zip->pack_stream_index = (unsigned)folder->packIndex;
 4047|      0|		zip->folder_outbytes_remaining =
 4048|      0|		    folder_uncompressed_size(folder);
 4049|      0|		zip->uncompressed_buffer_bytes_remaining = 0;
 4050|      0|	}
 4051|       |
 4052|       |	/*
 4053|       |	 * Initialize the decompressor for the new folder's pack streams.
 4054|       |	 */
 4055|     73|	r = init_decompression(a, zip, coder1, coder2);
 4056|     73|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|     73|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4056:6): [True: 0, False: 73]
  ------------------
 4057|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4058|     73|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     73|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4059|     73|}
archive_read_support_format_7zip.c:init_decompression:
 1355|     73|{
 1356|     73|	int r;
 1357|       |
 1358|     73|	zip->codec = coder1->codec;
 1359|     73|	zip->codec2 = -1;
 1360|       |
 1361|     73|	switch (zip->codec) {
 1362|      9|	case _7Z_COPY:
  ------------------
  |  |   94|      9|#define _7Z_COPY	0
  ------------------
  |  Branch (1362:2): [True: 9, False: 64]
  ------------------
 1363|      9|	case _7Z_BZ2:
  ------------------
  |  |   98|      9|#define _7Z_BZ2		0x040202
  ------------------
  |  Branch (1363:2): [True: 0, False: 73]
  ------------------
 1364|      9|	case _7Z_DEFLATE:
  ------------------
  |  |   97|      9|#define _7Z_DEFLATE	0x040108
  ------------------
  |  Branch (1364:2): [True: 0, False: 73]
  ------------------
 1365|      9|	case _7Z_ZSTD:
  ------------------
  |  |  116|      9|#define _7Z_ZSTD	0x4F71101 /* Copied from https://github.com/mcmilk/7-Zip-zstd.git */
  ------------------
  |  Branch (1365:2): [True: 0, False: 73]
  ------------------
 1366|     73|	case _7Z_PPMD:
  ------------------
  |  |   99|     73|#define _7Z_PPMD	0x030401
  ------------------
  |  Branch (1366:2): [True: 64, False: 9]
  ------------------
 1367|     73|		if (coder2 != NULL) {
  ------------------
  |  Branch (1367:7): [True: 0, False: 73]
  ------------------
 1368|      0|			if (coder2->codec != _7Z_X86 &&
  ------------------
  |  |  106|      0|#define _7Z_X86		0x03030103
  ------------------
  |  Branch (1368:8): [True: 0, False: 0]
  ------------------
 1369|      0|			    coder2->codec != _7Z_X86_BCJ2 &&
  ------------------
  |  |  107|      0|#define _7Z_X86_BCJ2	0x0303011B
  ------------------
  |  Branch (1369:8): [True: 0, False: 0]
  ------------------
 1370|      0|			    coder2->codec != _7Z_ARM &&
  ------------------
  |  |  110|      0|#define _7Z_ARM		0x03030501
  ------------------
  |  Branch (1370:8): [True: 0, False: 0]
  ------------------
 1371|      0|			    coder2->codec != _7Z_ARM64 &&
  ------------------
  |  |  112|      0|#define _7Z_ARM64	0xa
  ------------------
  |  Branch (1371:8): [True: 0, False: 0]
  ------------------
 1372|      0|			    coder2->codec != _7Z_POWERPC &&
  ------------------
  |  |  108|      0|#define _7Z_POWERPC	0x03030205
  ------------------
  |  Branch (1372:8): [True: 0, False: 0]
  ------------------
 1373|      0|			    coder2->codec != _7Z_SPARC) {
  ------------------
  |  |  114|      0|#define _7Z_SPARC	0x03030805
  ------------------
  |  Branch (1373:8): [True: 0, False: 0]
  ------------------
 1374|      0|				archive_set_error(&a->archive,
 1375|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1376|      0|				    "Unsupported filter %jx for %jx",
 1377|      0|				    (uintmax_t)coder2->codec,
 1378|      0|				    (uintmax_t)coder1->codec);
 1379|      0|				return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1380|      0|			}
 1381|      0|			zip->codec2 = coder2->codec;
 1382|      0|			zip->bcj_state = 0;
 1383|      0|			if (coder2->codec == _7Z_X86)
  ------------------
  |  |  106|      0|#define _7Z_X86		0x03030103
  ------------------
  |  Branch (1383:8): [True: 0, False: 0]
  ------------------
 1384|      0|				x86_Init(zip);
 1385|      0|			else if (coder2->codec == _7Z_ARM)
  ------------------
  |  |  110|      0|#define _7Z_ARM		0x03030501
  ------------------
  |  Branch (1385:13): [True: 0, False: 0]
  ------------------
 1386|      0|				arm_Init(zip);
 1387|      0|		}
 1388|     73|		break;
 1389|     73|	default:
  ------------------
  |  Branch (1389:2): [True: 0, False: 73]
  ------------------
 1390|      0|		break;
 1391|     73|	}
 1392|       |
 1393|     73|	switch (zip->codec) {
 1394|      9|	case _7Z_COPY:
  ------------------
  |  |   94|      9|#define _7Z_COPY	0
  ------------------
  |  Branch (1394:2): [True: 9, False: 64]
  ------------------
 1395|      9|		break;
 1396|       |
 1397|      0|	case _7Z_LZMA: case _7Z_LZMA2:
  ------------------
  |  |   95|      0|#define _7Z_LZMA	0x030101
  ------------------
              	case _7Z_LZMA: case _7Z_LZMA2:
  ------------------
  |  |   96|      0|#define _7Z_LZMA2	0x21
  ------------------
  |  Branch (1397:2): [True: 0, False: 73]
  |  Branch (1397:17): [True: 0, False: 73]
  ------------------
 1398|      0|#ifdef HAVE_LZMA_H
 1399|      0|#if LZMA_VERSION_MAJOR >= 5
 1400|       |/* Effectively disable the limiter. */
 1401|      0|#define LZMA_MEMLIMIT   UINT64_MAX
 1402|       |#else
 1403|       |/* NOTE: This needs to check memory size which running system has. */
 1404|       |#define LZMA_MEMLIMIT   (1U << 30)
 1405|       |#endif
 1406|      0|	{
 1407|      0|		lzma_options_delta delta_opt;
 1408|      0|		lzma_filter filters[LZMA_FILTERS_MAX], *ff;
 1409|      0|		int fi = 0;
 1410|       |
 1411|      0|		if (zip->lzstream_valid) {
  ------------------
  |  Branch (1411:7): [True: 0, False: 0]
  ------------------
 1412|      0|			lzma_end(&(zip->lzstream));
 1413|      0|			zip->lzstream_valid = 0;
 1414|      0|		}
 1415|       |
 1416|       |		/*
 1417|       |		 * NOTE: liblzma incompletely handle the BCJ+LZMA compressed
 1418|       |		 * data made by 7-Zip because 7-Zip does not add End-Of-
 1419|       |		 * Payload Marker(EOPM) at the end of LZMA compressed data,
 1420|       |		 * and so liblzma cannot know the end of the compressed data
 1421|       |		 * without EOPM. So consequently liblzma will not return last
 1422|       |		 * three or four bytes of uncompressed data because
 1423|       |		 * LZMA_FILTER_X86 filter does not handle input data if its
 1424|       |		 * data size is less than five bytes. If liblzma detect EOPM
 1425|       |		 * or know the uncompressed data size, liblzma will flush out
 1426|       |		 * the remaining that three or four bytes of uncompressed
 1427|       |		 * data. That is why we have to use our converting program
 1428|       |		 * for BCJ+LZMA. If we were able to tell the uncompressed
 1429|       |		 * size to liblzma when using lzma_raw_decoder() liblzma
 1430|       |		 * could correctly deal with BCJ+LZMA. But unfortunately
 1431|       |		 * there is no way to do that.
 1432|       |		 *
 1433|       |		 * Reference: https://web.archive.org/web/20240405171610/https://www.mail-archive.com/xz-devel@tukaani.org/msg00373.html
 1434|       |		 */
 1435|      0|		if (coder2 != NULL) {
  ------------------
  |  Branch (1435:7): [True: 0, False: 0]
  ------------------
 1436|      0|			zip->codec2 = coder2->codec;
 1437|       |
 1438|      0|			filters[fi].options = NULL;
 1439|      0|			switch (zip->codec2) {
 1440|      0|			case _7Z_X86:
  ------------------
  |  |  106|      0|#define _7Z_X86		0x03030103
  ------------------
  |  Branch (1440:4): [True: 0, False: 0]
  ------------------
 1441|      0|				if (zip->codec == _7Z_LZMA2) {
  ------------------
  |  |   96|      0|#define _7Z_LZMA2	0x21
  ------------------
  |  Branch (1441:9): [True: 0, False: 0]
  ------------------
 1442|      0|					filters[fi].id = LZMA_FILTER_X86;
 1443|      0|					fi++;
 1444|      0|				} else
 1445|       |					/* Use our filter. */
 1446|      0|					x86_Init(zip);
 1447|      0|				break;
 1448|      0|			case _7Z_X86_BCJ2:
  ------------------
  |  |  107|      0|#define _7Z_X86_BCJ2	0x0303011B
  ------------------
  |  Branch (1448:4): [True: 0, False: 0]
  ------------------
 1449|       |				/* Use our filter. */
 1450|      0|				zip->bcj_state = 0;
 1451|      0|				break;
 1452|      0|			case _7Z_DELTA:
  ------------------
  |  |  100|      0|#define _7Z_DELTA	0x03
  ------------------
  |  Branch (1452:4): [True: 0, False: 0]
  ------------------
 1453|      0|				if (coder2->propertiesSize != 1) {
  ------------------
  |  Branch (1453:9): [True: 0, False: 0]
  ------------------
 1454|      0|					archive_set_error(&a->archive,
 1455|      0|					    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1456|      0|					    "Invalid Delta parameter");
 1457|      0|					return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1458|      0|				}
 1459|      0|				filters[fi].id = LZMA_FILTER_DELTA;
 1460|      0|				memset(&delta_opt, 0, sizeof(delta_opt));
 1461|      0|				delta_opt.type = LZMA_DELTA_TYPE_BYTE;
 1462|      0|				delta_opt.dist =
 1463|      0|				    (uint32_t)coder2->properties[0] + 1;
 1464|      0|				filters[fi].options = &delta_opt;
 1465|      0|				fi++;
 1466|      0|				break;
 1467|       |			/* Following filters have not been tested yet. */
 1468|      0|			case _7Z_POWERPC:
  ------------------
  |  |  108|      0|#define _7Z_POWERPC	0x03030205
  ------------------
  |  Branch (1468:4): [True: 0, False: 0]
  ------------------
 1469|      0|				filters[fi].id = LZMA_FILTER_POWERPC;
 1470|      0|				fi++;
 1471|      0|				break;
 1472|      0|			case _7Z_IA64:
  ------------------
  |  |  109|      0|#define _7Z_IA64	0x03030401
  ------------------
  |  Branch (1472:4): [True: 0, False: 0]
  ------------------
 1473|      0|				filters[fi].id = LZMA_FILTER_IA64;
 1474|      0|				fi++;
 1475|      0|				break;
 1476|      0|			case _7Z_ARM:
  ------------------
  |  |  110|      0|#define _7Z_ARM		0x03030501
  ------------------
  |  Branch (1476:4): [True: 0, False: 0]
  ------------------
 1477|      0|				filters[fi].id = LZMA_FILTER_ARM;
 1478|      0|				fi++;
 1479|      0|				break;
 1480|      0|			case _7Z_ARMTHUMB:
  ------------------
  |  |  111|      0|#define _7Z_ARMTHUMB	0x03030701
  ------------------
  |  Branch (1480:4): [True: 0, False: 0]
  ------------------
 1481|      0|				filters[fi].id = LZMA_FILTER_ARMTHUMB;
 1482|      0|				fi++;
 1483|      0|				break;
 1484|       |#ifdef LZMA_FILTER_ARM64
 1485|       |			case _7Z_ARM64:
 1486|       |				filters[fi].id = LZMA_FILTER_ARM64;
 1487|       |				fi++;
 1488|       |				break;
 1489|       |#endif
 1490|       |#ifdef LZMA_FILTER_RISCV
 1491|       |			case _7Z_RISCV:
 1492|       |				filters[fi].id = LZMA_FILTER_RISCV;
 1493|       |				fi++;
 1494|       |				break;
 1495|       |#endif
 1496|      0|			case _7Z_SPARC:
  ------------------
  |  |  114|      0|#define _7Z_SPARC	0x03030805
  ------------------
  |  Branch (1496:4): [True: 0, False: 0]
  ------------------
 1497|      0|				filters[fi].id = LZMA_FILTER_SPARC;
 1498|      0|				fi++;
 1499|      0|				break;
 1500|      0|			default:
  ------------------
  |  Branch (1500:4): [True: 0, False: 0]
  ------------------
 1501|      0|				archive_set_error(&a->archive,
 1502|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1503|      0|				    "Unexpected codec ID: %lX", zip->codec2);
 1504|      0|				return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1505|      0|			}
 1506|      0|		}
 1507|       |
 1508|      0|		if (zip->codec == _7Z_LZMA2)
  ------------------
  |  |   96|      0|#define _7Z_LZMA2	0x21
  ------------------
  |  Branch (1508:7): [True: 0, False: 0]
  ------------------
 1509|      0|			filters[fi].id = LZMA_FILTER_LZMA2;
 1510|      0|		else
 1511|      0|			filters[fi].id = LZMA_FILTER_LZMA1;
 1512|      0|		filters[fi].options = NULL;
 1513|      0|		ff = &filters[fi];
 1514|      0|		r = lzma_properties_decode(&filters[fi], NULL,
 1515|      0|		    coder1->properties, (size_t)coder1->propertiesSize);
 1516|      0|		if (r != LZMA_OK) {
  ------------------
  |  Branch (1516:7): [True: 0, False: 0]
  ------------------
 1517|      0|			set_error(a, r);
 1518|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1519|      0|		}
 1520|      0|		fi++;
 1521|       |
 1522|      0|		filters[fi].id = LZMA_VLI_UNKNOWN;
 1523|      0|		filters[fi].options = NULL;
 1524|      0|		r = lzma_raw_decoder(&(zip->lzstream), filters);
 1525|      0|		free(ff->options);
 1526|      0|		if (r != LZMA_OK) {
  ------------------
  |  Branch (1526:7): [True: 0, False: 0]
  ------------------
 1527|      0|			set_error(a, r);
 1528|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1529|      0|		}
 1530|      0|		zip->lzstream_valid = 1;
 1531|      0|		zip->lzstream.total_in = 0;
 1532|      0|		zip->lzstream.total_out = 0;
 1533|      0|		break;
 1534|      0|	}
 1535|       |#else
 1536|       |		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
 1537|       |		    "LZMA codec is unsupported");
 1538|       |		return (ARCHIVE_FAILED);
 1539|       |#endif
 1540|      0|	case _7Z_BZ2:
  ------------------
  |  |   98|      0|#define _7Z_BZ2		0x040202
  ------------------
  |  Branch (1540:2): [True: 0, False: 73]
  ------------------
 1541|      0|#if defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR)
 1542|      0|		if (zip->bzstream_valid) {
  ------------------
  |  Branch (1542:7): [True: 0, False: 0]
  ------------------
 1543|      0|			BZ2_bzDecompressEnd(&(zip->bzstream));
 1544|      0|			zip->bzstream_valid = 0;
 1545|      0|		}
 1546|      0|		r = BZ2_bzDecompressInit(&(zip->bzstream), 0, 0);
 1547|      0|		if (r == BZ_MEM_ERROR)
  ------------------
  |  Branch (1547:7): [True: 0, False: 0]
  ------------------
 1548|      0|			r = BZ2_bzDecompressInit(&(zip->bzstream), 0, 1);
 1549|      0|		if (r != BZ_OK) {
  ------------------
  |  Branch (1549:7): [True: 0, False: 0]
  ------------------
 1550|      0|			int err = ARCHIVE_ERRNO_MISC;
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1551|      0|			const char *detail = NULL;
 1552|      0|			switch (r) {
  ------------------
  |  Branch (1552:12): [True: 0, False: 0]
  ------------------
 1553|      0|			case BZ_PARAM_ERROR:
  ------------------
  |  Branch (1553:4): [True: 0, False: 0]
  ------------------
 1554|      0|				detail = "invalid setup parameter";
 1555|      0|				break;
 1556|      0|			case BZ_MEM_ERROR:
  ------------------
  |  Branch (1556:4): [True: 0, False: 0]
  ------------------
 1557|      0|				err = ENOMEM;
 1558|      0|				detail = "out of memory";
 1559|      0|				break;
 1560|      0|			case BZ_CONFIG_ERROR:
  ------------------
  |  Branch (1560:4): [True: 0, False: 0]
  ------------------
 1561|      0|				detail = "mis-compiled library";
 1562|      0|				break;
 1563|      0|			}
 1564|      0|			archive_set_error(&a->archive, err,
 1565|      0|			    "Internal error initializing decompressor: %s",
 1566|      0|			    detail != NULL ? detail : "??");
  ------------------
  |  Branch (1566:8): [True: 0, False: 0]
  ------------------
 1567|      0|			zip->bzstream_valid = 0;
 1568|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1569|      0|		}
 1570|      0|		zip->bzstream_valid = 1;
 1571|      0|		zip->bzstream.total_in_lo32 = 0;
 1572|      0|		zip->bzstream.total_in_hi32 = 0;
 1573|      0|		zip->bzstream.total_out_lo32 = 0;
 1574|      0|		zip->bzstream.total_out_hi32 = 0;
 1575|      0|		break;
 1576|       |#else
 1577|       |		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
 1578|       |		    "BZ2 codec is unsupported");
 1579|       |		return (ARCHIVE_FAILED);
 1580|       |#endif
 1581|      0|	case _7Z_ZSTD:
  ------------------
  |  |  116|      0|#define _7Z_ZSTD	0x4F71101 /* Copied from https://github.com/mcmilk/7-Zip-zstd.git */
  ------------------
  |  Branch (1581:2): [True: 0, False: 73]
  ------------------
 1582|      0|	{
 1583|       |#if defined(HAVE_ZSTD_H)
 1584|       |		if (zip->zstdstream_valid) {
 1585|       |			ZSTD_freeDStream(zip->zstd_dstream);
 1586|       |			zip->zstdstream_valid = 0;
 1587|       |		}
 1588|       |		zip->zstd_dstream = ZSTD_createDStream();
 1589|       |		zip->zstdstream_valid = 1;
 1590|       |		break;
 1591|       |#else
 1592|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1593|      0|			"ZSTD codec is unsupported");
 1594|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1595|      0|#endif
 1596|      0|	}
 1597|      0|	case _7Z_DEFLATE:
  ------------------
  |  |   97|      0|#define _7Z_DEFLATE	0x040108
  ------------------
  |  Branch (1597:2): [True: 0, False: 73]
  ------------------
 1598|      0|#ifdef HAVE_ZLIB_H
 1599|      0|		if (zip->stream_valid)
  ------------------
  |  Branch (1599:7): [True: 0, False: 0]
  ------------------
 1600|      0|			r = inflateReset(&(zip->stream));
 1601|      0|		else
 1602|      0|			r = inflateInit2(&(zip->stream),
 1603|      0|			    -15 /* Don't check for zlib header */);
 1604|      0|		if (r != Z_OK) {
  ------------------
  |  Branch (1604:7): [True: 0, False: 0]
  ------------------
 1605|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1606|      0|			    "Couldn't initialize zlib stream");
 1607|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1608|      0|		}
 1609|      0|		zip->stream_valid = 1;
 1610|      0|		zip->stream.total_in = 0;
 1611|      0|		zip->stream.total_out = 0;
 1612|      0|		break;
 1613|       |#else
 1614|       |		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
 1615|       |		    "DEFLATE codec is unsupported");
 1616|       |		return (ARCHIVE_FAILED);
 1617|       |#endif
 1618|     64|	case _7Z_PPMD:
  ------------------
  |  |   99|     64|#define _7Z_PPMD	0x030401
  ------------------
  |  Branch (1618:2): [True: 64, False: 9]
  ------------------
 1619|     64|	{
 1620|     64|		unsigned order;
 1621|     64|		uint32_t msize;
 1622|       |
 1623|     64|		if (zip->ppmd7_valid) {
  ------------------
  |  Branch (1623:7): [True: 0, False: 64]
  ------------------
 1624|      0|			__archive_ppmd7_functions.Ppmd7_Free(
 1625|      0|			    &zip->ppmd7_context);
 1626|      0|			zip->ppmd7_valid = 0;
 1627|      0|		}
 1628|       |
 1629|     64|		if (coder1->propertiesSize < 5) {
  ------------------
  |  Branch (1629:7): [True: 0, False: 64]
  ------------------
 1630|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1631|      0|			    "Malformed PPMd parameter");
 1632|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1633|      0|		}
 1634|     64|		order = coder1->properties[0];
 1635|     64|		msize = archive_le32dec(&(coder1->properties[1]));
 1636|     64|		if (order < PPMD7_MIN_ORDER || order > PPMD7_MAX_ORDER ||
  ------------------
  |  |   18|    128|#define PPMD7_MIN_ORDER 2
  ------------------
              		if (order < PPMD7_MIN_ORDER || order > PPMD7_MAX_ORDER ||
  ------------------
  |  |   19|    128|#define PPMD7_MAX_ORDER 64
  ------------------
  |  Branch (1636:7): [True: 0, False: 64]
  |  Branch (1636:34): [True: 0, False: 64]
  ------------------
 1637|     64|		    msize < PPMD7_MIN_MEM_SIZE || msize > PPMD7_MAX_MEM_SIZE) {
  ------------------
  |  |   21|    128|#define PPMD7_MIN_MEM_SIZE (1 << 11)
  ------------------
              		    msize < PPMD7_MIN_MEM_SIZE || msize > PPMD7_MAX_MEM_SIZE) {
  ------------------
  |  |   22|     64|#define PPMD7_MAX_MEM_SIZE (0xFFFFFFFFu - 12 * 3)
  ------------------
  |  Branch (1637:7): [True: 0, False: 64]
  |  Branch (1637:37): [True: 0, False: 64]
  ------------------
 1638|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1639|      0|			    "Malformed PPMd parameter");
 1640|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1641|      0|		}
 1642|     64|		__archive_ppmd7_functions.Ppmd7_Construct(&zip->ppmd7_context);
 1643|     64|		r = __archive_ppmd7_functions.Ppmd7_Alloc(
 1644|     64|			&zip->ppmd7_context, msize);
 1645|     64|		if (r == 0) {
  ------------------
  |  Branch (1645:7): [True: 0, False: 64]
  ------------------
 1646|      0|			archive_set_error(&a->archive, ENOMEM,
 1647|      0|			    "Coludn't allocate memory for PPMd");
 1648|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1649|      0|		}
 1650|     64|		__archive_ppmd7_functions.Ppmd7_Init(
 1651|     64|			&zip->ppmd7_context, order);
 1652|     64|		__archive_ppmd7_functions.Ppmd7z_RangeDec_CreateVTable(
 1653|     64|			&zip->range_dec);
 1654|     64|		zip->ppmd7_valid = 1;
 1655|     64|		zip->ppmd7_stat = 0;
 1656|     64|		zip->ppstream.overconsumed = 0;
 1657|     64|		zip->ppstream.total_in = 0;
 1658|     64|		zip->ppstream.total_out = 0;
 1659|     64|		break;
 1660|     64|	}
 1661|      0|	case _7Z_X86:
  ------------------
  |  |  106|      0|#define _7Z_X86		0x03030103
  ------------------
  |  Branch (1661:2): [True: 0, False: 73]
  ------------------
 1662|      0|	case _7Z_X86_BCJ2:
  ------------------
  |  |  107|      0|#define _7Z_X86_BCJ2	0x0303011B
  ------------------
  |  Branch (1662:2): [True: 0, False: 73]
  ------------------
 1663|      0|	case _7Z_POWERPC:
  ------------------
  |  |  108|      0|#define _7Z_POWERPC	0x03030205
  ------------------
  |  Branch (1663:2): [True: 0, False: 73]
  ------------------
 1664|      0|	case _7Z_IA64:
  ------------------
  |  |  109|      0|#define _7Z_IA64	0x03030401
  ------------------
  |  Branch (1664:2): [True: 0, False: 73]
  ------------------
 1665|      0|	case _7Z_ARM:
  ------------------
  |  |  110|      0|#define _7Z_ARM		0x03030501
  ------------------
  |  Branch (1665:2): [True: 0, False: 73]
  ------------------
 1666|      0|	case _7Z_ARMTHUMB:
  ------------------
  |  |  111|      0|#define _7Z_ARMTHUMB	0x03030701
  ------------------
  |  Branch (1666:2): [True: 0, False: 73]
  ------------------
 1667|      0|	case _7Z_ARM64:
  ------------------
  |  |  112|      0|#define _7Z_ARM64	0xa
  ------------------
  |  Branch (1667:2): [True: 0, False: 73]
  ------------------
 1668|      0|	case _7Z_RISCV:
  ------------------
  |  |  113|      0|#define _7Z_RISCV	0xb
  ------------------
  |  Branch (1668:2): [True: 0, False: 73]
  ------------------
 1669|      0|	case _7Z_SPARC:
  ------------------
  |  |  114|      0|#define _7Z_SPARC	0x03030805
  ------------------
  |  Branch (1669:2): [True: 0, False: 73]
  ------------------
 1670|      0|	case _7Z_DELTA:
  ------------------
  |  |  100|      0|#define _7Z_DELTA	0x03
  ------------------
  |  Branch (1670:2): [True: 0, False: 73]
  ------------------
 1671|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1672|      0|		    "Unexpected codec ID: %lX", zip->codec);
 1673|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1674|      0|	case _7Z_CRYPTO_MAIN_ZIP:
  ------------------
  |  |  101|      0|#define _7Z_CRYPTO_MAIN_ZIP			0x06F10101 /* Main Zip crypto algo */
  ------------------
  |  Branch (1674:2): [True: 0, False: 73]
  ------------------
 1675|      0|	case _7Z_CRYPTO_RAR_29:
  ------------------
  |  |  102|      0|#define _7Z_CRYPTO_RAR_29			0x06F10303 /* Rar29 AES-128 + (modified SHA-1) */
  ------------------
  |  Branch (1675:2): [True: 0, False: 73]
  ------------------
 1676|      0|	case _7Z_CRYPTO_AES_256_SHA_256:
  ------------------
  |  |  103|      0|#define _7Z_CRYPTO_AES_256_SHA_256	0x06F10701 /* AES-256 + SHA-256 */
  ------------------
  |  Branch (1676:2): [True: 0, False: 73]
  ------------------
 1677|      0|		if (a->entry) {
  ------------------
  |  Branch (1677:7): [True: 0, False: 0]
  ------------------
 1678|      0|			archive_entry_set_is_metadata_encrypted(a->entry, 1);
 1679|      0|			archive_entry_set_is_data_encrypted(a->entry, 1);
 1680|      0|			zip->has_encrypted_entries = 1;
 1681|      0|		}
 1682|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1683|      0|		    "Crypto codec not supported yet (ID: 0x%lX)", zip->codec);
 1684|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1685|      0|	default:
  ------------------
  |  Branch (1685:2): [True: 0, False: 73]
  ------------------
 1686|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1687|      0|		    "Unknown codec ID: %lX", zip->codec);
 1688|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1689|     73|	}
 1690|       |
 1691|     73|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     73|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1692|     73|}
archive_read_support_format_7zip.c:seek_pack:
 3643|     73|{
 3644|     73|	struct _7zip *zip = (struct _7zip *)a->format->data;
 3645|     73|	int64_t pack_offset;
 3646|       |
 3647|     73|	if (zip->pack_stream_remaining <= 0) {
  ------------------
  |  Branch (3647:6): [True: 0, False: 73]
  ------------------
 3648|      0|		archive_set_error(&(a->archive),
 3649|      0|		    ARCHIVE_ERRNO_MISC, "Damaged 7-Zip archive");
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3650|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3651|      0|	}
 3652|     73|	zip->pack_stream_inbytes_remaining =
 3653|     73|	    zip->si.pi.sizes[zip->pack_stream_index];
 3654|     73|	pack_offset = zip->si.pi.positions[zip->pack_stream_index];
 3655|     73|	if (zip->stream_offset != pack_offset) {
  ------------------
  |  Branch (3655:6): [True: 73, False: 0]
  ------------------
 3656|     73|		if (0 > __archive_read_seek(a, pack_offset + zip->seek_base,
  ------------------
  |  Branch (3656:7): [True: 0, False: 73]
  ------------------
 3657|     73|		    SEEK_SET)) {
 3658|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Seek error");
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3659|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3660|      0|		}
 3661|     73|		zip->stream_offset = pack_offset;
 3662|     73|	}
 3663|     73|	zip->pack_stream_index++;
 3664|     73|	zip->pack_stream_remaining--;
 3665|     73|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     73|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3666|     73|}
archive_read_support_format_7zip.c:free_StreamsInfo:
 2679|  2.56k|{
 2680|  2.56k|	free_PackInfo(&(si->pi));
 2681|  2.56k|	free_CodersInfo(&(si->ci));
 2682|  2.56k|	free_SubStreamsInfo(&(si->ss));
 2683|  2.56k|}
archive_read_support_format_7zip.c:free_PackInfo:
 2157|  2.56k|{
 2158|  2.56k|	free(pi->sizes);
 2159|  2.56k|	free(pi->positions);
 2160|  2.56k|	free_Digest(&(pi->digest));
 2161|  2.56k|}
archive_read_support_format_7zip.c:free_CodersInfo:
 2403|  2.56k|{
 2404|  2.56k|	unsigned i;
 2405|       |
 2406|  2.56k|	if (ci->folders) {
  ------------------
  |  Branch (2406:6): [True: 87, False: 2.47k]
  ------------------
 2407|    174|		for (i = 0; i < ci->numFolders; i++)
  ------------------
  |  Branch (2407:15): [True: 87, False: 87]
  ------------------
 2408|     87|			free_Folder(&(ci->folders[i]));
 2409|     87|		free(ci->folders);
 2410|     87|	}
 2411|  2.56k|}
archive_read_support_format_7zip.c:free_Folder:
 2241|     87|{
 2242|     87|	unsigned i;
 2243|       |
 2244|     87|	if (f->coders) {
  ------------------
  |  Branch (2244:6): [True: 87, False: 0]
  ------------------
 2245|    178|		for (i = 0; i< f->numCoders; i++) {
  ------------------
  |  Branch (2245:15): [True: 91, False: 87]
  ------------------
 2246|     91|			free(f->coders[i].properties);
 2247|     91|		}
 2248|     87|		free(f->coders);
 2249|     87|	}
 2250|     87|	free(f->bindPairs);
 2251|     87|	free(f->packedStreams);
 2252|     87|	free(f->unPackSize);
 2253|     87|}
archive_read_support_format_7zip.c:free_SubStreamsInfo:
 2538|  2.56k|{
 2539|  2.56k|	free(ss->unpackSizes);
 2540|  2.56k|	free(ss->digestsDefined);
 2541|  2.56k|	free(ss->digests);
 2542|  2.56k|}
archive_read_support_format_7zip.c:read_Header:
 2773|    100|{
 2774|    100|	struct _7zip *zip = (struct _7zip *)a->format->data;
 2775|    100|	const unsigned char *p;
 2776|    100|	struct _7z_folder *folders;
 2777|    100|	struct _7z_stream_info *si = &(zip->si);
 2778|    100|	struct _7zip_entry *entries;
 2779|    100|	uint32_t folderIndex, indexInFolder;
 2780|    100|	unsigned i;
 2781|    100|	int eindex, empty_streams, sindex;
 2782|       |
 2783|    100|	if (check_header_id) {
  ------------------
  |  Branch (2783:6): [True: 64, False: 36]
  ------------------
 2784|       |		/*
 2785|       |		 * Read Header.
 2786|       |		 */
 2787|     64|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2787:7): [True: 64, False: 0]
  ------------------
 2788|     64|			return (-1);
 2789|      0|		if (*p != kHeader)
  ------------------
  |  |  122|      0|#define kHeader			0x01
  ------------------
  |  Branch (2789:7): [True: 0, False: 0]
  ------------------
 2790|      0|			return (-1);
 2791|      0|	}
 2792|       |
 2793|       |	/*
 2794|       |	 * Read ArchiveProperties.
 2795|       |	 */
 2796|     36|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2796:6): [True: 0, False: 36]
  ------------------
 2797|      0|		return (-1);
 2798|     36|	if (*p == kArchiveProperties) {
  ------------------
  |  |  123|     36|#define kArchiveProperties	0x02
  ------------------
  |  Branch (2798:6): [True: 0, False: 36]
  ------------------
 2799|      0|		for (;;) {
 2800|      0|			uint64_t size;
 2801|      0|			if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2801:8): [True: 0, False: 0]
  ------------------
 2802|      0|				return (-1);
 2803|      0|			if (*p == 0)
  ------------------
  |  Branch (2803:8): [True: 0, False: 0]
  ------------------
 2804|      0|				break;
 2805|      0|			if (parse_7zip_uint64(a, &size) < 0)
  ------------------
  |  Branch (2805:8): [True: 0, False: 0]
  ------------------
 2806|      0|				return (-1);
 2807|      0|		}
 2808|      0|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2808:7): [True: 0, False: 0]
  ------------------
 2809|      0|			return (-1);
 2810|      0|	}
 2811|       |
 2812|       |	/*
 2813|       |	 * Read MainStreamsInfo.
 2814|       |	 */
 2815|     36|	if (*p == kMainStreamsInfo) {
  ------------------
  |  |  125|     36|#define kMainStreamsInfo	0x04
  ------------------
  |  Branch (2815:6): [True: 24, False: 12]
  ------------------
 2816|     24|		if (read_StreamsInfo(a, &(zip->si)) < 0)
  ------------------
  |  Branch (2816:7): [True: 12, False: 12]
  ------------------
 2817|     12|			return (-1);
 2818|     12|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2818:7): [True: 0, False: 12]
  ------------------
 2819|      0|			return (-1);
 2820|     12|	}
 2821|     24|	if (*p == kEnd)
  ------------------
  |  |  121|     24|#define kEnd			0x00
  ------------------
  |  Branch (2821:6): [True: 0, False: 24]
  ------------------
 2822|      0|		return (0);
 2823|       |
 2824|       |	/*
 2825|       |	 * Read FilesInfo.
 2826|       |	 */
 2827|     24|	if (*p != kFilesInfo)
  ------------------
  |  |  126|     24|#define kFilesInfo		0x05
  ------------------
  |  Branch (2827:6): [True: 1, False: 23]
  ------------------
 2828|      1|		return (-1);
 2829|       |
 2830|     23|	if (parse_7zip_uint64(a, &(zip->numFiles)) < 0)
  ------------------
  |  Branch (2830:6): [True: 0, False: 23]
  ------------------
 2831|      0|		return (-1);
 2832|     23|	if (UMAX_ENTRY < zip->numFiles)
  ------------------
  |  |  400|     23|#define UMAX_ENTRY	ARCHIVE_LITERAL_ULL(100000000)
  |  |  ------------------
  |  |  |  |  180|     23|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  ------------------
  ------------------
  |  Branch (2832:6): [True: 0, False: 23]
  ------------------
 2833|      0|		return (-1);
 2834|       |	/* Empty-file entries (those beyond the known stream count) require a
 2835|       |	 * kEmptyStream bitmap of ceil(numFiles/8) bytes; reject if that cannot
 2836|       |	 * fit in the remaining header bytes. Non-empty files need no header
 2837|       |	 * space here because they map directly to already-parsed streams. */
 2838|     23|	if (zip->numFiles > (uint64_t)zip->si.ss.unpack_streams &&
  ------------------
  |  Branch (2838:6): [True: 13, False: 10]
  ------------------
 2839|     13|	    zip->numFiles - (uint64_t)zip->si.ss.unpack_streams >
  ------------------
  |  Branch (2839:6): [True: 0, False: 13]
  ------------------
 2840|     13|	    8 * zip->header_bytes_remaining)
 2841|      0|		return (-1);
 2842|       |
 2843|     23|	zip->entries = calloc((size_t)zip->numFiles, sizeof(*zip->entries));
 2844|     23|	if (zip->entries == NULL)
  ------------------
  |  Branch (2844:6): [True: 0, False: 23]
  ------------------
 2845|      0|		return (-1);
 2846|     23|	entries = zip->entries;
 2847|       |
 2848|     23|	empty_streams = 0;
 2849|  1.42k|	for (;;) {
 2850|  1.42k|		int type;
 2851|  1.42k|		uint64_t size;
 2852|  1.42k|		size_t ll;
 2853|       |
 2854|  1.42k|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2854:7): [True: 0, False: 1.42k]
  ------------------
 2855|      0|			return (-1);
 2856|  1.42k|		type = *p;
 2857|  1.42k|		if (type == kEnd)
  ------------------
  |  |  121|  1.42k|#define kEnd			0x00
  ------------------
  |  Branch (2857:7): [True: 20, False: 1.40k]
  ------------------
 2858|     20|			break;
 2859|       |
 2860|  1.40k|		if (parse_7zip_uint64(a, &size) < 0)
  ------------------
  |  Branch (2860:7): [True: 0, False: 1.40k]
  ------------------
 2861|      0|			return (-1);
 2862|  1.40k|		if (zip->header_bytes_remaining < size || size > SIZE_MAX / 4)
  ------------------
  |  Branch (2862:7): [True: 0, False: 1.40k]
  |  Branch (2862:45): [True: 0, False: 1.40k]
  ------------------
 2863|      0|			return (-1);
 2864|  1.40k|		ll = (size_t)size;
 2865|       |
 2866|  1.40k|		switch (type) {
 2867|     11|		case kEmptyStream:
  ------------------
  |  |  135|     11|#define kEmptyStream		0x0E
  ------------------
  |  Branch (2867:3): [True: 11, False: 1.39k]
  ------------------
 2868|     11|			if (h->emptyStreamBools != NULL)
  ------------------
  |  Branch (2868:8): [True: 0, False: 11]
  ------------------
 2869|      0|				return (-1);
 2870|     11|			h->emptyStreamBools = calloc((size_t)zip->numFiles,
 2871|     11|			    sizeof(*h->emptyStreamBools));
 2872|     11|			if (h->emptyStreamBools == NULL)
  ------------------
  |  Branch (2872:8): [True: 0, False: 11]
  ------------------
 2873|      0|				return (-1);
 2874|     11|			if (read_Bools(
  ------------------
  |  Branch (2874:8): [True: 0, False: 11]
  ------------------
 2875|     11|			    a, h->emptyStreamBools, (size_t)zip->numFiles) < 0)
 2876|      0|				return (-1);
 2877|     11|			empty_streams = 0;
 2878|  1.03k|			for (i = 0; i < zip->numFiles; i++) {
  ------------------
  |  Branch (2878:16): [True: 1.02k, False: 11]
  ------------------
 2879|  1.02k|				if (h->emptyStreamBools[i])
  ------------------
  |  Branch (2879:9): [True: 1.00k, False: 23]
  ------------------
 2880|  1.00k|					empty_streams++;
 2881|  1.02k|			}
 2882|     11|			break;
 2883|    385|		case kEmptyFile:
  ------------------
  |  |  136|    385|#define kEmptyFile		0x0F
  ------------------
  |  Branch (2883:3): [True: 385, False: 1.02k]
  ------------------
 2884|    385|			if (empty_streams <= 0) {
  ------------------
  |  Branch (2884:8): [True: 385, False: 0]
  ------------------
 2885|       |				/* Unexcepted sequence. Skip this. */
 2886|    385|				if (header_bytes(a, ll) == NULL)
  ------------------
  |  Branch (2886:9): [True: 0, False: 385]
  ------------------
 2887|      0|					return (-1);
 2888|    385|				break;
 2889|    385|			}
 2890|      0|			if (h->emptyFileBools != NULL)
  ------------------
  |  Branch (2890:8): [True: 0, False: 0]
  ------------------
 2891|      0|				return (-1);
 2892|      0|			h->emptyFileBools = calloc(empty_streams,
 2893|      0|			    sizeof(*h->emptyFileBools));
 2894|      0|			if (h->emptyFileBools == NULL)
  ------------------
  |  Branch (2894:8): [True: 0, False: 0]
  ------------------
 2895|      0|				return (-1);
 2896|      0|			if (read_Bools(a, h->emptyFileBools, empty_streams) < 0)
  ------------------
  |  Branch (2896:8): [True: 0, False: 0]
  ------------------
 2897|      0|				return (-1);
 2898|      0|			break;
 2899|      0|		case kAnti:
  ------------------
  |  |  137|      0|#define kAnti			0x10
  ------------------
  |  Branch (2899:3): [True: 0, False: 1.40k]
  ------------------
 2900|      0|			if (empty_streams <= 0) {
  ------------------
  |  Branch (2900:8): [True: 0, False: 0]
  ------------------
 2901|       |				/* Unexcepted sequence. Skip this. */
 2902|      0|				if (header_bytes(a, ll) == NULL)
  ------------------
  |  Branch (2902:9): [True: 0, False: 0]
  ------------------
 2903|      0|					return (-1);
 2904|      0|				break;
 2905|      0|			}
 2906|      0|			if (h->antiBools != NULL)
  ------------------
  |  Branch (2906:8): [True: 0, False: 0]
  ------------------
 2907|      0|				return (-1);
 2908|      0|			h->antiBools = calloc(empty_streams,
 2909|      0|			    sizeof(*h->antiBools));
 2910|      0|			if (h->antiBools == NULL)
  ------------------
  |  Branch (2910:8): [True: 0, False: 0]
  ------------------
 2911|      0|				return (-1);
 2912|      0|			if (read_Bools(a, h->antiBools, empty_streams) < 0)
  ------------------
  |  Branch (2912:8): [True: 0, False: 0]
  ------------------
 2913|      0|				return (-1);
 2914|      0|			break;
 2915|      3|		case kCTime:
  ------------------
  |  |  139|      3|#define kCTime			0x12
  ------------------
  |  Branch (2915:3): [True: 3, False: 1.40k]
  ------------------
 2916|    789|		case kATime:
  ------------------
  |  |  140|    789|#define kATime			0x13
  ------------------
  |  Branch (2916:3): [True: 786, False: 623]
  ------------------
 2917|    789|		case kMTime:
  ------------------
  |  |  141|    789|#define kMTime			0x14
  ------------------
  |  Branch (2917:3): [True: 0, False: 1.40k]
  ------------------
 2918|    789|			if (read_Times(a, h, type) < 0)
  ------------------
  |  Branch (2918:8): [True: 2, False: 787]
  ------------------
 2919|      2|				return (-1);
 2920|    787|			break;
 2921|    787|		case kName:
  ------------------
  |  |  138|     14|#define kName			0x11
  ------------------
  |  Branch (2921:3): [True: 14, False: 1.39k]
  ------------------
 2922|     14|		{
 2923|     14|			unsigned char *np;
 2924|     14|			size_t nl, nb;
 2925|       |
 2926|       |			/* Skip one byte. */
 2927|     14|			if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2927:8): [True: 0, False: 14]
  ------------------
 2928|      0|				return (-1);
 2929|     14|			ll--;
 2930|       |
 2931|     14|			if ((ll & 1) || ll < zip->numFiles * 4)
  ------------------
  |  Branch (2931:8): [True: 0, False: 14]
  |  Branch (2931:20): [True: 0, False: 14]
  ------------------
 2932|      0|				return (-1);
 2933|       |
 2934|     14|			if (zip->entry_names != NULL)
  ------------------
  |  Branch (2934:8): [True: 0, False: 14]
  ------------------
 2935|      0|				return (-1);
 2936|     14|			zip->entry_names = malloc(ll);
 2937|     14|			if (zip->entry_names == NULL)
  ------------------
  |  Branch (2937:8): [True: 0, False: 14]
  ------------------
 2938|      0|				return (-1);
 2939|     14|			np = zip->entry_names;
 2940|     14|			nb = ll;
 2941|       |			/*
 2942|       |			 * Copy whole file names.
 2943|       |			 * NOTE: This loop prevents from expanding
 2944|       |			 * the uncompressed buffer in order not to
 2945|       |			 * use extra memory resource.
 2946|       |			 */
 2947|     28|			while (nb) {
  ------------------
  |  Branch (2947:11): [True: 14, False: 14]
  ------------------
 2948|     14|				size_t b;
 2949|     14|				if (nb > UBUFF_SIZE)
  ------------------
  |  |  296|     14|#define UBUFF_SIZE	(64 * 1024)
  ------------------
  |  Branch (2949:9): [True: 0, False: 14]
  ------------------
 2950|      0|					b = UBUFF_SIZE;
  ------------------
  |  |  296|      0|#define UBUFF_SIZE	(64 * 1024)
  ------------------
 2951|     14|				else
 2952|     14|					b = nb;
 2953|     14|				if ((p = header_bytes(a, b)) == NULL)
  ------------------
  |  Branch (2953:9): [True: 0, False: 14]
  ------------------
 2954|      0|					return (-1);
 2955|     14|				memcpy(np, p, b);
 2956|     14|				np += b;
 2957|     14|				nb -= b;
 2958|     14|			}
 2959|     14|			np = zip->entry_names;
 2960|     14|			nl = ll;
 2961|       |
 2962|  1.00k|			for (i = 0; i < zip->numFiles; i++) {
  ------------------
  |  Branch (2962:16): [True: 994, False: 14]
  ------------------
 2963|    994|				entries[i].utf16name = np;
 2964|       |#if defined(_WIN32) && !defined(__CYGWIN__) && defined(_DEBUG)
 2965|       |				entries[i].wname = (wchar_t *)np;
 2966|       |#endif
 2967|       |
 2968|       |				/* Find a terminator. */
 2969|  38.7k|				while (nl >= 2 && (np[0] || np[1])) {
  ------------------
  |  Branch (2969:12): [True: 38.7k, False: 0]
  |  Branch (2969:24): [True: 37.1k, False: 1.63k]
  |  Branch (2969:33): [True: 640, False: 994]
  ------------------
 2970|  37.7k|					np += 2;
 2971|  37.7k|					nl -= 2;
 2972|  37.7k|				}
 2973|    994|				if (nl < 2)
  ------------------
  |  Branch (2973:9): [True: 0, False: 994]
  ------------------
 2974|      0|					return (-1);/* Terminator not found */
 2975|    994|				entries[i].name_len = np - entries[i].utf16name;
 2976|    994|				np += 2;
 2977|    994|				nl -= 2;
 2978|    994|			}
 2979|     14|			break;
 2980|     14|		}
 2981|     14|		case kAttributes:
  ------------------
  |  |  142|      1|#define kAttributes		0x15
  ------------------
  |  Branch (2981:3): [True: 1, False: 1.40k]
  ------------------
 2982|      1|		{
 2983|      1|			int allAreDefined;
 2984|       |
 2985|      1|			if ((p = header_bytes(a, 2)) == NULL)
  ------------------
  |  Branch (2985:8): [True: 0, False: 1]
  ------------------
 2986|      0|				return (-1);
 2987|      1|			allAreDefined = *p;
 2988|      1|			if (h->attrBools != NULL)
  ------------------
  |  Branch (2988:8): [True: 0, False: 1]
  ------------------
 2989|      0|				return (-1);
 2990|      1|			h->attrBools = calloc((size_t)zip->numFiles,
 2991|      1|			    sizeof(*h->attrBools));
 2992|      1|			if (h->attrBools == NULL)
  ------------------
  |  Branch (2992:8): [True: 0, False: 1]
  ------------------
 2993|      0|				return (-1);
 2994|      1|			if (allAreDefined)
  ------------------
  |  Branch (2994:8): [True: 1, False: 0]
  ------------------
 2995|      1|				memset(h->attrBools, 1, (size_t)zip->numFiles);
 2996|      0|			else {
 2997|      0|				if (read_Bools(a, h->attrBools,
  ------------------
  |  Branch (2997:9): [True: 0, False: 0]
  ------------------
 2998|      0|				      (size_t)zip->numFiles) < 0)
 2999|      0|					return (-1);
 3000|      0|			}
 3001|     20|			for (i = 0; i < zip->numFiles; i++) {
  ------------------
  |  Branch (3001:16): [True: 19, False: 1]
  ------------------
 3002|     19|				if (h->attrBools[i]) {
  ------------------
  |  Branch (3002:9): [True: 19, False: 0]
  ------------------
 3003|     19|					if ((p = header_bytes(a, 4)) == NULL)
  ------------------
  |  Branch (3003:10): [True: 0, False: 19]
  ------------------
 3004|      0|						return (-1);
 3005|     19|					entries[i].attr = archive_le32dec(p);
 3006|     19|				}
 3007|     19|			}
 3008|      1|			break;
 3009|      1|		}
 3010|    138|		case kDummy:
  ------------------
  |  |  144|    138|#define kDummy			0x19
  ------------------
  |  Branch (3010:3): [True: 138, False: 1.27k]
  ------------------
 3011|    138|			if (ll == 0)
  ------------------
  |  Branch (3011:8): [True: 0, False: 138]
  ------------------
 3012|      0|				break;
 3013|    138|			__LA_FALLTHROUGH;
 3014|    209|		default:
  ------------------
  |  Branch (3014:3): [True: 71, False: 1.33k]
  ------------------
 3015|    209|			if (header_bytes(a, ll) == NULL)
  ------------------
  |  Branch (3015:8): [True: 1, False: 208]
  ------------------
 3016|      1|				return (-1);
 3017|    208|			break;
 3018|  1.40k|		}
 3019|  1.40k|	}
 3020|       |
 3021|       |	/*
 3022|       |	 * Set up entry's attributes.
 3023|       |	 */
 3024|     20|	folders = si->ci.folders;
 3025|     20|	eindex = sindex = 0;
 3026|     20|	folderIndex = indexInFolder = 0;
 3027|  1.05k|	for (i = 0; i < zip->numFiles; i++) {
  ------------------
  |  Branch (3027:14): [True: 1.03k, False: 19]
  ------------------
 3028|  1.03k|		if (h->emptyStreamBools == NULL || h->emptyStreamBools[i] == 0)
  ------------------
  |  Branch (3028:7): [True: 9, False: 1.02k]
  |  Branch (3028:38): [True: 23, False: 1.00k]
  ------------------
 3029|     32|			entries[i].flg |= HAS_STREAM;
  ------------------
  |  |  252|     32|#define HAS_STREAM	(1<<4)
  ------------------
 3030|       |		/* The high 16 bits of attributes is a posix file mode. */
 3031|  1.03k|		entries[i].mode = entries[i].attr >> 16;
 3032|       |
 3033|  1.03k|		if (!(entries[i].attr & FILE_ATTRIBUTE_UNIX_EXTENSION)) {
  ------------------
  |  |  168|  1.03k|#define FILE_ATTRIBUTE_UNIX_EXTENSION 0x8000
  ------------------
  |  Branch (3033:7): [True: 1.03k, False: 0]
  ------------------
 3034|       |			// Only windows permissions specified for this entry. Translate to
 3035|       |			// reasonable corresponding unix permissions.
 3036|       |
 3037|  1.03k|			if (entries[i].attr & FILE_ATTRIBUTE_DIRECTORY) {
  ------------------
  |  |  161|  1.03k|#define FILE_ATTRIBUTE_DIRECTORY 0x00000010
  ------------------
  |  Branch (3037:8): [True: 0, False: 1.03k]
  ------------------
 3038|      0|				if (entries[i].attr & FILE_ATTRIBUTE_READONLY) {
  ------------------
  |  |  149|      0|#define FILE_ATTRIBUTE_READONLY 0x00000001
  ------------------
  |  Branch (3038:9): [True: 0, False: 0]
  ------------------
 3039|       |					// Read-only directory.
 3040|      0|					entries[i].mode = AE_IFDIR | 0555;
  ------------------
  |  |  221|      0|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 3041|      0|				} else {
 3042|       |					// Read-write directory.
 3043|      0|					entries[i].mode = AE_IFDIR | 0755;
  ------------------
  |  |  221|      0|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 3044|      0|				}
 3045|  1.03k|			} else if (entries[i].attr & FILE_ATTRIBUTE_READONLY) {
  ------------------
  |  |  149|  1.03k|#define FILE_ATTRIBUTE_READONLY 0x00000001
  ------------------
  |  Branch (3045:15): [True: 0, False: 1.03k]
  ------------------
 3046|       |				// Readonly file.
 3047|      0|				entries[i].mode = AE_IFREG | 0444;
  ------------------
  |  |  216|      0|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 3048|  1.03k|			} else {
 3049|       |				// Assume read-write file.
 3050|  1.03k|				entries[i].mode = AE_IFREG | 0644;
  ------------------
  |  |  216|  1.03k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 3051|  1.03k|			}
 3052|  1.03k|		}
 3053|       |
 3054|  1.03k|		if (entries[i].flg & HAS_STREAM) {
  ------------------
  |  |  252|  1.03k|#define HAS_STREAM	(1<<4)
  ------------------
  |  Branch (3054:7): [True: 32, False: 1.00k]
  ------------------
 3055|     32|			if ((size_t)sindex >= si->ss.unpack_streams)
  ------------------
  |  Branch (3055:8): [True: 1, False: 31]
  ------------------
 3056|      1|				return (-1);
 3057|     31|			if (entries[i].mode == 0)
  ------------------
  |  Branch (3057:8): [True: 0, False: 31]
  ------------------
 3058|      0|				entries[i].mode = AE_IFREG | 0666;
  ------------------
  |  |  216|      0|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 3059|     31|			if (si->ss.digestsDefined[sindex])
  ------------------
  |  Branch (3059:8): [True: 8, False: 23]
  ------------------
 3060|      8|				entries[i].flg |= CRC32_IS_SET;
  ------------------
  |  |  251|      8|#define CRC32_IS_SET	(1<<3)
  ------------------
 3061|     31|			entries[i].ssIndex = sindex;
 3062|     31|			sindex++;
 3063|  1.00k|		} else {
 3064|  1.00k|			int dir;
 3065|  1.00k|			if (h->emptyFileBools == NULL)
  ------------------
  |  Branch (3065:8): [True: 1.00k, False: 0]
  ------------------
 3066|  1.00k|				dir = 1;
 3067|      0|			else {
 3068|      0|				if (h->emptyFileBools[eindex])
  ------------------
  |  Branch (3068:9): [True: 0, False: 0]
  ------------------
 3069|      0|					dir = 0;
 3070|      0|				else
 3071|      0|					dir = 1;
 3072|      0|				eindex++;
 3073|      0|			}
 3074|  1.00k|			if (entries[i].mode == 0) {
  ------------------
  |  Branch (3074:8): [True: 0, False: 1.00k]
  ------------------
 3075|      0|				if (dir)
  ------------------
  |  Branch (3075:9): [True: 0, False: 0]
  ------------------
 3076|      0|					entries[i].mode = AE_IFDIR | 0777;
  ------------------
  |  |  221|      0|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 3077|      0|				else
 3078|      0|					entries[i].mode = AE_IFREG | 0666;
  ------------------
  |  |  216|      0|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 3079|  1.00k|			} else if (dir &&
  ------------------
  |  Branch (3079:15): [True: 1.00k, False: 0]
  ------------------
 3080|  1.00k|			    (entries[i].mode & AE_IFMT) != AE_IFDIR) {
  ------------------
  |  |  215|  1.00k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              			    (entries[i].mode & AE_IFMT) != AE_IFDIR) {
  ------------------
  |  |  221|  1.00k|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (3080:8): [True: 1.00k, False: 0]
  ------------------
 3081|  1.00k|				entries[i].mode &= ~AE_IFMT;
  ------------------
  |  |  215|  1.00k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
 3082|  1.00k|				entries[i].mode |= AE_IFDIR;
  ------------------
  |  |  221|  1.00k|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 3083|  1.00k|			}
 3084|  1.00k|			if ((entries[i].mode & AE_IFMT) == AE_IFDIR &&
  ------------------
  |  |  215|  1.00k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              			if ((entries[i].mode & AE_IFMT) == AE_IFDIR &&
  ------------------
  |  |  221|  2.00k|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (3084:8): [True: 1.00k, False: 0]
  ------------------
 3085|  1.00k|			    entries[i].name_len >= 2 &&
  ------------------
  |  Branch (3085:8): [True: 453, False: 551]
  ------------------
 3086|    453|			    (entries[i].utf16name[entries[i].name_len-2] != '/' ||
  ------------------
  |  Branch (3086:9): [True: 451, False: 2]
  ------------------
 3087|    451|			     entries[i].utf16name[entries[i].name_len-1] != 0)) {
  ------------------
  |  Branch (3087:9): [True: 0, False: 2]
  ------------------
 3088|    451|				entries[i].utf16name[entries[i].name_len] = '/';
 3089|    451|				entries[i].utf16name[entries[i].name_len+1] = 0;
 3090|    451|				entries[i].name_len += 2;
 3091|    451|			}
 3092|  1.00k|			entries[i].ssIndex = -1;
 3093|  1.00k|		}
 3094|  1.03k|		if (entries[i].attr & FILE_ATTRIBUTE_READONLY)
  ------------------
  |  |  149|  1.03k|#define FILE_ATTRIBUTE_READONLY 0x00000001
  ------------------
  |  Branch (3094:7): [True: 0, False: 1.03k]
  ------------------
 3095|      0|			entries[i].mode &= ~0222;/* Read only. */
 3096|       |
 3097|  1.03k|		if ((entries[i].flg & HAS_STREAM) == 0 && indexInFolder == 0) {
  ------------------
  |  |  252|  1.03k|#define HAS_STREAM	(1<<4)
  ------------------
  |  Branch (3097:7): [True: 1.00k, False: 31]
  |  Branch (3097:45): [True: 990, False: 14]
  ------------------
 3098|       |			/*
 3099|       |			 * The entry is an empty file or a directory file,
 3100|       |			 * those both have no contents.
 3101|       |			 */
 3102|    990|			entries[i].folderIndex = -1;
 3103|    990|			continue;
 3104|    990|		}
 3105|     45|		if (indexInFolder == 0) {
  ------------------
  |  Branch (3105:7): [True: 9, False: 36]
  ------------------
 3106|      9|			for (;;) {
 3107|      9|				if (folderIndex >= si->ci.numFolders)
  ------------------
  |  Branch (3107:9): [True: 0, False: 9]
  ------------------
 3108|      0|					return (-1);
 3109|      9|				if (folders[folderIndex].numUnpackStreams)
  ------------------
  |  Branch (3109:9): [True: 9, False: 0]
  ------------------
 3110|      9|					break;
 3111|      0|				folderIndex++;
 3112|      0|			}
 3113|      9|		}
 3114|     45|		entries[i].folderIndex = folderIndex;
 3115|     45|		if ((entries[i].flg & HAS_STREAM) == 0)
  ------------------
  |  |  252|     45|#define HAS_STREAM	(1<<4)
  ------------------
  |  Branch (3115:7): [True: 14, False: 31]
  ------------------
 3116|     14|			continue;
 3117|     31|		indexInFolder++;
 3118|     31|		if (indexInFolder >= folders[folderIndex].numUnpackStreams) {
  ------------------
  |  Branch (3118:7): [True: 8, False: 23]
  ------------------
 3119|      8|			folderIndex++;
 3120|      8|			indexInFolder = 0;
 3121|      8|		}
 3122|     31|	}
 3123|       |
 3124|     19|	return (0);
 3125|     20|}
archive_read_support_format_7zip.c:read_Times:
 3129|    789|{
 3130|    789|	struct _7zip *zip = (struct _7zip *)a->format->data;
 3131|    789|	const unsigned char *p;
 3132|    789|	struct _7zip_entry *entries = zip->entries;
 3133|    789|	unsigned char *timeBools;
 3134|    789|	int allAreDefined;
 3135|    789|	unsigned i;
 3136|       |
 3137|    789|	timeBools = calloc((size_t)zip->numFiles, sizeof(*timeBools));
 3138|    789|	if (timeBools == NULL)
  ------------------
  |  Branch (3138:6): [True: 0, False: 789]
  ------------------
 3139|      0|		return (-1);
 3140|       |
 3141|       |	/* Read allAreDefined. */
 3142|    789|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (3142:6): [True: 0, False: 789]
  ------------------
 3143|      0|		goto failed;
 3144|    789|	allAreDefined = *p;
 3145|    789|	if (allAreDefined)
  ------------------
  |  Branch (3145:6): [True: 768, False: 21]
  ------------------
 3146|    768|		memset(timeBools, 1, (size_t)zip->numFiles);
 3147|     21|	else {
 3148|     21|		if (read_Bools(a, timeBools, (size_t)zip->numFiles) < 0)
  ------------------
  |  Branch (3148:7): [True: 0, False: 21]
  ------------------
 3149|      0|			goto failed;
 3150|     21|	}
 3151|       |
 3152|       |	/* Read external. */
 3153|    789|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (3153:6): [True: 0, False: 789]
  ------------------
 3154|      0|		goto failed;
 3155|    789|	if (*p) {
  ------------------
  |  Branch (3155:6): [True: 769, False: 20]
  ------------------
 3156|    769|		if (parse_7zip_uint64(a, &(h->dataIndex)) < 0)
  ------------------
  |  Branch (3156:7): [True: 1, False: 768]
  ------------------
 3157|      1|			goto failed;
 3158|    768|		if (UMAX_ENTRY < h->dataIndex)
  ------------------
  |  |  400|    768|#define UMAX_ENTRY	ARCHIVE_LITERAL_ULL(100000000)
  |  |  ------------------
  |  |  |  |  180|    768|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  ------------------
  ------------------
  |  Branch (3158:7): [True: 0, False: 768]
  ------------------
 3159|      0|			goto failed;
 3160|    768|	}
 3161|       |
 3162|  3.38k|	for (i = 0; i < zip->numFiles; i++) {
  ------------------
  |  Branch (3162:14): [True: 2.59k, False: 787]
  ------------------
 3163|  2.59k|		if (!timeBools[i])
  ------------------
  |  Branch (3163:7): [True: 109, False: 2.48k]
  ------------------
 3164|    109|			continue;
 3165|  2.48k|		if ((p = header_bytes(a, 8)) == NULL)
  ------------------
  |  Branch (3165:7): [True: 1, False: 2.48k]
  ------------------
 3166|      1|			goto failed;
 3167|  2.48k|		switch (type) {
  ------------------
  |  Branch (3167:11): [True: 2.48k, False: 0]
  ------------------
 3168|     12|		case kCTime:
  ------------------
  |  |  139|     12|#define kCTime			0x12
  ------------------
  |  Branch (3168:3): [True: 12, False: 2.47k]
  ------------------
 3169|     12|			ntfs_to_unix(archive_le64dec(p),
 3170|     12|			    &(entries[i].ctime),
 3171|     12|			    &(entries[i].ctime_ns));
 3172|     12|			entries[i].flg |= CTIME_IS_SET;
  ------------------
  |  |  250|     12|#define CTIME_IS_SET	(1<<2)
  ------------------
 3173|     12|			break;
 3174|  2.47k|		case kATime:
  ------------------
  |  |  140|  2.47k|#define kATime			0x13
  ------------------
  |  Branch (3174:3): [True: 2.47k, False: 12]
  ------------------
 3175|  2.47k|			ntfs_to_unix(archive_le64dec(p),
 3176|  2.47k|			    &(entries[i].atime),
 3177|  2.47k|			    &(entries[i].atime_ns));
 3178|  2.47k|			entries[i].flg |= ATIME_IS_SET;
  ------------------
  |  |  249|  2.47k|#define ATIME_IS_SET	(1<<1)
  ------------------
 3179|  2.47k|			break;
 3180|      0|		case kMTime:
  ------------------
  |  |  141|      0|#define kMTime			0x14
  ------------------
  |  Branch (3180:3): [True: 0, False: 2.48k]
  ------------------
 3181|      0|			ntfs_to_unix(archive_le64dec(p),
 3182|      0|			    &(entries[i].mtime),
 3183|      0|			    &(entries[i].mtime_ns));
 3184|      0|			entries[i].flg |= MTIME_IS_SET;
  ------------------
  |  |  248|      0|#define MTIME_IS_SET	(1<<0)
  ------------------
 3185|      0|			break;
 3186|  2.48k|		}
 3187|  2.48k|	}
 3188|       |
 3189|    787|	free(timeBools);
 3190|    787|	return (0);
 3191|      2|failed:
 3192|      2|	free(timeBools);
 3193|      2|	return (-1);
 3194|    788|}
archive_read_support_format_7zip.c:free_Header:
 2763|    107|{
 2764|    107|	free(h->emptyStreamBools);
 2765|    107|	free(h->emptyFileBools);
 2766|    107|	free(h->antiBools);
 2767|    107|	free(h->attrBools);
 2768|    107|}
archive_read_support_format_7zip.c:archive_read_format_7zip_read_data:
 1121|  1.03k|{
 1122|  1.03k|	struct _7zip *zip;
 1123|  1.03k|	ssize_t bytes;
 1124|  1.03k|	int ret = ARCHIVE_OK;
  ------------------
  |  |  233|  1.03k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1125|       |
 1126|  1.03k|	zip = (struct _7zip *)(a->format->data);
 1127|       |
 1128|  1.03k|	if (zip->has_encrypted_entries == ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW) {
  ------------------
  |  |  411|  1.03k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  |  Branch (1128:6): [True: 0, False: 1.03k]
  ------------------
 1129|      0|		zip->has_encrypted_entries = 0;
 1130|      0|	}
 1131|       |
 1132|  1.03k|	if (zip->pack_stream_bytes_unconsumed)
  ------------------
  |  Branch (1132:6): [True: 1, False: 1.03k]
  ------------------
 1133|      1|		read_consume(a);
 1134|       |
 1135|  1.03k|	*offset = zip->entry_offset;
 1136|  1.03k|	*size = 0;
 1137|  1.03k|	*buff = NULL;
 1138|       |	/*
 1139|       |	 * If we hit end-of-entry last time, clean up and return
 1140|       |	 * ARCHIVE_EOF this time.
 1141|       |	 */
 1142|  1.03k|	if (zip->end_of_entry)
  ------------------
  |  Branch (1142:6): [True: 1.02k, False: 9]
  ------------------
 1143|  1.02k|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|  1.02k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1144|       |
 1145|      9|	size_t bytes_to_read = 16 * 1024 * 1024;  // Don't try to read more than 16 MB at a time
 1146|      9|	if ((uint64_t)bytes_to_read > zip->entry_bytes_remaining) {
  ------------------
  |  Branch (1146:6): [True: 9, False: 0]
  ------------------
 1147|      9|		bytes_to_read = (size_t)zip->entry_bytes_remaining;
 1148|      9|	}
 1149|      9|	bytes = read_stream(a, buff, bytes_to_read, 0);
 1150|      9|	if (bytes < 0)
  ------------------
  |  Branch (1150:6): [True: 0, False: 9]
  ------------------
 1151|      0|		return ((int)bytes);
 1152|      9|	if (bytes == 0) {
  ------------------
  |  Branch (1152:6): [True: 4, False: 5]
  ------------------
 1153|      4|		archive_set_error(&a->archive,
 1154|      4|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      4|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1155|      4|		    "Truncated 7-Zip file body");
 1156|      4|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1157|      4|	}
 1158|      5|	zip->entry_bytes_remaining -= bytes;
 1159|      5|	if (zip->entry_bytes_remaining == 0)
  ------------------
  |  Branch (1159:6): [True: 5, False: 0]
  ------------------
 1160|      5|		zip->end_of_entry = 1;
 1161|       |
 1162|       |	/* Update checksum */
 1163|      5|	if ((zip->entry->flg & CRC32_IS_SET) && bytes)
  ------------------
  |  |  251|      5|#define CRC32_IS_SET	(1<<3)
  ------------------
  |  Branch (1163:6): [True: 4, False: 1]
  |  Branch (1163:42): [True: 4, False: 0]
  ------------------
 1164|      4|		zip->entry_crc32 = crc32(zip->entry_crc32, *buff,
 1165|      4|		    (unsigned)bytes);
 1166|       |
 1167|       |	/* If we hit the end, swallow any end-of-data marker. */
 1168|      5|	if (zip->end_of_entry) {
  ------------------
  |  Branch (1168:6): [True: 5, False: 0]
  ------------------
 1169|       |		/* Check computed CRC against file contents. */
 1170|      5|		if ((zip->entry->flg & CRC32_IS_SET) &&
  ------------------
  |  |  251|      5|#define CRC32_IS_SET	(1<<3)
  ------------------
  |  Branch (1170:7): [True: 4, False: 1]
  ------------------
 1171|      4|			zip->si.ss.digests[zip->entry->ssIndex] !=
  ------------------
  |  Branch (1171:4): [True: 4, False: 0]
  ------------------
 1172|      4|		    zip->entry_crc32) {
 1173|      4|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      4|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1174|      4|			    "7-Zip bad CRC: 0x%lx should be 0x%lx",
 1175|      4|			    (unsigned long)zip->entry_crc32,
 1176|      4|			    (unsigned long)zip->si.ss.digests[
 1177|      4|			    		zip->entry->ssIndex]);
 1178|      4|			ret = ARCHIVE_WARN;
  ------------------
  |  |  235|      4|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1179|      4|		}
 1180|      5|	}
 1181|       |
 1182|      5|	*size = bytes;
 1183|      5|	*offset = zip->entry_offset;
 1184|      5|	zip->entry_offset += bytes;
 1185|       |
 1186|      5|	return (ret);
 1187|      9|}
archive_read_support_format_7zip.c:archive_read_format_7zip_read_data_skip:
 1191|  1.03k|{
 1192|  1.03k|	struct _7zip *zip;
 1193|  1.03k|	int64_t bytes_skipped;
 1194|       |
 1195|  1.03k|	zip = (struct _7zip *)(a->format->data);
 1196|       |
 1197|  1.03k|	if (zip->pack_stream_bytes_unconsumed)
  ------------------
  |  Branch (1197:6): [True: 4, False: 1.02k]
  ------------------
 1198|      4|		read_consume(a);
 1199|       |
 1200|       |	/* If we've already read to end of data, we're done. */
 1201|  1.03k|	if (zip->end_of_entry)
  ------------------
  |  Branch (1201:6): [True: 1.03k, False: 0]
  ------------------
 1202|  1.03k|		return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.03k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1203|       |
 1204|       |	/*
 1205|       |	 * If the length is at the beginning, we can skip the
 1206|       |	 * compressed data much more quickly.
 1207|       |	 */
 1208|      0|	bytes_skipped = skip_stream(a, (size_t)zip->entry_bytes_remaining);
 1209|      0|	if (bytes_skipped < 0)
  ------------------
  |  Branch (1209:6): [True: 0, False: 0]
  ------------------
 1210|      0|		return ((int)bytes_skipped);
 1211|      0|	zip->entry_bytes_remaining = 0;
 1212|       |
 1213|       |	/* This entry is finished and done. */
 1214|      0|	zip->end_of_entry = 1;
 1215|      0|	return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1216|      0|}
archive_read_support_format_7zip.c:archive_read_format_7zip_cleanup:
 1220|  2.49k|{
 1221|  2.49k|	struct _7zip *zip;
 1222|       |
 1223|  2.49k|	zip = (struct _7zip *)(a->format->data);
 1224|  2.49k|	free_StreamsInfo(&(zip->si));
 1225|  2.49k|	free(zip->entries);
 1226|  2.49k|	free(zip->entry_names);
 1227|  2.49k|	free_decompression(a, zip);
 1228|  2.49k|	free(zip->uncompressed_buffer);
 1229|  2.49k|	free(zip->sub_stream_buff[0]);
 1230|  2.49k|	free(zip->sub_stream_buff[1]);
 1231|  2.49k|	free(zip->sub_stream_buff[2]);
 1232|  2.49k|	free(zip->tmp_stream_buff);
 1233|  2.49k|	free(zip);
 1234|  2.49k|	(a->format->data) = NULL;
 1235|  2.49k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1236|  2.49k|}
archive_read_support_format_7zip.c:free_decompression:
 2019|  2.49k|{
 2020|  2.49k|	int r = ARCHIVE_OK;
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2021|       |
 2022|       |#if !defined(HAVE_ZLIB_H) &&\
 2023|       |	!(defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR))
 2024|       |	(void)a;/* UNUSED */
 2025|       |#endif
 2026|  2.49k|#ifdef HAVE_LZMA_H
 2027|  2.49k|	if (zip->lzstream_valid)
  ------------------
  |  Branch (2027:6): [True: 0, False: 2.49k]
  ------------------
 2028|      0|		lzma_end(&(zip->lzstream));
 2029|  2.49k|#endif
 2030|  2.49k|#if defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR)
 2031|  2.49k|	if (zip->bzstream_valid) {
  ------------------
  |  Branch (2031:6): [True: 0, False: 2.49k]
  ------------------
 2032|      0|		if (BZ2_bzDecompressEnd(&(zip->bzstream)) != BZ_OK) {
  ------------------
  |  Branch (2032:7): [True: 0, False: 0]
  ------------------
 2033|      0|			archive_set_error(&a->archive,
 2034|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2035|      0|			    "Failed to clean up bzip2 decompressor");
 2036|      0|			r = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2037|      0|		}
 2038|      0|		zip->bzstream_valid = 0;
 2039|      0|	}
 2040|  2.49k|#endif
 2041|  2.49k|#ifdef HAVE_ZLIB_H
 2042|  2.49k|	if (zip->stream_valid) {
  ------------------
  |  Branch (2042:6): [True: 0, False: 2.49k]
  ------------------
 2043|      0|		if (inflateEnd(&(zip->stream)) != Z_OK) {
  ------------------
  |  Branch (2043:7): [True: 0, False: 0]
  ------------------
 2044|      0|			archive_set_error(&a->archive,
 2045|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2046|      0|			    "Failed to clean up zlib decompressor");
 2047|      0|			r = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2048|      0|		}
 2049|      0|		zip->stream_valid = 0;
 2050|      0|	}
 2051|  2.49k|#endif
 2052|       |#ifdef HAVE_ZSTD_H
 2053|       |	if (zip->zstdstream_valid)
 2054|       |		ZSTD_freeDStream(zip->zstd_dstream);
 2055|       |#endif
 2056|  2.49k|	if (zip->ppmd7_valid) {
  ------------------
  |  Branch (2056:6): [True: 64, False: 2.43k]
  ------------------
 2057|     64|		__archive_ppmd7_functions.Ppmd7_Free(
 2058|     64|			&zip->ppmd7_context);
 2059|     64|		zip->ppmd7_valid = 0;
 2060|     64|	}
 2061|  2.49k|	return (r);
 2062|  2.49k|}

archive_read_support_format_all:
   33|  2.49k|{
   34|  2.49k|	archive_check_magic(a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  151|  2.49k|	do { \
  |  |  152|  2.49k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|  2.49k|			(allowed_states), (function_name)); \
  |  |  154|  2.49k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  2.49k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 2.49k]
  |  |  ------------------
  |  |  155|  2.49k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|  2.49k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 2.49k]
  |  |  ------------------
  ------------------
   35|  2.49k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_all");
   36|       |
   37|       |	/* TODO: It would be nice to compute the ordering
   38|       |	 * here automatically so that people who enable just
   39|       |	 * a few formats can still get the benefits.  That
   40|       |	 * may just require the format registration to include
   41|       |	 * a "maximum read-ahead" value (anything that uses seek
   42|       |	 * would be essentially infinite read-ahead).  The core
   43|       |	 * bid management can then sort the bidders before calling
   44|       |	 * them.
   45|       |	 *
   46|       |	 * If you implement the above, please return the list below
   47|       |	 * to alphabetic order.
   48|       |	 */
   49|       |
   50|       |	/*
   51|       |	 * These bidders are all pretty cheap; they just examine a
   52|       |	 * small initial part of the archive.  If one of these bids
   53|       |	 * high, we can maybe avoid running any of the more expensive
   54|       |	 * bidders below.
   55|       |	 */
   56|  2.49k|	archive_read_support_format_ar(a);
   57|  2.49k|	archive_read_support_format_cpio(a);
   58|  2.49k|	archive_read_support_format_empty(a);
   59|  2.49k|	archive_read_support_format_lha(a);
   60|  2.49k|	archive_read_support_format_mtree(a);
   61|  2.49k|	archive_read_support_format_tar(a);
   62|  2.49k|	archive_read_support_format_xar(a);
   63|  2.49k|	archive_read_support_format_warc(a);
   64|       |
   65|       |	/*
   66|       |	 * Install expensive bidders last.  By doing them last, we
   67|       |	 * increase the chance that a high bid from someone else will
   68|       |	 * make it unnecessary for these to do anything at all.
   69|       |	 */
   70|       |	/* These have potentially large look-ahead. */
   71|  2.49k|	archive_read_support_format_7zip(a);
   72|  2.49k|	archive_read_support_format_cab(a);
   73|  2.49k|	archive_read_support_format_rar(a);
   74|  2.49k|	archive_read_support_format_rar5(a);
   75|  2.49k|	archive_read_support_format_iso9660(a);
   76|       |	/* Seek is really bad, since it forces the read-ahead
   77|       |	 * logic to discard buffered data. */
   78|  2.49k|	archive_read_support_format_zip(a);
   79|       |
   80|       |	/* Note: We always return ARCHIVE_OK here, even if some of the
   81|       |	 * above return ARCHIVE_WARN.  The intent here is to enable
   82|       |	 * "as much as possible."  Clients who need specific
   83|       |	 * compression should enable those individually so they can
   84|       |	 * verify the level of support. */
   85|       |	/* Clear any warning messages set by the above functions. */
   86|  2.49k|	archive_clear_error(a);
   87|  2.49k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
   88|  2.49k|}

archive_read_support_format_ar:
   98|  2.49k|{
   99|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
  100|  2.49k|	struct ar *ar;
  101|  2.49k|	int r;
  102|       |
  103|  2.49k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  151|  2.49k|	do { \
  |  |  152|  2.49k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|  2.49k|			(allowed_states), (function_name)); \
  |  |  154|  2.49k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  2.49k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 2.49k]
  |  |  ------------------
  |  |  155|  2.49k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|  2.49k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 2.49k]
  |  |  ------------------
  ------------------
  104|  2.49k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_ar");
  105|       |
  106|  2.49k|	ar = calloc(1, sizeof(*ar));
  107|  2.49k|	if (ar == NULL) {
  ------------------
  |  Branch (107:6): [True: 0, False: 2.49k]
  ------------------
  108|      0|		archive_set_error(&a->archive, ENOMEM,
  109|      0|		    "Can't allocate ar data");
  110|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  111|      0|	}
  112|  2.49k|	ar->strtab = NULL;
  113|       |
  114|  2.49k|	r = __archive_read_register_format(a,
  115|  2.49k|	    ar,
  116|  2.49k|	    "ar",
  117|  2.49k|	    archive_read_format_ar_bid,
  118|  2.49k|	    NULL,
  119|  2.49k|	    archive_read_format_ar_read_header,
  120|  2.49k|	    archive_read_format_ar_read_data,
  121|  2.49k|	    archive_read_format_ar_skip,
  122|  2.49k|	    NULL,
  123|  2.49k|	    archive_read_format_ar_cleanup,
  124|  2.49k|	    NULL,
  125|  2.49k|	    NULL);
  126|       |
  127|  2.49k|	if (r != ARCHIVE_OK) {
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (127:6): [True: 0, False: 2.49k]
  ------------------
  128|      0|		free(ar);
  129|      0|		return (r);
  130|      0|	}
  131|  2.49k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  132|  2.49k|}
archive_read_support_format_ar.c:archive_read_format_ar_cleanup:
  136|  2.49k|{
  137|  2.49k|	struct ar *ar;
  138|       |
  139|  2.49k|	ar = (struct ar *)(a->format->data);
  140|  2.49k|	free(ar->strtab);
  141|  2.49k|	free(ar);
  142|  2.49k|	(a->format->data) = NULL;
  143|  2.49k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  144|  2.49k|}
archive_read_support_format_ar.c:archive_read_format_ar_bid:
  148|  2.46k|{
  149|  2.46k|	const void *h;
  150|       |
  151|  2.46k|	(void)best_bid; /* UNUSED */
  152|       |
  153|       |	/*
  154|       |	 * Verify the 8-byte file signature.
  155|       |	 * TODO: Do we need to check more than this?
  156|       |	 */
  157|  2.46k|	if ((h = __archive_read_ahead(a, 8, NULL)) == NULL)
  ------------------
  |  Branch (157:6): [True: 23, False: 2.43k]
  ------------------
  158|     23|		return (-1);
  159|  2.43k|	if (memcmp(h, "!<arch>\n", 8) == 0) {
  ------------------
  |  Branch (159:6): [True: 19, False: 2.41k]
  ------------------
  160|     19|		return (64);
  161|     19|	}
  162|  2.41k|	return (-1);
  163|  2.43k|}
archive_read_support_format_ar.c:archive_read_format_ar_read_header:
  421|  1.20k|{
  422|  1.20k|	struct ar *ar = (struct ar*)(a->format->data);
  423|  1.20k|	size_t unconsumed;
  424|  1.20k|	const void *header_data;
  425|  1.20k|	int ret;
  426|       |
  427|  1.20k|	if (!ar->read_global_header) {
  ------------------
  |  Branch (427:6): [True: 19, False: 1.18k]
  ------------------
  428|       |		/*
  429|       |		 * We are now at the beginning of the archive,
  430|       |		 * so we need first consume the ar global header.
  431|       |		 */
  432|     19|		__archive_read_consume(a, 8);
  433|     19|		ar->read_global_header = 1;
  434|       |		/* Set a default format code for now. */
  435|     19|		a->archive.archive_format = ARCHIVE_FORMAT_AR;
  ------------------
  |  |  376|     19|#define	ARCHIVE_FORMAT_AR			0x70000
  ------------------
  436|     19|	}
  437|       |
  438|       |	/* Read the header for the next file entry. */
  439|  1.20k|	if ((header_data = __archive_read_ahead(a, 60, NULL)) == NULL)
  ------------------
  |  Branch (439:6): [True: 3, False: 1.20k]
  ------------------
  440|       |		/* Broken header. */
  441|      3|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|      3|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  442|       |
  443|  1.20k|	unconsumed = 60;
  444|       |
  445|  1.20k|	ret = _ar_read_header(a, entry, ar, (const char *)header_data, &unconsumed);
  446|       |
  447|  1.20k|	if (unconsumed)
  ------------------
  |  Branch (447:6): [True: 525, False: 676]
  ------------------
  448|    525|		__archive_read_consume(a, unconsumed);
  449|       |
  450|  1.20k|	return ret;
  451|  1.20k|}
archive_read_support_format_ar.c:_ar_read_header:
  168|  1.20k|{
  169|  1.20k|	char filename[AR_name_size + 1];
  170|  1.20k|	uint64_t number; /* Used to hold parsed numbers before validation. */
  171|  1.20k|	size_t bsd_name_length, entry_size;
  172|  1.20k|	char *p, *st;
  173|  1.20k|	const void *b;
  174|  1.20k|	int r;
  175|       |
  176|       |	/* Verify the magic signature on the file header. */
  177|  1.20k|	if (strncmp(h + AR_fmag_offset, "`\n", 2) != 0) {
  ------------------
  |  |   80|  1.20k|#define AR_fmag_offset 58
  ------------------
  |  Branch (177:6): [True: 12, False: 1.18k]
  ------------------
  178|     12|		archive_set_error(&a->archive, EINVAL,
  179|     12|		    "Incorrect file header signature");
  180|     12|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     12|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  181|     12|	}
  182|       |
  183|       |	/* Copy filename into work buffer. */
  184|  1.18k|	strncpy(filename, h + AR_name_offset, AR_name_size);
  ------------------
  |  |   68|  1.18k|#define AR_name_offset 0
  ------------------
              	strncpy(filename, h + AR_name_offset, AR_name_size);
  ------------------
  |  |   69|  1.18k|#define AR_name_size 16
  ------------------
  185|  1.18k|	filename[AR_name_size] = '\0';
  ------------------
  |  |   69|  1.18k|#define AR_name_size 16
  ------------------
  186|       |
  187|       |	/*
  188|       |	 * Guess the format variant based on the filename.
  189|       |	 */
  190|  1.18k|	if (a->archive.archive_format == ARCHIVE_FORMAT_AR) {
  ------------------
  |  |  376|  1.18k|#define	ARCHIVE_FORMAT_AR			0x70000
  ------------------
  |  Branch (190:6): [True: 21, False: 1.16k]
  ------------------
  191|       |		/* We don't already know the variant, so let's guess. */
  192|       |		/*
  193|       |		 * Biggest clue is presence of '/': GNU starts special
  194|       |		 * filenames with '/', appends '/' as terminator to
  195|       |		 * non-special names, so anything with '/' should be
  196|       |		 * GNU except for BSD long filenames.
  197|       |		 */
  198|     21|		if (strncmp(filename, "#1/", 3) == 0)
  ------------------
  |  Branch (198:7): [True: 5, False: 16]
  ------------------
  199|      5|			a->archive.archive_format = ARCHIVE_FORMAT_AR_BSD;
  ------------------
  |  |  378|      5|#define	ARCHIVE_FORMAT_AR_BSD			(ARCHIVE_FORMAT_AR | 2)
  |  |  ------------------
  |  |  |  |  376|      5|#define	ARCHIVE_FORMAT_AR			0x70000
  |  |  ------------------
  ------------------
  200|     16|		else if (strchr(filename, '/') != NULL)
  ------------------
  |  Branch (200:12): [True: 14, False: 2]
  ------------------
  201|     14|			a->archive.archive_format = ARCHIVE_FORMAT_AR_GNU;
  ------------------
  |  |  377|     14|#define	ARCHIVE_FORMAT_AR_GNU			(ARCHIVE_FORMAT_AR | 1)
  |  |  ------------------
  |  |  |  |  376|     14|#define	ARCHIVE_FORMAT_AR			0x70000
  |  |  ------------------
  ------------------
  202|      2|		else if (strncmp(filename, "__.SYMDEF", 9) == 0)
  ------------------
  |  Branch (202:12): [True: 0, False: 2]
  ------------------
  203|      0|			a->archive.archive_format = ARCHIVE_FORMAT_AR_BSD;
  ------------------
  |  |  378|      0|#define	ARCHIVE_FORMAT_AR_BSD			(ARCHIVE_FORMAT_AR | 2)
  |  |  ------------------
  |  |  |  |  376|      0|#define	ARCHIVE_FORMAT_AR			0x70000
  |  |  ------------------
  ------------------
  204|       |		/*
  205|       |		 * XXX Do GNU/SVR4 'ar' programs ever omit trailing '/'
  206|       |		 * if name exactly fills 16-byte field?  If so, we
  207|       |		 * can't assume entries without '/' are BSD. XXX
  208|       |		 */
  209|     21|	}
  210|       |
  211|       |	/* Update format name from the code. */
  212|  1.18k|	if (a->archive.archive_format == ARCHIVE_FORMAT_AR_GNU)
  ------------------
  |  |  377|  1.18k|#define	ARCHIVE_FORMAT_AR_GNU			(ARCHIVE_FORMAT_AR | 1)
  |  |  ------------------
  |  |  |  |  376|  1.18k|#define	ARCHIVE_FORMAT_AR			0x70000
  |  |  ------------------
  ------------------
  |  Branch (212:6): [True: 886, False: 303]
  ------------------
  213|    886|		a->archive.archive_format_name = "ar (GNU/SVR4)";
  214|    303|	else if (a->archive.archive_format == ARCHIVE_FORMAT_AR_BSD)
  ------------------
  |  |  378|    303|#define	ARCHIVE_FORMAT_AR_BSD			(ARCHIVE_FORMAT_AR | 2)
  |  |  ------------------
  |  |  |  |  376|    303|#define	ARCHIVE_FORMAT_AR			0x70000
  |  |  ------------------
  ------------------
  |  Branch (214:11): [True: 301, False: 2]
  ------------------
  215|    301|		a->archive.archive_format_name = "ar (BSD)";
  216|      2|	else
  217|      2|		a->archive.archive_format_name = "ar";
  218|       |
  219|       |	/*
  220|       |	 * Remove trailing spaces from the filename.  GNU and BSD
  221|       |	 * variants both pad filename area out with spaces.
  222|       |	 * This will only be wrong if GNU/SVR4 'ar' implementations
  223|       |	 * omit trailing '/' for 16-char filenames and we have
  224|       |	 * a 16-char filename that ends in ' '.
  225|       |	 */
  226|  1.18k|	p = filename + AR_name_size - 1;
  ------------------
  |  |   69|  1.18k|#define AR_name_size 16
  ------------------
  227|  1.95k|	while (p >= filename && *p == ' ') {
  ------------------
  |  Branch (227:9): [True: 1.95k, False: 0]
  |  Branch (227:26): [True: 762, False: 1.18k]
  ------------------
  228|    762|		*p = '\0';
  229|    762|		p--;
  230|    762|	}
  231|       |
  232|       |	/*
  233|       |	 * Remove trailing slash unless first character is '/'.
  234|       |	 * (BSD entries never end in '/', so this will only trim
  235|       |	 * GNU-format entries.  GNU special entries start with '/'
  236|       |	 * and are not terminated in '/', so we don't trim anything
  237|       |	 * that starts with '/'.)
  238|       |	 */
  239|  1.18k|	if (filename[0] != '/' && p > filename && *p == '/') {
  ------------------
  |  Branch (239:6): [True: 1.13k, False: 57]
  |  Branch (239:28): [True: 1.12k, False: 9]
  |  Branch (239:44): [True: 1, False: 1.12k]
  ------------------
  240|      1|		*p = '\0';
  241|      1|	}
  242|       |
  243|  1.18k|	if (p < filename) {
  ------------------
  |  Branch (243:6): [True: 0, False: 1.18k]
  ------------------
  244|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  245|      0|		    "Found entry with empty filename");
  246|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  247|      0|	}
  248|       |
  249|       |	/*
  250|       |	 * '//' is the GNU filename table.
  251|       |	 * Later entries can refer to names in this table.
  252|       |	 */
  253|  1.18k|	if (strcmp(filename, "//") == 0) {
  ------------------
  |  Branch (253:6): [True: 0, False: 1.18k]
  ------------------
  254|       |		/* This must come before any call to _read_ahead. */
  255|      0|		ar_parse_common_header(ar, entry, h);
  256|      0|		archive_entry_copy_pathname(entry, filename);
  257|      0|		archive_entry_set_filetype(entry, AE_IFREG);
  ------------------
  |  |  216|      0|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
  258|       |		/* Get the size of the filename table. */
  259|      0|		number = ar_atol10(h + AR_size_offset, AR_size_size);
  ------------------
  |  |   78|      0|#define AR_size_offset 48
  ------------------
              		number = ar_atol10(h + AR_size_offset, AR_size_size);
  ------------------
  |  |   79|      0|#define AR_size_size 10
  ------------------
  260|      0|		if (number > SIZE_MAX || number > 1024 * 1024 * 1024) {
  ------------------
  |  Branch (260:7): [True: 0, False: 0]
  |  Branch (260:28): [True: 0, False: 0]
  ------------------
  261|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  262|      0|			    "Filename table too large");
  263|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  264|      0|		}
  265|      0|		entry_size = (size_t)number;
  266|      0|		if (entry_size == 0) {
  ------------------
  |  Branch (266:7): [True: 0, False: 0]
  ------------------
  267|      0|			archive_set_error(&a->archive, EINVAL,
  268|      0|			    "Invalid string table");
  269|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  270|      0|		}
  271|      0|		if (ar->strtab != NULL) {
  ------------------
  |  Branch (271:7): [True: 0, False: 0]
  ------------------
  272|      0|			archive_set_error(&a->archive, EINVAL,
  273|      0|			    "More than one string table exists");
  274|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  275|      0|		}
  276|       |
  277|       |		/* Read the filename table into memory. */
  278|      0|		st = malloc(entry_size);
  279|      0|		if (st == NULL) {
  ------------------
  |  Branch (279:7): [True: 0, False: 0]
  ------------------
  280|      0|			archive_set_error(&a->archive, ENOMEM,
  281|      0|			    "Can't allocate filename table buffer");
  282|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  283|      0|		}
  284|      0|		ar->strtab = st;
  285|      0|		ar->strtab_size = entry_size;
  286|       |
  287|      0|		if (*unconsumed) {
  ------------------
  |  Branch (287:7): [True: 0, False: 0]
  ------------------
  288|      0|			__archive_read_consume(a, *unconsumed);
  289|      0|			*unconsumed = 0;
  290|      0|		}
  291|       |
  292|      0|		if ((b = __archive_read_ahead(a, entry_size, NULL)) == NULL)
  ------------------
  |  Branch (292:7): [True: 0, False: 0]
  ------------------
  293|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  294|      0|		memcpy(st, b, entry_size);
  295|      0|		__archive_read_consume(a, entry_size);
  296|       |		/* All contents are consumed. */
  297|      0|		ar->entry_bytes_remaining = 0;
  298|      0|		archive_entry_set_size(entry, ar->entry_bytes_remaining);
  299|       |
  300|       |		/* Parse the filename table. */
  301|      0|		return (ar_parse_gnu_filename_table(a));
  302|      0|	}
  303|       |
  304|       |	/*
  305|       |	 * GNU variant handles long filenames by storing /<number>
  306|       |	 * to indicate a name stored in the filename table.
  307|       |	 * XXX TODO: Verify that it's all digits... Don't be fooled
  308|       |	 * by "/9xyz" XXX
  309|       |	 */
  310|  1.18k|	if (filename[0] == '/' && filename[1] >= '0' && filename[1] <= '9') {
  ------------------
  |  Branch (310:6): [True: 57, False: 1.13k]
  |  Branch (310:28): [True: 1, False: 56]
  |  Branch (310:50): [True: 1, False: 0]
  ------------------
  311|      1|		number = ar_atol10(h + AR_name_offset + 1, AR_name_size - 1);
  ------------------
  |  |   68|      1|#define AR_name_offset 0
  ------------------
              		number = ar_atol10(h + AR_name_offset + 1, AR_name_size - 1);
  ------------------
  |  |   69|      1|#define AR_name_size 16
  ------------------
  312|       |		/*
  313|       |		 * If we can't look up the real name, warn and return
  314|       |		 * the entry with the wrong name.
  315|       |		 */
  316|      1|		if (ar->strtab == NULL || number >= ar->strtab_size) {
  ------------------
  |  Branch (316:7): [True: 1, False: 0]
  |  Branch (316:29): [True: 0, False: 0]
  ------------------
  317|      1|			archive_set_error(&a->archive, EINVAL,
  318|      1|			    "Can't find long filename for GNU/SVR4 archive entry");
  319|      1|			archive_entry_copy_pathname(entry, filename);
  320|       |			/* Parse the time, owner, mode, size fields. */
  321|      1|			ar_parse_common_header(ar, entry, h);
  322|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  323|      1|		}
  324|       |
  325|      0|		archive_entry_copy_pathname(entry, &ar->strtab[(size_t)number]);
  326|       |		/* Parse the time, owner, mode, size fields. */
  327|      0|		return (ar_parse_common_header(ar, entry, h));
  328|      1|	}
  329|       |
  330|       |	/*
  331|       |	 * BSD handles long filenames by storing "#1/" followed by the
  332|       |	 * length of filename as a decimal number, then prepends the
  333|       |	 * the filename to the file contents.
  334|       |	 */
  335|  1.18k|	if (strncmp(filename, "#1/", 3) == 0) {
  ------------------
  |  Branch (335:6): [True: 679, False: 509]
  ------------------
  336|       |		/* Parse the time, owner, mode, size fields. */
  337|       |		/* This must occur before _read_ahead is called again. */
  338|    679|		ar_parse_common_header(ar, entry, h);
  339|       |
  340|       |		/* Parse the size of the name, adjust the file size. */
  341|    679|		number = ar_atol10(h + AR_name_offset + 3, AR_name_size - 3);
  ------------------
  |  |   68|    679|#define AR_name_offset 0
  ------------------
              		number = ar_atol10(h + AR_name_offset + 3, AR_name_size - 3);
  ------------------
  |  |   69|    679|#define AR_name_size 16
  ------------------
  342|       |		/* Sanity check the filename length:
  343|       |		 *   = Must be <= SIZE_MAX - 1
  344|       |		 *   = Must be <= 1MB
  345|       |		 *   = Cannot be bigger than the entire entry
  346|       |		 */
  347|    679|		if (number > SIZE_MAX - 1
  ------------------
  |  Branch (347:7): [True: 0, False: 679]
  ------------------
  348|    679|		    || number > 1024 * 1024
  ------------------
  |  Branch (348:10): [True: 0, False: 679]
  ------------------
  349|    679|		    || (int64_t)number > ar->entry_bytes_remaining) {
  ------------------
  |  Branch (349:10): [True: 3, False: 676]
  ------------------
  350|      3|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      3|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  351|      3|			    "Bad input file size");
  352|      3|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      3|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  353|      3|		}
  354|    676|		bsd_name_length = (size_t)number;
  355|    676|		ar->entry_bytes_remaining -= bsd_name_length;
  356|       |		/* Adjust file size reported to client. */
  357|    676|		archive_entry_set_size(entry, ar->entry_bytes_remaining);
  358|       |
  359|    676|		if (*unconsumed) {
  ------------------
  |  Branch (359:7): [True: 676, False: 0]
  ------------------
  360|    676|			__archive_read_consume(a, *unconsumed);
  361|    676|			*unconsumed = 0;
  362|    676|		}
  363|       |
  364|       |		/* Read the long name into memory. */
  365|    676|		if ((b = __archive_read_ahead(a, bsd_name_length, NULL)) == NULL) {
  ------------------
  |  Branch (365:7): [True: 0, False: 676]
  ------------------
  366|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  367|      0|			    "Truncated input file");
  368|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  369|      0|		}
  370|       |		/* Store it in the entry. */
  371|    676|		p = malloc(bsd_name_length + 1);
  372|    676|		if (p == NULL) {
  ------------------
  |  Branch (372:7): [True: 0, False: 676]
  ------------------
  373|      0|			archive_set_error(&a->archive, ENOMEM,
  374|      0|			    "Can't allocate fname buffer");
  375|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  376|      0|		}
  377|    676|		strncpy(p, b, bsd_name_length);
  378|    676|		p[bsd_name_length] = '\0';
  379|       |
  380|    676|		__archive_read_consume(a, bsd_name_length);
  381|       |
  382|    676|		archive_entry_copy_pathname(entry, p);
  383|    676|		free(p);
  384|    676|		return (ARCHIVE_OK);
  ------------------
  |  |  233|    676|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  385|    676|	}
  386|       |
  387|       |	/*
  388|       |	 * "/" is the SVR4/GNU archive symbol table.
  389|       |	 * "/SYM64/" is the SVR4/GNU 64-bit variant archive symbol table.
  390|       |	 */
  391|    509|	if (strcmp(filename, "/") == 0 || strcmp(filename, "/SYM64/") == 0) {
  ------------------
  |  Branch (391:6): [True: 55, False: 454]
  |  Branch (391:36): [True: 0, False: 454]
  ------------------
  392|     55|		archive_entry_copy_pathname(entry, filename);
  393|       |		/* Parse the time, owner, mode, size fields. */
  394|     55|		r = ar_parse_common_header(ar, entry, h);
  395|       |		/* Force the file type to a regular file. */
  396|     55|		archive_entry_set_filetype(entry, AE_IFREG);
  ------------------
  |  |  216|     55|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
  397|     55|		return (r);
  398|     55|	}
  399|       |
  400|       |	/*
  401|       |	 * "__.SYMDEF" is a BSD archive symbol table.
  402|       |	 */
  403|    454|	if (strcmp(filename, "__.SYMDEF") == 0) {
  ------------------
  |  Branch (403:6): [True: 0, False: 454]
  ------------------
  404|      0|		archive_entry_copy_pathname(entry, filename);
  405|       |		/* Parse the time, owner, mode, size fields. */
  406|      0|		return (ar_parse_common_header(ar, entry, h));
  407|      0|	}
  408|       |
  409|       |	/*
  410|       |	 * Otherwise, this is a standard entry.  The filename
  411|       |	 * has already been trimmed as much as possible, based
  412|       |	 * on our current knowledge of the format.
  413|       |	 */
  414|    454|	archive_entry_copy_pathname(entry, filename);
  415|    454|	return (ar_parse_common_header(ar, entry, h));
  416|    454|}
archive_read_support_format_ar.c:ar_parse_common_header:
  457|  1.18k|{
  458|  1.18k|	uint64_t n;
  459|       |
  460|       |	/* Copy remaining header */
  461|  1.18k|	archive_entry_set_mtime(entry,
  462|  1.18k|	    (time_t)ar_atol10(h + AR_date_offset, AR_date_size), 0L);
  ------------------
  |  |   70|  1.18k|#define AR_date_offset 16
  ------------------
              	    (time_t)ar_atol10(h + AR_date_offset, AR_date_size), 0L);
  ------------------
  |  |   71|  1.18k|#define AR_date_size 12
  ------------------
  463|  1.18k|	archive_entry_set_uid(entry,
  464|  1.18k|	    (uid_t)ar_atol10(h + AR_uid_offset, AR_uid_size));
  ------------------
  |  |   72|  1.18k|#define AR_uid_offset 28
  ------------------
              	    (uid_t)ar_atol10(h + AR_uid_offset, AR_uid_size));
  ------------------
  |  |   73|  1.18k|#define AR_uid_size 6
  ------------------
  465|  1.18k|	archive_entry_set_gid(entry,
  466|  1.18k|	    (gid_t)ar_atol10(h + AR_gid_offset, AR_gid_size));
  ------------------
  |  |   74|  1.18k|#define AR_gid_offset 34
  ------------------
              	    (gid_t)ar_atol10(h + AR_gid_offset, AR_gid_size));
  ------------------
  |  |   75|  1.18k|#define AR_gid_size 6
  ------------------
  467|  1.18k|	archive_entry_set_mode(entry,
  468|  1.18k|	    (mode_t)ar_atol8(h + AR_mode_offset, AR_mode_size));
  ------------------
  |  |   76|  1.18k|#define AR_mode_offset 40
  ------------------
              	    (mode_t)ar_atol8(h + AR_mode_offset, AR_mode_size));
  ------------------
  |  |   77|  1.18k|#define AR_mode_size 8
  ------------------
  469|  1.18k|	archive_entry_set_filetype(entry, AE_IFREG);
  ------------------
  |  |  216|  1.18k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
  470|  1.18k|	n = ar_atol10(h + AR_size_offset, AR_size_size);
  ------------------
  |  |   78|  1.18k|#define AR_size_offset 48
  ------------------
              	n = ar_atol10(h + AR_size_offset, AR_size_size);
  ------------------
  |  |   79|  1.18k|#define AR_size_size 10
  ------------------
  471|       |
  472|  1.18k|	ar->entry_offset = 0;
  473|  1.18k|	ar->entry_padding = n % 2;
  474|  1.18k|	archive_entry_set_size(entry, n);
  475|  1.18k|	ar->entry_bytes_remaining = n;
  476|  1.18k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.18k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  477|  1.18k|}
archive_read_support_format_ar.c:ar_atol8:
  590|  1.18k|{
  591|  1.18k|	uint64_t l, limit, last_digit_limit;
  592|  1.18k|	unsigned int digit, base;
  593|       |
  594|  1.18k|	base = 8;
  595|  1.18k|	limit = UINT64_MAX / base;
  596|  1.18k|	last_digit_limit = UINT64_MAX % base;
  597|       |
  598|  6.05k|	while ((*p == ' ' || *p == '\t') && char_cnt-- > 0)
  ------------------
  |  Branch (598:10): [True: 1.33k, False: 4.71k]
  |  Branch (598:23): [True: 3.53k, False: 1.17k]
  |  Branch (598:38): [True: 4.86k, False: 12]
  ------------------
  599|  4.86k|		p++;
  600|       |
  601|  1.18k|	l = 0;
  602|  1.18k|	digit = *p - '0';
  603|  1.29k|	while (*p >= '0' && digit < base  && char_cnt-- > 0) {
  ------------------
  |  Branch (603:9): [True: 692, False: 606]
  |  Branch (603:22): [True: 109, False: 583]
  |  Branch (603:39): [True: 109, False: 0]
  ------------------
  604|    109|		if (l>limit || (l == limit && digit > last_digit_limit)) {
  ------------------
  |  Branch (604:7): [True: 0, False: 109]
  |  Branch (604:19): [True: 0, False: 109]
  |  Branch (604:33): [True: 0, False: 0]
  ------------------
  605|      0|			l = UINT64_MAX; /* Truncate on overflow. */
  606|      0|			break;
  607|      0|		}
  608|    109|		l = (l * base) + digit;
  609|    109|		digit = *++p - '0';
  610|    109|	}
  611|  1.18k|	return (l);
  612|  1.18k|}
archive_read_support_format_ar.c:ar_atol10:
  616|  5.43k|{
  617|  5.43k|	uint64_t l, limit, last_digit_limit;
  618|  5.43k|	unsigned int base, digit;
  619|       |
  620|  5.43k|	base = 10;
  621|  5.43k|	limit = UINT64_MAX / base;
  622|  5.43k|	last_digit_limit = UINT64_MAX % base;
  623|       |
  624|  23.1k|	while ((*p == ' ' || *p == '\t') && char_cnt-- > 0)
  ------------------
  |  Branch (624:10): [True: 6.89k, False: 16.2k]
  |  Branch (624:23): [True: 11.7k, False: 4.52k]
  |  Branch (624:38): [True: 17.6k, False: 907]
  ------------------
  625|  17.6k|		p++;
  626|  5.43k|	l = 0;
  627|  5.43k|	digit = *p - '0';
  628|  9.09k|	while (*p >= '0' && digit < base  && char_cnt-- > 0) {
  ------------------
  |  Branch (628:9): [True: 5.36k, False: 3.72k]
  |  Branch (628:22): [True: 3.84k, False: 1.52k]
  |  Branch (628:39): [True: 3.65k, False: 186]
  ------------------
  629|  3.65k|		if (l > limit || (l == limit && digit > last_digit_limit)) {
  ------------------
  |  Branch (629:7): [True: 0, False: 3.65k]
  |  Branch (629:21): [True: 0, False: 3.65k]
  |  Branch (629:35): [True: 0, False: 0]
  ------------------
  630|      0|			l = UINT64_MAX; /* Truncate on overflow. */
  631|      0|			break;
  632|      0|		}
  633|  3.65k|		l = (l * base) + digit;
  634|  3.65k|		digit = *++p - '0';
  635|  3.65k|	}
  636|  5.43k|	return (l);
  637|  5.43k|}
archive_read_support_format_ar.c:archive_read_format_ar_read_data:
  482|  2.84k|{
  483|  2.84k|	ssize_t bytes_read;
  484|  2.84k|	struct ar *ar;
  485|       |
  486|  2.84k|	ar = (struct ar *)(a->format->data);
  487|       |
  488|  2.84k|	if (ar->entry_bytes_unconsumed) {
  ------------------
  |  Branch (488:6): [True: 828, False: 2.01k]
  ------------------
  489|    828|		__archive_read_consume(a, ar->entry_bytes_unconsumed);
  490|    828|		ar->entry_bytes_unconsumed = 0;
  491|    828|	}
  492|       |
  493|  2.84k|	if (ar->entry_bytes_remaining > 0) {
  ------------------
  |  Branch (493:6): [True: 828, False: 2.01k]
  ------------------
  494|    828|		*buff = __archive_read_ahead(a, 1, &bytes_read);
  495|    828|		if (bytes_read == 0) {
  ------------------
  |  Branch (495:7): [True: 0, False: 828]
  ------------------
  496|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  497|      0|			    "Truncated ar archive");
  498|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  499|      0|		}
  500|    828|		if (bytes_read < 0)
  ------------------
  |  Branch (500:7): [True: 0, False: 828]
  ------------------
  501|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  502|    828|		if (bytes_read > ar->entry_bytes_remaining)
  ------------------
  |  Branch (502:7): [True: 828, False: 0]
  ------------------
  503|    828|			bytes_read = (ssize_t)ar->entry_bytes_remaining;
  504|    828|		*size = bytes_read;
  505|    828|		ar->entry_bytes_unconsumed = bytes_read;
  506|    828|		*offset = ar->entry_offset;
  507|    828|		ar->entry_offset += bytes_read;
  508|    828|		ar->entry_bytes_remaining -= bytes_read;
  509|    828|		return (ARCHIVE_OK);
  ------------------
  |  |  233|    828|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  510|  2.01k|	} else {
  511|  2.01k|		int64_t skipped = __archive_read_consume(a, ar->entry_padding);
  512|  2.01k|		if (skipped >= 0) {
  ------------------
  |  Branch (512:7): [True: 2.01k, False: 0]
  ------------------
  513|  2.01k|			ar->entry_padding -= skipped;
  514|  2.01k|		}
  515|  2.01k|		if (ar->entry_padding) {
  ------------------
  |  Branch (515:7): [True: 0, False: 2.01k]
  ------------------
  516|      0|			if (skipped >= 0) {
  ------------------
  |  Branch (516:8): [True: 0, False: 0]
  ------------------
  517|      0|				archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  518|      0|					"Truncated ar archive - failed consuming padding");
  519|      0|			}
  520|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  521|      0|		}
  522|  2.01k|		*buff = NULL;
  523|  2.01k|		*size = 0;
  524|  2.01k|		*offset = ar->entry_offset;
  525|  2.01k|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|  2.01k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  526|  2.01k|	}
  527|  2.84k|}
archive_read_support_format_ar.c:archive_read_format_ar_skip:
  531|  1.18k|{
  532|  1.18k|	int64_t bytes_skipped;
  533|  1.18k|	struct ar* ar;
  534|       |
  535|  1.18k|	ar = (struct ar *)(a->format->data);
  536|       |
  537|  1.18k|	bytes_skipped = __archive_read_consume(a,
  538|  1.18k|	    ar->entry_bytes_remaining + ar->entry_padding
  539|  1.18k|	    + ar->entry_bytes_unconsumed);
  540|  1.18k|	if (bytes_skipped < 0)
  ------------------
  |  Branch (540:6): [True: 0, False: 1.18k]
  ------------------
  541|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  542|       |
  543|  1.18k|	ar->entry_bytes_remaining = 0;
  544|  1.18k|	ar->entry_bytes_unconsumed = 0;
  545|  1.18k|	ar->entry_padding = 0;
  546|       |
  547|  1.18k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.18k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  548|  1.18k|}

archive_read_support_format_cab:
  351|  2.49k|{
  352|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
  353|  2.49k|	struct cab *cab;
  354|  2.49k|	int r;
  355|       |
  356|  2.49k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  151|  2.49k|	do { \
  |  |  152|  2.49k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|  2.49k|			(allowed_states), (function_name)); \
  |  |  154|  2.49k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  2.49k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 2.49k]
  |  |  ------------------
  |  |  155|  2.49k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|  2.49k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 2.49k]
  |  |  ------------------
  ------------------
  357|  2.49k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_cab");
  358|       |
  359|  2.49k|	cab = calloc(1, sizeof(*cab));
  360|  2.49k|	if (cab == NULL) {
  ------------------
  |  Branch (360:6): [True: 0, False: 2.49k]
  ------------------
  361|      0|		archive_set_error(&a->archive, ENOMEM,
  362|      0|		    "Can't allocate CAB data");
  363|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  364|      0|	}
  365|  2.49k|	archive_string_init(&cab->ws);
  ------------------
  |  |   71|  2.49k|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 2.49k]
  |  |  ------------------
  ------------------
  366|  2.49k|	if (archive_wstring_ensure(&cab->ws, 256) == NULL) {
  ------------------
  |  Branch (366:6): [True: 0, False: 2.49k]
  ------------------
  367|      0|		archive_set_error(&a->archive, ENOMEM,
  368|      0|		    "Can't allocate memory");
  369|      0|		free(cab);
  370|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  371|      0|	}
  372|       |
  373|  2.49k|	r = __archive_read_register_format(a,
  374|  2.49k|	    cab,
  375|  2.49k|	    "cab",
  376|  2.49k|	    archive_read_format_cab_bid,
  377|  2.49k|	    archive_read_format_cab_options,
  378|  2.49k|	    archive_read_format_cab_read_header,
  379|  2.49k|	    archive_read_format_cab_read_data,
  380|  2.49k|	    archive_read_format_cab_read_data_skip,
  381|  2.49k|	    NULL,
  382|  2.49k|	    archive_read_format_cab_cleanup,
  383|  2.49k|	    NULL,
  384|  2.49k|	    NULL);
  385|       |
  386|  2.49k|	if (r != ARCHIVE_OK) {
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (386:6): [True: 0, False: 2.49k]
  ------------------
  387|      0|		archive_wstring_free(&cab->ws);
  388|      0|		free(cab);
  389|      0|	}
  390|  2.49k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  391|  2.49k|}
archive_read_support_format_cab.c:archive_read_format_cab_bid:
  418|  2.46k|{
  419|  2.46k|	const char *p;
  420|  2.46k|	ssize_t bytes_avail, offset, window;
  421|       |
  422|       |	/* If there's already a better bid than we can ever
  423|       |	   make, don't bother testing. */
  424|  2.46k|	if (best_bid > 64)
  ------------------
  |  Branch (424:6): [True: 249, False: 2.21k]
  ------------------
  425|    249|		return (-1);
  426|       |
  427|  2.21k|	if ((p = __archive_read_ahead(a, 8, NULL)) == NULL)
  ------------------
  |  Branch (427:6): [True: 29, False: 2.18k]
  ------------------
  428|     29|		return (-1);
  429|       |
  430|  2.18k|	if (memcmp(p, "MSCF\0\0\0\0", 8) == 0)
  ------------------
  |  Branch (430:6): [True: 27, False: 2.15k]
  ------------------
  431|     27|		return (64);
  432|       |
  433|       |	/*
  434|       |	 * Attempt to handle self-extracting archives
  435|       |	 * by noting a PE header and searching forward
  436|       |	 * up to 128k for a 'MSCF' marker.
  437|       |	 */
  438|  2.15k|	if (p[0] == 'M' && p[1] == 'Z') {
  ------------------
  |  Branch (438:6): [True: 110, False: 2.04k]
  |  Branch (438:21): [True: 109, False: 1]
  ------------------
  439|    109|		offset = 0;
  440|    109|		window = 4096;
  441|    543|		while (offset < (1024 * 128)) {
  ------------------
  |  Branch (441:10): [True: 532, False: 11]
  ------------------
  442|    532|			const char *h = __archive_read_ahead(a, offset + window,
  443|    532|			    &bytes_avail);
  444|    532|			if (h == NULL) {
  ------------------
  |  Branch (444:8): [True: 320, False: 212]
  ------------------
  445|       |				/* Remaining bytes are less than window. */
  446|    320|				window >>= 1;
  447|    320|				if (window < 128)
  ------------------
  |  Branch (447:9): [True: 53, False: 267]
  ------------------
  448|     53|					return (0);
  449|    267|				continue;
  450|    320|			}
  451|    212|			p = h + offset;
  452|  1.58M|			while (p + 8 < h + bytes_avail) {
  ------------------
  |  Branch (452:11): [True: 1.58M, False: 167]
  ------------------
  453|  1.58M|				int next;
  454|  1.58M|				if ((next = find_cab_magic(p)) == 0)
  ------------------
  |  Branch (454:9): [True: 45, False: 1.58M]
  ------------------
  455|     45|					return (64);
  456|  1.58M|				p += next;
  457|  1.58M|			}
  458|    167|			offset = p - h;
  459|    167|		}
  460|    109|	}
  461|  2.05k|	return (0);
  462|  2.15k|}
archive_read_support_format_cab.c:find_cab_magic:
  395|  1.61M|{
  396|  1.61M|	switch (p[4]) {
  397|   871k|	case 0:
  ------------------
  |  Branch (397:2): [True: 871k, False: 746k]
  ------------------
  398|       |		/*
  399|       |		 * Note: Self-Extraction program has 'MSCF' string in their
  400|       |		 * program. If we were finding 'MSCF' string only, we got
  401|       |		 * wrong place for Cabinet header, thus, we have to check
  402|       |		 * following four bytes which are reserved and must be set
  403|       |		 * to zero.
  404|       |		 */
  405|   871k|		if (memcmp(p, "MSCF\0\0\0\0", 8) == 0)
  ------------------
  |  Branch (405:7): [True: 90, False: 871k]
  ------------------
  406|     90|			return 0;
  407|   871k|		return 5;
  408|  1.02k|	case 'F': return 1;
  ------------------
  |  Branch (408:2): [True: 1.02k, False: 1.61M]
  ------------------
  409|  2.64k|	case 'C': return 2;
  ------------------
  |  Branch (409:2): [True: 2.64k, False: 1.61M]
  ------------------
  410|  4.44k|	case 'S': return 3;
  ------------------
  |  Branch (410:2): [True: 4.44k, False: 1.61M]
  ------------------
  411|  12.1k|	case 'M': return 4;
  ------------------
  |  Branch (411:2): [True: 12.1k, False: 1.60M]
  ------------------
  412|   726k|	default:  return 5;
  ------------------
  |  Branch (412:2): [True: 726k, False: 891k]
  ------------------
  413|  1.61M|	}
  414|  1.61M|}
archive_read_support_format_cab.c:archive_read_format_cab_read_header:
  892|    100|{
  893|    100|	struct cab *cab;
  894|    100|	struct cfheader *hd;
  895|    100|	struct cffolder *prev_folder;
  896|    100|	struct cffile *file;
  897|    100|	struct archive_string_conv *sconv;
  898|    100|	int err = ARCHIVE_OK, r;
  ------------------
  |  |  233|    100|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  899|       |	
  900|    100|	cab = (struct cab *)(a->format->data);
  901|    100|	if (cab->found_header == 0) {
  ------------------
  |  Branch (901:6): [True: 72, False: 28]
  ------------------
  902|     72|		err = cab_read_header(a); 
  903|     72|		if (err < ARCHIVE_WARN)
  ------------------
  |  |  235|     72|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (903:7): [True: 2, False: 70]
  ------------------
  904|      2|			return (err);
  905|       |		/* We've found the header. */
  906|     70|		cab->found_header = 1;
  907|     70|	}
  908|     98|	hd = &cab->cfheader;
  909|       |
  910|     98|	if (hd->file_index >= hd->file_count) {
  ------------------
  |  Branch (910:6): [True: 12, False: 86]
  ------------------
  911|     12|		cab->end_of_archive = 1;
  912|     12|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|     12|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  913|     12|	}
  914|     86|	file = &hd->file_array[hd->file_index++];
  915|       |
  916|     86|	cab->end_of_entry = 0;
  917|     86|	cab->end_of_entry_cleanup = 0;
  918|     86|	cab->entry_compressed_bytes_read = 0;
  919|     86|	cab->entry_uncompressed_bytes_read = 0;
  920|     86|	cab->entry_unconsumed = 0;
  921|     86|	cab->entry_cffile = file;
  922|       |
  923|       |	/*
  924|       |	 * Choose a proper folder.
  925|       |	 */
  926|     86|	prev_folder = cab->entry_cffolder;
  927|     86|	switch (file->folder) {
  928|      3|	case iFoldCONTINUED_FROM_PREV:
  ------------------
  |  |  233|      3|#define iFoldCONTINUED_FROM_PREV	0xFFFD
  ------------------
  |  Branch (928:2): [True: 3, False: 83]
  ------------------
  929|      3|	case iFoldCONTINUED_PREV_AND_NEXT:
  ------------------
  |  |  235|      3|#define iFoldCONTINUED_PREV_AND_NEXT	0xFFFF
  ------------------
  |  Branch (929:2): [True: 0, False: 86]
  ------------------
  930|      3|		cab->entry_cffolder = &hd->folder_array[0];
  931|      3|		break;
  932|      9|	case iFoldCONTINUED_TO_NEXT:
  ------------------
  |  |  234|      9|#define iFoldCONTINUED_TO_NEXT		0xFFFE
  ------------------
  |  Branch (932:2): [True: 9, False: 77]
  ------------------
  933|      9|		cab->entry_cffolder = &hd->folder_array[hd->folder_count-1];
  934|      9|		break;
  935|     74|	default:
  ------------------
  |  Branch (935:2): [True: 74, False: 12]
  ------------------
  936|     74|		cab->entry_cffolder = &hd->folder_array[file->folder];
  937|     74|		break;
  938|     86|	}
  939|       |	/* If a cffolder of this file is changed, reset a cfdata to read
  940|       |	 * file contents from next cfdata. */
  941|     86|	if (prev_folder != cab->entry_cffolder)
  ------------------
  |  Branch (941:6): [True: 70, False: 16]
  ------------------
  942|     70|		cab->entry_cfdata = NULL;
  943|       |
  944|       |	/* If a pathname is UTF-8, prepare a string conversion object
  945|       |	 * for UTF-8 and use it. */
  946|     86|	if (file->attr & ATTR_NAME_IS_UTF) {
  ------------------
  |  |  238|     86|#define ATTR_NAME_IS_UTF	0x80
  ------------------
  |  Branch (946:6): [True: 3, False: 83]
  ------------------
  947|      3|		if (cab->sconv_utf8 == NULL) {
  ------------------
  |  Branch (947:7): [True: 3, False: 0]
  ------------------
  948|      3|			cab->sconv_utf8 =
  949|      3|			    archive_string_conversion_from_charset(
  950|      3|				&(a->archive), "UTF-8", 1);
  951|      3|			if (cab->sconv_utf8 == NULL)
  ------------------
  |  Branch (951:8): [True: 0, False: 3]
  ------------------
  952|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  953|      3|		}
  954|      3|		sconv = cab->sconv_utf8;
  955|     83|	} else if (cab->sconv != NULL) {
  ------------------
  |  Branch (955:13): [True: 0, False: 83]
  ------------------
  956|       |		/* Choose the conversion specified by the option. */
  957|      0|		sconv = cab->sconv;
  958|     83|	} else {
  959|       |		/* Choose the default conversion. */
  960|     83|		if (!cab->init_default_conversion) {
  ------------------
  |  Branch (960:7): [True: 67, False: 16]
  ------------------
  961|     67|			cab->sconv_default =
  962|     67|			    archive_string_default_conversion_for_read(
  963|     67|			      &(a->archive));
  964|     67|			cab->init_default_conversion = 1;
  965|     67|		}
  966|     83|		sconv = cab->sconv_default;
  967|     83|	}
  968|       |
  969|       |	/*
  970|       |	 * Set a default value and common data
  971|       |	 */
  972|     86|	r = cab_convert_path_separator_1(&(file->pathname), file->attr);
  973|     86|	if (archive_entry_copy_pathname_l(entry, file->pathname.s,
  ------------------
  |  |   80|     86|#define archive_entry_copy_pathname_l	_archive_entry_copy_pathname_l
  ------------------
  |  Branch (973:6): [True: 3, False: 83]
  ------------------
  974|     86|	    archive_strlen(&(file->pathname)), sconv) != 0) {
  ------------------
  |  |  178|     86|#define	archive_strlen(a) ((a)->length)
  ------------------
  975|      3|		if (errno == ENOMEM) {
  ------------------
  |  Branch (975:7): [True: 0, False: 3]
  ------------------
  976|      0|			archive_set_error(&a->archive, ENOMEM,
  977|      0|			    "Can't allocate memory for Pathname");
  978|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  979|      0|		}
  980|      3|		archive_set_error(&a->archive,
  981|      3|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      3|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  982|      3|		    "Pathname cannot be converted "
  983|      3|		    "from %s to current locale",
  984|      3|		    archive_string_conversion_charset_name(sconv));
  985|      3|		err = ARCHIVE_WARN;
  ------------------
  |  |  235|      3|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  986|      3|	}
  987|     86|	if (r < 0) {
  ------------------
  |  Branch (987:6): [True: 0, False: 86]
  ------------------
  988|       |		/* Convert a path separator '\' -> '/' */
  989|      0|		cab_convert_path_separator_2(cab, entry);
  990|      0|	}
  991|       |
  992|     86|	archive_entry_set_size(entry, file->uncompressed_size);
  993|     86|	if (file->attr & ATTR_RDONLY)
  ------------------
  |  |  237|     86|#define ATTR_RDONLY		0x01
  ------------------
  |  Branch (993:6): [True: 14, False: 72]
  ------------------
  994|     14|		archive_entry_set_mode(entry, AE_IFREG | 0555);
  ------------------
  |  |  216|     14|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
  995|     72|	else
  996|     72|		archive_entry_set_mode(entry, AE_IFREG | 0666);
  ------------------
  |  |  216|     72|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
  997|     86|	archive_entry_set_mtime(entry, file->mtime, 0);
  998|       |
  999|     86|	cab->entry_bytes_remaining = file->uncompressed_size;
 1000|     86|	cab->entry_offset = 0;
 1001|       |	/* We don't need compress data. */
 1002|     86|	if (file->uncompressed_size == 0)
  ------------------
  |  Branch (1002:6): [True: 0, False: 86]
  ------------------
 1003|      0|		cab->end_of_entry_cleanup = cab->end_of_entry = 1;
 1004|       |
 1005|       |	/* Set up a more descriptive format name. */
 1006|     86|	snprintf(cab->format_name, sizeof(cab->format_name), "CAB %d.%d (%s)",
 1007|     86|	    hd->major, hd->minor, cab->entry_cffolder->compname);
 1008|     86|	a->archive.archive_format_name = cab->format_name;
 1009|       |
 1010|     86|	return (err);
 1011|     86|}
archive_read_support_format_cab.c:cab_read_header:
  625|     72|{
  626|     72|	const unsigned char *p;
  627|     72|	struct cab *cab;
  628|     72|	struct cfheader *hd;
  629|     72|	size_t bytes, used;
  630|     72|	ssize_t len;
  631|     72|	int64_t skip;
  632|     72|	int err, i;
  633|     72|	int cur_folder, prev_folder;
  634|     72|	uint32_t offset32;
  635|       |	
  636|     72|	a->archive.archive_format = ARCHIVE_FORMAT_CAB;
  ------------------
  |  |  383|     72|#define	ARCHIVE_FORMAT_CAB			0xC0000
  ------------------
  637|     72|	if (a->archive.archive_format_name == NULL)
  ------------------
  |  Branch (637:6): [True: 72, False: 0]
  ------------------
  638|     72|		a->archive.archive_format_name = "CAB";
  639|       |
  640|     72|	if ((p = __archive_read_ahead(a, 42, NULL)) == NULL)
  ------------------
  |  Branch (640:6): [True: 0, False: 72]
  ------------------
  641|      0|		return (truncated_error(a));
  642|       |
  643|     72|	cab = (struct cab *)(a->format->data);
  644|     72|	if (cab->found_header == 0 &&
  ------------------
  |  Branch (644:6): [True: 72, False: 0]
  ------------------
  645|     72|	    p[0] == 'M' && p[1] == 'Z') {
  ------------------
  |  Branch (645:6): [True: 72, False: 0]
  |  Branch (645:21): [True: 45, False: 27]
  ------------------
  646|       |		/* This is an executable?  Must be self-extracting... */
  647|     45|		err = cab_skip_sfx(a);
  648|     45|		if (err < ARCHIVE_WARN)
  ------------------
  |  |  235|     45|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (648:7): [True: 0, False: 45]
  ------------------
  649|      0|			return (err);
  650|       |
  651|       |		/* Re-read header after processing the SFX. */
  652|     45|		if ((p = __archive_read_ahead(a, 42, NULL)) == NULL)
  ------------------
  |  Branch (652:7): [True: 0, False: 45]
  ------------------
  653|      0|			return (truncated_error(a));
  654|     45|	}
  655|       |
  656|     72|	cab->cab_offset = 0;
  657|       |	/*
  658|       |	 * Read CFHEADER.
  659|       |	 */
  660|     72|	hd = &cab->cfheader;
  661|     72|	if (p[CFHEADER_signature+0] != 'M' || p[CFHEADER_signature+1] != 'S' ||
  ------------------
  |  |  150|     72|#define CFHEADER_signature	0
  ------------------
              	if (p[CFHEADER_signature+0] != 'M' || p[CFHEADER_signature+1] != 'S' ||
  ------------------
  |  |  150|     72|#define CFHEADER_signature	0
  ------------------
  |  Branch (661:6): [True: 0, False: 72]
  |  Branch (661:40): [True: 0, False: 72]
  ------------------
  662|     72|	    p[CFHEADER_signature+2] != 'C' || p[CFHEADER_signature+3] != 'F') {
  ------------------
  |  |  150|     72|#define CFHEADER_signature	0
  ------------------
              	    p[CFHEADER_signature+2] != 'C' || p[CFHEADER_signature+3] != 'F') {
  ------------------
  |  |  150|     72|#define CFHEADER_signature	0
  ------------------
  |  Branch (662:6): [True: 0, False: 72]
  |  Branch (662:40): [True: 0, False: 72]
  ------------------
  663|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  664|      0|		    "Couldn't find out CAB header");
  665|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  666|      0|	}
  667|     72|	hd->total_bytes = archive_le32dec(p + CFHEADER_cbCabinet);
  ------------------
  |  |  151|     72|#define CFHEADER_cbCabinet	8
  ------------------
  668|     72|	hd->files_offset = archive_le32dec(p + CFHEADER_coffFiles);
  ------------------
  |  |  152|     72|#define CFHEADER_coffFiles	16
  ------------------
  669|     72|	hd->minor = p[CFHEADER_versionMinor];
  ------------------
  |  |  153|     72|#define CFHEADER_versionMinor	24
  ------------------
  670|     72|	hd->major = p[CFHEADER_versionMajor];
  ------------------
  |  |  154|     72|#define CFHEADER_versionMajor	25
  ------------------
  671|     72|	hd->folder_count = archive_le16dec(p + CFHEADER_cFolders);
  ------------------
  |  |  155|     72|#define CFHEADER_cFolders	26
  ------------------
  672|     72|	if (hd->folder_count == 0)
  ------------------
  |  Branch (672:6): [True: 0, False: 72]
  ------------------
  673|      0|		goto invalid;
  674|     72|	hd->file_count = archive_le16dec(p + CFHEADER_cFiles);
  ------------------
  |  |  156|     72|#define CFHEADER_cFiles		28
  ------------------
  675|     72|	if (hd->file_count == 0)
  ------------------
  |  Branch (675:6): [True: 0, False: 72]
  ------------------
  676|      0|		goto invalid;
  677|     72|	hd->flags = archive_le16dec(p + CFHEADER_flags);
  ------------------
  |  |  157|     72|#define CFHEADER_flags		30
  ------------------
  678|     72|	hd->setid = archive_le16dec(p + CFHEADER_setID);
  ------------------
  |  |  158|     72|#define CFHEADER_setID		32
  ------------------
  679|     72|	hd->cabinet = archive_le16dec(p + CFHEADER_iCabinet);
  ------------------
  |  |  159|     72|#define CFHEADER_iCabinet	34
  ------------------
  680|     72|	used = CFHEADER_iCabinet + 2;
  ------------------
  |  |  159|     72|#define CFHEADER_iCabinet	34
  ------------------
  681|     72|	if (hd->flags & RESERVE_PRESENT) {
  ------------------
  |  |  251|     72|#define RESERVE_PRESENT	0x0004
  ------------------
  |  Branch (681:6): [True: 0, False: 72]
  ------------------
  682|      0|		uint16_t cfheader;
  683|      0|		cfheader = archive_le16dec(p + CFHEADER_cbCFHeader);
  ------------------
  |  |  160|      0|#define CFHEADER_cbCFHeader	36
  ------------------
  684|      0|		if (cfheader > 60000U)
  ------------------
  |  Branch (684:7): [True: 0, False: 0]
  ------------------
  685|      0|			goto invalid;
  686|      0|		hd->cffolder = p[CFHEADER_cbCFFolder];
  ------------------
  |  |  161|      0|#define CFHEADER_cbCFFolder	38
  ------------------
  687|      0|		hd->cfdata = p[CFHEADER_cbCFData];
  ------------------
  |  |  162|      0|#define CFHEADER_cbCFData	39
  ------------------
  688|      0|		used += 4;/* cbCFHeader, cbCFFolder and cbCFData */
  689|      0|		used += cfheader;/* abReserve */
  690|      0|	} else
  691|     72|		hd->cffolder = 0;/* Avoid compiling warning. */
  692|     72|	if (hd->flags & PREV_CABINET) {
  ------------------
  |  |  249|     72|#define PREV_CABINET	0x0001
  ------------------
  |  Branch (692:6): [True: 0, False: 72]
  ------------------
  693|       |		/* How many bytes are used for szCabinetPrev. */
  694|      0|		if ((p = __archive_read_ahead(a, used+256, NULL)) == NULL)
  ------------------
  |  Branch (694:7): [True: 0, False: 0]
  ------------------
  695|      0|			return (truncated_error(a));
  696|      0|		if ((len = cab_strnlen(p + used, 255)) <= 0)
  ------------------
  |  Branch (696:7): [True: 0, False: 0]
  ------------------
  697|      0|			goto invalid;
  698|      0|		used += len + 1;
  699|       |		/* How many bytes are used for szDiskPrev. */
  700|      0|		if ((p = __archive_read_ahead(a, used+256, NULL)) == NULL)
  ------------------
  |  Branch (700:7): [True: 0, False: 0]
  ------------------
  701|      0|			return (truncated_error(a));
  702|      0|		if ((len = cab_strnlen(p + used, 255)) <= 0)
  ------------------
  |  Branch (702:7): [True: 0, False: 0]
  ------------------
  703|      0|			goto invalid;
  704|      0|		used += len + 1;
  705|      0|	}
  706|     72|	if (hd->flags & NEXT_CABINET) {
  ------------------
  |  |  250|     72|#define NEXT_CABINET	0x0002
  ------------------
  |  Branch (706:6): [True: 2, False: 70]
  ------------------
  707|       |		/* How many bytes are used for szCabinetNext. */
  708|      2|		if ((p = __archive_read_ahead(a, used+256, NULL)) == NULL)
  ------------------
  |  Branch (708:7): [True: 0, False: 2]
  ------------------
  709|      0|			return (truncated_error(a));
  710|      2|		if ((len = cab_strnlen(p + used, 255)) <= 0)
  ------------------
  |  Branch (710:7): [True: 0, False: 2]
  ------------------
  711|      0|			goto invalid;
  712|      2|		used += len + 1;
  713|       |		/* How many bytes are used for szDiskNext. */
  714|      2|		if ((p = __archive_read_ahead(a, used+256, NULL)) == NULL)
  ------------------
  |  Branch (714:7): [True: 0, False: 2]
  ------------------
  715|      0|			return (truncated_error(a));
  716|      2|		if ((len = cab_strnlen(p + used, 255)) <= 0)
  ------------------
  |  Branch (716:7): [True: 0, False: 2]
  ------------------
  717|      0|			goto invalid;
  718|      2|		used += len + 1;
  719|      2|	}
  720|     72|	__archive_read_consume(a, used);
  721|     72|	cab->cab_offset += used;
  722|     72|	used = 0;
  723|       |
  724|       |	/*
  725|       |	 * Read CFFOLDER.
  726|       |	 */
  727|     72|	hd->folder_array = calloc(
  728|     72|	    hd->folder_count, sizeof(struct cffolder));
  729|     72|	if (hd->folder_array == NULL)
  ------------------
  |  Branch (729:6): [True: 0, False: 72]
  ------------------
  730|      0|		goto nomem;
  731|       |	
  732|     72|	bytes = 8;
  733|     72|	if (hd->flags & RESERVE_PRESENT)
  ------------------
  |  |  251|     72|#define RESERVE_PRESENT	0x0004
  ------------------
  |  Branch (733:6): [True: 0, False: 72]
  ------------------
  734|      0|		bytes += hd->cffolder;
  735|     72|	bytes *= hd->folder_count;
  736|     72|	if ((p = __archive_read_ahead(a, bytes, NULL)) == NULL)
  ------------------
  |  Branch (736:6): [True: 0, False: 72]
  ------------------
  737|      0|		return (truncated_error(a));
  738|     72|	offset32 = 0;
  739|    575|	for (i = 0; i < hd->folder_count; i++) {
  ------------------
  |  Branch (739:14): [True: 505, False: 70]
  ------------------
  740|    505|		struct cffolder *folder = &(hd->folder_array[i]);
  741|    505|		folder->cfdata_offset_in_cab =
  742|    505|		    archive_le32dec(p + CFFOLDER_coffCabStart);
  ------------------
  |  |  165|    505|#define CFFOLDER_coffCabStart	0
  ------------------
  743|    505|		folder->cfdata_count = archive_le16dec(p+CFFOLDER_cCFData);
  ------------------
  |  |  166|    505|#define CFFOLDER_cCFData	4
  ------------------
  744|    505|		folder->comptype =
  745|    505|		    archive_le16dec(p+CFFOLDER_typeCompress) & 0x0F;
  ------------------
  |  |  167|    505|#define CFFOLDER_typeCompress	6
  ------------------
  746|    505|		folder->compdata =
  747|    505|		    archive_le16dec(p+CFFOLDER_typeCompress) >> 8;
  ------------------
  |  |  167|    505|#define CFFOLDER_typeCompress	6
  ------------------
  748|       |		/* Get a compression name. */
  749|    505|		if (folder->comptype <
  ------------------
  |  Branch (749:7): [True: 329, False: 176]
  ------------------
  750|    505|		    sizeof(compression_name) / sizeof(compression_name[0]))
  751|    329|			folder->compname = compression_name[folder->comptype];
  752|    176|		else
  753|    176|			folder->compname = "UNKNOWN";
  754|    505|		p += 8;
  755|    505|		used += 8;
  756|    505|		if (hd->flags & RESERVE_PRESENT) {
  ------------------
  |  |  251|    505|#define RESERVE_PRESENT	0x0004
  ------------------
  |  Branch (756:7): [True: 0, False: 505]
  ------------------
  757|      0|			p += hd->cffolder;/* abReserve */
  758|      0|			used += hd->cffolder;
  759|      0|		}
  760|       |		/*
  761|       |		 * Sanity check if each data is acceptable.
  762|       |		 */
  763|    505|		if (offset32 >= folder->cfdata_offset_in_cab)
  ------------------
  |  Branch (763:7): [True: 2, False: 503]
  ------------------
  764|      2|			goto invalid;
  765|    503|		offset32 = folder->cfdata_offset_in_cab;
  766|       |
  767|       |		/* Set a request to initialize zlib for the CFDATA of
  768|       |		 * this folder. */
  769|    503|		folder->decompress_init = 0;
  770|    503|	}
  771|     70|	__archive_read_consume(a, used);
  772|     70|	cab->cab_offset += used;
  773|       |
  774|       |	/*
  775|       |	 * Read CFFILE.
  776|       |	 */
  777|       |	/* Seek read pointer to the offset of CFFILE if needed. */
  778|     70|	skip = (int64_t)hd->files_offset - cab->cab_offset;
  779|     70|	if (skip <  0) {
  ------------------
  |  Branch (779:6): [True: 0, False: 70]
  ------------------
  780|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  781|      0|		    "Invalid offset of CFFILE %jd < %jd",
  782|      0|		    (intmax_t)hd->files_offset, (intmax_t)cab->cab_offset);
  783|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  784|      0|	}
  785|     70|	if (skip) {
  ------------------
  |  Branch (785:6): [True: 0, False: 70]
  ------------------
  786|      0|		__archive_read_consume(a, skip);
  787|      0|		cab->cab_offset += skip;
  788|      0|	}
  789|       |	/* Allocate memory for CFDATA */
  790|     70|	hd->file_array = calloc(
  791|     70|	    hd->file_count, sizeof(struct cffile));
  792|     70|	if (hd->file_array == NULL)
  ------------------
  |  Branch (792:6): [True: 0, False: 70]
  ------------------
  793|      0|		goto nomem;
  794|       |
  795|     70|	prev_folder = -1;
  796|    160|	for (i = 0; i < hd->file_count; i++) {
  ------------------
  |  Branch (796:14): [True: 90, False: 70]
  ------------------
  797|     90|		struct cffile *file = &(hd->file_array[i]);
  798|     90|		ssize_t avail;
  799|       |
  800|     90|		if ((p = __archive_read_ahead(a, 16, NULL)) == NULL)
  ------------------
  |  Branch (800:7): [True: 0, False: 90]
  ------------------
  801|      0|			return (truncated_error(a));
  802|     90|		file->uncompressed_size = archive_le32dec(p + CFFILE_cbFile);
  ------------------
  |  |  171|     90|#define CFFILE_cbFile		0
  ------------------
  803|     90|		file->offset = archive_le32dec(p + CFFILE_uoffFolderStart);
  ------------------
  |  |  172|     90|#define CFFILE_uoffFolderStart	4
  ------------------
  804|     90|		file->folder = archive_le16dec(p + CFFILE_iFolder);
  ------------------
  |  |  173|     90|#define CFFILE_iFolder		8
  ------------------
  805|     90|		file->mtime = cab_dos_time(p + CFFILE_date_time);
  ------------------
  |  |  174|     90|#define CFFILE_date_time	10
  ------------------
  806|     90|		file->attr = (uint8_t)archive_le16dec(p + CFFILE_attribs);
  ------------------
  |  |  175|     90|#define CFFILE_attribs		14
  ------------------
  807|     90|		__archive_read_consume(a, 16);
  808|       |
  809|     90|		cab->cab_offset += 16;
  810|     90|		if ((p = cab_read_ahead_remaining(a, 256, &avail)) == NULL)
  ------------------
  |  Branch (810:7): [True: 0, False: 90]
  ------------------
  811|      0|			return (truncated_error(a));
  812|     90|		if ((len = cab_strnlen(p, avail-1)) <= 0)
  ------------------
  |  Branch (812:7): [True: 0, False: 90]
  ------------------
  813|      0|			goto invalid;
  814|       |
  815|       |		/* Copy a pathname.  */
  816|     90|		archive_string_init(&(file->pathname));
  ------------------
  |  |   71|     90|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 90]
  |  |  ------------------
  ------------------
  817|     90|		archive_strncpy(&(file->pathname), p, len);
  ------------------
  |  |  173|     90|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
  818|     90|		__archive_read_consume(a, len + 1);
  819|     90|		cab->cab_offset += len + 1;
  820|       |
  821|       |		/*
  822|       |		 * Sanity check if each data is acceptable.
  823|       |		 */
  824|     90|		if (file->uncompressed_size > 0x7FFF8000)
  ------------------
  |  Branch (824:7): [True: 0, False: 90]
  ------------------
  825|      0|			goto invalid;/* Too large */
  826|     90|		if ((int64_t)file->offset + (int64_t)file->uncompressed_size
  ------------------
  |  Branch (826:7): [True: 0, False: 90]
  ------------------
  827|     90|		    > ARCHIVE_LITERAL_LL(0x7FFF8000))
  ------------------
  |  |  179|     90|# define	ARCHIVE_LITERAL_LL(x)	x##ll
  ------------------
  828|      0|			goto invalid;/* Too large */
  829|     90|		switch (file->folder) {
  830|     10|		case iFoldCONTINUED_TO_NEXT:
  ------------------
  |  |  234|     10|#define iFoldCONTINUED_TO_NEXT		0xFFFE
  ------------------
  |  Branch (830:3): [True: 10, False: 80]
  ------------------
  831|       |			/* This must be last file in a folder. */
  832|     10|			if (i != hd->file_count -1)
  ------------------
  |  Branch (832:8): [True: 0, False: 10]
  ------------------
  833|      0|				goto invalid;
  834|     10|			cur_folder = hd->folder_count -1;
  835|     10|			break;
  836|      0|		case iFoldCONTINUED_PREV_AND_NEXT:
  ------------------
  |  |  235|      0|#define iFoldCONTINUED_PREV_AND_NEXT	0xFFFF
  ------------------
  |  Branch (836:3): [True: 0, False: 90]
  ------------------
  837|       |			/* This must be only one file in a folder. */
  838|      0|			if (hd->file_count != 1)
  ------------------
  |  Branch (838:8): [True: 0, False: 0]
  ------------------
  839|      0|				goto invalid;
  840|       |			/* FALL THROUGH */
  841|      3|		case iFoldCONTINUED_FROM_PREV:
  ------------------
  |  |  233|      3|#define iFoldCONTINUED_FROM_PREV	0xFFFD
  ------------------
  |  Branch (841:3): [True: 3, False: 87]
  ------------------
  842|       |			/* This must be first file in a folder. */
  843|      3|			if (i != 0)
  ------------------
  |  Branch (843:8): [True: 0, False: 3]
  ------------------
  844|      0|				goto invalid;
  845|      3|			prev_folder = cur_folder = 0;
  846|      3|			offset32 = file->offset;
  847|      3|			break;
  848|     77|		default:
  ------------------
  |  Branch (848:3): [True: 77, False: 13]
  ------------------
  849|     77|			if (file->folder >= hd->folder_count)
  ------------------
  |  Branch (849:8): [True: 0, False: 77]
  ------------------
  850|      0|				goto invalid;
  851|     77|			cur_folder = file->folder;
  852|     77|			break;
  853|     90|		}
  854|       |		/* Dot not back track. */
  855|     90|		if (cur_folder < prev_folder)
  ------------------
  |  Branch (855:7): [True: 0, False: 90]
  ------------------
  856|      0|			goto invalid;
  857|     90|		if (cur_folder != prev_folder)
  ------------------
  |  Branch (857:7): [True: 67, False: 23]
  ------------------
  858|     67|			offset32 = 0;
  859|     90|		prev_folder = cur_folder;
  860|       |
  861|       |		/* Make sure there are not any blanks from last file
  862|       |		 * contents. */
  863|     90|		if (offset32 != file->offset)
  ------------------
  |  Branch (863:7): [True: 0, False: 90]
  ------------------
  864|      0|			goto invalid;
  865|     90|		offset32 += file->uncompressed_size;
  866|       |
  867|       |		/* CFDATA is available for file contents. */
  868|     90|		if (file->uncompressed_size > 0 &&
  ------------------
  |  Branch (868:7): [True: 90, False: 0]
  ------------------
  869|     90|		    hd->folder_array[cur_folder].cfdata_count == 0)
  ------------------
  |  Branch (869:7): [True: 0, False: 90]
  ------------------
  870|      0|			goto invalid;
  871|     90|	}
  872|       |
  873|     70|	if (hd->cabinet != 0 || hd->flags & (PREV_CABINET | NEXT_CABINET)) {
  ------------------
  |  |  249|     68|#define PREV_CABINET	0x0001
  ------------------
              	if (hd->cabinet != 0 || hd->flags & (PREV_CABINET | NEXT_CABINET)) {
  ------------------
  |  |  250|     68|#define NEXT_CABINET	0x0002
  ------------------
  |  Branch (873:6): [True: 2, False: 68]
  |  Branch (873:26): [True: 0, False: 68]
  ------------------
  874|      2|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      2|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  875|      2|		    "Multivolume cabinet file is unsupported");
  876|      2|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|      2|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  877|      2|	}
  878|     68|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     68|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  879|      2|invalid:
  880|      2|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      2|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  881|      2|	    "Invalid CAB header");
  882|      2|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  883|      0|nomem:
  884|      0|	archive_set_error(&a->archive, ENOMEM,
  885|      0|	    "Can't allocate memory for CAB data");
  886|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  887|     70|}
archive_read_support_format_cab.c:truncated_error:
  537|      2|{
  538|      2|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      2|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  539|      2|	    "Truncated CAB header");
  540|      2|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  541|      2|}
archive_read_support_format_cab.c:cab_skip_sfx:
  495|     45|{
  496|     45|	const char *p, *q;
  497|     45|	size_t skip;
  498|     45|	ssize_t bytes, window;
  499|       |
  500|     45|	window = 4096;
  501|     47|	for (;;) {
  502|     47|		const char *h = __archive_read_ahead(a, window, &bytes);
  503|     47|		if (h == NULL) {
  ------------------
  |  Branch (503:7): [True: 2, False: 45]
  ------------------
  504|       |			/* Remaining size are less than window. */
  505|      2|			window >>= 1;
  506|      2|			if (window < 128) {
  ------------------
  |  Branch (506:8): [True: 0, False: 2]
  ------------------
  507|      0|				archive_set_error(&a->archive,
  508|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  509|      0|				    "Couldn't find out CAB header");
  510|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  511|      0|			}
  512|      2|			continue;
  513|      2|		}
  514|     45|		p = h;
  515|     45|		q = p + bytes;
  516|       |
  517|       |		/*
  518|       |		 * Scan ahead until we find something that looks
  519|       |		 * like the cab header.
  520|       |		 */
  521|  32.7k|		while (p + 8 < q) {
  ------------------
  |  Branch (521:10): [True: 32.7k, False: 0]
  ------------------
  522|  32.7k|			int next;
  523|  32.7k|			if ((next = find_cab_magic(p)) == 0) {
  ------------------
  |  Branch (523:8): [True: 45, False: 32.7k]
  ------------------
  524|     45|				skip = p - h;
  525|     45|				__archive_read_consume(a, skip);
  526|     45|				return (ARCHIVE_OK);
  ------------------
  |  |  233|     45|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  527|     45|			}
  528|  32.7k|			p += next;
  529|  32.7k|		}
  530|      0|		skip = p - h;
  531|      0|		__archive_read_consume(a, skip);
  532|      0|	}
  533|     45|}
archive_read_support_format_cab.c:cab_strnlen:
  545|     94|{
  546|     94|	size_t i;
  547|       |
  548|  23.7k|	for (i = 0; i <= maxlen; i++) {
  ------------------
  |  Branch (548:14): [True: 23.7k, False: 0]
  ------------------
  549|  23.7k|		if (p[i] == 0)
  ------------------
  |  Branch (549:7): [True: 94, False: 23.6k]
  ------------------
  550|     94|			break;
  551|  23.7k|	}
  552|     94|	if (i > maxlen)
  ------------------
  |  Branch (552:6): [True: 0, False: 94]
  ------------------
  553|      0|		return (-1);/* invalid */
  554|     94|	return ((ssize_t)i);
  555|     94|}
archive_read_support_format_cab.c:cab_dos_time:
 2074|     90|{
 2075|     90|	int msTime, msDate;
 2076|     90|	struct tm ts;
 2077|       |
 2078|     90|	msDate = archive_le16dec(p);
 2079|     90|	msTime = archive_le16dec(p+2);
 2080|       |
 2081|     90|	memset(&ts, 0, sizeof(ts));
 2082|     90|	ts.tm_year = ((msDate >> 9) & 0x7f) + 80;   /* Years since 1900. */
 2083|     90|	ts.tm_mon = ((msDate >> 5) & 0x0f) - 1;     /* Month number.     */
 2084|     90|	ts.tm_mday = msDate & 0x1f;		    /* Day of month.     */
 2085|     90|	ts.tm_hour = (msTime >> 11) & 0x1f;
 2086|     90|	ts.tm_min = (msTime >> 5) & 0x3f;
 2087|     90|	ts.tm_sec = (msTime << 1) & 0x3e;
 2088|     90|	ts.tm_isdst = -1;
 2089|     90|	return (mktime(&ts));
 2090|     90|}
archive_read_support_format_cab.c:cab_read_ahead_remaining:
  560|     90|{
  561|     90|	const void *p;
  562|       |
  563|     90|	while (min > 0) {
  ------------------
  |  Branch (563:9): [True: 90, False: 0]
  ------------------
  564|     90|		p = __archive_read_ahead(a, min, avail);
  565|     90|		if (p != NULL)
  ------------------
  |  Branch (565:7): [True: 90, False: 0]
  ------------------
  566|     90|			return (p);
  567|      0|		min--;
  568|      0|	}
  569|      0|	return (NULL);
  570|     90|}
archive_read_support_format_cab.c:cab_convert_path_separator_1:
  575|     86|{
  576|     86|	size_t i;
  577|     86|	int mb;
  578|       |
  579|       |	/* Easy check if we have '\' in multi-byte string. */
  580|     86|	mb = 0;
  581|  23.4k|	for (i = 0; i < archive_strlen(fn); i++) {
  ------------------
  |  |  178|  23.4k|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (581:14): [True: 23.3k, False: 86]
  ------------------
  582|  23.3k|		if (fn->s[i] == '\\') {
  ------------------
  |  Branch (582:7): [True: 37, False: 23.2k]
  ------------------
  583|     37|			if (mb) {
  ------------------
  |  Branch (583:8): [True: 0, False: 37]
  ------------------
  584|       |				/* This may be second byte of multi-byte
  585|       |				 * character. */
  586|      0|				break;
  587|      0|			}
  588|     37|			fn->s[i] = '/';
  589|     37|			mb = 0;
  590|  23.2k|		} else if ((fn->s[i] & 0x80) && !(attr & ATTR_NAME_IS_UTF))
  ------------------
  |  |  238|  6.59k|#define ATTR_NAME_IS_UTF	0x80
  ------------------
  |  Branch (590:14): [True: 6.59k, False: 16.6k]
  |  Branch (590:35): [True: 62, False: 6.53k]
  ------------------
  591|     62|			mb = 1;
  592|  23.2k|		else
  593|  23.2k|			mb = 0;
  594|  23.3k|	}
  595|     86|	if (i == archive_strlen(fn))
  ------------------
  |  |  178|     86|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (595:6): [True: 86, False: 0]
  ------------------
  596|     86|		return (0);
  597|      0|	return (-1);
  598|     86|}
archive_read_support_format_cab.c:archive_read_format_cab_read_data:
 1016|    146|{
 1017|    146|	struct cab *cab = (struct cab *)(a->format->data);
 1018|    146|	int r;
 1019|       |
 1020|    146|	switch (cab->entry_cffile->folder) {
 1021|      3|	case iFoldCONTINUED_FROM_PREV:
  ------------------
  |  |  233|      3|#define iFoldCONTINUED_FROM_PREV	0xFFFD
  ------------------
  |  Branch (1021:2): [True: 3, False: 143]
  ------------------
 1022|     12|	case iFoldCONTINUED_TO_NEXT:
  ------------------
  |  |  234|     12|#define iFoldCONTINUED_TO_NEXT		0xFFFE
  ------------------
  |  Branch (1022:2): [True: 9, False: 137]
  ------------------
 1023|     12|	case iFoldCONTINUED_PREV_AND_NEXT:
  ------------------
  |  |  235|     12|#define iFoldCONTINUED_PREV_AND_NEXT	0xFFFF
  ------------------
  |  Branch (1023:2): [True: 0, False: 146]
  ------------------
 1024|     12|		*buff = NULL;
 1025|     12|		*size = 0;
 1026|     12|		*offset = 0;
 1027|     12|		archive_clear_error(&a->archive);
 1028|     12|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     12|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1029|     12|		    "Cannot restore this file split in multivolume");
 1030|     12|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|     12|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1031|    134|	default:
  ------------------
  |  Branch (1031:2): [True: 134, False: 12]
  ------------------
 1032|    134|		break;
 1033|    146|	}
 1034|    134|	if (cab->read_data_invoked == 0) {
  ------------------
  |  Branch (1034:6): [True: 70, False: 64]
  ------------------
 1035|     70|		if (cab->bytes_skipped) {
  ------------------
  |  Branch (1035:7): [True: 3, False: 67]
  ------------------
 1036|      3|			if (cab->entry_cfdata == NULL) {
  ------------------
  |  Branch (1036:8): [True: 3, False: 0]
  ------------------
 1037|      3|				r = cab_next_cfdata(a);
 1038|      3|				if (r < 0)
  ------------------
  |  Branch (1038:9): [True: 0, False: 3]
  ------------------
 1039|      0|					return (r);
 1040|      3|			}
 1041|      3|			if (cab_consume_cfdata(a, cab->bytes_skipped) < 0)
  ------------------
  |  Branch (1041:8): [True: 0, False: 3]
  ------------------
 1042|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1043|      3|			cab->bytes_skipped = 0;
 1044|      3|		}
 1045|     70|		cab->read_data_invoked = 1;
 1046|     70|	}
 1047|    134|	if (cab->entry_unconsumed) {
  ------------------
  |  Branch (1047:6): [True: 37, False: 97]
  ------------------
 1048|       |		/* Consume as much as the compressor actually used. */
 1049|     37|		r = (int)cab_consume_cfdata(a, cab->entry_unconsumed);
 1050|     37|		cab->entry_unconsumed = 0;
 1051|     37|		if (r < 0)
  ------------------
  |  Branch (1051:7): [True: 0, False: 37]
  ------------------
 1052|      0|			return (r);
 1053|     37|	}
 1054|    134|	if (cab->end_of_archive || cab->end_of_entry) {
  ------------------
  |  Branch (1054:6): [True: 0, False: 134]
  |  Branch (1054:29): [True: 46, False: 88]
  ------------------
 1055|     46|		if (!cab->end_of_entry_cleanup) {
  ------------------
  |  Branch (1055:7): [True: 23, False: 23]
  ------------------
 1056|       |			/* End-of-entry cleanup done. */
 1057|     23|			cab->end_of_entry_cleanup = 1;
 1058|     23|		}
 1059|     46|		*offset = cab->entry_offset;
 1060|     46|		*size = 0;
 1061|     46|		*buff = NULL;
 1062|     46|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|     46|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1063|     46|	}
 1064|       |
 1065|     88|	return (cab_read_data(a, buff, size, offset));
 1066|    134|}
archive_read_support_format_cab.c:cab_next_cfdata:
 1201|    105|{
 1202|    105|	struct cab *cab = (struct cab *)(a->format->data);
 1203|    105|	struct cfdata *cfdata = cab->entry_cfdata;
 1204|       |
 1205|       |	/* There are remaining bytes in current CFDATA, use it first. */
 1206|    105|	if (cfdata != NULL && cfdata->uncompressed_bytes_remaining > 0)
  ------------------
  |  Branch (1206:6): [True: 35, False: 70]
  |  Branch (1206:24): [True: 14, False: 21]
  ------------------
 1207|     14|		return (ARCHIVE_OK);
  ------------------
  |  |  233|     14|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1208|       |
 1209|     91|	if (cfdata == NULL) {
  ------------------
  |  Branch (1209:6): [True: 70, False: 21]
  ------------------
 1210|     70|		int64_t skip;
 1211|       |
 1212|     70|		cab->entry_cffolder->cfdata_index = 0;
 1213|       |
 1214|       |		/* Seek read pointer to the offset of CFDATA if needed. */
 1215|     70|		skip = cab->entry_cffolder->cfdata_offset_in_cab
 1216|     70|			- cab->cab_offset;
 1217|     70|		if (skip < 0) {
  ------------------
  |  Branch (1217:7): [True: 2, False: 68]
  ------------------
 1218|      2|			int folder_index;
 1219|      2|			switch (cab->entry_cffile->folder) {
 1220|      0|			case iFoldCONTINUED_FROM_PREV:
  ------------------
  |  |  233|      0|#define iFoldCONTINUED_FROM_PREV	0xFFFD
  ------------------
  |  Branch (1220:4): [True: 0, False: 2]
  ------------------
 1221|      0|			case iFoldCONTINUED_PREV_AND_NEXT:
  ------------------
  |  |  235|      0|#define iFoldCONTINUED_PREV_AND_NEXT	0xFFFF
  ------------------
  |  Branch (1221:4): [True: 0, False: 2]
  ------------------
 1222|      0|				folder_index = 0;
 1223|      0|				break;
 1224|      0|			case iFoldCONTINUED_TO_NEXT:
  ------------------
  |  |  234|      0|#define iFoldCONTINUED_TO_NEXT		0xFFFE
  ------------------
  |  Branch (1224:4): [True: 0, False: 2]
  ------------------
 1225|      0|				folder_index = cab->cfheader.folder_count-1;
 1226|      0|				break;
 1227|      2|			default:
  ------------------
  |  Branch (1227:4): [True: 2, False: 0]
  ------------------
 1228|      2|				folder_index = cab->entry_cffile->folder;
 1229|      2|				break;
 1230|      2|			}
 1231|      2|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      2|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1232|      2|			    "Invalid offset of CFDATA in folder(%d) %jd < %jd",
 1233|      2|			    folder_index,
 1234|      2|			    (intmax_t)cab->entry_cffolder->cfdata_offset_in_cab,
 1235|      2|			    (intmax_t)cab->cab_offset);
 1236|      2|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1237|      2|		}
 1238|     68|		if (skip > 0) {
  ------------------
  |  Branch (1238:7): [True: 14, False: 54]
  ------------------
 1239|     14|			if (__archive_read_consume(a, skip) < 0)
  ------------------
  |  Branch (1239:8): [True: 0, False: 14]
  ------------------
 1240|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1241|     14|			cab->cab_offset =
 1242|     14|			    cab->entry_cffolder->cfdata_offset_in_cab;
 1243|     14|		}
 1244|     68|	}
 1245|       |
 1246|       |	/*
 1247|       |	 * Read a CFDATA.
 1248|       |	 */
 1249|     89|	if (cab->entry_cffolder->cfdata_index <
  ------------------
  |  Branch (1249:6): [True: 82, False: 7]
  ------------------
 1250|     89|	    cab->entry_cffolder->cfdata_count) {
 1251|     82|		const unsigned char *p;
 1252|     82|		int l;
 1253|       |
 1254|     82|		cfdata = &(cab->entry_cffolder->cfdata);
 1255|     82|		cab->entry_cffolder->cfdata_index++;
 1256|     82|		cab->entry_cfdata = cfdata;
 1257|     82|		cfdata->sum_calculated = 0;
 1258|     82|		cfdata->sum_extra_avail = 0;
 1259|     82|		cfdata->sum_ptr = NULL;
 1260|     82|		l = 8;
 1261|     82|		if (cab->cfheader.flags & RESERVE_PRESENT)
  ------------------
  |  |  251|     82|#define RESERVE_PRESENT	0x0004
  ------------------
  |  Branch (1261:7): [True: 0, False: 82]
  ------------------
 1262|      0|			l += cab->cfheader.cfdata;
 1263|     82|		if ((p = __archive_read_ahead(a, l, NULL)) == NULL)
  ------------------
  |  Branch (1263:7): [True: 2, False: 80]
  ------------------
 1264|      2|			return (truncated_error(a));
 1265|     80|		cfdata->sum = archive_le32dec(p + CFDATA_csum);
  ------------------
  |  |  178|     80|#define CFDATA_csum		0
  ------------------
 1266|     80|		cfdata->compressed_size = archive_le16dec(p + CFDATA_cbData);
  ------------------
  |  |  179|     80|#define CFDATA_cbData		4
  ------------------
 1267|     80|		cfdata->compressed_bytes_remaining = cfdata->compressed_size;
 1268|     80|		cfdata->uncompressed_size =
 1269|     80|		    archive_le16dec(p + CFDATA_cbUncomp);
  ------------------
  |  |  180|     80|#define CFDATA_cbUncomp		6
  ------------------
 1270|     80|		cfdata->uncompressed_bytes_remaining =
 1271|     80|		    cfdata->uncompressed_size;
 1272|     80|		cfdata->uncompressed_avail = 0;
 1273|     80|		cfdata->read_offset = 0;
 1274|     80|		cfdata->unconsumed = 0;
 1275|       |
 1276|       |		/*
 1277|       |		 * Sanity check if data size is acceptable.
 1278|       |		 */
 1279|     80|		if (cfdata->compressed_size == 0 ||
  ------------------
  |  Branch (1279:7): [True: 0, False: 80]
  ------------------
 1280|     80|		    cfdata->compressed_size > (0x8000+6144))
  ------------------
  |  Branch (1280:7): [True: 0, False: 80]
  ------------------
 1281|      0|			goto invalid;
 1282|     80|		if (cfdata->uncompressed_size > 0x8000)
  ------------------
  |  Branch (1282:7): [True: 0, False: 80]
  ------------------
 1283|      0|			goto invalid;
 1284|     80|		if (cfdata->uncompressed_size == 0) {
  ------------------
  |  Branch (1284:7): [True: 1, False: 79]
  ------------------
 1285|      1|			switch (cab->entry_cffile->folder) {
 1286|      0|			case iFoldCONTINUED_PREV_AND_NEXT:
  ------------------
  |  |  235|      0|#define iFoldCONTINUED_PREV_AND_NEXT	0xFFFF
  ------------------
  |  Branch (1286:4): [True: 0, False: 1]
  ------------------
 1287|      1|			case iFoldCONTINUED_TO_NEXT:
  ------------------
  |  |  234|      1|#define iFoldCONTINUED_TO_NEXT		0xFFFE
  ------------------
  |  Branch (1287:4): [True: 1, False: 0]
  ------------------
 1288|      1|				break;
 1289|      0|			case iFoldCONTINUED_FROM_PREV:
  ------------------
  |  |  233|      0|#define iFoldCONTINUED_FROM_PREV	0xFFFD
  ------------------
  |  Branch (1289:4): [True: 0, False: 1]
  ------------------
 1290|      0|			default:
  ------------------
  |  Branch (1290:4): [True: 0, False: 1]
  ------------------
 1291|      0|				goto invalid;
 1292|      1|			}
 1293|      1|		}
 1294|       |		/* If CFDATA is not last in a folder, an uncompressed
 1295|       |		 * size must be 0x8000(32KBi) */
 1296|     80|		if ((cab->entry_cffolder->cfdata_index <
  ------------------
  |  Branch (1296:7): [True: 46, False: 34]
  ------------------
 1297|     80|		     cab->entry_cffolder->cfdata_count) &&
 1298|     46|		       cfdata->uncompressed_size != 0x8000)
  ------------------
  |  Branch (1298:10): [True: 0, False: 46]
  ------------------
 1299|      0|			goto invalid;
 1300|       |
 1301|       |		/* A compressed data size and an uncompressed data size must
 1302|       |		 * be the same in no compression mode. */
 1303|     80|		if (cab->entry_cffolder->comptype == COMPTYPE_NONE &&
  ------------------
  |  |  215|    160|#define COMPTYPE_NONE		0x0000
  ------------------
  |  Branch (1303:7): [True: 3, False: 77]
  ------------------
 1304|      3|		    cfdata->compressed_size != cfdata->uncompressed_size)
  ------------------
  |  Branch (1304:7): [True: 0, False: 3]
  ------------------
 1305|      0|			goto invalid;
 1306|       |
 1307|       |		/*
 1308|       |		 * Save CFDATA image for sum check.
 1309|       |		 */
 1310|     80|		if (cfdata->memimage_size < (size_t)l) {
  ------------------
  |  Branch (1310:7): [True: 68, False: 12]
  ------------------
 1311|     68|			free(cfdata->memimage);
 1312|     68|			cfdata->memimage = malloc(l);
 1313|     68|			if (cfdata->memimage == NULL) {
  ------------------
  |  Branch (1313:8): [True: 0, False: 68]
  ------------------
 1314|      0|				archive_set_error(&a->archive, ENOMEM,
 1315|      0|				    "Can't allocate memory for CAB data");
 1316|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1317|      0|			}
 1318|     68|			cfdata->memimage_size = l;
 1319|     68|		}
 1320|     80|		memcpy(cfdata->memimage, p, l);
 1321|       |
 1322|       |		/* Consume bytes as much as we used. */
 1323|     80|		__archive_read_consume(a, l);
 1324|     80|		cab->cab_offset += l;
 1325|     80|	} else if (cab->entry_cffolder->cfdata_count > 0) {
  ------------------
  |  Branch (1325:13): [True: 7, False: 0]
  ------------------
 1326|       |		/* Run out of all CFDATA in a folder. */
 1327|      7|		cfdata->compressed_size = 0;
 1328|      7|		cfdata->uncompressed_size = 0;
 1329|      7|		cfdata->compressed_bytes_remaining = 0;
 1330|      7|		cfdata->uncompressed_bytes_remaining = 0;
 1331|      7|	} else {
 1332|       |		/* Current folder does not have any CFDATA. */
 1333|      0|		cfdata = &(cab->entry_cffolder->cfdata);
 1334|      0|		cab->entry_cfdata = cfdata;
 1335|      0|		memset(cfdata, 0, sizeof(*cfdata));
 1336|      0|	}
 1337|     87|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     87|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1338|      0|invalid:
 1339|      0|	cfdata->compressed_size = 0;
 1340|      0|	cfdata->compressed_bytes_remaining = 0;
 1341|      0|	cfdata->uncompressed_size = 0;
 1342|      0|	cfdata->uncompressed_bytes_remaining = 0;
 1343|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1344|      0|	    "Invalid CFDATA");
 1345|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1346|     89|}
archive_read_support_format_cab.c:cab_consume_cfdata:
 1793|     49|{
 1794|     49|	struct cab *cab = (struct cab *)(a->format->data);
 1795|     49|	struct cfdata *cfdata;
 1796|     49|	int64_t cbytes, rbytes;
 1797|     49|	int err;
 1798|       |
 1799|     49|	rbytes = cab_minimum_consume_cfdata(a, consumed_bytes);
 1800|     49|	if (rbytes < 0)
  ------------------
  |  Branch (1800:6): [True: 0, False: 49]
  ------------------
 1801|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1802|       |
 1803|     49|	cfdata = cab->entry_cfdata;
 1804|     56|	while (rbytes > 0) {
  ------------------
  |  Branch (1804:9): [True: 14, False: 42]
  ------------------
 1805|     14|		ssize_t avail;
 1806|       |
 1807|     14|		if (cfdata->compressed_size == 0) {
  ------------------
  |  Branch (1807:7): [True: 0, False: 14]
  ------------------
 1808|      0|			archive_set_error(&a->archive,
 1809|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1810|      0|			    "Invalid CFDATA");
 1811|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1812|      0|		}
 1813|     14|		cbytes = cfdata->uncompressed_bytes_remaining;
 1814|     14|		if (cbytes > rbytes)
  ------------------
  |  Branch (1814:7): [True: 3, False: 11]
  ------------------
 1815|      3|			cbytes = rbytes;
 1816|     14|		rbytes -= cbytes;
 1817|       |
 1818|     14|		if (cfdata->uncompressed_avail == 0 &&
  ------------------
  |  Branch (1818:7): [True: 7, False: 7]
  ------------------
 1819|      7|		   (cab->entry_cffile->folder == iFoldCONTINUED_PREV_AND_NEXT ||
  ------------------
  |  |  235|     14|#define iFoldCONTINUED_PREV_AND_NEXT	0xFFFF
  ------------------
  |  Branch (1819:7): [True: 0, False: 7]
  ------------------
 1820|      7|		    cab->entry_cffile->folder == iFoldCONTINUED_FROM_PREV)) {
  ------------------
  |  |  233|      7|#define iFoldCONTINUED_FROM_PREV	0xFFFD
  ------------------
  |  Branch (1820:7): [True: 0, False: 7]
  ------------------
 1821|       |			/* We have not read any data yet. */
 1822|      0|			if (cbytes == cfdata->uncompressed_bytes_remaining) {
  ------------------
  |  Branch (1822:8): [True: 0, False: 0]
  ------------------
 1823|       |				/* Skip whole current CFDATA. */
 1824|      0|				__archive_read_consume(a,
 1825|      0|				    cfdata->compressed_size);
 1826|      0|				cab->cab_offset += cfdata->compressed_size;
 1827|      0|				cfdata->compressed_bytes_remaining = 0;
 1828|      0|				cfdata->uncompressed_bytes_remaining = 0;
 1829|      0|				err = cab_next_cfdata(a);
 1830|      0|				if (err < 0)
  ------------------
  |  Branch (1830:9): [True: 0, False: 0]
  ------------------
 1831|      0|					return (err);
 1832|      0|				cfdata = cab->entry_cfdata;
 1833|      0|				if (cfdata->uncompressed_size == 0) {
  ------------------
  |  Branch (1833:9): [True: 0, False: 0]
  ------------------
 1834|      0|					switch (cab->entry_cffile->folder) {
 1835|      0|					case iFoldCONTINUED_PREV_AND_NEXT:
  ------------------
  |  |  235|      0|#define iFoldCONTINUED_PREV_AND_NEXT	0xFFFF
  ------------------
  |  Branch (1835:6): [True: 0, False: 0]
  ------------------
 1836|      0|					case iFoldCONTINUED_TO_NEXT:
  ------------------
  |  |  234|      0|#define iFoldCONTINUED_TO_NEXT		0xFFFE
  ------------------
  |  Branch (1836:6): [True: 0, False: 0]
  ------------------
 1837|      0|					case iFoldCONTINUED_FROM_PREV:
  ------------------
  |  |  233|      0|#define iFoldCONTINUED_FROM_PREV	0xFFFD
  ------------------
  |  Branch (1837:6): [True: 0, False: 0]
  ------------------
 1838|      0|						rbytes = 0;
 1839|      0|						break;
 1840|      0|					default:
  ------------------
  |  Branch (1840:6): [True: 0, False: 0]
  ------------------
 1841|      0|						break;
 1842|      0|					}
 1843|      0|				}
 1844|      0|				continue;
 1845|      0|			}
 1846|      0|			cfdata->read_offset += (uint16_t)cbytes;
 1847|      0|			cfdata->uncompressed_bytes_remaining -= (uint16_t)cbytes;
 1848|      0|			break;
 1849|     14|		} else if (cbytes == 0) {
  ------------------
  |  Branch (1849:14): [True: 7, False: 7]
  ------------------
 1850|      7|			err = cab_next_cfdata(a);
 1851|      7|			if (err < 0)
  ------------------
  |  Branch (1851:8): [True: 1, False: 6]
  ------------------
 1852|      1|				return (err);
 1853|      6|			cfdata = cab->entry_cfdata;
 1854|      6|			if (cfdata->uncompressed_size == 0) {
  ------------------
  |  Branch (1854:8): [True: 2, False: 4]
  ------------------
 1855|      2|				switch (cab->entry_cffile->folder) {
 1856|      0|				case iFoldCONTINUED_PREV_AND_NEXT:
  ------------------
  |  |  235|      0|#define iFoldCONTINUED_PREV_AND_NEXT	0xFFFF
  ------------------
  |  Branch (1856:5): [True: 0, False: 2]
  ------------------
 1857|      2|				case iFoldCONTINUED_TO_NEXT:
  ------------------
  |  |  234|      2|#define iFoldCONTINUED_TO_NEXT		0xFFFE
  ------------------
  |  Branch (1857:5): [True: 2, False: 0]
  ------------------
 1858|      2|				case iFoldCONTINUED_FROM_PREV:
  ------------------
  |  |  233|      2|#define iFoldCONTINUED_FROM_PREV	0xFFFD
  ------------------
  |  Branch (1858:5): [True: 0, False: 2]
  ------------------
 1859|      2|					return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1860|      0|				default:
  ------------------
  |  Branch (1860:5): [True: 0, False: 2]
  ------------------
 1861|      0|					break;
 1862|      2|				}
 1863|      2|			}
 1864|      4|			continue;
 1865|      6|		}
 1866|     10|		while (cbytes > 0) {
  ------------------
  |  Branch (1866:10): [True: 7, False: 3]
  ------------------
 1867|      7|			(void)cab_read_ahead_cfdata(a, &avail);
 1868|      7|			if (avail <= 0)
  ------------------
  |  Branch (1868:8): [True: 4, False: 3]
  ------------------
 1869|      4|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1870|      3|			if (avail > cbytes)
  ------------------
  |  Branch (1870:8): [True: 3, False: 0]
  ------------------
 1871|      3|				avail = (ssize_t)cbytes;
 1872|      3|			if (cab_minimum_consume_cfdata(a, avail) < 0)
  ------------------
  |  Branch (1872:8): [True: 0, False: 3]
  ------------------
 1873|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1874|      3|			cbytes -= avail;
 1875|      3|		}
 1876|      7|	}
 1877|     42|	return (consumed_bytes);
 1878|     49|}
archive_read_support_format_cab.c:cab_minimum_consume_cfdata:
 1886|    635|{
 1887|    635|	struct cab *cab = (struct cab *)(a->format->data);
 1888|    635|	struct cfdata *cfdata;
 1889|    635|	int64_t cbytes, rbytes;
 1890|    635|	int err;
 1891|       |
 1892|    635|	cfdata = cab->entry_cfdata;
 1893|    635|	rbytes = consumed_bytes;
 1894|    635|	if (cab->entry_cffolder->comptype == COMPTYPE_NONE) {
  ------------------
  |  |  215|    635|#define COMPTYPE_NONE		0x0000
  ------------------
  |  Branch (1894:6): [True: 9, False: 626]
  ------------------
 1895|      9|		if (consumed_bytes < cfdata->unconsumed)
  ------------------
  |  Branch (1895:7): [True: 3, False: 6]
  ------------------
 1896|      3|			cbytes = consumed_bytes;
 1897|      6|		else
 1898|      6|			cbytes = cfdata->unconsumed;
 1899|      9|		rbytes -= cbytes; 
 1900|      9|		cfdata->read_offset += (uint16_t)cbytes;
 1901|      9|		cfdata->uncompressed_bytes_remaining -= (uint16_t)cbytes;
 1902|      9|		cfdata->unconsumed -= cbytes;
 1903|    626|	} else {
 1904|    626|		cbytes = cfdata->uncompressed_avail - cfdata->read_offset;
 1905|    626|		if (cbytes > 0) {
  ------------------
  |  Branch (1905:7): [True: 43, False: 583]
  ------------------
 1906|     43|			if (consumed_bytes < cbytes)
  ------------------
  |  Branch (1906:8): [True: 23, False: 20]
  ------------------
 1907|     23|				cbytes = consumed_bytes;
 1908|     43|			rbytes -= cbytes;
 1909|     43|			cfdata->read_offset += (uint16_t)cbytes;
 1910|     43|			cfdata->uncompressed_bytes_remaining -= (uint16_t)cbytes;
 1911|     43|		}
 1912|       |
 1913|    626|		if (cfdata->unconsumed) {
  ------------------
  |  Branch (1913:7): [True: 582, False: 44]
  ------------------
 1914|    582|			cbytes = cfdata->unconsumed;
 1915|    582|			cfdata->unconsumed = 0;
 1916|    582|		} else
 1917|     44|			cbytes = 0;
 1918|    626|	}
 1919|    635|	if (cbytes) {
  ------------------
  |  Branch (1919:6): [True: 588, False: 47]
  ------------------
 1920|       |		/* Compute the sum. */
 1921|    588|		cab_checksum_update(a, (size_t)cbytes);
 1922|       |
 1923|       |		/* Consume as much as the compressor actually used. */
 1924|    588|		__archive_read_consume(a, cbytes);
 1925|    588|		cab->cab_offset += cbytes;
 1926|    588|		cfdata->compressed_bytes_remaining -= (uint16_t)cbytes;
 1927|    588|		if (cfdata->compressed_bytes_remaining == 0) {
  ------------------
  |  Branch (1927:7): [True: 32, False: 556]
  ------------------
 1928|     32|			err = cab_checksum_finish(a);
 1929|     32|			if (err < 0)
  ------------------
  |  Branch (1929:8): [True: 0, False: 32]
  ------------------
 1930|      0|				return (err);
 1931|     32|		}
 1932|    588|	}
 1933|    635|	return (rbytes);
 1934|    635|}
archive_read_support_format_cab.c:cab_checksum_update:
 1116|    588|{
 1117|    588|	struct cab *cab = (struct cab *)(a->format->data);
 1118|    588|	struct cfdata *cfdata = cab->entry_cfdata;
 1119|    588|	const unsigned char *p;
 1120|    588|	size_t sumbytes;
 1121|       |
 1122|    588|	if (cfdata->sum == 0 || cfdata->sum_ptr == NULL)
  ------------------
  |  Branch (1122:6): [True: 56, False: 532]
  |  Branch (1122:26): [True: 9, False: 523]
  ------------------
 1123|     65|		return;
 1124|       |	/*
 1125|       |	 * Calculate the sum of this CFDATA.
 1126|       |	 * Make sure CFDATA must be calculated in four bytes.
 1127|       |	 */
 1128|    523|	p = cfdata->sum_ptr;
 1129|    523|	sumbytes = bytes;
 1130|    523|	if (cfdata->sum_extra_avail) {
  ------------------
  |  Branch (1130:6): [True: 227, False: 296]
  ------------------
 1131|    678|		while (cfdata->sum_extra_avail < 4 && sumbytes > 0) {
  ------------------
  |  Branch (1131:10): [True: 455, False: 223]
  |  Branch (1131:41): [True: 451, False: 4]
  ------------------
 1132|    451|			cfdata->sum_extra[
 1133|    451|			    cfdata->sum_extra_avail++] = *p++;
 1134|    451|			sumbytes--;
 1135|    451|		}
 1136|    227|		if (cfdata->sum_extra_avail == 4) {
  ------------------
  |  Branch (1136:7): [True: 223, False: 4]
  ------------------
 1137|    223|			cfdata->sum_calculated = cab_checksum_cfdata_4(
 1138|    223|			    cfdata->sum_extra, 4, cfdata->sum_calculated);
 1139|    223|			cfdata->sum_extra_avail = 0;
 1140|    223|		}
 1141|    227|	}
 1142|    523|	if (sumbytes) {
  ------------------
  |  Branch (1142:6): [True: 513, False: 10]
  ------------------
 1143|    513|		int odd = sumbytes & 3;
 1144|    513|		if ((int)(sumbytes - odd) > 0)
  ------------------
  |  Branch (1144:7): [True: 497, False: 16]
  ------------------
 1145|    497|			cfdata->sum_calculated = cab_checksum_cfdata_4(
 1146|    497|			    p, sumbytes - odd, cfdata->sum_calculated);
 1147|    513|		if (odd)
  ------------------
  |  Branch (1147:7): [True: 260, False: 253]
  ------------------
 1148|    260|			memcpy(cfdata->sum_extra, p + sumbytes - odd, odd);
 1149|    513|		cfdata->sum_extra_avail = odd;
 1150|    513|	}
 1151|       |	cfdata->sum_ptr = NULL;
 1152|    523|}
archive_read_support_format_cab.c:cab_checksum_cfdata_4:
 1070|    764|{
 1071|    764|	const unsigned char *b;
 1072|    764|	unsigned u32num;
 1073|    764|	uint32_t sum;
 1074|       |
 1075|    764|	u32num = (unsigned)bytes / 4;
 1076|    764|	sum = seed;
 1077|    764|	b = p;
 1078|   142k|	for (;u32num > 0; --u32num) {
  ------------------
  |  Branch (1078:8): [True: 142k, False: 764]
  ------------------
 1079|   142k|		sum ^= archive_le32dec(b);
 1080|   142k|		b += 4;
 1081|   142k|	}
 1082|    764|	return (sum);
 1083|    764|}
archive_read_support_format_cab.c:cab_checksum_finish:
 1156|     32|{
 1157|     32|	struct cab *cab = (struct cab *)(a->format->data);
 1158|     32|	struct cfdata *cfdata = cab->entry_cfdata;
 1159|     32|	int l;
 1160|       |
 1161|       |	/* Do not need to compute a sum. */
 1162|     32|	if (cfdata->sum == 0)
  ------------------
  |  Branch (1162:6): [True: 2, False: 30]
  ------------------
 1163|      2|		return (ARCHIVE_OK);
  ------------------
  |  |  233|      2|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1164|       |
 1165|       |	/*
 1166|       |	 * Calculate the sum of remaining CFDATA.
 1167|       |	 */
 1168|     30|	if (cfdata->sum_extra_avail) {
  ------------------
  |  Branch (1168:6): [True: 14, False: 16]
  ------------------
 1169|     14|		cfdata->sum_calculated =
 1170|     14|		    cab_checksum_cfdata(cfdata->sum_extra,
 1171|     14|		       cfdata->sum_extra_avail, cfdata->sum_calculated);
 1172|     14|		cfdata->sum_extra_avail = 0;
 1173|     14|	}
 1174|       |
 1175|     30|	l = 4;
 1176|     30|	if (cab->cfheader.flags & RESERVE_PRESENT)
  ------------------
  |  |  251|     30|#define RESERVE_PRESENT	0x0004
  ------------------
  |  Branch (1176:6): [True: 0, False: 30]
  ------------------
 1177|      0|		l += cab->cfheader.cfdata;
 1178|     30|	if (cfdata->memimage == NULL) {
  ------------------
  |  Branch (1178:6): [True: 0, False: 30]
  ------------------
 1179|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1180|      0|	}
 1181|     30|	cfdata->sum_calculated = cab_checksum_cfdata(
 1182|     30|	    cfdata->memimage + CFDATA_cbData, l, cfdata->sum_calculated);
  ------------------
  |  |  179|     30|#define CFDATA_cbData		4
  ------------------
 1183|     30|	if (cfdata->sum_calculated != cfdata->sum) {
  ------------------
  |  Branch (1183:6): [True: 30, False: 0]
  ------------------
 1184|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 1185|       |		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
 1186|       |		    "Checksum error CFDATA[%d] %" PRIx32 ":%" PRIx32 " in %d bytes",
 1187|       |		    cab->entry_cffolder->cfdata_index -1,
 1188|       |		    cfdata->sum, cfdata->sum_calculated,
 1189|       |		    cfdata->compressed_size);
 1190|       |		return (ARCHIVE_FAILED);
 1191|       |#endif
 1192|     30|	}
 1193|     30|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     30|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1194|     30|}
archive_read_support_format_cab.c:cab_checksum_cfdata:
 1087|     44|{
 1088|     44|	const unsigned char *b;
 1089|     44|	uint32_t sum;
 1090|     44|	uint32_t t;
 1091|       |
 1092|     44|	sum = cab_checksum_cfdata_4(p, bytes, seed);
 1093|     44|	b = p;
 1094|     44|	b += bytes & ~3;
 1095|     44|	t = 0;
 1096|     44|	switch (bytes & 3) {
 1097|      5|	case 3:
  ------------------
  |  Branch (1097:2): [True: 5, False: 39]
  ------------------
 1098|      5|		t |= ((uint32_t)(*b++)) << 16;
 1099|       |		/* FALL THROUGH */
 1100|      5|	case 2:
  ------------------
  |  Branch (1100:2): [True: 0, False: 44]
  ------------------
 1101|      5|		t |= ((uint32_t)(*b++)) << 8;
 1102|       |		/* FALL THROUGH */
 1103|     14|	case 1:
  ------------------
  |  Branch (1103:2): [True: 9, False: 35]
  ------------------
 1104|     14|		t |= *b;
 1105|       |		/* FALL THROUGH */
 1106|     44|	default:
  ------------------
  |  Branch (1106:2): [True: 30, False: 14]
  ------------------
 1107|     44|		break;
 1108|     44|	}
 1109|     44|	sum ^= t;
 1110|       |
 1111|     44|	return (sum);
 1112|     44|}
archive_read_support_format_cab.c:cab_read_ahead_cfdata:
 1353|     95|{
 1354|     95|	struct cab *cab = (struct cab *)(a->format->data);
 1355|     95|	int err;
 1356|       |
 1357|     95|	err = cab_next_cfdata(a);
 1358|     95|	if (err < ARCHIVE_OK) {
  ------------------
  |  |  233|     95|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1358:6): [True: 3, False: 92]
  ------------------
 1359|      3|		*avail = err;
 1360|      3|		return (NULL);
 1361|      3|	}
 1362|       |
 1363|     92|	switch (cab->entry_cffolder->comptype) {
 1364|      7|	case COMPTYPE_NONE:
  ------------------
  |  |  215|      7|#define COMPTYPE_NONE		0x0000
  ------------------
  |  Branch (1364:2): [True: 7, False: 85]
  ------------------
 1365|      7|		return (cab_read_ahead_cfdata_none(a, avail));
 1366|     28|	case COMPTYPE_MSZIP:
  ------------------
  |  |  216|     28|#define COMPTYPE_MSZIP		0x0001
  ------------------
  |  Branch (1366:2): [True: 28, False: 64]
  ------------------
 1367|     28|		return (cab_read_ahead_cfdata_deflate(a, avail));
 1368|     57|	case COMPTYPE_LZX:
  ------------------
  |  |  218|     57|#define COMPTYPE_LZX		0x0003
  ------------------
  |  Branch (1368:2): [True: 57, False: 35]
  ------------------
 1369|     57|		return (cab_read_ahead_cfdata_lzx(a, avail));
 1370|      0|	default: /* Unsupported compression. */
  ------------------
  |  Branch (1370:2): [True: 0, False: 92]
  ------------------
 1371|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1372|      0|		    "Unsupported CAB compression: %s",
 1373|      0|		    cab->entry_cffolder->compname);
 1374|      0|		*avail = ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1375|       |		return (NULL);
 1376|     92|	}
 1377|     92|}
archive_read_support_format_cab.c:cab_read_ahead_cfdata_none:
 1384|      7|{
 1385|      7|	struct cab *cab = (struct cab *)(a->format->data);
 1386|      7|	struct cfdata *cfdata;
 1387|      7|	const void *d;
 1388|       |
 1389|      7|	cfdata = cab->entry_cfdata;
 1390|       |
 1391|       |	/*
 1392|       |	 * Note: '1' here is a performance optimization.
 1393|       |	 * Recall that the decompression layer returns a count of
 1394|       |	 * available bytes; asking for more than that forces the
 1395|       |	 * decompressor to combine reads by copying data.
 1396|       |	 */
 1397|      7|	d = __archive_read_ahead(a, 1, avail);
 1398|      7|	if (*avail <= 0) {
  ------------------
  |  Branch (1398:6): [True: 0, False: 7]
  ------------------
 1399|      0|		*avail = truncated_error(a);
 1400|      0|		return (NULL);
 1401|      0|	}
 1402|      7|	if (*avail > cfdata->uncompressed_bytes_remaining)
  ------------------
  |  Branch (1402:6): [True: 3, False: 4]
  ------------------
 1403|      3|		*avail = cfdata->uncompressed_bytes_remaining;
 1404|      7|	cfdata->uncompressed_avail = cfdata->uncompressed_size;
 1405|      7|	cfdata->unconsumed = *avail;
 1406|      7|	cfdata->sum_ptr = d;
 1407|      7|	return (d);
 1408|      7|}
archive_read_support_format_cab.c:cab_read_ahead_cfdata_deflate:
 1416|     28|{
 1417|     28|	struct cab *cab = (struct cab *)(a->format->data);
 1418|     28|	struct cfdata *cfdata;
 1419|     28|	const void *d;
 1420|     28|	int r, mszip;
 1421|     28|	uint16_t uavail;
 1422|     28|	char eod = 0;
 1423|       |
 1424|     28|	cfdata = cab->entry_cfdata;
 1425|       |	/* If the buffer hasn't been allocated, allocate it now. */
 1426|     28|	if (cab->uncompressed_buffer == NULL) {
  ------------------
  |  Branch (1426:6): [True: 18, False: 10]
  ------------------
 1427|     18|		cab->uncompressed_buffer_size = 0x8000;
 1428|     18|		cab->uncompressed_buffer
 1429|     18|		    = malloc(cab->uncompressed_buffer_size);
 1430|     18|		if (cab->uncompressed_buffer == NULL) {
  ------------------
  |  Branch (1430:7): [True: 0, False: 18]
  ------------------
 1431|      0|			archive_set_error(&a->archive, ENOMEM,
 1432|      0|			    "No memory for CAB reader");
 1433|      0|			*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1434|      0|			return (NULL);
 1435|      0|		}
 1436|     18|	}
 1437|       |
 1438|     28|	uavail = cfdata->uncompressed_avail;
 1439|     28|	if (uavail == cfdata->uncompressed_size) {
  ------------------
  |  Branch (1439:6): [True: 4, False: 24]
  ------------------
 1440|      4|		d = cab->uncompressed_buffer + cfdata->read_offset;
 1441|      4|		*avail = uavail - cfdata->read_offset;
 1442|      4|		return (d);
 1443|      4|	}
 1444|       |
 1445|     24|	if (!cab->entry_cffolder->decompress_init) {
  ------------------
  |  Branch (1445:6): [True: 18, False: 6]
  ------------------
 1446|     18|		cab->stream.next_in = NULL;
 1447|     18|		cab->stream.avail_in = 0;
 1448|     18|		cab->stream.total_in = 0;
 1449|     18|		cab->stream.next_out = NULL;
 1450|     18|		cab->stream.avail_out = 0;
 1451|     18|		cab->stream.total_out = 0;
 1452|     18|		if (cab->stream_valid)
  ------------------
  |  Branch (1452:7): [True: 0, False: 18]
  ------------------
 1453|      0|			r = inflateReset(&cab->stream);
 1454|     18|		else
 1455|     18|			r = inflateInit2(&cab->stream,
 1456|     18|			    -15 /* Don't check for zlib header */);
 1457|     18|		if (r != Z_OK) {
  ------------------
  |  Branch (1457:7): [True: 0, False: 18]
  ------------------
 1458|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1459|      0|			    "Can't initialize deflate decompression");
 1460|      0|			*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1461|      0|			return (NULL);
 1462|      0|		}
 1463|       |		/* Stream structure has been set up. */
 1464|     18|		cab->stream_valid = 1;
 1465|       |		/* We've initialized decompression for this stream. */
 1466|     18|		cab->entry_cffolder->decompress_init = 1;
 1467|     18|	}
 1468|       |
 1469|     24|	if (cfdata->compressed_bytes_remaining == cfdata->compressed_size)
  ------------------
  |  Branch (1469:6): [True: 24, False: 0]
  ------------------
 1470|     24|		mszip = 2;
 1471|      0|	else
 1472|      0|		mszip = 0;
 1473|     24|	eod = 0;
 1474|     24|	cab->stream.total_out = uavail;
 1475|       |	/*
 1476|       |	 * We always uncompress all data in current CFDATA.
 1477|       |	 */
 1478|     41|	while (!eod && cab->stream.total_out < cfdata->uncompressed_size) {
  ------------------
  |  Branch (1478:9): [True: 41, False: 0]
  |  Branch (1478:17): [True: 27, False: 14]
  ------------------
 1479|     27|		ssize_t bytes_avail;
 1480|       |
 1481|     27|		cab->stream.next_out =
 1482|     27|		    cab->uncompressed_buffer + cab->stream.total_out;
 1483|     27|		cab->stream.avail_out =
 1484|     27|		    cfdata->uncompressed_size - cab->stream.total_out;
 1485|     27|		if ((size_t)cfdata->uncompressed_size >
  ------------------
  |  Branch (1485:7): [True: 0, False: 27]
  ------------------
 1486|     27|		    cab->uncompressed_buffer_size) {
 1487|      0|			archive_set_error(&a->archive,
 1488|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1489|      0|			    "Invalid CFDATA uncompressed size");
 1490|      0|			*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1491|      0|			return (NULL);
 1492|      0|		}
 1493|       |
 1494|     27|		d = __archive_read_ahead(a, 1, &bytes_avail);
 1495|     27|		if (bytes_avail <= 0) {
  ------------------
  |  Branch (1495:7): [True: 0, False: 27]
  ------------------
 1496|      0|			*avail = truncated_error(a);
 1497|      0|			return (NULL);
 1498|      0|		}
 1499|     27|		if (bytes_avail > cfdata->compressed_bytes_remaining)
  ------------------
  |  Branch (1499:7): [True: 13, False: 14]
  ------------------
 1500|     13|			bytes_avail = cfdata->compressed_bytes_remaining;
 1501|       |		/*
 1502|       |		 * A bug in zlib.h: stream.next_in should be marked 'const'
 1503|       |		 * but isn't (the library never alters data through the
 1504|       |		 * next_in pointer, only reads it).  The result: this ugly
 1505|       |		 * cast to remove 'const'.
 1506|       |		 */
 1507|     27|		cab->stream.next_in = (Bytef *)(uintptr_t)d;
 1508|     27|		cab->stream.avail_in = (uInt)bytes_avail;
 1509|     27|		cab->stream.total_in = 0;
 1510|       |
 1511|       |		/* Cut out a tow-byte MSZIP signature(0x43, 0x4b). */
 1512|     27|		if (mszip > 0) {
  ------------------
  |  Branch (1512:7): [True: 24, False: 3]
  ------------------
 1513|     24|			if (bytes_avail <= 0)
  ------------------
  |  Branch (1513:8): [True: 0, False: 24]
  ------------------
 1514|      0|				goto nomszip;
 1515|     24|			if (bytes_avail <= mszip) {
  ------------------
  |  Branch (1515:8): [True: 1, False: 23]
  ------------------
 1516|      1|				if (mszip == 2) {
  ------------------
  |  Branch (1516:9): [True: 1, False: 0]
  ------------------
 1517|      1|					if (cab->stream.next_in[0] != 0x43)
  ------------------
  |  Branch (1517:10): [True: 1, False: 0]
  ------------------
 1518|      1|						goto nomszip;
 1519|      0|					if (bytes_avail > 1 &&
  ------------------
  |  Branch (1519:10): [True: 0, False: 0]
  ------------------
 1520|      0|					    cab->stream.next_in[1] != 0x4b)
  ------------------
  |  Branch (1520:10): [True: 0, False: 0]
  ------------------
 1521|      0|						goto nomszip;
 1522|      0|				} else if (cab->stream.next_in[0] != 0x4b)
  ------------------
  |  Branch (1522:16): [True: 0, False: 0]
  ------------------
 1523|      0|					goto nomszip;
 1524|      0|				cfdata->unconsumed = bytes_avail;
 1525|      0|				cfdata->sum_ptr = d;
 1526|      0|				if (cab_minimum_consume_cfdata(
  ------------------
  |  Branch (1526:9): [True: 0, False: 0]
  ------------------
 1527|      0|				    a, cfdata->unconsumed) < 0) {
 1528|      0|					*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1529|      0|					return (NULL);
 1530|      0|				}
 1531|      0|				mszip -= (int)bytes_avail;
 1532|      0|				continue;
 1533|      0|			}
 1534|     23|			if (mszip == 1 && cab->stream.next_in[0] != 0x4b)
  ------------------
  |  Branch (1534:8): [True: 0, False: 23]
  |  Branch (1534:22): [True: 0, False: 0]
  ------------------
 1535|      0|				goto nomszip;
 1536|     23|			else if (mszip == 2 && (cab->stream.next_in[0] != 0x43 ||
  ------------------
  |  Branch (1536:13): [True: 23, False: 0]
  |  Branch (1536:28): [True: 5, False: 18]
  ------------------
 1537|     18|			    cab->stream.next_in[1] != 0x4b))
  ------------------
  |  Branch (1537:8): [True: 1, False: 17]
  ------------------
 1538|      6|				goto nomszip;
 1539|     17|			cab->stream.next_in += mszip;
 1540|     17|			cab->stream.avail_in -= mszip;
 1541|     17|			cab->stream.total_in += mszip;
 1542|     17|			mszip = 0;
 1543|     17|		}
 1544|       |
 1545|     20|		r = inflate(&cab->stream, 0);
 1546|     20|		switch (r) {
 1547|     17|		case Z_OK:
  ------------------
  |  Branch (1547:3): [True: 17, False: 3]
  ------------------
 1548|     17|			break;
 1549|      0|		case Z_STREAM_END:
  ------------------
  |  Branch (1549:3): [True: 0, False: 20]
  ------------------
 1550|      0|			eod = 1;
 1551|      0|			break;
 1552|      3|		default:
  ------------------
  |  Branch (1552:3): [True: 3, False: 17]
  ------------------
 1553|      3|			goto zlibfailed;
 1554|     20|		}
 1555|     17|		cfdata->unconsumed = cab->stream.total_in;
 1556|     17|		cfdata->sum_ptr = d;
 1557|     17|		if (cab_minimum_consume_cfdata(a, cfdata->unconsumed) < 0) {
  ------------------
  |  Branch (1557:7): [True: 0, False: 17]
  ------------------
 1558|      0|			*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1559|      0|			return (NULL);
 1560|      0|		}
 1561|     17|	}
 1562|     14|	uavail = (uint16_t)cab->stream.total_out;
 1563|       |
 1564|     14|	if (uavail < cfdata->uncompressed_size) {
  ------------------
  |  Branch (1564:6): [True: 0, False: 14]
  ------------------
 1565|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1566|      0|		    "Invalid uncompressed size (%d < %d)",
 1567|      0|		    uavail, cfdata->uncompressed_size);
 1568|      0|		*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1569|      0|		return (NULL);
 1570|      0|	}
 1571|       |
 1572|       |	/*
 1573|       |	 * Note: I suspect there is a bug in makecab.exe because, in rare
 1574|       |	 * case, compressed bytes are still remaining regardless we have
 1575|       |	 * gotten all uncompressed bytes, which size is recorded in CFDATA,
 1576|       |	 * as much as we need, and we have to use the garbage so as to
 1577|       |	 * correctly compute the sum of CFDATA accordingly.
 1578|       |	 */
 1579|     14|	if (cfdata->compressed_bytes_remaining > 0) {
  ------------------
  |  Branch (1579:6): [True: 14, False: 0]
  ------------------
 1580|     14|		ssize_t bytes_avail;
 1581|       |
 1582|     14|		d = __archive_read_ahead(a, cfdata->compressed_bytes_remaining,
 1583|     14|		    &bytes_avail);
 1584|     14|		if (bytes_avail <= 0) {
  ------------------
  |  Branch (1584:7): [True: 0, False: 14]
  ------------------
 1585|      0|			*avail = truncated_error(a);
 1586|      0|			return (NULL);
 1587|      0|		}
 1588|     14|		cfdata->unconsumed = cfdata->compressed_bytes_remaining;
 1589|     14|		cfdata->sum_ptr = d;
 1590|     14|		if (cab_minimum_consume_cfdata(a, cfdata->unconsumed) < 0) {
  ------------------
  |  Branch (1590:7): [True: 0, False: 14]
  ------------------
 1591|      0|			*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1592|      0|			return (NULL);
 1593|      0|		}
 1594|     14|	}
 1595|       |
 1596|       |	/*
 1597|       |	 * Set dictionary data for decompressing of next CFDATA, which
 1598|       |	 * in the same folder. This is why we always do decompress CFDATA
 1599|       |	 * even if beginning CFDATA or some of CFDATA are not used in
 1600|       |	 * skipping file data.
 1601|       |	 */
 1602|     14|	if (cab->entry_cffolder->cfdata_index <
  ------------------
  |  Branch (1602:6): [True: 12, False: 2]
  ------------------
 1603|     14|	    cab->entry_cffolder->cfdata_count) {
 1604|     12|		r = inflateReset(&cab->stream);
 1605|     12|		if (r != Z_OK)
  ------------------
  |  Branch (1605:7): [True: 0, False: 12]
  ------------------
 1606|      0|			goto zlibfailed;
 1607|     12|		r = inflateSetDictionary(&cab->stream,
 1608|     12|		    cab->uncompressed_buffer, cfdata->uncompressed_size);
 1609|     12|		if (r != Z_OK)
  ------------------
  |  Branch (1609:7): [True: 0, False: 12]
  ------------------
 1610|      0|			goto zlibfailed;
 1611|     12|	}
 1612|       |
 1613|     14|	d = cab->uncompressed_buffer + cfdata->read_offset;
 1614|     14|	*avail = uavail - cfdata->read_offset;
 1615|     14|	cfdata->uncompressed_avail = uavail;
 1616|       |
 1617|     14|	return (d);
 1618|       |
 1619|      3|zlibfailed:
 1620|      3|	switch (r) {
 1621|      0|	case Z_MEM_ERROR:
  ------------------
  |  Branch (1621:2): [True: 0, False: 3]
  ------------------
 1622|      0|		archive_set_error(&a->archive, ENOMEM,
 1623|      0|		    "Out of memory for deflate decompression");
 1624|      0|		break;
 1625|      3|	default:
  ------------------
  |  Branch (1625:2): [True: 3, False: 0]
  ------------------
 1626|      3|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      3|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1627|      3|		    "Deflate decompression failed (%d)", r);
 1628|      3|		break;
 1629|      3|	}
 1630|      3|	*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      3|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1631|      3|	return (NULL);
 1632|      7|nomszip:
 1633|      7|	archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      7|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1634|      7|	    "CFDATA incorrect(no MSZIP signature)");
 1635|      7|	*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      7|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1636|       |	return (NULL);
 1637|      3|}
archive_read_support_format_cab.c:cab_read_ahead_cfdata_lzx:
 1654|     57|{
 1655|     57|	struct cab *cab = (struct cab *)(a->format->data);
 1656|     57|	struct cfdata *cfdata;
 1657|     57|	const void *d;
 1658|     57|	int r;
 1659|     57|	uint16_t uavail;
 1660|       |
 1661|     57|	cfdata = cab->entry_cfdata;
 1662|       |	/* If the buffer hasn't been allocated, allocate it now. */
 1663|     57|	if (cab->uncompressed_buffer == NULL) {
  ------------------
  |  Branch (1663:6): [True: 47, False: 10]
  ------------------
 1664|     47|		cab->uncompressed_buffer_size = 0x8000;
 1665|     47|		cab->uncompressed_buffer
 1666|     47|		    = malloc(cab->uncompressed_buffer_size);
 1667|     47|		if (cab->uncompressed_buffer == NULL) {
  ------------------
  |  Branch (1667:7): [True: 0, False: 47]
  ------------------
 1668|      0|			archive_set_error(&a->archive, ENOMEM,
 1669|      0|			    "No memory for CAB reader");
 1670|      0|			*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1671|      0|			return (NULL);
 1672|      0|		}
 1673|     47|	}
 1674|       |
 1675|     57|	uavail = cfdata->uncompressed_avail;
 1676|     57|	if (uavail == cfdata->uncompressed_size) {
  ------------------
  |  Branch (1676:6): [True: 0, False: 57]
  ------------------
 1677|      0|		d = cab->uncompressed_buffer + cfdata->read_offset;
 1678|      0|		*avail = uavail - cfdata->read_offset;
 1679|      0|		return (d);
 1680|      0|	}
 1681|       |
 1682|     57|	if (!cab->entry_cffolder->decompress_init) {
  ------------------
  |  Branch (1682:6): [True: 47, False: 10]
  ------------------
 1683|     47|		r = lzx_decode_init(&cab->xstrm,
 1684|     47|		    cab->entry_cffolder->compdata);
 1685|     47|		if (r != ARCHIVE_OK) {
  ------------------
  |  |  233|     47|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1685:7): [True: 0, False: 47]
  ------------------
 1686|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1687|      0|			    "Can't initialize LZX decompression");
 1688|      0|			*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1689|      0|			return (NULL);
 1690|      0|		}
 1691|       |		/* We've initialized decompression for this stream. */
 1692|     47|		cab->entry_cffolder->decompress_init = 1;
 1693|     47|	}
 1694|       |
 1695|       |	/* Clean up remaining bits of previous CFDATA. */
 1696|     57|	lzx_cleanup_bitstream(&cab->xstrm);
 1697|     57|	cab->xstrm.total_out = uavail;
 1698|    593|	while (cab->xstrm.total_out < cfdata->uncompressed_size) {
  ------------------
  |  Branch (1698:9): [True: 572, False: 21]
  ------------------
 1699|    572|		ssize_t bytes_avail;
 1700|       |
 1701|    572|		cab->xstrm.next_out =
 1702|    572|		    cab->uncompressed_buffer + cab->xstrm.total_out;
 1703|    572|		cab->xstrm.avail_out =
 1704|    572|		    cfdata->uncompressed_size - cab->xstrm.total_out;
 1705|       |		
 1706|    572|		if ((size_t)cfdata->uncompressed_size > cab->uncompressed_buffer_size) {
  ------------------
  |  Branch (1706:7): [True: 0, False: 572]
  ------------------
 1707|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1708|      0|				"Invalid CFDATA uncompressed size");
 1709|      0|			*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1710|      0|			return (NULL);
 1711|      0|		}
 1712|       |
 1713|    572|		d = __archive_read_ahead(a, 1, &bytes_avail);
 1714|    572|		if (d == NULL) {
  ------------------
  |  Branch (1714:7): [True: 24, False: 548]
  ------------------
 1715|     24|			archive_set_error(&a->archive,
 1716|     24|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     24|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1717|     24|			    "Truncated CAB file data");
 1718|     24|			*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|     24|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1719|     24|			return (NULL);
 1720|     24|		}
 1721|    548|		if (bytes_avail > cfdata->compressed_bytes_remaining)
  ------------------
  |  Branch (1721:7): [True: 219, False: 329]
  ------------------
 1722|    219|			bytes_avail = cfdata->compressed_bytes_remaining;
 1723|       |
 1724|    548|		cab->xstrm.next_in = d;
 1725|    548|		cab->xstrm.avail_in = bytes_avail;
 1726|    548|		cab->xstrm.total_in = 0;
 1727|    548|		r = lzx_decode(&cab->xstrm,
 1728|    548|		    cfdata->compressed_bytes_remaining == bytes_avail);
 1729|    548|		switch (r) {
 1730|     66|		case ARCHIVE_OK:
  ------------------
  |  |  233|     66|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1730:3): [True: 66, False: 482]
  ------------------
 1731|    536|		case ARCHIVE_EOF:
  ------------------
  |  |  232|    536|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (1731:3): [True: 470, False: 78]
  ------------------
 1732|    536|			break;
 1733|     12|		default:
  ------------------
  |  Branch (1733:3): [True: 12, False: 536]
  ------------------
 1734|     12|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     12|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1735|     12|			    "LZX decompression failed (%d)", r);
 1736|     12|			*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|     12|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1737|     12|			return (NULL);
 1738|    548|		}
 1739|    536|		cfdata->unconsumed = cab->xstrm.total_in;
 1740|    536|		cfdata->sum_ptr = d;
 1741|    536|		if (cab_minimum_consume_cfdata(a, cfdata->unconsumed) < 0) {
  ------------------
  |  Branch (1741:7): [True: 0, False: 536]
  ------------------
 1742|      0|			*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1743|      0|			return (NULL);
 1744|      0|		}
 1745|    536|	}
 1746|       |
 1747|     21|	uavail = (uint16_t)cab->xstrm.total_out;
 1748|       |	/*
 1749|       |	 * Make sure a read pointer advances to next CFDATA.
 1750|       |	 */
 1751|     21|	if (cfdata->compressed_bytes_remaining > 0) {
  ------------------
  |  Branch (1751:6): [True: 16, False: 5]
  ------------------
 1752|     16|		ssize_t bytes_avail;
 1753|       |
 1754|     16|		d = __archive_read_ahead(a, cfdata->compressed_bytes_remaining,
 1755|     16|		    &bytes_avail);
 1756|     16|		if (bytes_avail <= 0) {
  ------------------
  |  Branch (1756:7): [True: 0, False: 16]
  ------------------
 1757|      0|			*avail = truncated_error(a);
 1758|      0|			return (NULL);
 1759|      0|		}
 1760|     16|		cfdata->unconsumed = cfdata->compressed_bytes_remaining;
 1761|     16|		cfdata->sum_ptr = d;
 1762|     16|		if (cab_minimum_consume_cfdata(a, cfdata->unconsumed) < 0) {
  ------------------
  |  Branch (1762:7): [True: 0, False: 16]
  ------------------
 1763|      0|			*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1764|      0|			return (NULL);
 1765|      0|		}
 1766|     16|	}
 1767|       |
 1768|       |	/*
 1769|       |	 * Translation reversal of x86 processor CALL byte sequence(E8).
 1770|       |	 */
 1771|     21|	lzx_translation(&cab->xstrm, cab->uncompressed_buffer,
 1772|     21|	    cfdata->uncompressed_size,
 1773|     21|	    (cab->entry_cffolder->cfdata_index-1) * 0x8000);
 1774|       |
 1775|     21|	d = cab->uncompressed_buffer + cfdata->read_offset;
 1776|     21|	*avail = uavail - cfdata->read_offset;
 1777|     21|	cfdata->uncompressed_avail = uavail;
 1778|       |
 1779|     21|	return (d);
 1780|     21|}
archive_read_support_format_cab.c:lzx_decode_init:
 2108|     47|{
 2109|     47|	struct lzx_dec *ds;
 2110|     47|	int slot, w_size, w_slot;
 2111|     47|	int base, footer;
 2112|     47|	int base_inc[18];
 2113|       |
 2114|     47|	if (strm->ds == NULL) {
  ------------------
  |  Branch (2114:6): [True: 47, False: 0]
  ------------------
 2115|     47|		strm->ds = calloc(1, sizeof(*strm->ds));
 2116|     47|		if (strm->ds == NULL)
  ------------------
  |  Branch (2116:7): [True: 0, False: 47]
  ------------------
 2117|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2118|     47|	}
 2119|     47|	ds = strm->ds;
 2120|     47|	ds->error = ARCHIVE_FAILED;
  ------------------
  |  |  237|     47|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2121|       |
 2122|       |	/* Allow bits from 15(32KBi) up to 21(2MBi) */
 2123|     47|	if (w_bits < SLOT_BASE || w_bits > SLOT_MAX)
  ------------------
  |  |  133|     94|#define SLOT_BASE	15
  ------------------
              	if (w_bits < SLOT_BASE || w_bits > SLOT_MAX)
  ------------------
  |  |  134|     47|#define SLOT_MAX	21/*->25*/
  ------------------
  |  Branch (2123:6): [True: 0, False: 47]
  |  Branch (2123:28): [True: 0, False: 47]
  ------------------
 2124|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2125|       |
 2126|     47|	ds->error = ARCHIVE_FATAL;
  ------------------
  |  |  239|     47|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2127|       |
 2128|       |	/*
 2129|       |	 * Alloc window
 2130|       |	 */
 2131|     47|	w_size = ds->w_size;
 2132|     47|	w_slot = slots[w_bits - SLOT_BASE];
  ------------------
  |  |  133|     47|#define SLOT_BASE	15
  ------------------
 2133|     47|	ds->w_size = 1U << w_bits;
 2134|     47|	ds->w_mask = ds->w_size -1;
 2135|     47|	if (ds->w_buff == NULL || w_size != ds->w_size) {
  ------------------
  |  Branch (2135:6): [True: 47, False: 0]
  |  Branch (2135:28): [True: 0, False: 0]
  ------------------
 2136|     47|		free(ds->w_buff);
 2137|     47|		ds->w_buff = malloc(ds->w_size);
 2138|     47|		if (ds->w_buff == NULL)
  ------------------
  |  Branch (2138:7): [True: 0, False: 47]
  ------------------
 2139|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2140|     47|		free(ds->pos_tbl);
 2141|     47|		ds->pos_tbl = malloc(sizeof(ds->pos_tbl[0]) * w_slot);
 2142|     47|		if (ds->pos_tbl == NULL)
  ------------------
  |  Branch (2142:7): [True: 0, False: 47]
  ------------------
 2143|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2144|     47|	}
 2145|       |
 2146|    893|	for (footer = 0; footer < 18; footer++)
  ------------------
  |  Branch (2146:19): [True: 846, False: 47]
  ------------------
 2147|    846|		base_inc[footer] = 1 << footer;
 2148|     47|	base = footer = 0;
 2149|  2.11k|	for (slot = 0; slot < w_slot; slot++) {
  ------------------
  |  Branch (2149:17): [True: 2.06k, False: 47]
  ------------------
 2150|  2.06k|		int n;
 2151|  2.06k|		if (footer == 0)
  ------------------
  |  Branch (2151:7): [True: 235, False: 1.82k]
  ------------------
 2152|    235|			base = slot;
 2153|  1.82k|		else
 2154|  1.82k|			base += base_inc[footer];
 2155|  2.06k|		if (footer < 17) {
  ------------------
  |  Branch (2155:7): [True: 1.67k, False: 390]
  ------------------
 2156|  1.67k|			footer = -2;
 2157|  17.4k|			for (n = base; n; n >>= 1)
  ------------------
  |  Branch (2157:19): [True: 15.7k, False: 1.67k]
  ------------------
 2158|  15.7k|				footer++;
 2159|  1.67k|			if (footer <= 0)
  ------------------
  |  Branch (2159:8): [True: 188, False: 1.48k]
  ------------------
 2160|    188|				footer = 0;
 2161|  1.67k|		}
 2162|  2.06k|		ds->pos_tbl[slot].base = base;
 2163|  2.06k|		ds->pos_tbl[slot].footer_bits = footer;
 2164|  2.06k|	}
 2165|       |
 2166|     47|	ds->w_pos = 0;
 2167|     47|	ds->state = 0;
 2168|     47|	ds->br.cache_buffer = 0;
 2169|     47|	ds->br.cache_avail = 0;
 2170|     47|	ds->r0 = ds->r1 = ds->r2 = 1;
 2171|       |
 2172|       |	/* Initialize aligned offset tree. */
 2173|     47|	if (lzx_huffman_init(&(ds->at), 8, 8) != ARCHIVE_OK)
  ------------------
  |  |  233|     47|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2173:6): [True: 0, False: 47]
  ------------------
 2174|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2175|       |
 2176|       |	/* Initialize pre-tree. */
 2177|     47|	if (lzx_huffman_init(&(ds->pt), 20, 10) != ARCHIVE_OK)
  ------------------
  |  |  233|     47|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2177:6): [True: 0, False: 47]
  ------------------
 2178|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2179|       |
 2180|       |	/* Initialize Main tree. */
 2181|     47|	if (lzx_huffman_init(&(ds->mt), 256+(w_slot<<3), 16)
  ------------------
  |  Branch (2181:6): [True: 0, False: 47]
  ------------------
 2182|     47|	    != ARCHIVE_OK)
  ------------------
  |  |  233|     47|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2183|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2184|       |
 2185|       |	/* Initialize Length tree. */
 2186|     47|	if (lzx_huffman_init(&(ds->lt), 249, 16) != ARCHIVE_OK)
  ------------------
  |  |  233|     47|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2186:6): [True: 0, False: 47]
  ------------------
 2187|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2188|       |
 2189|     47|	ds->error = 0;
 2190|       |
 2191|     47|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     47|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2192|     47|}
archive_read_support_format_cab.c:lzx_huffman_init:
 3150|    188|{
 3151|       |
 3152|    188|	if (hf->bitlen == NULL || hf->len_size != (int)len_size) {
  ------------------
  |  Branch (3152:6): [True: 188, False: 0]
  |  Branch (3152:28): [True: 0, False: 0]
  ------------------
 3153|    188|		free(hf->bitlen);
 3154|    188|		hf->bitlen = calloc(len_size,  sizeof(hf->bitlen[0]));
 3155|    188|		if (hf->bitlen == NULL)
  ------------------
  |  Branch (3155:7): [True: 0, False: 188]
  ------------------
 3156|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3157|    188|		hf->len_size = (int)len_size;
 3158|    188|	} else
 3159|      0|		memset(hf->bitlen, 0, len_size *  sizeof(hf->bitlen[0]));
 3160|    188|	if (hf->tbl == NULL) {
  ------------------
  |  Branch (3160:6): [True: 188, False: 0]
  ------------------
 3161|    188|		hf->tbl = malloc(((size_t)1 << tbl_bits) * sizeof(hf->tbl[0]));
 3162|    188|		if (hf->tbl == NULL)
  ------------------
  |  Branch (3162:7): [True: 0, False: 188]
  ------------------
 3163|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3164|    188|		hf->tbl_bits = tbl_bits;
 3165|    188|	}
 3166|    188|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    188|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3167|    188|}
archive_read_support_format_cab.c:lzx_cleanup_bitstream:
 2381|     57|{
 2382|     57|	strm->ds->br.cache_avail = 0;
 2383|     57|	strm->ds->br.have_odd = 0;
 2384|     57|}
archive_read_support_format_cab.c:lzx_decode:
 2421|    548|{
 2422|    548|	struct lzx_dec *ds = strm->ds;
 2423|    548|	int64_t avail_in;
 2424|    548|	int r;
 2425|       |
 2426|    548|	if (ds->error)
  ------------------
  |  Branch (2426:6): [True: 0, False: 548]
  ------------------
 2427|      0|		return (ds->error);
 2428|       |
 2429|    548|	avail_in = strm->avail_in;
 2430|    548|	lzx_br_fixup(strm, &(ds->br));
 2431|    584|	do {
 2432|    584|		if (ds->state < ST_MAIN)
  ------------------
  |  | 2413|    584|#define ST_MAIN			18
  ------------------
  |  Branch (2432:7): [True: 538, False: 46]
  ------------------
 2433|    538|			r = lzx_read_blocks(strm, last);
 2434|     46|		else {
 2435|     46|			int64_t bytes_written = strm->avail_out;
 2436|     46|			r = lzx_decode_blocks(strm, last);
 2437|     46|			bytes_written -= strm->avail_out;
 2438|     46|			strm->next_out += bytes_written;
 2439|     46|			strm->total_out += bytes_written;
 2440|     46|		}
 2441|    584|	} while (r == 100);
  ------------------
  |  Branch (2441:11): [True: 36, False: 548]
  ------------------
 2442|    548|	strm->total_in += avail_in - strm->avail_in;
 2443|    548|	return (r);
 2444|    548|}
archive_read_support_format_cab.c:lzx_br_fixup:
 2365|    548|{
 2366|    548|	int n = CACHE_BITS - br->cache_avail;
  ------------------
  |  |   97|    548|#define CACHE_BITS		(8 * sizeof(CACHE_TYPE))
  ------------------
 2367|       |
 2368|    548|	if (br->have_odd && n >= 16 && strm->avail_in > 0) {
  ------------------
  |  Branch (2368:6): [True: 5, False: 543]
  |  Branch (2368:22): [True: 5, False: 0]
  |  Branch (2368:33): [True: 5, False: 0]
  ------------------
 2369|      5|		br->cache_buffer =
 2370|      5|		   (br->cache_buffer << 16) |
 2371|      5|		   ((uint16_t)(*strm->next_in)) << 8 | br->odd;
 2372|      5|		strm->next_in++;
 2373|      5|		strm->avail_in--;
 2374|      5|		br->cache_avail += 16;
 2375|      5|		br->have_odd = 0;
 2376|      5|	}
 2377|    548|}
archive_read_support_format_cab.c:lzx_read_blocks:
 2448|    538|{
 2449|    538|	struct lzx_dec *ds = strm->ds;
 2450|    538|	struct lzx_br *br = &(ds->br);
 2451|    538|	int i, r;
 2452|       |
 2453|    588|	for (;;) {
 2454|    588|		switch (ds->state) {
  ------------------
  |  Branch (2454:11): [True: 588, False: 0]
  ------------------
 2455|     47|		case ST_RD_TRANSLATION:
  ------------------
  |  | 2395|     47|#define ST_RD_TRANSLATION	0
  ------------------
  |  Branch (2455:3): [True: 47, False: 541]
  ------------------
 2456|     47|			if (!lzx_br_read_ahead(strm, br, 1)) {
  ------------------
  |  | 2266|     47|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2261|     94|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 2247|     94|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2247:27): [True: 0, False: 47]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2261:28): [True: 47, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2247|      0|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2247:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2457|      0|				ds->state = ST_RD_TRANSLATION;
  ------------------
  |  | 2395|      0|#define ST_RD_TRANSLATION	0
  ------------------
 2458|      0|				if (last)
  ------------------
  |  Branch (2458:9): [True: 0, False: 0]
  ------------------
 2459|      0|					goto failed;
 2460|      0|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2461|      0|			}
 2462|     47|			ds->translation = lzx_br_bits(br, 1);
  ------------------
  |  | 2250|     47|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2251|     47|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2463|     47|			lzx_br_consume(br, 1);
  ------------------
  |  | 2269|     47|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2464|       |			/* FALL THROUGH */
 2465|     47|		case ST_RD_TRANSLATION_SIZE:
  ------------------
  |  | 2396|     47|#define ST_RD_TRANSLATION_SIZE	1
  ------------------
  |  Branch (2465:3): [True: 0, False: 588]
  ------------------
 2466|     47|			if (ds->translation) {
  ------------------
  |  Branch (2466:8): [True: 3, False: 44]
  ------------------
 2467|      3|				if (!lzx_br_read_ahead(strm, br, 32)) {
  ------------------
  |  | 2266|      3|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2261|      6|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 2247|      6|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2247:27): [True: 3, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2261:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2247|      0|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2247:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2468|      0|					ds->state = ST_RD_TRANSLATION_SIZE;
  ------------------
  |  | 2396|      0|#define ST_RD_TRANSLATION_SIZE	1
  ------------------
 2469|      0|					if (last)
  ------------------
  |  Branch (2469:10): [True: 0, False: 0]
  ------------------
 2470|      0|						goto failed;
 2471|      0|					return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2472|      0|				}
 2473|      3|				ds->translation_size = lzx_br_bits(br, 16);
  ------------------
  |  | 2250|      3|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2251|      3|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2474|      3|				lzx_br_consume(br, 16);
  ------------------
  |  | 2269|      3|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2475|      3|				ds->translation_size <<= 16;
 2476|      3|				ds->translation_size |= lzx_br_bits(br, 16);
  ------------------
  |  | 2250|      3|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2251|      3|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2477|      3|				lzx_br_consume(br, 16);
  ------------------
  |  | 2269|      3|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2478|      3|			}
 2479|       |			/* FALL THROUGH */
 2480|    516|		case ST_RD_BLOCK_TYPE:
  ------------------
  |  | 2397|    516|#define ST_RD_BLOCK_TYPE	2
  ------------------
  |  Branch (2480:3): [True: 469, False: 119]
  ------------------
 2481|    516|			if (!lzx_br_read_ahead(strm, br, 3)) {
  ------------------
  |  | 2266|    516|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2261|  1.03k|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 2247|  1.03k|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2247:27): [True: 69, False: 447]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2261:28): [True: 446, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2247|      1|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2247:27): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2482|      1|				ds->state = ST_RD_BLOCK_TYPE;
  ------------------
  |  | 2397|      1|#define ST_RD_BLOCK_TYPE	2
  ------------------
 2483|      1|				if (last)
  ------------------
  |  Branch (2483:9): [True: 0, False: 1]
  ------------------
 2484|      0|					goto failed;
 2485|      1|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      1|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2486|      1|			}
 2487|    515|			ds->block_type = lzx_br_bits(br, 3);
  ------------------
  |  | 2250|    515|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2251|    515|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2488|    515|			lzx_br_consume(br, 3);
  ------------------
  |  | 2269|    515|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2489|       |			/* Check a block type. */
 2490|    515|			switch (ds->block_type) {
 2491|     41|			case VERBATIM_BLOCK:
  ------------------
  |  |   75|     41|#define VERBATIM_BLOCK		1
  ------------------
  |  Branch (2491:4): [True: 41, False: 474]
  ------------------
 2492|     51|			case ALIGNED_OFFSET_BLOCK:
  ------------------
  |  |   76|     51|#define ALIGNED_OFFSET_BLOCK	2
  ------------------
  |  Branch (2492:4): [True: 10, False: 505]
  ------------------
 2493|    514|			case UNCOMPRESSED_BLOCK:
  ------------------
  |  |   77|    514|#define UNCOMPRESSED_BLOCK	3
  ------------------
  |  Branch (2493:4): [True: 463, False: 52]
  ------------------
 2494|    514|				break;
 2495|      1|			default:
  ------------------
  |  Branch (2495:4): [True: 1, False: 514]
  ------------------
 2496|      1|				goto failed;/* Invalid */
 2497|    515|			}
 2498|       |			/* FALL THROUGH */
 2499|    516|		case ST_RD_BLOCK_SIZE:
  ------------------
  |  | 2398|    516|#define ST_RD_BLOCK_SIZE	3
  ------------------
  |  Branch (2499:3): [True: 2, False: 586]
  ------------------
 2500|    516|			if (!lzx_br_read_ahead(strm, br, 24)) {
  ------------------
  |  | 2266|    516|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2261|  1.03k|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 2247|  1.03k|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2247:27): [True: 499, False: 17]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2261:28): [True: 9, False: 8]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2247|      8|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2247:27): [True: 5, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2501|      3|				ds->state = ST_RD_BLOCK_SIZE;
  ------------------
  |  | 2398|      3|#define ST_RD_BLOCK_SIZE	3
  ------------------
 2502|      3|				if (last)
  ------------------
  |  Branch (2502:9): [True: 0, False: 3]
  ------------------
 2503|      0|					goto failed;
 2504|      3|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      3|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2505|      3|			}
 2506|    513|			ds->block_size = lzx_br_bits(br, 8);
  ------------------
  |  | 2250|    513|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2251|    513|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2507|    513|			lzx_br_consume(br, 8);
  ------------------
  |  | 2269|    513|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2508|    513|			ds->block_size <<= 16;
 2509|    513|			ds->block_size |= lzx_br_bits(br, 16);
  ------------------
  |  | 2250|    513|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2251|    513|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2510|    513|			lzx_br_consume(br, 16);
  ------------------
  |  | 2269|    513|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2511|    513|			if (ds->block_size == 0)
  ------------------
  |  Branch (2511:8): [True: 0, False: 513]
  ------------------
 2512|      0|				goto failed;
 2513|    513|			ds->block_bytes_avail = ds->block_size;
 2514|    513|			if (ds->block_type != UNCOMPRESSED_BLOCK) {
  ------------------
  |  |   77|    513|#define UNCOMPRESSED_BLOCK	3
  ------------------
  |  Branch (2514:8): [True: 50, False: 463]
  ------------------
 2515|     50|				if (ds->block_type == VERBATIM_BLOCK)
  ------------------
  |  |   75|     50|#define VERBATIM_BLOCK		1
  ------------------
  |  Branch (2515:9): [True: 41, False: 9]
  ------------------
 2516|     41|					ds->state = ST_RD_VERBATIM;
  ------------------
  |  | 2406|     41|#define ST_RD_VERBATIM		11
  ------------------
 2517|      9|				else
 2518|      9|					ds->state = ST_RD_ALIGNED_OFFSET;
  ------------------
  |  | 2405|      9|#define ST_RD_ALIGNED_OFFSET	10
  ------------------
 2519|     50|				break;
 2520|     50|			}
 2521|       |			/* FALL THROUGH */
 2522|    464|		case ST_RD_ALIGNMENT:
  ------------------
  |  | 2399|    464|#define ST_RD_ALIGNMENT		4
  ------------------
  |  Branch (2522:3): [True: 1, False: 587]
  ------------------
 2523|       |			/*
 2524|       |			 * Handle an Uncompressed Block.
 2525|       |			 */
 2526|       |			/* Skip padding to align following field on
 2527|       |			 * 16-bit boundary. */
 2528|    464|			if (lzx_br_is_unaligned(br))
  ------------------
  |  | 2272|    464|#define lzx_br_is_unaligned(br)	((br)->cache_avail & 0x0f)
  |  |  ------------------
  |  |  |  Branch (2272:33): [True: 460, False: 4]
  |  |  ------------------
  ------------------
 2529|    460|				lzx_br_consume_unaligned_bits(br);
  ------------------
  |  | 2270|    460|#define lzx_br_consume_unaligned_bits(br) ((br)->cache_avail &= ~0x0f)
  ------------------
 2530|      4|			else {
 2531|      4|				if (lzx_br_read_ahead(strm, br, 16))
  ------------------
  |  | 2266|      4|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2261|      8|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 2247|      8|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2247:27): [True: 0, False: 4]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2261:28): [True: 2, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2247|      2|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2247:27): [True: 1, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2532|      3|					lzx_br_consume(br, 16);
  ------------------
  |  | 2269|      3|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2533|      1|				else {
 2534|      1|					ds->state = ST_RD_ALIGNMENT;
  ------------------
  |  | 2399|      1|#define ST_RD_ALIGNMENT		4
  ------------------
 2535|      1|					if (last)
  ------------------
  |  Branch (2535:10): [True: 0, False: 1]
  ------------------
 2536|      0|						goto failed;
 2537|      1|					return (ARCHIVE_OK);
  ------------------
  |  |  233|      1|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2538|      1|				}
 2539|      4|			}
 2540|       |			/* Preparation to read repeated offsets R0,R1 and R2. */
 2541|    463|			ds->rbytes_avail = 0;
 2542|    463|			ds->state = ST_RD_R0;
  ------------------
  |  | 2400|    463|#define ST_RD_R0		5
  ------------------
 2543|       |			/* FALL THROUGH */
 2544|    464|		case ST_RD_R0:
  ------------------
  |  | 2400|    464|#define ST_RD_R0		5
  ------------------
  |  Branch (2544:3): [True: 1, False: 587]
  ------------------
 2545|    465|		case ST_RD_R1:
  ------------------
  |  | 2401|    465|#define ST_RD_R1		6
  ------------------
  |  Branch (2545:3): [True: 1, False: 587]
  ------------------
 2546|    466|		case ST_RD_R2:
  ------------------
  |  | 2402|    466|#define ST_RD_R2		7
  ------------------
  |  Branch (2546:3): [True: 1, False: 587]
  ------------------
 2547|  1.37k|			do {
 2548|  1.37k|				uint16_t u16;
 2549|       |				/* Drain bits in the cache buffer of
 2550|       |				 * bit-stream. */
 2551|  1.37k|				if (lzx_br_has(br, 32)) {
  ------------------
  |  | 2247|  1.37k|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  ------------------
  |  |  |  Branch (2247:27): [True: 453, False: 923]
  |  |  ------------------
  ------------------
 2552|    453|					u16 = lzx_br_bits(br, 16);
  ------------------
  |  | 2250|    453|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2251|    453|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2553|    453|					lzx_br_consume(br, 16);
  ------------------
  |  | 2269|    453|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2554|    453|					archive_le16enc(ds->rbytes, u16);
 2555|    453|					u16 = lzx_br_bits(br, 16);
  ------------------
  |  | 2250|    453|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2251|    453|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2556|    453|					lzx_br_consume(br, 16);
  ------------------
  |  | 2269|    453|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2557|    453|					archive_le16enc(ds->rbytes+2, u16);
 2558|    453|					ds->rbytes_avail = 4;
 2559|    923|				} else if (lzx_br_has(br, 16)) {
  ------------------
  |  | 2247|    923|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  ------------------
  |  |  |  Branch (2247:27): [True: 5, False: 918]
  |  |  ------------------
  ------------------
 2560|      5|					u16 = lzx_br_bits(br, 16);
  ------------------
  |  | 2250|      5|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2251|      5|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2561|      5|					lzx_br_consume(br, 16);
  ------------------
  |  | 2269|      5|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2562|      5|					archive_le16enc(ds->rbytes, u16);
 2563|      5|					ds->rbytes_avail = 2;
 2564|      5|				}
 2565|  1.37k|				if (ds->rbytes_avail < 4 && ds->br.have_odd) {
  ------------------
  |  Branch (2565:9): [True: 923, False: 453]
  |  Branch (2565:33): [True: 3, False: 920]
  ------------------
 2566|      3|					ds->rbytes[ds->rbytes_avail++] =
 2567|      3|					    ds->br.odd;
 2568|      3|					ds->br.have_odd = 0;
 2569|      3|				}
 2570|  5.03k|				while (ds->rbytes_avail < 4) {
  ------------------
  |  Branch (2570:12): [True: 3.66k, False: 1.36k]
  ------------------
 2571|  3.66k|					if (strm->avail_in <= 0) {
  ------------------
  |  Branch (2571:10): [True: 7, False: 3.66k]
  ------------------
 2572|      7|						if (last)
  ------------------
  |  Branch (2572:11): [True: 0, False: 7]
  ------------------
 2573|      0|							goto failed;
 2574|      7|						return (ARCHIVE_OK);
  ------------------
  |  |  233|      7|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2575|      7|					}
 2576|  3.66k|					ds->rbytes[ds->rbytes_avail++] =
 2577|  3.66k|					    *strm->next_in++;
 2578|  3.66k|					strm->avail_in--;
 2579|  3.66k|				}
 2580|  1.36k|				ds->rbytes_avail = 0;
 2581|  1.36k|				if (ds->state == ST_RD_R0) {
  ------------------
  |  | 2400|  1.36k|#define ST_RD_R0		5
  ------------------
  |  Branch (2581:9): [True: 461, False: 908]
  ------------------
 2582|    461|					ds->r0 = archive_le32dec(ds->rbytes);
 2583|    461|					if (ds->r0 < 0)
  ------------------
  |  Branch (2583:10): [True: 4, False: 457]
  ------------------
 2584|      4|						goto failed;
 2585|    457|					ds->state = ST_RD_R1;
  ------------------
  |  | 2401|    457|#define ST_RD_R1		6
  ------------------
 2586|    908|				} else if (ds->state == ST_RD_R1) {
  ------------------
  |  | 2401|    908|#define ST_RD_R1		6
  ------------------
  |  Branch (2586:16): [True: 456, False: 452]
  ------------------
 2587|    456|					ds->r1 = archive_le32dec(ds->rbytes);
 2588|    456|					if (ds->r1 < 0)
  ------------------
  |  Branch (2588:10): [True: 3, False: 453]
  ------------------
 2589|      3|						goto failed;
 2590|    453|					ds->state = ST_RD_R2;
  ------------------
  |  | 2402|    453|#define ST_RD_R2		7
  ------------------
 2591|    453|				} else if (ds->state == ST_RD_R2) {
  ------------------
  |  | 2402|    452|#define ST_RD_R2		7
  ------------------
  |  Branch (2591:16): [True: 452, False: 0]
  ------------------
 2592|    452|					ds->r2 = archive_le32dec(ds->rbytes);
 2593|    452|					if (ds->r2 < 0)
  ------------------
  |  Branch (2593:10): [True: 0, False: 452]
  ------------------
 2594|      0|						goto failed;
 2595|       |					/* We've gotten all repeated offsets. */
 2596|    452|					ds->state = ST_COPY_UNCOMP1;
  ------------------
  |  | 2403|    452|#define ST_COPY_UNCOMP1		8
  ------------------
 2597|    452|				}
 2598|  1.36k|			} while (ds->state != ST_COPY_UNCOMP1);
  ------------------
  |  | 2403|  1.36k|#define ST_COPY_UNCOMP1		8
  ------------------
  |  Branch (2598:13): [True: 910, False: 452]
  ------------------
 2599|       |			/* FALL THROUGH */
 2600|    458|		case ST_COPY_UNCOMP1:
  ------------------
  |  | 2403|    458|#define ST_COPY_UNCOMP1		8
  ------------------
  |  Branch (2600:3): [True: 6, False: 582]
  ------------------
 2601|       |			/*
 2602|       |			 * Copy bytes form next_in to next_out directly.
 2603|       |			 */
 2604|    916|			while (ds->block_bytes_avail) {
  ------------------
  |  Branch (2604:11): [True: 470, False: 446]
  ------------------
 2605|    470|				int l;
 2606|       |
 2607|    470|				if (strm->avail_out <= 0)
  ------------------
  |  Branch (2607:9): [True: 6, False: 464]
  ------------------
 2608|       |					/* Output buffer is empty. */
 2609|      6|					return (ARCHIVE_OK);
  ------------------
  |  |  233|      6|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2610|    464|				if (strm->avail_in <= 0) {
  ------------------
  |  Branch (2610:9): [True: 6, False: 458]
  ------------------
 2611|       |					/* Input buffer is empty. */
 2612|      6|					if (last)
  ------------------
  |  Branch (2612:10): [True: 0, False: 6]
  ------------------
 2613|      0|						goto failed;
 2614|      6|					return (ARCHIVE_OK);
  ------------------
  |  |  233|      6|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2615|      6|				}
 2616|    458|				l = (int)ds->block_bytes_avail;
 2617|    458|				if (l > ds->w_size - ds->w_pos)
  ------------------
  |  Branch (2617:9): [True: 10, False: 448]
  ------------------
 2618|     10|					l = ds->w_size - ds->w_pos;
 2619|    458|				if (l > strm->avail_out)
  ------------------
  |  Branch (2619:9): [True: 12, False: 446]
  ------------------
 2620|     12|					l = (int)strm->avail_out;
 2621|    458|				if (l > strm->avail_in)
  ------------------
  |  Branch (2621:9): [True: 6, False: 452]
  ------------------
 2622|      6|					l = (int)strm->avail_in;
 2623|    458|				memcpy(strm->next_out, strm->next_in, l);
 2624|    458|				memcpy(&(ds->w_buff[ds->w_pos]),
 2625|    458|				    strm->next_in, l);
 2626|    458|				strm->next_in += l;
 2627|    458|				strm->avail_in -= l;
 2628|    458|				strm->next_out += l;
 2629|    458|				strm->avail_out -= l;
 2630|    458|				strm->total_out += l;
 2631|    458|				ds->w_pos = (ds->w_pos + l) & ds->w_mask;
 2632|    458|				ds->block_bytes_avail -= l;
 2633|    458|			}
 2634|       |			/* FALL THROUGH */
 2635|    446|		case ST_COPY_UNCOMP2:
  ------------------
  |  | 2404|    446|#define ST_COPY_UNCOMP2		9
  ------------------
  |  Branch (2635:3): [True: 0, False: 588]
  ------------------
 2636|       |			/* Re-align; skip padding byte. */
 2637|    446|			if (ds->block_size & 1) {
  ------------------
  |  Branch (2637:8): [True: 423, False: 23]
  ------------------
 2638|    423|				if (strm->avail_in <= 0) {
  ------------------
  |  Branch (2638:9): [True: 0, False: 423]
  ------------------
 2639|       |					/* Input buffer is empty. */
 2640|      0|					ds->state = ST_COPY_UNCOMP2;
  ------------------
  |  | 2404|      0|#define ST_COPY_UNCOMP2		9
  ------------------
 2641|      0|					if (last)
  ------------------
  |  Branch (2641:10): [True: 0, False: 0]
  ------------------
 2642|      0|						goto failed;
 2643|      0|					return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2644|      0|				}
 2645|    423|				strm->next_in++;
 2646|    423|				strm->avail_in --;
 2647|    423|			}
 2648|       |			/* This block ended. */
 2649|    446|			ds->state = ST_RD_BLOCK_TYPE;
  ------------------
  |  | 2397|    446|#define ST_RD_BLOCK_TYPE	2
  ------------------
 2650|    446|			return (ARCHIVE_EOF);
  ------------------
  |  |  232|    446|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2651|       |			/********************/
 2652|     10|		case ST_RD_ALIGNED_OFFSET:
  ------------------
  |  | 2405|     10|#define ST_RD_ALIGNED_OFFSET	10
  ------------------
  |  Branch (2652:3): [True: 10, False: 578]
  ------------------
 2653|       |			/*
 2654|       |			 * Read Aligned offset tree.
 2655|       |			 */
 2656|     10|			if (!lzx_br_read_ahead(strm, br, 3 * ds->at.len_size)) {
  ------------------
  |  | 2266|     10|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2261|     20|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 2247|     20|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2247:27): [True: 8, False: 2]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2261:28): [True: 0, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2247|      2|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2247:27): [True: 0, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2657|      2|				ds->state = ST_RD_ALIGNED_OFFSET;
  ------------------
  |  | 2405|      2|#define ST_RD_ALIGNED_OFFSET	10
  ------------------
 2658|      2|				if (last)
  ------------------
  |  Branch (2658:9): [True: 0, False: 2]
  ------------------
 2659|      0|					goto failed;
 2660|      2|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      2|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2661|      2|			}
 2662|      8|			memset(ds->at.freq, 0, sizeof(ds->at.freq));
 2663|     72|			for (i = 0; i < ds->at.len_size; i++) {
  ------------------
  |  Branch (2663:16): [True: 64, False: 8]
  ------------------
 2664|     64|				ds->at.bitlen[i] = lzx_br_bits(br, 3);
  ------------------
  |  | 2250|     64|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2251|     64|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2665|     64|				ds->at.freq[ds->at.bitlen[i]]++;
 2666|     64|				lzx_br_consume(br, 3);
  ------------------
  |  | 2269|     64|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2667|     64|			}
 2668|      8|			if (!lzx_make_huffman_table(&ds->at))
  ------------------
  |  Branch (2668:8): [True: 2, False: 6]
  ------------------
 2669|      2|				goto failed;
 2670|       |			/* FALL THROUGH */
 2671|     47|		case ST_RD_VERBATIM:
  ------------------
  |  | 2406|     47|#define ST_RD_VERBATIM		11
  ------------------
  |  Branch (2671:3): [True: 41, False: 547]
  ------------------
 2672|     47|			ds->loop = 0;
 2673|       |			/* FALL THROUGH */
 2674|     49|		case ST_RD_PRE_MAIN_TREE_256:
  ------------------
  |  | 2407|     49|#define ST_RD_PRE_MAIN_TREE_256	12
  ------------------
  |  Branch (2674:3): [True: 2, False: 586]
  ------------------
 2675|       |			/*
 2676|       |			 * Read Pre-tree for first 256 elements of main tree.
 2677|       |			 */
 2678|     49|			if (!lzx_read_pre_tree(strm)) {
  ------------------
  |  Branch (2678:8): [True: 4, False: 45]
  ------------------
 2679|      4|				ds->state = ST_RD_PRE_MAIN_TREE_256;
  ------------------
  |  | 2407|      4|#define ST_RD_PRE_MAIN_TREE_256	12
  ------------------
 2680|      4|				if (last)
  ------------------
  |  Branch (2680:9): [True: 0, False: 4]
  ------------------
 2681|      0|					goto failed;
 2682|      4|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      4|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2683|      4|			}
 2684|     45|			if (!lzx_make_huffman_table(&ds->pt))
  ------------------
  |  Branch (2684:8): [True: 2, False: 43]
  ------------------
 2685|      2|				goto failed;
 2686|     43|			ds->loop = 0;
 2687|       |			/* FALL THROUGH */
 2688|     44|		case ST_MAIN_TREE_256:
  ------------------
  |  | 2408|     44|#define ST_MAIN_TREE_256	13
  ------------------
  |  Branch (2688:3): [True: 1, False: 587]
  ------------------
 2689|       |			/*
 2690|       |			 * Get path lengths of first 256 elements of main tree.
 2691|       |			 */
 2692|     44|			r = lzx_read_bitlen(strm, &ds->mt, 256);
 2693|     44|			if (r < 0)
  ------------------
  |  Branch (2693:8): [True: 0, False: 44]
  ------------------
 2694|      0|				goto failed;
 2695|     44|			else if (!r) {
  ------------------
  |  Branch (2695:13): [True: 2, False: 42]
  ------------------
 2696|      2|				ds->state = ST_MAIN_TREE_256;
  ------------------
  |  | 2408|      2|#define ST_MAIN_TREE_256	13
  ------------------
 2697|      2|				if (last)
  ------------------
  |  Branch (2697:9): [True: 0, False: 2]
  ------------------
 2698|      0|					goto failed;
 2699|      2|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      2|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2700|      2|			}
 2701|     42|			ds->loop = 0;
 2702|       |			/* FALL THROUGH */
 2703|     43|		case ST_RD_PRE_MAIN_TREE_REM:
  ------------------
  |  | 2409|     43|#define ST_RD_PRE_MAIN_TREE_REM	14
  ------------------
  |  Branch (2703:3): [True: 1, False: 587]
  ------------------
 2704|       |			/*
 2705|       |			 * Read Pre-tree for remaining elements of main tree.
 2706|       |			 */
 2707|     43|			if (!lzx_read_pre_tree(strm)) {
  ------------------
  |  Branch (2707:8): [True: 2, False: 41]
  ------------------
 2708|      2|				ds->state = ST_RD_PRE_MAIN_TREE_REM;
  ------------------
  |  | 2409|      2|#define ST_RD_PRE_MAIN_TREE_REM	14
  ------------------
 2709|      2|				if (last)
  ------------------
  |  Branch (2709:9): [True: 0, False: 2]
  ------------------
 2710|      0|					goto failed;
 2711|      2|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      2|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2712|      2|			}
 2713|     41|			if (!lzx_make_huffman_table(&ds->pt))
  ------------------
  |  Branch (2713:8): [True: 0, False: 41]
  ------------------
 2714|      0|				goto failed;
 2715|     41|			ds->loop = 256;
 2716|       |			/* FALL THROUGH */
 2717|     44|		case ST_MAIN_TREE_REM:
  ------------------
  |  | 2410|     44|#define ST_MAIN_TREE_REM	15
  ------------------
  |  Branch (2717:3): [True: 3, False: 585]
  ------------------
 2718|       |			/*
 2719|       |			 * Get path lengths of remaining elements of main tree.
 2720|       |			 */
 2721|     44|			r = lzx_read_bitlen(strm, &ds->mt, -1);
 2722|     44|			if (r < 0)
  ------------------
  |  Branch (2722:8): [True: 0, False: 44]
  ------------------
 2723|      0|				goto failed;
 2724|     44|			else if (!r) {
  ------------------
  |  Branch (2724:13): [True: 6, False: 38]
  ------------------
 2725|      6|				ds->state = ST_MAIN_TREE_REM;
  ------------------
  |  | 2410|      6|#define ST_MAIN_TREE_REM	15
  ------------------
 2726|      6|				if (last)
  ------------------
  |  Branch (2726:9): [True: 0, False: 6]
  ------------------
 2727|      0|					goto failed;
 2728|      6|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      6|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2729|      6|			}
 2730|     38|			if (!lzx_make_huffman_table(&ds->mt))
  ------------------
  |  Branch (2730:8): [True: 0, False: 38]
  ------------------
 2731|      0|				goto failed;
 2732|     38|			ds->loop = 0;
 2733|       |			/* FALL THROUGH */
 2734|     39|		case ST_RD_PRE_LENGTH_TREE:
  ------------------
  |  | 2411|     39|#define ST_RD_PRE_LENGTH_TREE	16
  ------------------
  |  Branch (2734:3): [True: 1, False: 587]
  ------------------
 2735|       |			/*
 2736|       |			 * Read Pre-tree for remaining elements of main tree.
 2737|       |			 */
 2738|     39|			if (!lzx_read_pre_tree(strm)) {
  ------------------
  |  Branch (2738:8): [True: 2, False: 37]
  ------------------
 2739|      2|				ds->state = ST_RD_PRE_LENGTH_TREE;
  ------------------
  |  | 2411|      2|#define ST_RD_PRE_LENGTH_TREE	16
  ------------------
 2740|      2|				if (last)
  ------------------
  |  Branch (2740:9): [True: 0, False: 2]
  ------------------
 2741|      0|					goto failed;
 2742|      2|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      2|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2743|      2|			}
 2744|     37|			if (!lzx_make_huffman_table(&ds->pt))
  ------------------
  |  Branch (2744:8): [True: 0, False: 37]
  ------------------
 2745|      0|				goto failed;
 2746|     37|			ds->loop = 0;
 2747|       |			/* FALL THROUGH */
 2748|     38|		case ST_LENGTH_TREE:
  ------------------
  |  | 2412|     38|#define ST_LENGTH_TREE		17
  ------------------
  |  Branch (2748:3): [True: 1, False: 587]
  ------------------
 2749|       |			/*
 2750|       |			 * Get path lengths of remaining elements of main tree.
 2751|       |			 */
 2752|     38|			r = lzx_read_bitlen(strm, &ds->lt, -1);
 2753|     38|			if (r < 0)
  ------------------
  |  Branch (2753:8): [True: 0, False: 38]
  ------------------
 2754|      0|				goto failed;
 2755|     38|			else if (!r) {
  ------------------
  |  Branch (2755:13): [True: 2, False: 36]
  ------------------
 2756|      2|				ds->state = ST_LENGTH_TREE;
  ------------------
  |  | 2412|      2|#define ST_LENGTH_TREE		17
  ------------------
 2757|      2|				if (last)
  ------------------
  |  Branch (2757:9): [True: 0, False: 2]
  ------------------
 2758|      0|					goto failed;
 2759|      2|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      2|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2760|      2|			}
 2761|     36|			if (!lzx_make_huffman_table(&ds->lt))
  ------------------
  |  Branch (2761:8): [True: 0, False: 36]
  ------------------
 2762|      0|				goto failed;
 2763|     36|			ds->state = ST_MAIN;
  ------------------
  |  | 2413|     36|#define ST_MAIN			18
  ------------------
 2764|     36|			return (100);
 2765|    588|		}
 2766|    588|	}
 2767|     12|failed:
 2768|     12|	return (ds->error = ARCHIVE_FAILED);
  ------------------
  |  |  237|     12|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2769|    538|}
archive_read_support_format_cab.c:lzx_br_fillup:
 2295|  12.8k|{
 2296|       |/*
 2297|       | * x86 processor family can read misaligned data without an access error.
 2298|       | */
 2299|  12.8k|	int n = CACHE_BITS - br->cache_avail;
  ------------------
  |  |   97|  12.8k|#define CACHE_BITS		(8 * sizeof(CACHE_TYPE))
  ------------------
 2300|       |
 2301|  12.9k|	for (;;) {
 2302|  12.9k|		switch (n >> 4) {
 2303|  1.08k|		case 4:
  ------------------
  |  Branch (2303:3): [True: 1.08k, False: 11.8k]
  ------------------
 2304|  1.08k|			if (strm->avail_in >= 8) {
  ------------------
  |  Branch (2304:8): [True: 1.06k, False: 13]
  ------------------
 2305|  1.06k|				br->cache_buffer =
 2306|  1.06k|				    ((uint64_t)strm->next_in[1]) << 56 |
 2307|  1.06k|				    ((uint64_t)strm->next_in[0]) << 48 |
 2308|  1.06k|				    ((uint64_t)strm->next_in[3]) << 40 |
 2309|  1.06k|				    ((uint64_t)strm->next_in[2]) << 32 |
 2310|  1.06k|				    ((uint32_t)strm->next_in[5]) << 24 |
 2311|  1.06k|				    ((uint32_t)strm->next_in[4]) << 16 |
 2312|  1.06k|				    ((uint32_t)strm->next_in[7]) << 8 |
 2313|  1.06k|				     (uint32_t)strm->next_in[6];
 2314|  1.06k|				strm->next_in += 8;
 2315|  1.06k|				strm->avail_in -= 8;
 2316|  1.06k|				br->cache_avail += 8 * 8;
 2317|  1.06k|				return (1);
 2318|  1.06k|			}
 2319|     13|			break;
 2320|  11.7k|		case 3:
  ------------------
  |  Branch (2320:3): [True: 11.7k, False: 1.14k]
  ------------------
 2321|  11.7k|			if (strm->avail_in >= 6) {
  ------------------
  |  Branch (2321:8): [True: 11.7k, False: 60]
  ------------------
 2322|  11.7k|				br->cache_buffer =
 2323|  11.7k|		 		   (br->cache_buffer << 48) |
 2324|  11.7k|				    ((uint64_t)strm->next_in[1]) << 40 |
 2325|  11.7k|				    ((uint64_t)strm->next_in[0]) << 32 |
 2326|  11.7k|				    ((uint64_t)strm->next_in[3]) << 24 |
 2327|  11.7k|				    ((uint64_t)strm->next_in[2]) << 16 |
 2328|  11.7k|				    ((uint64_t)strm->next_in[5]) << 8 |
 2329|  11.7k|				     (uint64_t)strm->next_in[4];
 2330|  11.7k|				strm->next_in += 6;
 2331|  11.7k|				strm->avail_in -= 6;
 2332|  11.7k|				br->cache_avail += 6 * 8;
 2333|  11.7k|				return (1);
 2334|  11.7k|			}
 2335|     60|			break;
 2336|     60|		case 0:
  ------------------
  |  Branch (2336:3): [True: 7, False: 12.9k]
  ------------------
 2337|       |			/* We have enough compressed data in
 2338|       |			 * the cache buffer.*/
 2339|      7|			return (1);
 2340|     59|		default:
  ------------------
  |  Branch (2340:3): [True: 59, False: 12.8k]
  ------------------
 2341|     59|			break;
 2342|  12.9k|		}
 2343|    132|		if (strm->avail_in < 2) {
  ------------------
  |  Branch (2343:7): [True: 71, False: 61]
  ------------------
 2344|       |			/* There is not enough compressed data to
 2345|       |			 * fill up the cache buffer. */
 2346|     71|			if (strm->avail_in == 1) {
  ------------------
  |  Branch (2346:8): [True: 19, False: 52]
  ------------------
 2347|     19|				br->odd = *strm->next_in++;
 2348|     19|				strm->avail_in--;
 2349|     19|				br->have_odd = 1;
 2350|     19|			}
 2351|     71|			return (0);
 2352|     71|		}
 2353|     61|		br->cache_buffer =
 2354|     61|		   (br->cache_buffer << 16) |
 2355|     61|		    archive_le16dec(strm->next_in);
 2356|     61|		strm->next_in += 2;
 2357|     61|		strm->avail_in -= 2;
 2358|     61|		br->cache_avail += 16;
 2359|     61|		n -= 16;
 2360|     61|	}
 2361|  12.8k|}
archive_read_support_format_cab.c:lzx_make_huffman_table:
 3181|    205|{
 3182|    205|	uint16_t *tbl;
 3183|    205|	const unsigned char *bitlen;
 3184|    205|	int bitptn[17], weight[17];
 3185|    205|	int i, maxbits = 0, ptn, tbl_size, w;
 3186|    205|	int len_avail;
 3187|       |
 3188|       |	/*
 3189|       |	 * Initialize bit patterns.
 3190|       |	 */
 3191|    205|	ptn = 0;
 3192|  3.48k|	for (i = 1, w = 1 << 15; i <= 16; i++, w >>= 1) {
  ------------------
  |  Branch (3192:27): [True: 3.28k, False: 205]
  ------------------
 3193|  3.28k|		bitptn[i] = ptn;
 3194|  3.28k|		weight[i] = w;
 3195|  3.28k|		if (hf->freq[i]) {
  ------------------
  |  Branch (3195:7): [True: 204, False: 3.07k]
  ------------------
 3196|    204|			ptn += hf->freq[i] * w;
 3197|    204|			maxbits = i;
 3198|    204|		}
 3199|  3.28k|	}
 3200|    205|	if ((ptn & 0xffff) != 0 || maxbits > hf->tbl_bits)
  ------------------
  |  Branch (3200:6): [True: 4, False: 201]
  |  Branch (3200:29): [True: 0, False: 201]
  ------------------
 3201|      4|		return (0);/* Invalid */
 3202|       |
 3203|    201|	hf->max_bits = maxbits;
 3204|       |
 3205|       |	/*
 3206|       |	 * Cut out extra bits which we won't house in the table.
 3207|       |	 * This preparation reduces the same calculation in the for-loop
 3208|       |	 * making the table.
 3209|       |	 */
 3210|    201|	if (maxbits < 16) {
  ------------------
  |  Branch (3210:6): [True: 201, False: 0]
  ------------------
 3211|    201|		int ebits = 16 - maxbits;
 3212|    427|		for (i = 1; i <= maxbits; i++) {
  ------------------
  |  Branch (3212:15): [True: 226, False: 201]
  ------------------
 3213|    226|			bitptn[i] >>= ebits;
 3214|    226|			weight[i] >>= ebits;
 3215|    226|		}
 3216|    201|	}
 3217|       |
 3218|       |	/*
 3219|       |	 * Make the table.
 3220|       |	 */
 3221|    201|	tbl_size = 1 << hf->tbl_bits;
 3222|    201|	tbl = hf->tbl;
 3223|    201|	bitlen = hf->bitlen;
 3224|    201|	len_avail = hf->len_size;
 3225|    201|	hf->tree_used = 0;
 3226|       |	/* Initialize table to invalid values */
 3227|  4.97M|	for (i = 0; i < tbl_size; i++) {
  ------------------
  |  Branch (3227:14): [True: 4.97M, False: 201]
  ------------------
 3228|  4.97M|		tbl[i] = (uint16_t)hf->len_size;
 3229|  4.97M|	}
 3230|  35.6k|	for (i = 0; i < len_avail; i++) {
  ------------------
  |  Branch (3230:14): [True: 35.4k, False: 201]
  ------------------
 3231|  35.4k|		uint16_t *p;
 3232|  35.4k|		int len, cnt;
 3233|       |
 3234|  35.4k|		if (bitlen[i] == 0)
  ------------------
  |  Branch (3234:7): [True: 21.3k, False: 14.1k]
  ------------------
 3235|  21.3k|			continue;
 3236|       |		/* Get a bit pattern */
 3237|  14.1k|		len = bitlen[i];
 3238|  14.1k|		if (len > tbl_size)
  ------------------
  |  Branch (3238:7): [True: 0, False: 14.1k]
  ------------------
 3239|      0|			return (0);
 3240|  14.1k|		ptn = bitptn[len];
 3241|  14.1k|		cnt = weight[len];
 3242|       |		/* Calculate next bit pattern */
 3243|  14.1k|		if ((bitptn[len] = ptn + cnt) > tbl_size)
  ------------------
  |  Branch (3243:7): [True: 0, False: 14.1k]
  ------------------
 3244|      0|			return (0);/* Invalid */
 3245|       |		/* Update the table */
 3246|  14.1k|		p = &(tbl[ptn]);
 3247|  31.0k|		while (--cnt >= 0)
  ------------------
  |  Branch (3247:10): [True: 16.8k, False: 14.1k]
  ------------------
 3248|  16.8k|			p[cnt] = (uint16_t)i;
 3249|  14.1k|	}
 3250|    201|	return (1);
 3251|    201|}
archive_read_support_format_cab.c:lzx_read_pre_tree:
 3047|    131|{
 3048|    131|	struct lzx_dec *ds = strm->ds;
 3049|    131|	struct lzx_br *br = &(ds->br);
 3050|    131|	int i;
 3051|       |
 3052|    131|	if (ds->loop == 0)
  ------------------
  |  Branch (3052:6): [True: 128, False: 3]
  ------------------
 3053|    128|		memset(ds->pt.freq, 0, sizeof(ds->pt.freq));
 3054|  2.62k|	for (i = ds->loop; i < ds->pt.len_size; i++) {
  ------------------
  |  Branch (3054:21): [True: 2.50k, False: 123]
  ------------------
 3055|  2.50k|		if (!lzx_br_read_ahead(strm, br, 4)) {
  ------------------
  |  | 2266|  2.50k|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2261|  5.00k|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 2247|  5.00k|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2247:27): [True: 2.35k, False: 154]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2261:28): [True: 138, False: 16]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2247|     16|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2247:27): [True: 8, False: 8]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3056|      8|			ds->loop = i;
 3057|      8|			return (0);
 3058|      8|		}
 3059|  2.49k|		ds->pt.bitlen[i] = lzx_br_bits(br, 4);
  ------------------
  |  | 2250|  2.49k|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2251|  2.49k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 3060|  2.49k|		ds->pt.freq[ds->pt.bitlen[i]]++;
 3061|  2.49k|		lzx_br_consume(br, 4);
  ------------------
  |  | 2269|  2.49k|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 3062|  2.49k|	}
 3063|    123|	ds->loop = i;
 3064|    123|	return (1);
 3065|    131|}
archive_read_support_format_cab.c:lzx_read_bitlen:
 3072|    126|{
 3073|    126|	struct lzx_dec *ds = strm->ds;
 3074|    126|	struct lzx_br *br = &(ds->br);
 3075|    126|	int c, i, j, ret, same;
 3076|    126|	unsigned rbits;
 3077|       |
 3078|    126|	i = ds->loop;
 3079|    126|	if (i == 0)
  ------------------
  |  Branch (3079:6): [True: 80, False: 46]
  ------------------
 3080|     80|		memset(d->freq, 0, sizeof(d->freq));
 3081|    126|	ret = 0;
 3082|    126|	if (end < 0)
  ------------------
  |  Branch (3082:6): [True: 82, False: 44]
  ------------------
 3083|     82|		end = d->len_size;
 3084|  31.6k|	while (i < end) {
  ------------------
  |  Branch (3084:9): [True: 31.5k, False: 116]
  ------------------
 3085|  31.5k|		ds->loop = i;
 3086|  31.5k|		if (!lzx_br_read_ahead(strm, br, ds->pt.max_bits))
  ------------------
  |  | 2266|  31.5k|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2261|  63.1k|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 2247|  63.1k|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2247:27): [True: 31.0k, False: 453]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2261:28): [True: 444, False: 9]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2247|      9|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2247:27): [True: 4, False: 5]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3087|      5|			goto getdata;
 3088|  31.5k|		rbits = lzx_br_bits(br, ds->pt.max_bits);
  ------------------
  |  | 2250|  31.5k|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2251|  31.5k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 3089|  31.5k|		c = lzx_decode_huffman(&(ds->pt), rbits);
 3090|  31.5k|		switch (c) {
 3091|    235|		case 17:/* several zero lengths, from 4 to 19. */
  ------------------
  |  Branch (3091:3): [True: 235, False: 31.3k]
  ------------------
 3092|    235|			if (!lzx_br_read_ahead(strm, br, ds->pt.bitlen[c]+4))
  ------------------
  |  | 2266|    235|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2261|    470|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 2247|    470|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2247:27): [True: 227, False: 8]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2261:28): [True: 4, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2247|      4|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2247:27): [True: 2, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3093|      2|				goto getdata;
 3094|    233|			lzx_br_consume(br, ds->pt.bitlen[c]);
  ------------------
  |  | 2269|    233|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 3095|    233|			same = lzx_br_bits(br, 4) + 4;
  ------------------
  |  | 2250|    233|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2251|    233|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 3096|    233|			if (i + same > end)
  ------------------
  |  Branch (3096:8): [True: 0, False: 233]
  ------------------
 3097|      0|				return (-1);/* Invalid */
 3098|    233|			lzx_br_consume(br, 4);
  ------------------
  |  | 2269|    233|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 3099|  1.54k|			for (j = 0; j < same; j++)
  ------------------
  |  Branch (3099:16): [True: 1.31k, False: 233]
  ------------------
 3100|  1.31k|				d->bitlen[i++] = 0;
 3101|    233|			break;
 3102|     92|		case 18:/* many zero lengths, from 20 to 51. */
  ------------------
  |  Branch (3102:3): [True: 92, False: 31.4k]
  ------------------
 3103|     92|			if (!lzx_br_read_ahead(strm, br, ds->pt.bitlen[c]+5))
  ------------------
  |  | 2266|     92|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2261|    184|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 2247|    184|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2247:27): [True: 91, False: 1]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2261:28): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2247|      0|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2247:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3104|      0|				goto getdata;
 3105|     92|			lzx_br_consume(br, ds->pt.bitlen[c]);
  ------------------
  |  | 2269|     92|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 3106|     92|			same = lzx_br_bits(br, 5) + 20;
  ------------------
  |  | 2250|     92|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2251|     92|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 3107|     92|			if (i + same > end)
  ------------------
  |  Branch (3107:8): [True: 0, False: 92]
  ------------------
 3108|      0|				return (-1);/* Invalid */
 3109|     92|			lzx_br_consume(br, 5);
  ------------------
  |  | 2269|     92|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 3110|     92|			memset(d->bitlen + i, 0, same);
 3111|     92|			i += same;
 3112|     92|			break;
 3113|     81|		case 19:/* a few same lengths. */
  ------------------
  |  Branch (3113:3): [True: 81, False: 31.4k]
  ------------------
 3114|     81|			if (!lzx_br_read_ahead(strm, br,
  ------------------
  |  | 2266|     81|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2261|    162|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 2247|    162|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2247:27): [True: 76, False: 5]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2261:28): [True: 0, False: 5]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2247|      5|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2247:27): [True: 2, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3115|     81|			    ds->pt.bitlen[c]+1+ds->pt.max_bits))
 3116|      3|				goto getdata;
 3117|     78|			lzx_br_consume(br, ds->pt.bitlen[c]);
  ------------------
  |  | 2269|     78|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 3118|     78|			same = lzx_br_bits(br, 1) + 4;
  ------------------
  |  | 2250|     78|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2251|     78|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 3119|     78|			if (i + same > end)
  ------------------
  |  Branch (3119:8): [True: 0, False: 78]
  ------------------
 3120|      0|				return (-1);
 3121|     78|			lzx_br_consume(br, 1);
  ------------------
  |  | 2269|     78|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 3122|     78|			rbits = lzx_br_bits(br, ds->pt.max_bits);
  ------------------
  |  | 2250|     78|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2251|     78|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 3123|     78|			c = lzx_decode_huffman(&(ds->pt), rbits);
 3124|     78|			lzx_br_consume(br, ds->pt.bitlen[c]);
  ------------------
  |  | 2269|     78|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 3125|     78|			c = (d->bitlen[i] - c + 17) % 17;
 3126|     78|			if (c < 0)
  ------------------
  |  Branch (3126:8): [True: 0, False: 78]
  ------------------
 3127|      0|				return (-1);/* Invalid */
 3128|    431|			for (j = 0; j < same; j++)
  ------------------
  |  Branch (3128:16): [True: 353, False: 78]
  ------------------
 3129|    353|				d->bitlen[i++] = c;
 3130|     78|			d->freq[c] += same;
 3131|     78|			break;
 3132|  31.1k|		default:
  ------------------
  |  Branch (3132:3): [True: 31.1k, False: 408]
  ------------------
 3133|  31.1k|			lzx_br_consume(br, ds->pt.bitlen[c]);
  ------------------
  |  | 2269|  31.1k|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 3134|  31.1k|			c = (d->bitlen[i] - c + 17) % 17;
 3135|  31.1k|			if (c < 0)
  ------------------
  |  Branch (3135:8): [True: 0, False: 31.1k]
  ------------------
 3136|      0|				return (-1);/* Invalid */
 3137|  31.1k|			d->freq[c]++;
 3138|  31.1k|			d->bitlen[i++] = c;
 3139|  31.1k|			break;
 3140|  31.5k|		}
 3141|  31.5k|	}
 3142|    116|	ret = 1;
 3143|    126|getdata:
 3144|    126|	ds->loop = i;
 3145|    126|	return (ret);
 3146|    116|}
archive_read_support_format_cab.c:lzx_decode_huffman:
 3255|   206k|{
 3256|   206k|	int c;
 3257|   206k|	c = hf->tbl[rbits];
 3258|   206k|	if (c < hf->len_size)
  ------------------
  |  Branch (3258:6): [True: 116k, False: 89.9k]
  ------------------
 3259|   116k|		return (c);
 3260|  89.9k|	return (0);
 3261|   206k|}
archive_read_support_format_cab.c:lzx_decode_blocks:
 2773|     46|{
 2774|     46|	struct lzx_dec *ds = strm->ds;
 2775|     46|	struct lzx_br bre = ds->br;
 2776|     46|	struct huffman *at = &(ds->at), *lt = &(ds->lt), *mt = &(ds->mt);
 2777|     46|	const struct lzx_pos_tbl *pos_tbl = ds->pos_tbl;
 2778|     46|	unsigned char *noutp = strm->next_out;
 2779|     46|	unsigned char *endp = noutp + strm->avail_out;
 2780|     46|	unsigned char *w_buff = ds->w_buff;
 2781|     46|	unsigned char *at_bitlen = at->bitlen;
 2782|     46|	unsigned char *lt_bitlen = lt->bitlen;
 2783|     46|	unsigned char *mt_bitlen = mt->bitlen;
 2784|     46|	size_t block_bytes_avail = ds->block_bytes_avail;
 2785|     46|	int at_max_bits = at->max_bits;
 2786|     46|	int lt_max_bits = lt->max_bits;
 2787|     46|	int mt_max_bits = mt->max_bits;
 2788|     46|	int c, copy_len = ds->copy_len, copy_pos = ds->copy_pos;
 2789|     46|	int w_pos = ds->w_pos, w_mask = ds->w_mask, w_size = ds->w_size;
 2790|     46|	int length_header = ds->length_header;
 2791|     46|	int offset_bits = ds->offset_bits;
 2792|     46|	int position_slot = ds->position_slot;
 2793|     46|	int r0 = ds->r0, r1 = ds->r1, r2 = ds->r2;
 2794|     46|	int state = ds->state;
 2795|     46|	char block_type = ds->block_type;
 2796|       |
 2797|   107k|	for (;;) {
 2798|   107k|		switch (state) {
  ------------------
  |  Branch (2798:11): [True: 107k, False: 0]
  ------------------
 2799|  94.1k|		case ST_MAIN:
  ------------------
  |  | 2413|  94.1k|#define ST_MAIN			18
  ------------------
  |  Branch (2799:3): [True: 94.1k, False: 13.5k]
  ------------------
 2800|   169k|			for (;;) {
 2801|   169k|				if (block_bytes_avail == 0) {
  ------------------
  |  Branch (2801:9): [True: 24, False: 169k]
  ------------------
 2802|       |					/* This block ended. */
 2803|     24|					ds->state = ST_RD_BLOCK_TYPE;
  ------------------
  |  | 2397|     24|#define ST_RD_BLOCK_TYPE	2
  ------------------
 2804|     24|					ds->br = bre;
 2805|     24|					ds->block_bytes_avail =
 2806|     24|					    block_bytes_avail;
 2807|     24|					ds->copy_len = copy_len;
 2808|     24|					ds->copy_pos = copy_pos;
 2809|     24|					ds->length_header = length_header;
 2810|     24|					ds->position_slot = position_slot;
 2811|     24|					ds->r0 = r0; ds->r1 = r1; ds->r2 = r2;
 2812|     24|					ds->w_pos = w_pos;
 2813|     24|					strm->avail_out = endp - noutp;
 2814|     24|					return (ARCHIVE_EOF);
  ------------------
  |  |  232|     24|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2815|     24|				}
 2816|   169k|				if (noutp >= endp)
  ------------------
  |  Branch (2816:9): [True: 5, False: 169k]
  ------------------
 2817|       |					/* Output buffer is empty. */
 2818|      5|					goto next_data;
 2819|       |
 2820|   169k|				if (!lzx_br_read_ahead(strm, &bre,
  ------------------
  |  | 2266|   169k|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2261|   339k|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 2247|   339k|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2247:27): [True: 168k, False: 1.85k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2261:28): [True: 1.85k, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2247|      3|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2247:27): [True: 1, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2821|   169k|				    mt_max_bits)) {
 2822|      2|					if (!last)
  ------------------
  |  Branch (2822:10): [True: 2, False: 0]
  ------------------
 2823|      2|						goto next_data;
 2824|       |					/* Remaining bits are less than
 2825|       |					 * maximum bits(mt.max_bits) but maybe
 2826|       |					 * it still remains as much as we need,
 2827|       |					 * so we should try to use it with
 2828|       |					 * dummy bits. */
 2829|      0|					c = lzx_decode_huffman(mt,
 2830|      0|					      lzx_br_bits_forced(
  ------------------
  |  | 2253|      0|	(((uint32_t)((br)->cache_buffer <<		\
  |  | 2254|      0|		((n) - (br)->cache_avail))) & cache_masks[n])
  ------------------
 2831|      0|				 	        &bre, mt_max_bits));
 2832|      0|					lzx_br_consume(&bre, mt_bitlen[c]);
  ------------------
  |  | 2269|      0|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2833|      0|					if (!lzx_br_has(&bre, 0))
  ------------------
  |  | 2247|      0|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  ------------------
  |  Branch (2833:10): [True: 0, False: 0]
  ------------------
 2834|      0|						goto failed;/* Over read. */
 2835|   169k|				} else {
 2836|   169k|					c = lzx_decode_huffman(mt,
 2837|   169k|					      lzx_br_bits(&bre, mt_max_bits));
  ------------------
  |  | 2250|   169k|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2251|   169k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2838|   169k|					lzx_br_consume(&bre, mt_bitlen[c]);
  ------------------
  |  | 2269|   169k|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2839|   169k|				}
 2840|   169k|				if ((unsigned int)c > UCHAR_MAX)
  ------------------
  |  Branch (2840:9): [True: 94.0k, False: 75.8k]
  ------------------
 2841|  94.0k|					break;
 2842|       |				/*
 2843|       |				 * 'c' is exactly literal code.
 2844|       |				 */
 2845|       |				/* Save a decoded code to reference it
 2846|       |				 * afterward. */
 2847|  75.8k|				w_buff[w_pos] = c;
 2848|  75.8k|				w_pos = (w_pos + 1) & w_mask;
 2849|       |				/* Store the decoded code to output buffer. */
 2850|  75.8k|				*noutp++ = c;
 2851|  75.8k|				block_bytes_avail--;
 2852|  75.8k|			}
 2853|       |			/*
 2854|       |			 * Get a match code, its length and offset.
 2855|       |			 */
 2856|  94.0k|			c -= UCHAR_MAX + 1;
 2857|  94.0k|			length_header = c & 7;
 2858|  94.0k|			position_slot = c >> 3;
 2859|       |			/* FALL THROUGH */
 2860|  94.0k|		case ST_LENGTH:
  ------------------
  |  | 2414|  94.0k|#define ST_LENGTH		19
  ------------------
  |  Branch (2860:3): [True: 0, False: 107k]
  ------------------
 2861|       |			/*
 2862|       |			 * Get a length.
 2863|       |			 */
 2864|  94.0k|			if (length_header == 7) {
  ------------------
  |  Branch (2864:8): [True: 1.47k, False: 92.6k]
  ------------------
 2865|  1.47k|				if (!lzx_br_read_ahead(strm, &bre,
  ------------------
  |  | 2266|  1.47k|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2261|  2.95k|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 2247|  2.95k|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2247:27): [True: 1.42k, False: 47]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2261:28): [True: 47, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2247|      0|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2247:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2866|  1.47k|				    lt_max_bits)) {
 2867|      0|					if (!last) {
  ------------------
  |  Branch (2867:10): [True: 0, False: 0]
  ------------------
 2868|      0|						state = ST_LENGTH;
  ------------------
  |  | 2414|      0|#define ST_LENGTH		19
  ------------------
 2869|      0|						goto next_data;
 2870|      0|					}
 2871|      0|					c = lzx_decode_huffman(lt,
 2872|      0|					      lzx_br_bits_forced(
  ------------------
  |  | 2253|      0|	(((uint32_t)((br)->cache_buffer <<		\
  |  | 2254|      0|		((n) - (br)->cache_avail))) & cache_masks[n])
  ------------------
 2873|      0|					        &bre, lt_max_bits));
 2874|      0|					lzx_br_consume(&bre, lt_bitlen[c]);
  ------------------
  |  | 2269|      0|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2875|      0|					if (!lzx_br_has(&bre, 0))
  ------------------
  |  | 2247|      0|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  ------------------
  |  Branch (2875:10): [True: 0, False: 0]
  ------------------
 2876|      0|						goto failed;/* Over read. */
 2877|  1.47k|				} else {
 2878|  1.47k|					c = lzx_decode_huffman(lt,
 2879|  1.47k|					    lzx_br_bits(&bre, lt_max_bits));
  ------------------
  |  | 2250|  1.47k|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2251|  1.47k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2880|  1.47k|					lzx_br_consume(&bre, lt_bitlen[c]);
  ------------------
  |  | 2269|  1.47k|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2881|  1.47k|				}
 2882|  1.47k|				copy_len = c + 7 + 2;
 2883|  1.47k|			} else
 2884|  92.6k|				copy_len = length_header + 2;
 2885|  94.0k|			if ((size_t)copy_len > block_bytes_avail)
  ------------------
  |  Branch (2885:8): [True: 0, False: 94.0k]
  ------------------
 2886|      0|				goto failed;
 2887|       |			/*
 2888|       |			 * Get an offset.
 2889|       |			 */
 2890|  94.0k|			switch (position_slot) {
 2891|  12.0k|			case 0: /* Use repeated offset 0. */
  ------------------
  |  Branch (2891:4): [True: 12.0k, False: 82.0k]
  ------------------
 2892|  12.0k|				copy_pos = r0;
 2893|  12.0k|				state = ST_REAL_POS;
  ------------------
  |  | 2416|  12.0k|#define ST_REAL_POS		21
  ------------------
 2894|  12.0k|				continue;
 2895|    738|			case 1: /* Use repeated offset 1. */
  ------------------
  |  Branch (2895:4): [True: 738, False: 93.3k]
  ------------------
 2896|    738|				copy_pos = r1;
 2897|       |				/* Swap repeated offset. */
 2898|    738|				r1 = r0;
 2899|    738|				r0 = copy_pos;
 2900|    738|				state = ST_REAL_POS;
  ------------------
  |  | 2416|    738|#define ST_REAL_POS		21
  ------------------
 2901|    738|				continue;
 2902|    718|			case 2: /* Use repeated offset 2. */
  ------------------
  |  Branch (2902:4): [True: 718, False: 93.3k]
  ------------------
 2903|    718|				copy_pos = r2;
 2904|       |				/* Swap repeated offset. */
 2905|    718|				r2 = r0;
 2906|    718|				r0 = copy_pos;
 2907|    718|				state = ST_REAL_POS;
  ------------------
  |  | 2416|    718|#define ST_REAL_POS		21
  ------------------
 2908|    718|				continue;
 2909|  80.5k|			default:
  ------------------
  |  Branch (2909:4): [True: 80.5k, False: 13.5k]
  ------------------
 2910|  80.5k|				offset_bits =
 2911|  80.5k|				    pos_tbl[position_slot].footer_bits;
 2912|  80.5k|				break;
 2913|  94.0k|			}
 2914|       |			/* FALL THROUGH */
 2915|  80.5k|		case ST_OFFSET:
  ------------------
  |  | 2415|  80.5k|#define ST_OFFSET		20
  ------------------
  |  Branch (2915:3): [True: 7, False: 107k]
  ------------------
 2916|       |			/*
 2917|       |			 * Get the offset, which is a distance from
 2918|       |			 * current window position.
 2919|       |			 */
 2920|  80.5k|			if (block_type == ALIGNED_OFFSET_BLOCK &&
  ------------------
  |  |   76|   161k|#define ALIGNED_OFFSET_BLOCK	2
  ------------------
  |  Branch (2920:8): [True: 3.49k, False: 77.0k]
  ------------------
 2921|  3.49k|			    offset_bits >= 3) {
  ------------------
  |  Branch (2921:8): [True: 3.09k, False: 400]
  ------------------
 2922|  3.09k|				int offbits = offset_bits - 3;
 2923|       |
 2924|  3.09k|				if (!lzx_br_read_ahead(strm, &bre, offbits)) {
  ------------------
  |  | 2266|  3.09k|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2261|  6.18k|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 2247|  6.18k|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2247:27): [True: 2.91k, False: 171]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2261:28): [True: 171, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2247|      0|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2247:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2925|      0|					state = ST_OFFSET;
  ------------------
  |  | 2415|      0|#define ST_OFFSET		20
  ------------------
 2926|      0|					if (last)
  ------------------
  |  Branch (2926:10): [True: 0, False: 0]
  ------------------
 2927|      0|						goto failed;
 2928|      0|					goto next_data;
 2929|      0|				}
 2930|  3.09k|				copy_pos = lzx_br_bits(&bre, offbits) << 3;
  ------------------
  |  | 2250|  3.09k|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2251|  3.09k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2931|       |
 2932|       |				/* Get an aligned number. */
 2933|  3.09k|				if (!lzx_br_read_ahead(strm, &bre,
  ------------------
  |  | 2266|  3.09k|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2261|  6.18k|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 2247|  6.18k|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2247:27): [True: 3.07k, False: 20]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2261:28): [True: 20, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2247|      0|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2247:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2934|  3.09k|				    offbits + at_max_bits)) {
 2935|      0|					if (!last) {
  ------------------
  |  Branch (2935:10): [True: 0, False: 0]
  ------------------
 2936|      0|						state = ST_OFFSET;
  ------------------
  |  | 2415|      0|#define ST_OFFSET		20
  ------------------
 2937|      0|						goto next_data;
 2938|      0|					}
 2939|      0|					lzx_br_consume(&bre, offbits);
  ------------------
  |  | 2269|      0|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2940|      0|					c = lzx_decode_huffman(at,
 2941|      0|					      lzx_br_bits_forced(&bre,
  ------------------
  |  | 2253|      0|	(((uint32_t)((br)->cache_buffer <<		\
  |  | 2254|      0|		((n) - (br)->cache_avail))) & cache_masks[n])
  ------------------
 2942|      0|					        at_max_bits));
 2943|      0|					lzx_br_consume(&bre, at_bitlen[c]);
  ------------------
  |  | 2269|      0|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2944|      0|					if (!lzx_br_has(&bre, 0))
  ------------------
  |  | 2247|      0|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  ------------------
  |  Branch (2944:10): [True: 0, False: 0]
  ------------------
 2945|      0|						goto failed;/* Over read. */
 2946|  3.09k|				} else {
 2947|  3.09k|					lzx_br_consume(&bre, offbits);
  ------------------
  |  | 2269|  3.09k|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2948|  3.09k|					c = lzx_decode_huffman(at,
 2949|  3.09k|					      lzx_br_bits(&bre, at_max_bits));
  ------------------
  |  | 2250|  3.09k|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2251|  3.09k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2950|  3.09k|					lzx_br_consume(&bre, at_bitlen[c]);
  ------------------
  |  | 2269|  3.09k|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2951|  3.09k|				}
 2952|       |				/* Add an aligned number. */
 2953|  3.09k|				copy_pos += c;
 2954|  77.4k|			} else {
 2955|  77.4k|				if (!lzx_br_read_ahead(strm, &bre,
  ------------------
  |  | 2266|  77.4k|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2261|   154k|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 2247|   154k|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2247:27): [True: 67.8k, False: 9.64k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2261:28): [True: 9.62k, False: 21]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2247|     21|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2247:27): [True: 11, False: 10]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2956|  77.4k|				    offset_bits)) {
 2957|     10|					state = ST_OFFSET;
  ------------------
  |  | 2415|     10|#define ST_OFFSET		20
  ------------------
 2958|     10|					if (last)
  ------------------
  |  Branch (2958:10): [True: 0, False: 10]
  ------------------
 2959|      0|						goto failed;
 2960|     10|					goto next_data;
 2961|     10|				}
 2962|  77.4k|				copy_pos = lzx_br_bits(&bre, offset_bits);
  ------------------
  |  | 2250|  77.4k|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2251|  77.4k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2963|  77.4k|				lzx_br_consume(&bre, offset_bits);
  ------------------
  |  | 2269|  77.4k|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2964|  77.4k|			}
 2965|  80.5k|			copy_pos += pos_tbl[position_slot].base -2;
 2966|       |
 2967|       |			/* Update repeated offset LRU queue. */
 2968|  80.5k|			r2 = r1;
 2969|  80.5k|			r1 = r0;
 2970|  80.5k|			r0 = copy_pos;
 2971|       |			/* FALL THROUGH */
 2972|  94.0k|		case ST_REAL_POS:
  ------------------
  |  | 2416|  94.0k|#define ST_REAL_POS		21
  ------------------
  |  Branch (2972:3): [True: 13.5k, False: 94.1k]
  ------------------
 2973|       |			/*
 2974|       |			 * Compute a real position in window.
 2975|       |			 */
 2976|  94.0k|			copy_pos = (w_pos - copy_pos) & w_mask;
 2977|       |			/* FALL THROUGH */
 2978|  94.0k|		case ST_COPY:
  ------------------
  |  | 2417|  94.0k|#define ST_COPY			22
  ------------------
  |  Branch (2978:3): [True: 1, False: 107k]
  ------------------
 2979|       |			/*
 2980|       |			 * Copy several bytes as extracted data from the window
 2981|       |			 * into the output buffer.
 2982|       |			 */
 2983|  94.1k|			for (;;) {
 2984|  94.1k|				const unsigned char *s;
 2985|  94.1k|				int l;
 2986|       |
 2987|  94.1k|				l = copy_len;
 2988|  94.1k|				if (copy_pos > w_pos) {
  ------------------
  |  Branch (2988:9): [True: 2.30k, False: 91.8k]
  ------------------
 2989|  2.30k|					if (l > w_size - copy_pos)
  ------------------
  |  Branch (2989:10): [True: 50, False: 2.25k]
  ------------------
 2990|     50|						l = w_size - copy_pos;
 2991|  91.8k|				} else {
 2992|  91.8k|					if (l > w_size - w_pos)
  ------------------
  |  Branch (2992:10): [True: 0, False: 91.8k]
  ------------------
 2993|      0|						l = w_size - w_pos;
 2994|  91.8k|				}
 2995|  94.1k|				if (noutp + l >= endp)
  ------------------
  |  Branch (2995:9): [True: 5, False: 94.1k]
  ------------------
 2996|      5|					l = (int)(endp - noutp);
 2997|  94.1k|				s = w_buff + copy_pos;
 2998|  94.1k|				if (l >= 8 && ((copy_pos + l < w_pos)
  ------------------
  |  Branch (2998:9): [True: 30.8k, False: 63.2k]
  |  Branch (2998:20): [True: 28.8k, False: 2.01k]
  ------------------
 2999|  29.0k|				  || (w_pos + l < copy_pos))) {
  ------------------
  |  Branch (2999:10): [True: 203, False: 1.81k]
  ------------------
 3000|  29.0k|					memcpy(w_buff + w_pos, s, l);
 3001|  29.0k|					memcpy(noutp, s, l);
 3002|  65.0k|				} else {
 3003|  65.0k|					unsigned char *d;
 3004|  65.0k|					int li;
 3005|       |
 3006|  65.0k|					d = w_buff + w_pos;
 3007|   421k|					for (li = 0; li < l; li++)
  ------------------
  |  Branch (3007:19): [True: 356k, False: 65.0k]
  ------------------
 3008|   356k|						noutp[li] = d[li] = s[li];
 3009|  65.0k|				}
 3010|  94.1k|				noutp += l;
 3011|  94.1k|				copy_pos = (copy_pos + l) & w_mask;
 3012|  94.1k|				w_pos = (w_pos + l) & w_mask;
 3013|  94.1k|				block_bytes_avail -= l;
 3014|  94.1k|				if (copy_len <= l)
  ------------------
  |  Branch (3014:9): [True: 94.0k, False: 55]
  ------------------
 3015|       |					/* A copy of current pattern ended. */
 3016|  94.0k|					break;
 3017|     55|				copy_len -= l;
 3018|     55|				if (noutp >= endp) {
  ------------------
  |  Branch (3018:9): [True: 5, False: 50]
  ------------------
 3019|       |					/* Output buffer is empty. */
 3020|      5|					state = ST_COPY;
  ------------------
  |  | 2417|      5|#define ST_COPY			22
  ------------------
 3021|      5|					goto next_data;
 3022|      5|				}
 3023|     55|			}
 3024|  94.0k|			state = ST_MAIN;
  ------------------
  |  | 2413|  94.0k|#define ST_MAIN			18
  ------------------
 3025|  94.0k|			break;
 3026|   107k|		}
 3027|   107k|	}
 3028|      0|failed:
 3029|      0|	return (ds->error = ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3030|     22|next_data:
 3031|     22|	ds->br = bre;
 3032|     22|	ds->block_bytes_avail = block_bytes_avail;
 3033|     22|	ds->copy_len = copy_len;
 3034|     22|	ds->copy_pos = copy_pos;
 3035|     22|	ds->length_header = length_header;
 3036|     22|	ds->offset_bits = offset_bits;
 3037|     22|	ds->position_slot = position_slot;
 3038|     22|	ds->r0 = r0; ds->r1 = r1; ds->r2 = r2;
 3039|     22|	ds->state = state;
 3040|     22|	ds->w_pos = w_pos;
 3041|     22|	strm->avail_out = endp - noutp;
 3042|     22|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     22|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3043|     46|}
archive_read_support_format_cab.c:lzx_translation:
 2218|     21|{
 2219|     21|	struct lzx_dec *ds = strm->ds;
 2220|     21|	unsigned char *b, *end;
 2221|       |
 2222|     21|	if (!ds->translation || size <= 10)
  ------------------
  |  Branch (2222:6): [True: 13, False: 8]
  |  Branch (2222:26): [True: 3, False: 5]
  ------------------
 2223|     16|		return;
 2224|      5|	b = p;
 2225|      5|	end = b + size - 10;
 2226|    102|	while (b < end && (b = memchr(b, 0xE8, end - b)) != NULL) {
  ------------------
  |  Branch (2226:9): [True: 102, False: 0]
  |  Branch (2226:20): [True: 97, False: 5]
  ------------------
 2227|     97|		size_t i = b - (unsigned char *)p;
 2228|     97|		int32_t cp, displacement, value;
 2229|       |
 2230|     97|		cp = (int32_t)(offset + (uint32_t)i);
 2231|     97|		value = archive_le32dec(&b[1]);
 2232|     97|		if (value >= -cp && value < (int32_t)ds->translation_size) {
  ------------------
  |  Branch (2232:7): [True: 49, False: 48]
  |  Branch (2232:23): [True: 48, False: 1]
  ------------------
 2233|     48|			if (value >= 0)
  ------------------
  |  Branch (2233:8): [True: 25, False: 23]
  ------------------
 2234|     25|				displacement = value - cp;
 2235|     23|			else
 2236|     23|				displacement = value + ds->translation_size;
 2237|     48|			archive_le32enc(&b[1], (uint32_t)displacement);
 2238|     48|		}
 2239|     97|		b += 5;
 2240|     97|	}
 2241|      5|}
archive_read_support_format_cab.c:cab_read_data:
 1943|     88|{
 1944|     88|	struct cab *cab = (struct cab *)(a->format->data);
 1945|     88|	ssize_t bytes_avail;
 1946|       |
 1947|     88|	if (cab->entry_bytes_remaining == 0) {
  ------------------
  |  Branch (1947:6): [True: 0, False: 88]
  ------------------
 1948|      0|		*buff = NULL;
 1949|      0|		*size = 0;
 1950|      0|		*offset = cab->entry_offset;
 1951|      0|		cab->end_of_entry = 1;
 1952|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1953|      0|	}
 1954|       |
 1955|     88|	*buff = cab_read_ahead_cfdata(a, &bytes_avail);
 1956|     88|	if (bytes_avail <= 0) {
  ------------------
  |  Branch (1956:6): [True: 51, False: 37]
  ------------------
 1957|     51|		*buff = NULL;
 1958|     51|		*size = 0;
 1959|     51|		*offset = 0;
 1960|     51|		if (bytes_avail == 0 &&
  ------------------
  |  Branch (1960:7): [True: 6, False: 45]
  ------------------
 1961|      6|		    cab->entry_cfdata->uncompressed_size == 0) {
  ------------------
  |  Branch (1961:7): [True: 6, False: 0]
  ------------------
 1962|       |			/* All of CFDATA in a folder has been handled. */
 1963|      6|			archive_set_error(&a->archive,
 1964|      6|			    ARCHIVE_ERRNO_FILE_FORMAT, "Invalid CFDATA");
  ------------------
  |  |  192|      6|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1965|      6|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      6|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1966|      6|		} else
 1967|     45|			return ((int)bytes_avail);
 1968|     51|	}
 1969|     37|	if (bytes_avail > cab->entry_bytes_remaining)
  ------------------
  |  Branch (1969:6): [True: 23, False: 14]
  ------------------
 1970|     23|		bytes_avail = (ssize_t)cab->entry_bytes_remaining;
 1971|       |
 1972|     37|	*size = bytes_avail;
 1973|     37|	*offset = cab->entry_offset;
 1974|     37|	cab->entry_offset += bytes_avail;
 1975|     37|	cab->entry_bytes_remaining -= bytes_avail;
 1976|     37|	if (cab->entry_bytes_remaining == 0)
  ------------------
  |  Branch (1976:6): [True: 23, False: 14]
  ------------------
 1977|     23|		cab->end_of_entry = 1;
 1978|     37|	cab->entry_unconsumed = bytes_avail;
 1979|     37|	if (cab->entry_cffolder->comptype == COMPTYPE_NONE) {
  ------------------
  |  |  215|     37|#define COMPTYPE_NONE		0x0000
  ------------------
  |  Branch (1979:6): [True: 3, False: 34]
  ------------------
 1980|       |		/* Don't consume more than current entry used. */
 1981|      3|		if (cab->entry_cfdata->unconsumed > cab->entry_unconsumed)
  ------------------
  |  Branch (1981:7): [True: 2, False: 1]
  ------------------
 1982|      2|			cab->entry_cfdata->unconsumed = cab->entry_unconsumed;
 1983|      3|	}
 1984|     37|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     37|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1985|     88|}
archive_read_support_format_cab.c:archive_read_format_cab_read_data_skip:
 1989|     35|{
 1990|     35|	struct cab *cab;
 1991|     35|	int64_t bytes_skipped;
 1992|     35|	int r;
 1993|       |
 1994|     35|	cab = (struct cab *)(a->format->data);
 1995|       |
 1996|     35|	if (cab->end_of_archive)
  ------------------
  |  Branch (1996:6): [True: 0, False: 35]
  ------------------
 1997|      0|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1998|       |
 1999|     35|	if (!cab->read_data_invoked) {
  ------------------
  |  Branch (1999:6): [True: 3, False: 32]
  ------------------
 2000|      3|		cab->bytes_skipped += cab->entry_bytes_remaining;
 2001|      3|		cab->entry_bytes_remaining = 0;
 2002|       |		/* This entry is finished and done. */
 2003|      3|		cab->end_of_entry_cleanup = cab->end_of_entry = 1;
 2004|      3|		return (ARCHIVE_OK);
  ------------------
  |  |  233|      3|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2005|      3|	}
 2006|       |
 2007|     32|	if (cab->entry_unconsumed) {
  ------------------
  |  Branch (2007:6): [True: 0, False: 32]
  ------------------
 2008|       |		/* Consume as much as the compressor actually used. */
 2009|      0|		r = (int)cab_consume_cfdata(a, cab->entry_unconsumed);
 2010|      0|		cab->entry_unconsumed = 0;
 2011|      0|		if (r < 0)
  ------------------
  |  Branch (2011:7): [True: 0, False: 0]
  ------------------
 2012|      0|			return (r);
 2013|     32|	} else if (cab->entry_cfdata == NULL) {
  ------------------
  |  Branch (2013:13): [True: 0, False: 32]
  ------------------
 2014|      0|		r = cab_next_cfdata(a);
 2015|      0|		if (r < 0)
  ------------------
  |  Branch (2015:7): [True: 0, False: 0]
  ------------------
 2016|      0|			return (r);
 2017|      0|	}
 2018|       |
 2019|       |	/* if we've already read to end of data, we're done. */
 2020|     32|	if (cab->end_of_entry_cleanup)
  ------------------
  |  Branch (2020:6): [True: 23, False: 9]
  ------------------
 2021|     23|		return (ARCHIVE_OK);
  ------------------
  |  |  233|     23|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2022|       |
 2023|       |	/*
 2024|       |	 * If the length is at the beginning, we can skip the
 2025|       |	 * compressed data much more quickly.
 2026|       |	 */
 2027|      9|	bytes_skipped = cab_consume_cfdata(a, cab->entry_bytes_remaining);
 2028|      9|	if (bytes_skipped < 0)
  ------------------
  |  Branch (2028:6): [True: 7, False: 2]
  ------------------
 2029|      7|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      7|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2030|       |
 2031|       |	/* If the compression type is none(uncompressed), we've already
 2032|       |	 * consumed data as much as the current entry size. */
 2033|      2|	if (cab->entry_cffolder->comptype == COMPTYPE_NONE &&
  ------------------
  |  |  215|      4|#define COMPTYPE_NONE		0x0000
  ------------------
  |  Branch (2033:6): [True: 0, False: 2]
  ------------------
 2034|      0|	    cab->entry_cfdata != NULL)
  ------------------
  |  Branch (2034:6): [True: 0, False: 0]
  ------------------
 2035|      0|		cab->entry_cfdata->unconsumed = 0;
 2036|       |
 2037|       |	/* This entry is finished and done. */
 2038|      2|	cab->end_of_entry_cleanup = cab->end_of_entry = 1;
 2039|      2|	return (ARCHIVE_OK);
  ------------------
  |  |  233|      2|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2040|      9|}
archive_read_support_format_cab.c:archive_read_format_cab_cleanup:
 2044|  2.49k|{
 2045|  2.49k|	struct cab *cab = (struct cab *)(a->format->data);
 2046|  2.49k|	struct cfheader *hd = &cab->cfheader;
 2047|  2.49k|	int i;
 2048|       |
 2049|  2.49k|	if (hd->folder_array != NULL) {
  ------------------
  |  Branch (2049:6): [True: 72, False: 2.42k]
  ------------------
 2050|  5.34k|		for (i = 0; i < hd->folder_count; i++)
  ------------------
  |  Branch (2050:15): [True: 5.27k, False: 72]
  ------------------
 2051|  5.27k|			free(hd->folder_array[i].cfdata.memimage);
 2052|     72|		free(hd->folder_array);
 2053|     72|	}
 2054|  2.49k|	if (hd->file_array != NULL) {
  ------------------
  |  Branch (2054:6): [True: 70, False: 2.42k]
  ------------------
 2055|    160|		for (i = 0; i < cab->cfheader.file_count; i++)
  ------------------
  |  Branch (2055:15): [True: 90, False: 70]
  ------------------
 2056|     90|			archive_string_free(&(hd->file_array[i].pathname));
 2057|     70|		free(hd->file_array);
 2058|     70|	}
 2059|  2.49k|#ifdef HAVE_ZLIB_H
 2060|  2.49k|	if (cab->stream_valid)
  ------------------
  |  Branch (2060:6): [True: 18, False: 2.48k]
  ------------------
 2061|     18|		inflateEnd(&cab->stream);
 2062|  2.49k|#endif
 2063|  2.49k|	lzx_decode_free(&cab->xstrm);
 2064|  2.49k|	archive_wstring_free(&cab->ws);
 2065|  2.49k|	free(cab->uncompressed_buffer);
 2066|  2.49k|	free(cab);
 2067|  2.49k|	(a->format->data) = NULL;
 2068|  2.49k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2069|  2.49k|}
archive_read_support_format_cab.c:lzx_decode_free:
 2199|  2.49k|{
 2200|       |
 2201|  2.49k|	if (strm->ds == NULL)
  ------------------
  |  Branch (2201:6): [True: 2.45k, False: 47]
  ------------------
 2202|  2.45k|		return;
 2203|     47|	free(strm->ds->w_buff);
 2204|     47|	free(strm->ds->pos_tbl);
 2205|     47|	lzx_huffman_free(&(strm->ds->at));
 2206|     47|	lzx_huffman_free(&(strm->ds->pt));
 2207|     47|	lzx_huffman_free(&(strm->ds->mt));
 2208|     47|	lzx_huffman_free(&(strm->ds->lt));
 2209|     47|	free(strm->ds);
 2210|       |	strm->ds = NULL;
 2211|     47|}
archive_read_support_format_cab.c:lzx_huffman_free:
 3171|    188|{
 3172|    188|	free(hf->bitlen);
 3173|    188|	free(hf->tbl);
 3174|    188|}

archive_read_support_format_cpio:
  226|  2.49k|{
  227|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
  228|  2.49k|	struct cpio *cpio;
  229|  2.49k|	int r;
  230|       |
  231|  2.49k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  151|  2.49k|	do { \
  |  |  152|  2.49k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|  2.49k|			(allowed_states), (function_name)); \
  |  |  154|  2.49k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  2.49k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 2.49k]
  |  |  ------------------
  |  |  155|  2.49k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|  2.49k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 2.49k]
  |  |  ------------------
  ------------------
  232|  2.49k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_cpio");
  233|       |
  234|  2.49k|	cpio = calloc(1, sizeof(*cpio));
  235|  2.49k|	if (cpio == NULL) {
  ------------------
  |  Branch (235:6): [True: 0, False: 2.49k]
  ------------------
  236|      0|		archive_set_error(&a->archive, ENOMEM, "Can't allocate cpio data");
  237|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  238|      0|	}
  239|  2.49k|	cpio->magic = CPIO_MAGIC;
  ------------------
  |  |  175|  2.49k|#define	CPIO_MAGIC   0x13141516
  ------------------
  240|       |
  241|  2.49k|	r = __archive_read_register_format(a,
  242|  2.49k|	    cpio,
  243|  2.49k|	    "cpio",
  244|  2.49k|	    archive_read_format_cpio_bid,
  245|  2.49k|	    archive_read_format_cpio_options,
  246|  2.49k|	    archive_read_format_cpio_read_header,
  247|  2.49k|	    archive_read_format_cpio_read_data,
  248|  2.49k|	    archive_read_format_cpio_skip,
  249|  2.49k|	    NULL,
  250|  2.49k|	    archive_read_format_cpio_cleanup,
  251|  2.49k|	    NULL,
  252|  2.49k|	    NULL);
  253|       |
  254|  2.49k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (254:6): [True: 0, False: 2.49k]
  ------------------
  255|      0|		free(cpio);
  256|  2.49k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  257|  2.49k|}
archive_read_support_format_cpio.c:archive_read_format_cpio_bid:
  262|  2.46k|{
  263|  2.46k|	const unsigned char *p;
  264|  2.46k|	struct cpio *cpio;
  265|  2.46k|	int bid;
  266|       |
  267|  2.46k|	(void)best_bid; /* UNUSED */
  268|       |
  269|  2.46k|	cpio = (struct cpio *)(a->format->data);
  270|       |
  271|  2.46k|	if ((p = __archive_read_ahead(a, 6, NULL)) == NULL)
  ------------------
  |  Branch (271:6): [True: 23, False: 2.43k]
  ------------------
  272|     23|		return (-1);
  273|       |
  274|  2.43k|	bid = 0;
  275|  2.43k|	if (memcmp(p, "070707", 6) == 0) {
  ------------------
  |  Branch (275:6): [True: 15, False: 2.42k]
  ------------------
  276|       |		/* ASCII cpio archive (odc, POSIX.1) */
  277|     15|		cpio->read_header = header_odc;
  278|     15|		bid += 48;
  279|       |		/*
  280|       |		 * XXX TODO:  More verification; Could check that only octal
  281|       |		 * digits appear in appropriate header locations. XXX
  282|       |		 */
  283|  2.42k|	} else if (memcmp(p, "070727", 6) == 0) {
  ------------------
  |  Branch (283:13): [True: 55, False: 2.36k]
  ------------------
  284|       |		/* afio large ASCII cpio archive */
  285|     55|		cpio->read_header = header_odc;
  286|     55|		bid += 48;
  287|       |		/*
  288|       |		 * XXX TODO:  More verification; Could check that almost hex
  289|       |		 * digits appear in appropriate header locations. XXX
  290|       |		 */
  291|  2.36k|	} else if (memcmp(p, "070701", 6) == 0) {
  ------------------
  |  Branch (291:13): [True: 45, False: 2.32k]
  ------------------
  292|       |		/* ASCII cpio archive (SVR4 without CRC) */
  293|     45|		cpio->read_header = header_newc;
  294|     45|		bid += 48;
  295|       |		/*
  296|       |		 * XXX TODO:  More verification; Could check that only hex
  297|       |		 * digits appear in appropriate header locations. XXX
  298|       |		 */
  299|  2.32k|	} else if (memcmp(p, "070702", 6) == 0) {
  ------------------
  |  Branch (299:13): [True: 18, False: 2.30k]
  ------------------
  300|       |		/* ASCII cpio archive (SVR4 with CRC) */
  301|       |		/* XXX TODO: Flag that we should check the CRC. XXX */
  302|     18|		cpio->read_header = header_newc;
  303|     18|		bid += 48;
  304|       |		/*
  305|       |		 * XXX TODO:  More verification; Could check that only hex
  306|       |		 * digits appear in appropriate header locations. XXX
  307|       |		 */
  308|  2.30k|	} else if (p[0] * 256 + p[1] == 070707) {
  ------------------
  |  Branch (308:13): [True: 1, False: 2.30k]
  ------------------
  309|       |		/* big-endian binary cpio archives */
  310|      1|		cpio->read_header = header_bin_be;
  311|      1|		bid += 16;
  312|       |		/* Is more verification possible here? */
  313|  2.30k|	} else if (p[0] + p[1] * 256 == 070707) {
  ------------------
  |  Branch (313:13): [True: 2, False: 2.30k]
  ------------------
  314|       |		/* little-endian binary cpio archives */
  315|      2|		cpio->read_header = header_bin_le;
  316|      2|		bid += 16;
  317|       |		/* Is more verification possible here? */
  318|      2|	} else
  319|  2.30k|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|  2.30k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  320|       |
  321|    136|	return (bid);
  322|  2.43k|}
archive_read_support_format_cpio.c:header_odc:
  780|    751|{
  781|    751|	const void *h;
  782|    751|	int r;
  783|    751|	const char *header;
  784|       |
  785|    751|	a->archive.archive_format = ARCHIVE_FORMAT_CPIO_POSIX;
  ------------------
  |  |  357|    751|#define	ARCHIVE_FORMAT_CPIO_POSIX		(ARCHIVE_FORMAT_CPIO | 1)
  |  |  ------------------
  |  |  |  |  356|    751|#define	ARCHIVE_FORMAT_CPIO			0x10000
  |  |  ------------------
  ------------------
  786|    751|	a->archive.archive_format_name = "POSIX octet-oriented cpio";
  787|       |
  788|       |	/* Find the start of the next header. */
  789|    751|	r = find_odc_header(a);
  790|    751|	if (r < ARCHIVE_WARN)
  ------------------
  |  |  235|    751|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (790:6): [True: 45, False: 706]
  ------------------
  791|     45|		return (r);
  792|       |
  793|    706|	if (a->archive.archive_format == ARCHIVE_FORMAT_CPIO_AFIO_LARGE) {
  ------------------
  |  |  362|    706|#define	ARCHIVE_FORMAT_CPIO_AFIO_LARGE		(ARCHIVE_FORMAT_CPIO | 6)
  |  |  ------------------
  |  |  |  |  356|    706|#define	ARCHIVE_FORMAT_CPIO			0x10000
  |  |  ------------------
  ------------------
  |  Branch (793:6): [True: 22, False: 684]
  ------------------
  794|     22|		int r2 = (header_afiol(a, cpio, entry, namelength, name_pad));
  795|     22|		if (r2 == ARCHIVE_OK)
  ------------------
  |  |  233|     22|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (795:7): [True: 16, False: 6]
  ------------------
  796|     16|			return (r);
  797|      6|		else
  798|      6|			return (r2);
  799|     22|	}
  800|       |
  801|       |	/* Read fixed-size portion of header. */
  802|    684|	h = __archive_read_ahead(a, odc_header_size, NULL);
  ------------------
  |  |   92|    684|#define	odc_header_size 76
  ------------------
  803|    684|	if (h == NULL)
  ------------------
  |  Branch (803:6): [True: 0, False: 684]
  ------------------
  804|      0|	    return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  805|       |
  806|       |	/* Parse out octal fields. */
  807|    684|	header = (const char *)h;
  808|       |
  809|    684|	archive_entry_set_dev(entry, 
  810|    684|		(dev_t)atol8(header + odc_dev_offset, odc_dev_size));
  ------------------
  |  |   72|    684|#define	odc_dev_offset 6
  ------------------
              		(dev_t)atol8(header + odc_dev_offset, odc_dev_size));
  ------------------
  |  |   73|    684|#define	odc_dev_size 6
  ------------------
  811|    684|	archive_entry_set_ino(entry, atol8(header + odc_ino_offset, odc_ino_size));
  ------------------
  |  |   74|    684|#define	odc_ino_offset 12
  ------------------
              	archive_entry_set_ino(entry, atol8(header + odc_ino_offset, odc_ino_size));
  ------------------
  |  |   75|    684|#define	odc_ino_size 6
  ------------------
  812|    684|	archive_entry_set_mode(entry, 
  813|    684|		(mode_t)atol8(header + odc_mode_offset, odc_mode_size));
  ------------------
  |  |   76|    684|#define	odc_mode_offset 18
  ------------------
              		(mode_t)atol8(header + odc_mode_offset, odc_mode_size));
  ------------------
  |  |   77|    684|#define	odc_mode_size 6
  ------------------
  814|    684|	archive_entry_set_uid(entry, atol8(header + odc_uid_offset, odc_uid_size));
  ------------------
  |  |   78|    684|#define	odc_uid_offset 24
  ------------------
              	archive_entry_set_uid(entry, atol8(header + odc_uid_offset, odc_uid_size));
  ------------------
  |  |   79|    684|#define	odc_uid_size 6
  ------------------
  815|    684|	archive_entry_set_gid(entry, atol8(header + odc_gid_offset, odc_gid_size));
  ------------------
  |  |   80|    684|#define	odc_gid_offset 30
  ------------------
              	archive_entry_set_gid(entry, atol8(header + odc_gid_offset, odc_gid_size));
  ------------------
  |  |   81|    684|#define	odc_gid_size 6
  ------------------
  816|    684|	archive_entry_set_nlink(entry, 
  817|    684|		(unsigned int)atol8(header + odc_nlink_offset, odc_nlink_size));
  ------------------
  |  |   82|    684|#define	odc_nlink_offset 36
  ------------------
              		(unsigned int)atol8(header + odc_nlink_offset, odc_nlink_size));
  ------------------
  |  |   83|    684|#define	odc_nlink_size 6
  ------------------
  818|    684|	archive_entry_set_rdev(entry,
  819|    684|		(dev_t)atol8(header + odc_rdev_offset, odc_rdev_size));
  ------------------
  |  |   84|    684|#define	odc_rdev_offset 42
  ------------------
              		(dev_t)atol8(header + odc_rdev_offset, odc_rdev_size));
  ------------------
  |  |   85|    684|#define	odc_rdev_size 6
  ------------------
  820|    684|	archive_entry_set_mtime(entry, atol8(header + odc_mtime_offset, odc_mtime_size), 0);
  ------------------
  |  |   86|    684|#define	odc_mtime_offset 48
  ------------------
              	archive_entry_set_mtime(entry, atol8(header + odc_mtime_offset, odc_mtime_size), 0);
  ------------------
  |  |   87|    684|#define	odc_mtime_size 11
  ------------------
  821|    684|	*namelength = (size_t)atol8(header + odc_namesize_offset, odc_namesize_size);
  ------------------
  |  |   88|    684|#define	odc_namesize_offset 59
  ------------------
              	*namelength = (size_t)atol8(header + odc_namesize_offset, odc_namesize_size);
  ------------------
  |  |   89|    684|#define	odc_namesize_size 6
  ------------------
  822|    684|	*name_pad = 0; /* No padding of filename. */
  823|       |
  824|       |	/*
  825|       |	 * Note: entry_bytes_remaining is at least 64 bits and
  826|       |	 * therefore guaranteed to be big enough for a 33-bit file
  827|       |	 * size.
  828|       |	 */
  829|    684|	cpio->entry_bytes_remaining =
  830|    684|	    atol8(header + odc_filesize_offset, odc_filesize_size);
  ------------------
  |  |   90|    684|#define	odc_filesize_offset 65
  ------------------
              	    atol8(header + odc_filesize_offset, odc_filesize_size);
  ------------------
  |  |   91|    684|#define	odc_filesize_size 11
  ------------------
  831|    684|	archive_entry_set_size(entry, cpio->entry_bytes_remaining);
  832|    684|	cpio->entry_padding = 0;
  833|    684|	__archive_read_consume(a, odc_header_size);
  ------------------
  |  |   92|    684|#define	odc_header_size 76
  ------------------
  834|    684|	return (r);
  835|    684|}
archive_read_support_format_cpio.c:find_odc_header:
  713|    751|{
  714|    751|	const void *h;
  715|    751|	const char *p, *q;
  716|    751|	size_t skip, skipped = 0;
  717|    751|	ssize_t bytes;
  718|       |
  719|  2.50k|	for (;;) {
  720|  2.50k|		h = __archive_read_ahead(a, odc_header_size, &bytes);
  ------------------
  |  |   92|  2.50k|#define	odc_header_size 76
  ------------------
  721|  2.50k|		if (h == NULL)
  ------------------
  |  Branch (721:7): [True: 45, False: 2.45k]
  ------------------
  722|     45|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     45|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  723|  2.45k|		p = h;
  724|  2.45k|		q = p + bytes;
  725|       |
  726|       |		/* Try the typical case first, then go into the slow search.*/
  727|  2.45k|		if (memcmp("070707", p, 6) == 0 && is_octal(p, odc_header_size))
  ------------------
  |  |   92|    626|#define	odc_header_size 76
  ------------------
  |  Branch (727:7): [True: 626, False: 1.83k]
  |  Branch (727:38): [True: 186, False: 440]
  ------------------
  728|    186|			return (ARCHIVE_OK);
  ------------------
  |  |  233|    186|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  729|  2.27k|		if (memcmp("070727", p, 6) == 0 && is_afio_large(p, bytes)) {
  ------------------
  |  Branch (729:7): [True: 258, False: 2.01k]
  |  Branch (729:38): [True: 0, False: 258]
  ------------------
  730|      0|			a->archive.archive_format = ARCHIVE_FORMAT_CPIO_AFIO_LARGE;
  ------------------
  |  |  362|      0|#define	ARCHIVE_FORMAT_CPIO_AFIO_LARGE		(ARCHIVE_FORMAT_CPIO | 6)
  |  |  ------------------
  |  |  |  |  356|      0|#define	ARCHIVE_FORMAT_CPIO			0x10000
  |  |  ------------------
  ------------------
  731|      0|			return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  732|      0|		}
  733|       |
  734|       |		/*
  735|       |		 * Scan ahead until we find something that looks
  736|       |		 * like an odc header.
  737|       |		 */
  738|  2.04M|		while (p + odc_header_size <= q) {
  ------------------
  |  |   92|  2.04M|#define	odc_header_size 76
  ------------------
  |  Branch (738:10): [True: 2.04M, False: 1.75k]
  ------------------
  739|  2.04M|			switch (p[5]) {
  740|  1.04M|			case '7':
  ------------------
  |  Branch (740:4): [True: 1.04M, False: 1.00M]
  ------------------
  741|  1.04M|				if ((memcmp("070707", p, 6) == 0
  ------------------
  |  Branch (741:10): [True: 158k, False: 884k]
  ------------------
  742|   158k|				    && is_octal(p, odc_header_size))
  ------------------
  |  |   92|   158k|#define	odc_header_size 76
  ------------------
  |  Branch (742:12): [True: 498, False: 158k]
  ------------------
  743|  1.04M|				    || (memcmp("070727", p, 6) == 0
  ------------------
  |  Branch (743:13): [True: 229k, False: 813k]
  ------------------
  744|   229k|				        && is_afio_large(p, q - p))) {
  ------------------
  |  Branch (744:16): [True: 22, False: 229k]
  ------------------
  745|    520|					skip = p - (const char *)h;
  746|    520|					__archive_read_consume(a, skip);
  747|    520|					skipped += skip;
  748|    520|					if (p[4] == '2')
  ------------------
  |  Branch (748:10): [True: 22, False: 498]
  ------------------
  749|     22|						a->archive.archive_format =
  750|     22|						    ARCHIVE_FORMAT_CPIO_AFIO_LARGE;
  ------------------
  |  |  362|     22|#define	ARCHIVE_FORMAT_CPIO_AFIO_LARGE		(ARCHIVE_FORMAT_CPIO | 6)
  |  |  ------------------
  |  |  |  |  356|     22|#define	ARCHIVE_FORMAT_CPIO			0x10000
  |  |  ------------------
  ------------------
  751|    520|					if (skipped > 0) {
  ------------------
  |  Branch (751:10): [True: 520, False: 0]
  ------------------
  752|    520|						archive_set_error(&a->archive,
  753|    520|						    0,
  754|    520|						    "Skipped %d bytes before "
  755|    520|						    "finding valid header",
  756|    520|						    (int)skipped);
  757|    520|						return (ARCHIVE_WARN);
  ------------------
  |  |  235|    520|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  758|    520|					}
  759|      0|					return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  760|    520|				}
  761|  1.04M|				p += 2;
  762|  1.04M|				break;
  763|   421k|			case '0':
  ------------------
  |  Branch (763:4): [True: 421k, False: 1.62M]
  ------------------
  764|   421k|				p++;
  765|   421k|				break;
  766|   582k|			default:
  ------------------
  |  Branch (766:4): [True: 582k, False: 1.46M]
  ------------------
  767|   582k|				p += 6;
  768|   582k|				break;
  769|  2.04M|			}
  770|  2.04M|		}
  771|  1.75k|		skip = p - (const char *)h;
  772|  1.75k|		__archive_read_consume(a, skip);
  773|  1.75k|		skipped += skip;
  774|  1.75k|	}
  775|    751|}
archive_read_support_format_cpio.c:is_octal:
  681|   159k|{
  682|  4.91M|	while (len-- > 0) {
  ------------------
  |  Branch (682:9): [True: 4.91M, False: 684]
  ------------------
  683|  4.91M|		if (*p < '0' || *p > '7')
  ------------------
  |  Branch (683:7): [True: 157k, False: 4.75M]
  |  Branch (683:19): [True: 923, False: 4.75M]
  ------------------
  684|   158k|			return (0);
  685|  4.75M|	        ++p;
  686|  4.75M|	}
  687|    684|	return (1);
  688|   159k|}
archive_read_support_format_cpio.c:is_afio_large:
  692|   229k|{
  693|   229k|	if (len < afiol_header_size)
  ------------------
  |  |  161|   229k|#define afiol_header_size 116
  ------------------
  |  Branch (693:6): [True: 515, False: 229k]
  ------------------
  694|    515|		return (0);
  695|   229k|	if (h[afiol_ino_m_offset] != 'm'
  ------------------
  |  |  137|   229k|#define	afiol_ino_m_offset 30	/* 'm' */
  ------------------
  |  Branch (695:6): [True: 223k, False: 6.00k]
  ------------------
  696|  6.00k|	    || h[afiol_mtime_n_offset] != 'n'
  ------------------
  |  |  150|  6.00k|#define	afiol_mtime_n_offset 85	/* 'n' */
  ------------------
  |  Branch (696:9): [True: 1.38k, False: 4.62k]
  ------------------
  697|  4.62k|	    || h[afiol_xsize_s_offset] != 's'
  ------------------
  |  |  157|  4.62k|#define	afiol_xsize_s_offset 98	/* 's' */
  ------------------
  |  Branch (697:9): [True: 475, False: 4.14k]
  ------------------
  698|  4.14k|	    || h[afiol_filesize_c_offset] != ':')
  ------------------
  |  |  160|  4.14k|#define	afiol_filesize_c_offset 115	/* ':' */
  ------------------
  |  Branch (698:9): [True: 476, False: 3.67k]
  ------------------
  699|   225k|		return (0);
  700|  3.67k|	if (!is_hex(h + afiol_dev_offset, afiol_ino_m_offset - afiol_dev_offset))
  ------------------
  |  |  133|  3.67k|#define	afiol_dev_offset 6
  ------------------
              	if (!is_hex(h + afiol_dev_offset, afiol_ino_m_offset - afiol_dev_offset))
  ------------------
  |  |  137|  3.67k|#define	afiol_ino_m_offset 30	/* 'm' */
  ------------------
              	if (!is_hex(h + afiol_dev_offset, afiol_ino_m_offset - afiol_dev_offset))
  ------------------
  |  |  133|  3.67k|#define	afiol_dev_offset 6
  ------------------
  |  Branch (700:6): [True: 727, False: 2.94k]
  ------------------
  701|    727|		return (0);
  702|  2.94k|	if (!is_hex(h + afiol_mode_offset, afiol_mtime_n_offset - afiol_mode_offset))
  ------------------
  |  |  138|  2.94k|#define	afiol_mode_offset 31
  ------------------
              	if (!is_hex(h + afiol_mode_offset, afiol_mtime_n_offset - afiol_mode_offset))
  ------------------
  |  |  150|  2.94k|#define	afiol_mtime_n_offset 85	/* 'n' */
  ------------------
              	if (!is_hex(h + afiol_mode_offset, afiol_mtime_n_offset - afiol_mode_offset))
  ------------------
  |  |  138|  2.94k|#define	afiol_mode_offset 31
  ------------------
  |  Branch (702:6): [True: 1.03k, False: 1.91k]
  ------------------
  703|  1.03k|		return (0);
  704|  1.91k|	if (!is_hex(h + afiol_namesize_offset, afiol_xsize_s_offset - afiol_namesize_offset))
  ------------------
  |  |  151|  1.91k|#define	afiol_namesize_offset 86
  ------------------
              	if (!is_hex(h + afiol_namesize_offset, afiol_xsize_s_offset - afiol_namesize_offset))
  ------------------
  |  |  157|  1.91k|#define	afiol_xsize_s_offset 98	/* 's' */
  ------------------
              	if (!is_hex(h + afiol_namesize_offset, afiol_xsize_s_offset - afiol_namesize_offset))
  ------------------
  |  |  151|  1.91k|#define	afiol_namesize_offset 86
  ------------------
  |  Branch (704:6): [True: 912, False: 999]
  ------------------
  705|    912|		return (0);
  706|    999|	if (!is_hex(h + afiol_filesize_offset, afiol_filesize_size))
  ------------------
  |  |  158|    999|#define	afiol_filesize_offset 99
  ------------------
              	if (!is_hex(h + afiol_filesize_offset, afiol_filesize_size))
  ------------------
  |  |  159|    999|#define	afiol_filesize_size 16	/* hex */
  ------------------
  |  Branch (706:6): [True: 977, False: 22]
  ------------------
  707|    977|		return (0);
  708|     22|	return (1);
  709|    999|}
archive_read_support_format_cpio.c:is_hex:
  530|  19.4k|{
  531|   923k|	while (len-- > 0) {
  ------------------
  |  Branch (531:9): [True: 913k, False: 10.2k]
  ------------------
  532|   913k|		if ((*p >= '0' && *p <= '9')
  ------------------
  |  Branch (532:8): [True: 907k, False: 6.05k]
  |  Branch (532:21): [True: 552k, False: 354k]
  ------------------
  533|   360k|		    || (*p >= 'a' && *p <= 'f')
  ------------------
  |  Branch (533:11): [True: 161k, False: 198k]
  |  Branch (533:24): [True: 159k, False: 1.75k]
  ------------------
  534|   200k|		    || (*p >= 'A' && *p <= 'F'))
  ------------------
  |  Branch (534:11): [True: 194k, False: 6.23k]
  |  Branch (534:24): [True: 191k, False: 3.02k]
  ------------------
  535|   904k|			++p;
  536|  9.26k|		else
  537|  9.26k|			return (0);
  538|   913k|	}
  539|  10.2k|	return (1);
  540|  19.4k|}
archive_read_support_format_cpio.c:header_afiol:
  847|     22|{
  848|     22|	int64_t t;
  849|     22|	uint64_t u;
  850|     22|	const void *h;
  851|     22|	const char *header;
  852|       |
  853|     22|	a->archive.archive_format = ARCHIVE_FORMAT_CPIO_AFIO_LARGE;
  ------------------
  |  |  362|     22|#define	ARCHIVE_FORMAT_CPIO_AFIO_LARGE		(ARCHIVE_FORMAT_CPIO | 6)
  |  |  ------------------
  |  |  |  |  356|     22|#define	ARCHIVE_FORMAT_CPIO			0x10000
  |  |  ------------------
  ------------------
  854|     22|	a->archive.archive_format_name = "afio large ASCII";
  855|       |
  856|       |	/* Read fixed-size portion of header. */
  857|     22|	h = __archive_read_ahead(a, afiol_header_size, NULL);
  ------------------
  |  |  161|     22|#define afiol_header_size 116
  ------------------
  858|     22|	if (h == NULL)
  ------------------
  |  Branch (858:6): [True: 0, False: 22]
  ------------------
  859|      0|	    return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  860|       |
  861|       |	/* Parse out octal fields. */
  862|     22|	header = (const char *)h;
  863|       |
  864|     22|	archive_entry_set_dev(entry, 
  865|     22|		(dev_t)atol16(header + afiol_dev_offset, afiol_dev_size));
  ------------------
  |  |  133|     22|#define	afiol_dev_offset 6
  ------------------
              		(dev_t)atol16(header + afiol_dev_offset, afiol_dev_size));
  ------------------
  |  |  134|     22|#define	afiol_dev_size 8	/* hex */
  ------------------
  866|     22|	u = atol16u(header + afiol_ino_offset, afiol_ino_size);
  ------------------
  |  |  135|     22|#define	afiol_ino_offset 14
  ------------------
              	u = atol16u(header + afiol_ino_offset, afiol_ino_size);
  ------------------
  |  |  136|     22|#define	afiol_ino_size 16	/* hex */
  ------------------
  867|     22|#if ARCHIVE_VERSION_NUMBER < 4000000
  868|     22|	archive_entry_set_ino(entry, (int64_t)(u & INT64_MAX));
  869|       |#else
  870|       |	archive_entry_set_ino(entry, u);
  871|       |#endif
  872|     22|	archive_entry_set_mode(entry,
  873|     22|		(mode_t)atol8(header + afiol_mode_offset, afiol_mode_size));
  ------------------
  |  |  138|     22|#define	afiol_mode_offset 31
  ------------------
              		(mode_t)atol8(header + afiol_mode_offset, afiol_mode_size));
  ------------------
  |  |  139|     22|#define	afiol_mode_size 6	/* oct */
  ------------------
  874|     22|	archive_entry_set_uid(entry, atol16(header + afiol_uid_offset, afiol_uid_size));
  ------------------
  |  |  140|     22|#define	afiol_uid_offset 37
  ------------------
              	archive_entry_set_uid(entry, atol16(header + afiol_uid_offset, afiol_uid_size));
  ------------------
  |  |  141|     22|#define	afiol_uid_size 8	/* hex */
  ------------------
  875|     22|	archive_entry_set_gid(entry, atol16(header + afiol_gid_offset, afiol_gid_size));
  ------------------
  |  |  142|     22|#define	afiol_gid_offset 45
  ------------------
              	archive_entry_set_gid(entry, atol16(header + afiol_gid_offset, afiol_gid_size));
  ------------------
  |  |  143|     22|#define	afiol_gid_size 8	/* hex */
  ------------------
  876|     22|	archive_entry_set_nlink(entry,
  877|     22|		(unsigned int)atol16(header + afiol_nlink_offset, afiol_nlink_size));
  ------------------
  |  |  144|     22|#define	afiol_nlink_offset 53
  ------------------
              		(unsigned int)atol16(header + afiol_nlink_offset, afiol_nlink_size));
  ------------------
  |  |  145|     22|#define	afiol_nlink_size 8	/* hex */
  ------------------
  878|     22|	archive_entry_set_rdev(entry,
  879|     22|		(dev_t)atol16(header + afiol_rdev_offset, afiol_rdev_size));
  ------------------
  |  |  146|     22|#define	afiol_rdev_offset 61
  ------------------
              		(dev_t)atol16(header + afiol_rdev_offset, afiol_rdev_size));
  ------------------
  |  |  147|     22|#define	afiol_rdev_size 8	/* hex */
  ------------------
  880|     22|	archive_entry_set_mtime(entry, atol16(header + afiol_mtime_offset, afiol_mtime_size), 0);
  ------------------
  |  |  148|     22|#define	afiol_mtime_offset 69
  ------------------
              	archive_entry_set_mtime(entry, atol16(header + afiol_mtime_offset, afiol_mtime_size), 0);
  ------------------
  |  |  149|     22|#define	afiol_mtime_size 16	/* hex */
  ------------------
  881|     22|	*namelength = (size_t)atol16(header + afiol_namesize_offset, afiol_namesize_size);
  ------------------
  |  |  151|     22|#define	afiol_namesize_offset 86
  ------------------
              	*namelength = (size_t)atol16(header + afiol_namesize_offset, afiol_namesize_size);
  ------------------
  |  |  152|     22|#define	afiol_namesize_size 4	/* hex */
  ------------------
  882|     22|	*name_pad = 0; /* No padding of filename. */
  883|       |
  884|     22|	t = atol16(header + afiol_filesize_offset, afiol_filesize_size);
  ------------------
  |  |  158|     22|#define	afiol_filesize_offset 99
  ------------------
              	t = atol16(header + afiol_filesize_offset, afiol_filesize_size);
  ------------------
  |  |  159|     22|#define	afiol_filesize_size 16	/* hex */
  ------------------
  885|     22|	if (t < 0) {
  ------------------
  |  Branch (885:6): [True: 6, False: 16]
  ------------------
  886|      6|		archive_set_error(&a->archive, 0, "Nonsensical file size");
  887|      6|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      6|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  888|      6|	}
  889|     16|	cpio->entry_bytes_remaining = t;
  890|     16|	archive_entry_set_size(entry, cpio->entry_bytes_remaining);
  891|     16|	cpio->entry_padding = 0;
  892|     16|	__archive_read_consume(a, afiol_header_size);
  ------------------
  |  |  161|     16|#define afiol_header_size 116
  ------------------
  893|     16|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     16|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  894|     22|}
archive_read_support_format_cpio.c:atol16:
 1045|  52.2k|{
 1046|  52.2k|	return ((int64_t)atol16u(p, char_cnt));
 1047|  52.2k|}
archive_read_support_format_cpio.c:atol16u:
 1051|  52.2k|{
 1052|  52.2k|	uint64_t l;
 1053|  52.2k|	int digit;
 1054|       |
 1055|  52.2k|	l = 0;
 1056|   470k|	while (char_cnt-- > 0) {
  ------------------
  |  Branch (1056:9): [True: 418k, False: 52.2k]
  ------------------
 1057|   418k|		if (*p >= 'a' && *p <= 'f')
  ------------------
  |  Branch (1057:7): [True: 41.3k, False: 377k]
  |  Branch (1057:20): [True: 41.3k, False: 0]
  ------------------
 1058|  41.3k|			digit = *p - 'a' + 10;
 1059|   377k|		else if (*p >= 'A' && *p <= 'F')
  ------------------
  |  Branch (1059:12): [True: 74.1k, False: 302k]
  |  Branch (1059:25): [True: 74.1k, False: 0]
  ------------------
 1060|  74.1k|			digit = *p - 'A' + 10;
 1061|   302k|		else if (*p >= '0' && *p <= '9')
  ------------------
  |  Branch (1061:12): [True: 302k, False: 0]
  |  Branch (1061:25): [True: 302k, False: 0]
  ------------------
 1062|   302k|			digit = *p - '0';
 1063|      0|		else
 1064|      0|			return ((int64_t)l);
 1065|   418k|		p++;
 1066|   418k|		l <<= 4;
 1067|   418k|		l |= digit;
 1068|   418k|	}
 1069|  52.2k|	return (l);
 1070|  52.2k|}
archive_read_support_format_cpio.c:atol8:
 1026|  6.86k|{
 1027|  6.86k|	uint64_t l;
 1028|  6.86k|	int digit;
 1029|       |
 1030|  6.86k|	l = 0;
 1031|  54.7k|	while (char_cnt-- > 0) {
  ------------------
  |  Branch (1031:9): [True: 47.9k, False: 6.84k]
  ------------------
 1032|  47.9k|		if (*p >= '0' && *p <= '7')
  ------------------
  |  Branch (1032:7): [True: 47.9k, False: 0]
  |  Branch (1032:20): [True: 47.9k, False: 22]
  ------------------
 1033|  47.9k|			digit = *p - '0';
 1034|     22|		else
 1035|     22|			return ((int64_t)l);
 1036|  47.9k|		p++;
 1037|  47.9k|		l <<= 3;
 1038|  47.9k|		l |= digit;
 1039|  47.9k|	}
 1040|  6.84k|	return ((int64_t)l);
 1041|  6.86k|}
archive_read_support_format_cpio.c:header_newc:
  605|  4.38k|{
  606|  4.38k|	const void *h;
  607|  4.38k|	const char *header;
  608|  4.38k|	int r;
  609|       |
  610|  4.38k|	r = find_newc_header(a);
  611|  4.38k|	if (r < ARCHIVE_WARN)
  ------------------
  |  |  235|  4.38k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (611:6): [True: 43, False: 4.33k]
  ------------------
  612|     43|		return (r);
  613|       |
  614|       |	/* Read fixed-size portion of header. */
  615|  4.33k|	h = __archive_read_ahead(a, newc_header_size, NULL);
  ------------------
  |  |  122|  4.33k|#define	newc_header_size 110
  ------------------
  616|  4.33k|	if (h == NULL)
  ------------------
  |  Branch (616:6): [True: 0, False: 4.33k]
  ------------------
  617|      0|	    return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  618|       |
  619|       |	/* Parse out hex fields. */
  620|  4.33k|	header = (const char *)h;
  621|       |
  622|  4.33k|	if (memcmp(header + newc_magic_offset, "070701", 6) == 0) {
  ------------------
  |  |   94|  4.33k|#define	newc_magic_offset 0
  ------------------
  |  Branch (622:6): [True: 3.50k, False: 829]
  ------------------
  623|  3.50k|		a->archive.archive_format = ARCHIVE_FORMAT_CPIO_SVR4_NOCRC;
  ------------------
  |  |  360|  3.50k|#define	ARCHIVE_FORMAT_CPIO_SVR4_NOCRC		(ARCHIVE_FORMAT_CPIO | 4)
  |  |  ------------------
  |  |  |  |  356|  3.50k|#define	ARCHIVE_FORMAT_CPIO			0x10000
  |  |  ------------------
  ------------------
  624|  3.50k|		a->archive.archive_format_name = "ASCII cpio (SVR4 with no CRC)";
  625|  3.50k|	} else if (memcmp(header + newc_magic_offset, "070702", 6) == 0) {
  ------------------
  |  |   94|    829|#define	newc_magic_offset 0
  ------------------
  |  Branch (625:13): [True: 829, False: 0]
  ------------------
  626|    829|		a->archive.archive_format = ARCHIVE_FORMAT_CPIO_SVR4_CRC;
  ------------------
  |  |  361|    829|#define	ARCHIVE_FORMAT_CPIO_SVR4_CRC		(ARCHIVE_FORMAT_CPIO | 5)
  |  |  ------------------
  |  |  |  |  356|    829|#define	ARCHIVE_FORMAT_CPIO			0x10000
  |  |  ------------------
  ------------------
  627|    829|		a->archive.archive_format_name = "ASCII cpio (SVR4 with CRC)";
  628|    829|	} else {
  629|       |		/* TODO: Abort here? */
  630|      0|	}
  631|       |
  632|  4.33k|	archive_entry_set_devmajor(entry,
  633|  4.33k|		(dev_t)atol16(header + newc_devmajor_offset, newc_devmajor_size));
  ------------------
  |  |  110|  4.33k|#define	newc_devmajor_offset 62
  ------------------
              		(dev_t)atol16(header + newc_devmajor_offset, newc_devmajor_size));
  ------------------
  |  |  111|  4.33k|#define	newc_devmajor_size 8
  ------------------
  634|  4.33k|	archive_entry_set_devminor(entry, 
  635|  4.33k|		(dev_t)atol16(header + newc_devminor_offset, newc_devminor_size));
  ------------------
  |  |  112|  4.33k|#define	newc_devminor_offset 70
  ------------------
              		(dev_t)atol16(header + newc_devminor_offset, newc_devminor_size));
  ------------------
  |  |  113|  4.33k|#define	newc_devminor_size 8
  ------------------
  636|  4.33k|	archive_entry_set_ino(entry, atol16(header + newc_ino_offset, newc_ino_size));
  ------------------
  |  |   96|  4.33k|#define	newc_ino_offset 6
  ------------------
              	archive_entry_set_ino(entry, atol16(header + newc_ino_offset, newc_ino_size));
  ------------------
  |  |   97|  4.33k|#define	newc_ino_size 8
  ------------------
  637|  4.33k|	archive_entry_set_mode(entry, 
  638|  4.33k|		(mode_t)atol16(header + newc_mode_offset, newc_mode_size));
  ------------------
  |  |   98|  4.33k|#define	newc_mode_offset 14
  ------------------
              		(mode_t)atol16(header + newc_mode_offset, newc_mode_size));
  ------------------
  |  |   99|  4.33k|#define	newc_mode_size 8
  ------------------
  639|  4.33k|	archive_entry_set_uid(entry, atol16(header + newc_uid_offset, newc_uid_size));
  ------------------
  |  |  100|  4.33k|#define	newc_uid_offset 22
  ------------------
              	archive_entry_set_uid(entry, atol16(header + newc_uid_offset, newc_uid_size));
  ------------------
  |  |  101|  4.33k|#define	newc_uid_size 8
  ------------------
  640|  4.33k|	archive_entry_set_gid(entry, atol16(header + newc_gid_offset, newc_gid_size));
  ------------------
  |  |  102|  4.33k|#define	newc_gid_offset 30
  ------------------
              	archive_entry_set_gid(entry, atol16(header + newc_gid_offset, newc_gid_size));
  ------------------
  |  |  103|  4.33k|#define	newc_gid_size 8
  ------------------
  641|  4.33k|	archive_entry_set_nlink(entry,
  642|  4.33k|		(unsigned int)atol16(header + newc_nlink_offset, newc_nlink_size));
  ------------------
  |  |  104|  4.33k|#define	newc_nlink_offset 38
  ------------------
              		(unsigned int)atol16(header + newc_nlink_offset, newc_nlink_size));
  ------------------
  |  |  105|  4.33k|#define	newc_nlink_size 8
  ------------------
  643|  4.33k|	archive_entry_set_rdevmajor(entry,
  644|  4.33k|		(dev_t)atol16(header + newc_rdevmajor_offset, newc_rdevmajor_size));
  ------------------
  |  |  114|  4.33k|#define	newc_rdevmajor_offset 78
  ------------------
              		(dev_t)atol16(header + newc_rdevmajor_offset, newc_rdevmajor_size));
  ------------------
  |  |  115|  4.33k|#define	newc_rdevmajor_size 8
  ------------------
  645|  4.33k|	archive_entry_set_rdevminor(entry,
  646|  4.33k|		(dev_t)atol16(header + newc_rdevminor_offset, newc_rdevminor_size));
  ------------------
  |  |  116|  4.33k|#define	newc_rdevminor_offset 86
  ------------------
              		(dev_t)atol16(header + newc_rdevminor_offset, newc_rdevminor_size));
  ------------------
  |  |  117|  4.33k|#define	newc_rdevminor_size 8
  ------------------
  647|  4.33k|	archive_entry_set_mtime(entry, atol16(header + newc_mtime_offset, newc_mtime_size), 0);
  ------------------
  |  |  106|  4.33k|#define	newc_mtime_offset 46
  ------------------
              	archive_entry_set_mtime(entry, atol16(header + newc_mtime_offset, newc_mtime_size), 0);
  ------------------
  |  |  107|  4.33k|#define	newc_mtime_size 8
  ------------------
  648|  4.33k|	*namelength = (size_t)atol16(header + newc_namesize_offset, newc_namesize_size);
  ------------------
  |  |  118|  4.33k|#define	newc_namesize_offset 94
  ------------------
              	*namelength = (size_t)atol16(header + newc_namesize_offset, newc_namesize_size);
  ------------------
  |  |  119|  4.33k|#define	newc_namesize_size 8
  ------------------
  649|       |	/* Pad name to 2 more than a multiple of 4. */
  650|  4.33k|	*name_pad = (2 - *namelength) & 3;
  651|       |
  652|       |	/* Make sure that the padded name length fits into size_t. */
  653|  4.33k|	if (*name_pad > SIZE_MAX - *namelength) {
  ------------------
  |  Branch (653:6): [True: 0, False: 4.33k]
  ------------------
  654|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  655|      0|		    "cpio archive has invalid namelength");
  656|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  657|      0|	}
  658|       |
  659|       |	/*
  660|       |	 * Note: entry_bytes_remaining is at least 64 bits and
  661|       |	 * therefore guaranteed to be big enough for a 33-bit file
  662|       |	 * size.
  663|       |	 */
  664|  4.33k|	cpio->entry_bytes_remaining =
  665|  4.33k|	    atol16(header + newc_filesize_offset, newc_filesize_size);
  ------------------
  |  |  108|  4.33k|#define	newc_filesize_offset 54
  ------------------
              	    atol16(header + newc_filesize_offset, newc_filesize_size);
  ------------------
  |  |  109|  4.33k|#define	newc_filesize_size 8
  ------------------
  666|  4.33k|	archive_entry_set_size(entry, cpio->entry_bytes_remaining);
  667|       |	/* Pad file contents to a multiple of 4. */
  668|  4.33k|	cpio->entry_padding = 3 & -cpio->entry_bytes_remaining;
  669|  4.33k|	__archive_read_consume(a, newc_header_size);
  ------------------
  |  |  122|  4.33k|#define	newc_header_size 110
  ------------------
  670|  4.33k|	return (r);
  671|  4.33k|}
archive_read_support_format_cpio.c:find_newc_header:
  544|  4.38k|{
  545|  4.38k|	const void *h;
  546|  4.38k|	const char *p, *q;
  547|  4.38k|	size_t skip, skipped = 0;
  548|  4.38k|	ssize_t bytes;
  549|       |
  550|  4.51k|	for (;;) {
  551|  4.51k|		h = __archive_read_ahead(a, newc_header_size, &bytes);
  ------------------
  |  |  122|  4.51k|#define	newc_header_size 110
  ------------------
  552|  4.51k|		if (h == NULL)
  ------------------
  |  Branch (552:7): [True: 43, False: 4.47k]
  ------------------
  553|     43|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     43|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  554|  4.47k|		p = h;
  555|  4.47k|		q = p + bytes;
  556|       |
  557|       |		/* Try the typical case first, then go into the slow search.*/
  558|  4.47k|		if (memcmp("07070", p, 5) == 0
  ------------------
  |  Branch (558:7): [True: 1.49k, False: 2.98k]
  ------------------
  559|  1.49k|		    && (p[5] == '1' || p[5] == '2')
  ------------------
  |  Branch (559:11): [True: 1.08k, False: 404]
  |  Branch (559:26): [True: 272, False: 132]
  ------------------
  560|  1.35k|		    && is_hex(p, newc_header_size))
  ------------------
  |  |  122|  1.35k|#define	newc_header_size 110
  ------------------
  |  Branch (560:10): [True: 783, False: 575]
  ------------------
  561|    783|			return (ARCHIVE_OK);
  ------------------
  |  |  233|    783|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  562|       |
  563|       |		/*
  564|       |		 * Scan ahead until we find something that looks
  565|       |		 * like a newc header.
  566|       |		 */
  567|   397k|		while (p + newc_header_size <= q) {
  ------------------
  |  |  122|   397k|#define	newc_header_size 110
  ------------------
  |  Branch (567:10): [True: 397k, False: 134]
  ------------------
  568|   397k|			switch (p[5]) {
  569|  7.01k|			case '1':
  ------------------
  |  Branch (569:4): [True: 7.01k, False: 390k]
  ------------------
  570|  18.2k|			case '2':
  ------------------
  |  Branch (570:4): [True: 11.2k, False: 386k]
  ------------------
  571|  18.2k|				if (memcmp("07070", p, 5) == 0
  ------------------
  |  Branch (571:9): [True: 8.59k, False: 9.64k]
  ------------------
  572|  8.59k|				    && is_hex(p, newc_header_size)) {
  ------------------
  |  |  122|  8.59k|#define	newc_header_size 110
  ------------------
  |  Branch (572:12): [True: 3.55k, False: 5.04k]
  ------------------
  573|  3.55k|					skip = p - (const char *)h;
  574|  3.55k|					__archive_read_consume(a, skip);
  575|  3.55k|					skipped += skip;
  576|  3.55k|					if (skipped > 0) {
  ------------------
  |  Branch (576:10): [True: 3.55k, False: 0]
  ------------------
  577|  3.55k|						archive_set_error(&a->archive,
  578|  3.55k|						    0,
  579|  3.55k|						    "Skipped %d bytes before "
  580|  3.55k|						    "finding valid header",
  581|  3.55k|						    (int)skipped);
  582|  3.55k|						return (ARCHIVE_WARN);
  ------------------
  |  |  235|  3.55k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  583|  3.55k|					}
  584|      0|					return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  585|  3.55k|				}
  586|  14.6k|				p += 2;
  587|  14.6k|				break;
  588|   207k|			case '0':
  ------------------
  |  Branch (588:4): [True: 207k, False: 190k]
  ------------------
  589|   207k|				p++;
  590|   207k|				break;
  591|   172k|			default:
  ------------------
  |  Branch (591:4): [True: 172k, False: 225k]
  ------------------
  592|   172k|				p += 6;
  593|   172k|				break;
  594|   397k|			}
  595|   397k|		}
  596|    134|		skip = p - (const char *)h;
  597|    134|		__archive_read_consume(a, skip);
  598|    134|		skipped += skip;
  599|    134|	}
  600|  4.38k|}
archive_read_support_format_cpio.c:header_bin_be:
  945|    196|{
  946|    196|	const void *h;
  947|    196|	const unsigned char *header;
  948|       |
  949|    196|	a->archive.archive_format = ARCHIVE_FORMAT_CPIO_BIN_BE;
  ------------------
  |  |  359|    196|#define	ARCHIVE_FORMAT_CPIO_BIN_BE		(ARCHIVE_FORMAT_CPIO | 3)
  |  |  ------------------
  |  |  |  |  356|    196|#define	ARCHIVE_FORMAT_CPIO			0x10000
  |  |  ------------------
  ------------------
  950|    196|	a->archive.archive_format_name = "cpio (big-endian binary)";
  951|       |
  952|       |	/* Read fixed-size portion of header. */
  953|    196|	h = __archive_read_ahead(a, bin_header_size, NULL);
  ------------------
  |  |   68|    196|#define	bin_header_size 26
  ------------------
  954|    196|	if (h == NULL) {
  ------------------
  |  Branch (954:6): [True: 1, False: 195]
  ------------------
  955|      1|	    archive_set_error(&a->archive, 0,
  956|      1|		"End of file trying to read next cpio header");
  957|      1|	    return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  958|      1|	}
  959|       |
  960|       |	/* Parse out binary fields. */
  961|    195|	header = (const unsigned char *)h;
  962|       |
  963|    195|	archive_entry_set_dev(entry, header[bin_dev_offset] * 256 + header[bin_dev_offset + 1]);
  ------------------
  |  |   48|    195|#define	bin_dev_offset 2
  ------------------
              	archive_entry_set_dev(entry, header[bin_dev_offset] * 256 + header[bin_dev_offset + 1]);
  ------------------
  |  |   48|    195|#define	bin_dev_offset 2
  ------------------
  964|    195|	archive_entry_set_ino(entry, header[bin_ino_offset] * 256 + header[bin_ino_offset + 1]);
  ------------------
  |  |   50|    195|#define	bin_ino_offset 4
  ------------------
              	archive_entry_set_ino(entry, header[bin_ino_offset] * 256 + header[bin_ino_offset + 1]);
  ------------------
  |  |   50|    195|#define	bin_ino_offset 4
  ------------------
  965|    195|	archive_entry_set_mode(entry, header[bin_mode_offset] * 256 + header[bin_mode_offset + 1]);
  ------------------
  |  |   52|    195|#define	bin_mode_offset 6
  ------------------
              	archive_entry_set_mode(entry, header[bin_mode_offset] * 256 + header[bin_mode_offset + 1]);
  ------------------
  |  |   52|    195|#define	bin_mode_offset 6
  ------------------
  966|    195|	if (cpio->option_pwb) {
  ------------------
  |  Branch (966:6): [True: 0, False: 195]
  ------------------
  967|       |		/* turn off random bits left over from V6 inode */
  968|      0|		archive_entry_set_mode(entry, archive_entry_mode(entry) & 067777);
  969|      0|		if ((archive_entry_mode(entry) & AE_IFMT) == 0)
  ------------------
  |  |  215|      0|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
  |  Branch (969:7): [True: 0, False: 0]
  ------------------
  970|      0|			archive_entry_set_mode(entry, archive_entry_mode(entry) | AE_IFREG);
  ------------------
  |  |  216|      0|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
  971|      0|	}
  972|    195|	archive_entry_set_uid(entry, header[bin_uid_offset] * 256 + header[bin_uid_offset + 1]);
  ------------------
  |  |   54|    195|#define	bin_uid_offset 8
  ------------------
              	archive_entry_set_uid(entry, header[bin_uid_offset] * 256 + header[bin_uid_offset + 1]);
  ------------------
  |  |   54|    195|#define	bin_uid_offset 8
  ------------------
  973|    195|	archive_entry_set_gid(entry, header[bin_gid_offset] * 256 + header[bin_gid_offset + 1]);
  ------------------
  |  |   56|    195|#define	bin_gid_offset 10
  ------------------
              	archive_entry_set_gid(entry, header[bin_gid_offset] * 256 + header[bin_gid_offset + 1]);
  ------------------
  |  |   56|    195|#define	bin_gid_offset 10
  ------------------
  974|    195|	archive_entry_set_nlink(entry, header[bin_nlink_offset] * 256 + header[bin_nlink_offset + 1]);
  ------------------
  |  |   58|    195|#define	bin_nlink_offset 12
  ------------------
              	archive_entry_set_nlink(entry, header[bin_nlink_offset] * 256 + header[bin_nlink_offset + 1]);
  ------------------
  |  |   58|    195|#define	bin_nlink_offset 12
  ------------------
  975|    195|	archive_entry_set_rdev(entry, header[bin_rdev_offset] * 256 + header[bin_rdev_offset + 1]);
  ------------------
  |  |   60|    195|#define	bin_rdev_offset 14
  ------------------
              	archive_entry_set_rdev(entry, header[bin_rdev_offset] * 256 + header[bin_rdev_offset + 1]);
  ------------------
  |  |   60|    195|#define	bin_rdev_offset 14
  ------------------
  976|    195|	archive_entry_set_mtime(entry, be4(header + bin_mtime_offset), 0);
  ------------------
  |  |   62|    195|#define	bin_mtime_offset 16
  ------------------
  977|    195|	*namelength = header[bin_namesize_offset] * 256 + header[bin_namesize_offset + 1];
  ------------------
  |  |   64|    195|#define	bin_namesize_offset 20
  ------------------
              	*namelength = header[bin_namesize_offset] * 256 + header[bin_namesize_offset + 1];
  ------------------
  |  |   64|    195|#define	bin_namesize_offset 20
  ------------------
  978|    195|	*name_pad = *namelength & 1; /* Pad to even. */
  979|       |
  980|    195|	cpio->entry_bytes_remaining = be4(header + bin_filesize_offset);
  ------------------
  |  |   66|    195|#define	bin_filesize_offset 22
  ------------------
  981|    195|	archive_entry_set_size(entry, cpio->entry_bytes_remaining);
  982|    195|	cpio->entry_padding = cpio->entry_bytes_remaining & 1; /* Pad to even. */
  983|    195|	    __archive_read_consume(a, bin_header_size);
  ------------------
  |  |   68|    195|#define	bin_header_size 26
  ------------------
  984|    195|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    195|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  985|    196|}
archive_read_support_format_cpio.c:be4:
 1015|    390|{
 1016|    390|	return ((((int64_t)p[0]) << 24) | (p[1] << 16) | (p[2] << 8) | (p[3]));
 1017|    390|}
archive_read_support_format_cpio.c:header_bin_le:
  900|    736|{
  901|    736|	const void *h;
  902|    736|	const unsigned char *header;
  903|       |
  904|    736|	a->archive.archive_format = ARCHIVE_FORMAT_CPIO_BIN_LE;
  ------------------
  |  |  358|    736|#define	ARCHIVE_FORMAT_CPIO_BIN_LE		(ARCHIVE_FORMAT_CPIO | 2)
  |  |  ------------------
  |  |  |  |  356|    736|#define	ARCHIVE_FORMAT_CPIO			0x10000
  |  |  ------------------
  ------------------
  905|    736|	a->archive.archive_format_name = "cpio (little-endian binary)";
  906|       |
  907|       |	/* Read fixed-size portion of header. */
  908|    736|	h = __archive_read_ahead(a, bin_header_size, NULL);
  ------------------
  |  |   68|    736|#define	bin_header_size 26
  ------------------
  909|    736|	if (h == NULL) {
  ------------------
  |  Branch (909:6): [True: 0, False: 736]
  ------------------
  910|      0|	    archive_set_error(&a->archive, 0,
  911|      0|		"End of file trying to read next cpio header");
  912|      0|	    return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  913|      0|	}
  914|       |
  915|       |	/* Parse out binary fields. */
  916|    736|	header = (const unsigned char *)h;
  917|       |
  918|    736|	archive_entry_set_dev(entry, header[bin_dev_offset] + header[bin_dev_offset + 1] * 256);
  ------------------
  |  |   48|    736|#define	bin_dev_offset 2
  ------------------
              	archive_entry_set_dev(entry, header[bin_dev_offset] + header[bin_dev_offset + 1] * 256);
  ------------------
  |  |   48|    736|#define	bin_dev_offset 2
  ------------------
  919|    736|	archive_entry_set_ino(entry, header[bin_ino_offset] + header[bin_ino_offset + 1] * 256);
  ------------------
  |  |   50|    736|#define	bin_ino_offset 4
  ------------------
              	archive_entry_set_ino(entry, header[bin_ino_offset] + header[bin_ino_offset + 1] * 256);
  ------------------
  |  |   50|    736|#define	bin_ino_offset 4
  ------------------
  920|    736|	archive_entry_set_mode(entry, header[bin_mode_offset] + header[bin_mode_offset + 1] * 256);
  ------------------
  |  |   52|    736|#define	bin_mode_offset 6
  ------------------
              	archive_entry_set_mode(entry, header[bin_mode_offset] + header[bin_mode_offset + 1] * 256);
  ------------------
  |  |   52|    736|#define	bin_mode_offset 6
  ------------------
  921|    736|	if (cpio->option_pwb) {
  ------------------
  |  Branch (921:6): [True: 0, False: 736]
  ------------------
  922|       |		/* turn off random bits left over from V6 inode */
  923|      0|		archive_entry_set_mode(entry, archive_entry_mode(entry) & 067777);
  924|      0|		if ((archive_entry_mode(entry) & AE_IFMT) == 0)
  ------------------
  |  |  215|      0|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
  |  Branch (924:7): [True: 0, False: 0]
  ------------------
  925|      0|			archive_entry_set_mode(entry, archive_entry_mode(entry) | AE_IFREG);
  ------------------
  |  |  216|      0|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
  926|      0|	}
  927|    736|	archive_entry_set_uid(entry, header[bin_uid_offset] + header[bin_uid_offset + 1] * 256);
  ------------------
  |  |   54|    736|#define	bin_uid_offset 8
  ------------------
              	archive_entry_set_uid(entry, header[bin_uid_offset] + header[bin_uid_offset + 1] * 256);
  ------------------
  |  |   54|    736|#define	bin_uid_offset 8
  ------------------
  928|    736|	archive_entry_set_gid(entry, header[bin_gid_offset] + header[bin_gid_offset + 1] * 256);
  ------------------
  |  |   56|    736|#define	bin_gid_offset 10
  ------------------
              	archive_entry_set_gid(entry, header[bin_gid_offset] + header[bin_gid_offset + 1] * 256);
  ------------------
  |  |   56|    736|#define	bin_gid_offset 10
  ------------------
  929|    736|	archive_entry_set_nlink(entry, header[bin_nlink_offset] + header[bin_nlink_offset + 1] * 256);
  ------------------
  |  |   58|    736|#define	bin_nlink_offset 12
  ------------------
              	archive_entry_set_nlink(entry, header[bin_nlink_offset] + header[bin_nlink_offset + 1] * 256);
  ------------------
  |  |   58|    736|#define	bin_nlink_offset 12
  ------------------
  930|    736|	archive_entry_set_rdev(entry, header[bin_rdev_offset] + header[bin_rdev_offset + 1] * 256);
  ------------------
  |  |   60|    736|#define	bin_rdev_offset 14
  ------------------
              	archive_entry_set_rdev(entry, header[bin_rdev_offset] + header[bin_rdev_offset + 1] * 256);
  ------------------
  |  |   60|    736|#define	bin_rdev_offset 14
  ------------------
  931|    736|	archive_entry_set_mtime(entry, le4(header + bin_mtime_offset), 0);
  ------------------
  |  |   62|    736|#define	bin_mtime_offset 16
  ------------------
  932|    736|	*namelength = header[bin_namesize_offset] + header[bin_namesize_offset + 1] * 256;
  ------------------
  |  |   64|    736|#define	bin_namesize_offset 20
  ------------------
              	*namelength = header[bin_namesize_offset] + header[bin_namesize_offset + 1] * 256;
  ------------------
  |  |   64|    736|#define	bin_namesize_offset 20
  ------------------
  933|    736|	*name_pad = *namelength & 1; /* Pad to even. */
  934|       |
  935|    736|	cpio->entry_bytes_remaining = le4(header + bin_filesize_offset);
  ------------------
  |  |   66|    736|#define	bin_filesize_offset 22
  ------------------
  936|    736|	archive_entry_set_size(entry, cpio->entry_bytes_remaining);
  937|    736|	cpio->entry_padding = cpio->entry_bytes_remaining & 1; /* Pad to even. */
  938|    736|	__archive_read_consume(a, bin_header_size);
  ------------------
  |  |   68|    736|#define	bin_header_size 26
  ------------------
  939|    736|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    736|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  940|    736|}
archive_read_support_format_cpio.c:le4:
 1008|  1.47k|{
 1009|  1.47k|	return ((p[0] << 16) | (((int64_t)p[1]) << 24) | (p[2] << 0) | (p[3] << 8));
 1010|  1.47k|}
archive_read_support_format_cpio.c:archive_read_format_cpio_read_header:
  365|  6.06k|{
  366|  6.06k|	struct cpio *cpio;
  367|  6.06k|	const void *h, *hl;
  368|  6.06k|	struct archive_string_conv *sconv;
  369|  6.06k|	size_t namelength;
  370|  6.06k|	size_t name_pad;
  371|  6.06k|	int r;
  372|       |
  373|  6.06k|	cpio = (struct cpio *)(a->format->data);
  374|  6.06k|	sconv = cpio->opt_sconv;
  375|  6.06k|	if (sconv == NULL) {
  ------------------
  |  Branch (375:6): [True: 6.06k, False: 0]
  ------------------
  376|  6.06k|		if (!cpio->init_default_conversion) {
  ------------------
  |  Branch (376:7): [True: 134, False: 5.93k]
  ------------------
  377|    134|			cpio->sconv_default =
  378|    134|			    archive_string_default_conversion_for_read(
  379|    134|			      &(a->archive));
  380|    134|			cpio->init_default_conversion = 1;
  381|    134|		}
  382|  6.06k|		sconv = cpio->sconv_default;
  383|  6.06k|	}
  384|       |	
  385|  6.06k|	r = (cpio->read_header(a, cpio, entry, &namelength, &name_pad));
  386|       |
  387|  6.06k|	if (r < ARCHIVE_WARN)
  ------------------
  |  |  235|  6.06k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (387:6): [True: 95, False: 5.96k]
  ------------------
  388|     95|		return (r);
  389|       |
  390|  5.96k|	if (namelength > CPIO_PATHNAME_MAX) {
  ------------------
  |  |  164|  5.96k|#define	CPIO_PATHNAME_MAX	(1024 * 1024)
  ------------------
  |  Branch (390:6): [True: 14, False: 5.95k]
  ------------------
  391|     14|		archive_set_error(&a->archive, ENOMEM,
  392|     14|		    "Rejecting malformed cpio archive: "
  393|     14|		    "pathname exceeds 1 megabyte");
  394|     14|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     14|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  395|     14|	}
  396|       |
  397|       |	/* Read name from buffer. */
  398|  5.95k|	h = __archive_read_ahead(a, namelength, NULL);
  399|  5.95k|	if (h == NULL)
  ------------------
  |  Branch (399:6): [True: 2, False: 5.95k]
  ------------------
  400|      2|	    return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  401|  5.95k|	if (archive_entry_copy_pathname_l(entry,
  ------------------
  |  |   80|  5.95k|#define archive_entry_copy_pathname_l	_archive_entry_copy_pathname_l
  ------------------
  |  Branch (401:6): [True: 0, False: 5.95k]
  ------------------
  402|  5.95k|	    (const char *)h, namelength, sconv) != 0) {
  403|      0|		if (errno == ENOMEM) {
  ------------------
  |  Branch (403:7): [True: 0, False: 0]
  ------------------
  404|      0|			archive_set_error(&a->archive, ENOMEM,
  405|      0|			    "Can't allocate memory for Pathname");
  406|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  407|      0|		}
  408|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  409|      0|		    "Pathname can't be converted from %s to current locale",
  410|      0|		    archive_string_conversion_charset_name(sconv));
  411|      0|		r = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  412|      0|	}
  413|  5.95k|	cpio->entry_offset = 0;
  414|       |
  415|  5.95k|	__archive_read_consume(a, namelength);
  416|  5.95k|	__archive_read_consume(a, name_pad);
  417|       |
  418|       |	/* If this is a symlink, read the link contents. */
  419|  5.95k|	if (archive_entry_filetype(entry) == AE_IFLNK) {
  ------------------
  |  |  217|  5.95k|#define AE_IFLNK	((__LA_MODE_T)0120000)
  ------------------
  |  Branch (419:6): [True: 386, False: 5.56k]
  ------------------
  420|    386|		if (cpio->entry_bytes_remaining > 1024 * 1024) {
  ------------------
  |  Branch (420:7): [True: 0, False: 386]
  ------------------
  421|      0|			archive_set_error(&a->archive, ENOMEM,
  422|      0|			    "Rejecting malformed cpio archive: symlink contents exceed 1 megabyte");
  423|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  424|      0|		}
  425|    386|		hl = __archive_read_ahead(a,
  426|    386|			(size_t)cpio->entry_bytes_remaining, NULL);
  427|    386|		if (hl == NULL)
  ------------------
  |  Branch (427:7): [True: 0, False: 386]
  ------------------
  428|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  429|    386|		if (archive_entry_copy_symlink_l(entry, (const char *)hl,
  ------------------
  |  |   83|    386|#define archive_entry_copy_symlink_l	_archive_entry_copy_symlink_l
  ------------------
  |  Branch (429:7): [True: 0, False: 386]
  ------------------
  430|    386|		    (size_t)cpio->entry_bytes_remaining, sconv) != 0) {
  431|      0|			if (errno == ENOMEM) {
  ------------------
  |  Branch (431:8): [True: 0, False: 0]
  ------------------
  432|      0|				archive_set_error(&a->archive, ENOMEM,
  433|      0|				    "Can't allocate memory for Linkname");
  434|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  435|      0|			}
  436|      0|			archive_set_error(&a->archive,
  437|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  438|      0|			    "Linkname can't be converted from %s to "
  439|      0|			    "current locale",
  440|      0|			    archive_string_conversion_charset_name(sconv));
  441|      0|			r = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  442|      0|		}
  443|    386|		__archive_read_consume(a, cpio->entry_bytes_remaining);
  444|    386|		cpio->entry_bytes_remaining = 0;
  445|    386|	}
  446|       |
  447|       |	/* XXX TODO: If the full mode is 0160200, then this is a Solaris
  448|       |	 * ACL description for the following entry.  Read this body
  449|       |	 * and parse it as a Solaris-style ACL, then read the next
  450|       |	 * header.  XXX */
  451|       |
  452|       |	/* Compare name to "TRAILER!!!" to test for end-of-archive. */
  453|  5.95k|	if (namelength == 11 && strncmp((const char *)h, "TRAILER!!!",
  ------------------
  |  Branch (453:6): [True: 2.51k, False: 3.44k]
  |  Branch (453:26): [True: 0, False: 2.51k]
  ------------------
  454|  2.51k|	    10) == 0) {
  455|       |		/* TODO: Store file location of start of block. */
  456|      0|		archive_clear_error(&a->archive);
  457|      0|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  458|      0|	}
  459|       |
  460|       |	/* Detect and record hardlinks to previously-extracted entries. */
  461|  5.95k|	if (record_hardlink(a, cpio, entry) != ARCHIVE_OK) {
  ------------------
  |  |  233|  5.95k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (461:6): [True: 0, False: 5.95k]
  ------------------
  462|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  463|      0|	}
  464|       |
  465|  5.95k|	return (r);
  466|  5.95k|}
archive_read_support_format_cpio.c:record_hardlink:
 1075|  5.95k|{
 1076|  5.95k|	struct links_entry      *le;
 1077|  5.95k|	dev_t dev;
 1078|  5.95k|	int64_t ino;
 1079|       |
 1080|  5.95k|	if (archive_entry_nlink(entry) <= 1)
  ------------------
  |  Branch (1080:6): [True: 1.40k, False: 4.54k]
  ------------------
 1081|  1.40k|		return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.40k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1082|       |
 1083|  4.54k|	dev = archive_entry_dev(entry);
 1084|  4.54k|	ino = archive_entry_ino64(entry);
 1085|       |
 1086|       |	/*
 1087|       |	 * First look in the list of multiply-linked files.  If we've
 1088|       |	 * already dumped it, convert this entry to a hard link entry.
 1089|       |	 */
 1090|  12.6k|	for (le = cpio->links_head; le; le = le->next) {
  ------------------
  |  Branch (1090:30): [True: 11.6k, False: 981]
  ------------------
 1091|  11.6k|		if (le->dev == dev && le->ino == ino) {
  ------------------
  |  Branch (1091:7): [True: 4.89k, False: 6.77k]
  |  Branch (1091:25): [True: 3.56k, False: 1.32k]
  ------------------
 1092|  3.56k|			archive_entry_copy_hardlink(entry, le->name);
 1093|       |
 1094|  3.56k|			if (--le->links <= 0) {
  ------------------
  |  Branch (1094:8): [True: 721, False: 2.84k]
  ------------------
 1095|    721|				if (le->previous != NULL)
  ------------------
  |  Branch (1095:9): [True: 71, False: 650]
  ------------------
 1096|     71|					le->previous->next = le->next;
 1097|    721|				if (le->next != NULL)
  ------------------
  |  Branch (1097:9): [True: 331, False: 390]
  ------------------
 1098|    331|					le->next->previous = le->previous;
 1099|    721|				if (cpio->links_head == le)
  ------------------
  |  Branch (1099:9): [True: 650, False: 71]
  ------------------
 1100|    650|					cpio->links_head = le->next;
 1101|    721|				free(le->name);
 1102|    721|				free(le);
 1103|    721|			}
 1104|       |
 1105|  3.56k|			return (ARCHIVE_OK);
  ------------------
  |  |  233|  3.56k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1106|  3.56k|		}
 1107|  11.6k|	}
 1108|       |
 1109|    981|	le = malloc(sizeof(struct links_entry));
 1110|    981|	if (le == NULL) {
  ------------------
  |  Branch (1110:6): [True: 0, False: 981]
  ------------------
 1111|      0|		archive_set_error(&a->archive,
 1112|      0|		    ENOMEM, "Out of memory adding file to list");
 1113|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1114|      0|	}
 1115|       |
 1116|    981|	const char *pathname = archive_entry_pathname(entry);
 1117|    981|	if (pathname == NULL) {
  ------------------
  |  Branch (1117:6): [True: 0, False: 981]
  ------------------
 1118|      0|		archive_set_error(&a->archive,
 1119|      0|			ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1120|      0|           "Invalid hardlink entry with no pathname");
 1121|      0|		free(le);
 1122|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1123|      0|	}
 1124|       |
 1125|    981|	le->dev = dev;
 1126|    981|	le->ino = ino;
 1127|    981|	le->links = archive_entry_nlink(entry) - 1;
 1128|    981|	le->name = strdup(pathname);
 1129|    981|	if (le->name == NULL) {
  ------------------
  |  Branch (1129:6): [True: 0, False: 981]
  ------------------
 1130|      0|		archive_set_error(&a->archive,
 1131|      0|		    ENOMEM, "Out of memory adding file to list");
 1132|      0|		free(le);
 1133|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1134|      0|	}
 1135|       |
 1136|    981|	if (cpio->links_head != NULL)
  ------------------
  |  Branch (1136:6): [True: 562, False: 419]
  ------------------
 1137|    562|		cpio->links_head->previous = le;
 1138|    981|	le->next = cpio->links_head;
 1139|    981|	le->previous = NULL;
 1140|    981|	cpio->links_head = le;
 1141|       |
 1142|    981|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    981|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1143|    981|}
archive_read_support_format_cpio.c:archive_read_format_cpio_read_data:
  471|  12.3k|{
  472|  12.3k|	ssize_t bytes_read;
  473|  12.3k|	struct cpio *cpio;
  474|       |
  475|  12.3k|	cpio = (struct cpio *)(a->format->data);
  476|       |
  477|  12.3k|	if (cpio->entry_bytes_unconsumed) {
  ------------------
  |  Branch (477:6): [True: 3.21k, False: 9.14k]
  ------------------
  478|  3.21k|		__archive_read_consume(a, cpio->entry_bytes_unconsumed);
  479|  3.21k|		cpio->entry_bytes_unconsumed = 0;
  480|  3.21k|	}
  481|       |
  482|  12.3k|	if (cpio->entry_bytes_remaining > 0) {
  ------------------
  |  Branch (482:6): [True: 3.24k, False: 9.12k]
  ------------------
  483|  3.24k|		*buff = __archive_read_ahead(a, 1, &bytes_read);
  484|  3.24k|		if (bytes_read <= 0)
  ------------------
  |  Branch (484:7): [True: 23, False: 3.21k]
  ------------------
  485|     23|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     23|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  486|  3.21k|		if (bytes_read > cpio->entry_bytes_remaining)
  ------------------
  |  Branch (486:7): [True: 3.19k, False: 24]
  ------------------
  487|  3.19k|			bytes_read = (ssize_t)cpio->entry_bytes_remaining;
  488|  3.21k|		*size = bytes_read;
  489|  3.21k|		cpio->entry_bytes_unconsumed = bytes_read;
  490|  3.21k|		*offset = cpio->entry_offset;
  491|  3.21k|		cpio->entry_offset += bytes_read;
  492|  3.21k|		cpio->entry_bytes_remaining -= bytes_read;
  493|  3.21k|		return (ARCHIVE_OK);
  ------------------
  |  |  233|  3.21k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  494|  9.12k|	} else {
  495|  9.12k|		if (cpio->entry_padding !=
  ------------------
  |  Branch (495:7): [True: 0, False: 9.12k]
  ------------------
  496|  9.12k|			__archive_read_consume(a, cpio->entry_padding)) {
  497|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  498|      0|		}
  499|  9.12k|		cpio->entry_padding = 0;
  500|  9.12k|		*buff = NULL;
  501|  9.12k|		*size = 0;
  502|  9.12k|		*offset = cpio->entry_offset;
  503|  9.12k|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|  9.12k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  504|  9.12k|	}
  505|  12.3k|}
archive_read_support_format_cpio.c:archive_read_format_cpio_skip:
  509|  5.93k|{
  510|  5.93k|	struct cpio *cpio = (struct cpio *)(a->format->data);
  511|  5.93k|	int64_t to_skip = cpio->entry_bytes_remaining + cpio->entry_padding +
  512|  5.93k|		cpio->entry_bytes_unconsumed;
  513|       |
  514|  5.93k|	if (to_skip != __archive_read_consume(a, to_skip)) {
  ------------------
  |  Branch (514:6): [True: 0, False: 5.93k]
  ------------------
  515|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  516|      0|	}
  517|  5.93k|	cpio->entry_bytes_remaining = 0;
  518|  5.93k|	cpio->entry_padding = 0;
  519|  5.93k|	cpio->entry_bytes_unconsumed = 0;
  520|  5.93k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  5.93k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  521|  5.93k|}
archive_read_support_format_cpio.c:archive_read_format_cpio_cleanup:
  989|  2.49k|{
  990|  2.49k|	struct cpio *cpio;
  991|       |
  992|  2.49k|	cpio = (struct cpio *)(a->format->data);
  993|       |        /* Free inode->name map */
  994|  2.75k|        while (cpio->links_head != NULL) {
  ------------------
  |  Branch (994:16): [True: 260, False: 2.49k]
  ------------------
  995|    260|                struct links_entry *lp = cpio->links_head->next;
  996|       |
  997|    260|                free(cpio->links_head->name);
  998|    260|                free(cpio->links_head);
  999|    260|                cpio->links_head = lp;
 1000|    260|        }
 1001|  2.49k|	free(cpio);
 1002|  2.49k|	(a->format->data) = NULL;
 1003|  2.49k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1004|  2.49k|}

archive_read_support_format_empty:
   40|  4.99k|{
   41|  4.99k|	struct archive_read *a = (struct archive_read *)_a;
   42|  4.99k|	int r;
   43|       |
   44|  4.99k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  151|  4.99k|	do { \
  |  |  152|  4.99k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|  4.99k|			(allowed_states), (function_name)); \
  |  |  154|  4.99k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  4.99k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 4.99k]
  |  |  ------------------
  |  |  155|  4.99k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|  4.99k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 4.99k]
  |  |  ------------------
  ------------------
   45|  4.99k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_empty");
   46|       |
   47|  4.99k|	r = __archive_read_register_format(a,
   48|  4.99k|	    NULL,
   49|  4.99k|	    "empty",
   50|  4.99k|	    archive_read_format_empty_bid,
   51|  4.99k|	    NULL,
   52|  4.99k|	    archive_read_format_empty_read_header,
   53|  4.99k|	    archive_read_format_empty_read_data,
   54|  4.99k|	    NULL,
   55|  4.99k|	    NULL,
   56|  4.99k|	    NULL,
   57|  4.99k|	    NULL,
   58|  4.99k|	    NULL);
   59|       |
   60|  4.99k|	return (r);
   61|  4.99k|}
archive_read_support_format_empty.c:archive_read_format_empty_bid:
   66|  2.46k|{
   67|  2.46k|	if (best_bid < 1 && __archive_read_ahead(a, 1, NULL) == NULL)
  ------------------
  |  Branch (67:6): [True: 2.30k, False: 155]
  |  Branch (67:22): [True: 2, False: 2.30k]
  ------------------
   68|      2|		return (1);
   69|  2.45k|	return (-1);
   70|  2.46k|}
archive_read_support_format_empty.c:archive_read_format_empty_read_header:
   75|      2|{
   76|      2|	(void)a; /* UNUSED */
   77|      2|	(void)entry; /* UNUSED */
   78|       |
   79|      2|	a->archive.archive_format = ARCHIVE_FORMAT_EMPTY;
  ------------------
  |  |  375|      2|#define	ARCHIVE_FORMAT_EMPTY			0x60000
  ------------------
   80|      2|	a->archive.archive_format_name = "Empty file";
   81|       |
   82|      2|	return (ARCHIVE_EOF);
  ------------------
  |  |  232|      2|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
   83|      2|}

archive_read_support_format_iso9660:
  458|  2.49k|{
  459|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
  460|  2.49k|	struct iso9660 *iso9660;
  461|  2.49k|	int r;
  462|       |
  463|  2.49k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  151|  2.49k|	do { \
  |  |  152|  2.49k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|  2.49k|			(allowed_states), (function_name)); \
  |  |  154|  2.49k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  2.49k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 2.49k]
  |  |  ------------------
  |  |  155|  2.49k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|  2.49k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 2.49k]
  |  |  ------------------
  ------------------
  464|  2.49k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_iso9660");
  465|       |
  466|  2.49k|	iso9660 = calloc(1, sizeof(*iso9660));
  467|  2.49k|	if (iso9660 == NULL) {
  ------------------
  |  Branch (467:6): [True: 0, False: 2.49k]
  ------------------
  468|      0|		archive_set_error(&a->archive, ENOMEM,
  469|      0|		    "Can't allocate iso9660 data");
  470|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  471|      0|	}
  472|  2.49k|	iso9660->magic = ISO9660_MAGIC;
  ------------------
  |  |  322|  2.49k|#define ISO9660_MAGIC   0x96609660
  ------------------
  473|  2.49k|	iso9660->cache_files.first = NULL;
  474|  2.49k|	iso9660->cache_files.last = &(iso9660->cache_files.first);
  475|  2.49k|	iso9660->re_files.first = NULL;
  476|  2.49k|	iso9660->re_files.last = &(iso9660->re_files.first);
  477|       |	/* Enable to support Joliet extensions by default.	*/
  478|  2.49k|	iso9660->opt_support_joliet = 1;
  479|       |	/* Enable to support Rock Ridge extensions by default.	*/
  480|  2.49k|	iso9660->opt_support_rockridge = 1;
  481|       |
  482|  2.49k|	r = __archive_read_register_format(a,
  483|  2.49k|	    iso9660,
  484|  2.49k|	    "iso9660",
  485|  2.49k|	    archive_read_format_iso9660_bid,
  486|  2.49k|	    archive_read_format_iso9660_options,
  487|  2.49k|	    archive_read_format_iso9660_read_header,
  488|  2.49k|	    archive_read_format_iso9660_read_data,
  489|  2.49k|	    archive_read_format_iso9660_read_data_skip,
  490|  2.49k|	    NULL,
  491|  2.49k|	    archive_read_format_iso9660_cleanup,
  492|  2.49k|	    NULL,
  493|  2.49k|	    NULL);
  494|       |
  495|  2.49k|	if (r != ARCHIVE_OK) {
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (495:6): [True: 0, False: 2.49k]
  ------------------
  496|      0|		free(iso9660);
  497|      0|		return (r);
  498|      0|	}
  499|  2.49k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  500|  2.49k|}
archive_read_support_format_iso9660.c:archive_read_format_iso9660_bid:
  505|  2.46k|{
  506|  2.46k|	struct iso9660 *iso9660;
  507|  2.46k|	ssize_t bytes_read;
  508|  2.46k|	const unsigned char *p;
  509|  2.46k|	int seenTerminator;
  510|       |
  511|       |	/* If there's already a better bid than we can ever
  512|       |	   make, don't bother testing. */
  513|  2.46k|	if (best_bid > 48)
  ------------------
  |  Branch (513:6): [True: 704, False: 1.75k]
  ------------------
  514|    704|		return (-1);
  515|       |
  516|  1.75k|	iso9660 = (struct iso9660 *)(a->format->data);
  517|       |
  518|       |	/*
  519|       |	 * Skip the first 32k (reserved area) and get the first
  520|       |	 * 8 sectors of the volume descriptor table.  Of course,
  521|       |	 * if the I/O layer gives us more, we'll take it.
  522|       |	 */
  523|  1.75k|#define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  524|  1.75k|	p = __archive_read_ahead(a,
  525|  1.75k|	    RESERVED_AREA + 8 * LOGICAL_BLOCK_SIZE,
  ------------------
  |  |  523|  1.75k|#define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  |  |  ------------------
  |  |  |  |   82|  1.75k|#define	SYSTEM_AREA_BLOCK	16
  |  |  ------------------
  |  |               #define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  |  |  ------------------
  |  |  |  |   81|  1.75k|#define	LOGICAL_BLOCK_SIZE	2048
  |  |  ------------------
  ------------------
              	    RESERVED_AREA + 8 * LOGICAL_BLOCK_SIZE,
  ------------------
  |  |   81|  1.75k|#define	LOGICAL_BLOCK_SIZE	2048
  ------------------
  526|  1.75k|	    &bytes_read);
  527|  1.75k|	if (p == NULL)
  ------------------
  |  Branch (527:6): [True: 1.18k, False: 569]
  ------------------
  528|  1.18k|	    return (-1);
  529|       |
  530|       |	/* Skip the reserved area. */
  531|    569|	bytes_read -= RESERVED_AREA;
  ------------------
  |  |  523|    569|#define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  |  |  ------------------
  |  |  |  |   82|    569|#define	SYSTEM_AREA_BLOCK	16
  |  |  ------------------
  |  |               #define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  |  |  ------------------
  |  |  |  |   81|    569|#define	LOGICAL_BLOCK_SIZE	2048
  |  |  ------------------
  ------------------
  532|    569|	p += RESERVED_AREA;
  ------------------
  |  |  523|    569|#define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  |  |  ------------------
  |  |  |  |   82|    569|#define	SYSTEM_AREA_BLOCK	16
  |  |  ------------------
  |  |               #define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  |  |  ------------------
  |  |  |  |   81|    569|#define	LOGICAL_BLOCK_SIZE	2048
  |  |  ------------------
  ------------------
  533|       |
  534|       |	/* Check each volume descriptor. */
  535|    569|	seenTerminator = 0;
  536|    893|	for (; bytes_read > LOGICAL_BLOCK_SIZE;
  ------------------
  |  |   81|    893|#define	LOGICAL_BLOCK_SIZE	2048
  ------------------
  |  Branch (536:9): [True: 893, False: 0]
  ------------------
  537|    893|	    bytes_read -= LOGICAL_BLOCK_SIZE, p += LOGICAL_BLOCK_SIZE) {
  ------------------
  |  |   81|    324|#define	LOGICAL_BLOCK_SIZE	2048
  ------------------
              	    bytes_read -= LOGICAL_BLOCK_SIZE, p += LOGICAL_BLOCK_SIZE) {
  ------------------
  |  |   81|    324|#define	LOGICAL_BLOCK_SIZE	2048
  ------------------
  538|       |		/* Do not handle undefined Volume Descriptor Type. */
  539|    893|		if (p[0] >= 4 && p[0] <= 254)
  ------------------
  |  Branch (539:7): [True: 445, False: 448]
  |  Branch (539:20): [True: 234, False: 211]
  ------------------
  540|    234|			return (0);
  541|       |		/* Standard Identifier must be "CD001" */
  542|    659|		if (memcmp(p + 1, "CD001", 5) != 0)
  ------------------
  |  Branch (542:7): [True: 83, False: 576]
  ------------------
  543|     83|			return (0);
  544|    576|		if (isPVD(iso9660, p))
  ------------------
  |  Branch (544:7): [True: 214, False: 362]
  ------------------
  545|    214|			continue;
  546|    362|		if (!iso9660->joliet.location) {
  ------------------
  |  Branch (546:7): [True: 338, False: 24]
  ------------------
  547|    338|			if (isJolietSVD(iso9660, p))
  ------------------
  |  Branch (547:8): [True: 25, False: 313]
  ------------------
  548|     25|				continue;
  549|    338|		}
  550|    337|		if (isBootRecord(iso9660, p))
  ------------------
  |  Branch (550:7): [True: 7, False: 330]
  ------------------
  551|      7|			continue;
  552|    330|		if (isEVD(iso9660, p))
  ------------------
  |  Branch (552:7): [True: 0, False: 330]
  ------------------
  553|      0|			continue;
  554|    330|		if (isSVD(iso9660, p))
  ------------------
  |  Branch (554:7): [True: 78, False: 252]
  ------------------
  555|     78|			continue;
  556|    252|		if (isVolumePartition(iso9660, p))
  ------------------
  |  Branch (556:7): [True: 0, False: 252]
  ------------------
  557|      0|			continue;
  558|    252|		if (isVDSetTerminator(iso9660, p)) {
  ------------------
  |  Branch (558:7): [True: 193, False: 59]
  ------------------
  559|    193|			seenTerminator = 1;
  560|    193|			break;
  561|    193|		}
  562|     59|		return (0);
  563|    252|	}
  564|       |	/*
  565|       |	 * ISO 9660 format must have Primary Volume Descriptor and
  566|       |	 * Volume Descriptor Set Terminator.
  567|       |	 */
  568|    193|	if (seenTerminator && iso9660->primary.location > 16)
  ------------------
  |  Branch (568:6): [True: 193, False: 0]
  |  Branch (568:24): [True: 192, False: 1]
  ------------------
  569|    192|		return (48);
  570|       |
  571|       |	/* We didn't find a valid PVD; return a bid of zero. */
  572|      1|	return (0);
  573|    193|}
archive_read_support_format_iso9660.c:isPVD:
  874|    576|{
  875|    576|	const unsigned char *p;
  876|    576|	ssize_t logical_block_size;
  877|    576|	int32_t volume_block;
  878|    576|	int32_t location;
  879|    576|	int i;
  880|       |
  881|       |	/* Type of the Primary Volume Descriptor must be 1. */
  882|    576|	if (h[PVD_type_offset] != 1)
  ------------------
  |  |   85|    576|#define PVD_type_offset 0
  ------------------
  |  Branch (882:6): [True: 326, False: 250]
  ------------------
  883|    326|		return (0);
  884|       |
  885|       |	/* PVD version must be 1. */
  886|    250|	if (h[PVD_version_offset] != 1)
  ------------------
  |  |   89|    250|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  ------------------
  |  |  |  |   87|    250|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   85|    250|#define PVD_type_offset 0
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   86|    250|#define PVD_type_size 1
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  ------------------
  |  |  |  |   88|    250|#define PVD_id_size 5
  |  |  ------------------
  ------------------
  |  Branch (886:6): [True: 0, False: 250]
  ------------------
  887|      0|		return (0);
  888|       |
  889|       |	/* Reserved field must be 0. */
  890|    250|	if (h[PVD_reserved1_offset] != 0)
  ------------------
  |  |   91|    250|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  ------------------
  |  |  |  |   89|    250|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   87|    250|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   85|    250|#define PVD_type_offset 0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   86|    250|#define PVD_type_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   88|    250|#define PVD_id_size 5
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  ------------------
  |  |  |  |   90|    250|#define PVD_version_size 1
  |  |  ------------------
  ------------------
  |  Branch (890:6): [True: 0, False: 250]
  ------------------
  891|      0|		return (0);
  892|       |
  893|       |	/* Reserved field must be 0. */
  894|    250|	if (!isNull(iso9660, h, PVD_reserved2_offset, PVD_reserved2_size))
  ------------------
  |  |   97|    250|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  ------------------
  |  |  |  |   95|    250|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|    250|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   91|    250|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   89|    250|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   87|    250|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   85|    250|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    250|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   88|    250|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   90|    250|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|    250|#define PVD_reserved1_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   94|    250|#define PVD_system_id_size 32
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  ------------------
  |  |  |  |   96|    250|#define PVD_volume_id_size 32
  |  |  ------------------
  ------------------
              	if (!isNull(iso9660, h, PVD_reserved2_offset, PVD_reserved2_size))
  ------------------
  |  |   98|    250|#define PVD_reserved2_size 8
  ------------------
  |  Branch (894:6): [True: 0, False: 250]
  ------------------
  895|      0|		return (0);
  896|       |
  897|       |	/* Volume space size must be encoded according to 7.3.3 */
  898|    250|	if (!isValid733Integer(h + PVD_volume_space_size_offset)) {
  ------------------
  |  |   99|    250|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  ------------------
  |  |  |  |   97|    250|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|    250|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|    250|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   91|    250|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   89|    250|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    250|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   85|    250|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    250|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    250|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   90|    250|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   92|    250|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|    250|#define PVD_system_id_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|    250|#define PVD_volume_id_size 32
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  ------------------
  |  |  |  |   98|    250|#define PVD_reserved2_size 8
  |  |  ------------------
  ------------------
  |  Branch (898:6): [True: 3, False: 247]
  ------------------
  899|      3|		return (0);
  900|      3|	}
  901|    247|	volume_block = archive_le32dec(h + PVD_volume_space_size_offset);
  ------------------
  |  |   99|    247|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  ------------------
  |  |  |  |   97|    247|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|    247|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|    247|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   91|    247|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   89|    247|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    247|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   85|    247|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    247|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    247|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   90|    247|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   92|    247|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|    247|#define PVD_system_id_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|    247|#define PVD_volume_id_size 32
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  ------------------
  |  |  |  |   98|    247|#define PVD_reserved2_size 8
  |  |  ------------------
  ------------------
  902|    247|	if (volume_block <= SYSTEM_AREA_BLOCK+4)
  ------------------
  |  |   82|    247|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (902:6): [True: 1, False: 246]
  ------------------
  903|      1|		return (0);
  904|       |
  905|       |	/* Reserved field must be 0. */
  906|    246|	if (!isNull(iso9660, h, PVD_reserved3_offset, PVD_reserved3_size))
  ------------------
  |  |  101|    246|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  ------------------
  |  |  |  |   99|    246|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|    246|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|    246|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   93|    246|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   91|    246|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    246|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    246|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   85|    246|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    246|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    246|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    246|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   92|    246|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   94|    246|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|    246|#define PVD_volume_id_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|    246|#define PVD_reserved2_size 8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  ------------------
  |  |  |  |  100|    246|#define PVD_volume_space_size_size 8
  |  |  ------------------
  ------------------
              	if (!isNull(iso9660, h, PVD_reserved3_offset, PVD_reserved3_size))
  ------------------
  |  |  102|    246|#define PVD_reserved3_size 32
  ------------------
  |  Branch (906:6): [True: 2, False: 244]
  ------------------
  907|      2|		return (0);
  908|       |
  909|       |	/* Volume set size must be encoded according to 7.2.3 */
  910|    244|	if (!isValid723Integer(h + PVD_volume_set_size_offset)) {
  ------------------
  |  |  103|    244|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  ------------------
  |  |  |  |  101|    244|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|    244|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   97|    244|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   95|    244|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   93|    244|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    244|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    244|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    244|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   85|    244|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    244|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    244|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    244|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    244|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   94|    244|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   96|    244|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   98|    244|#define PVD_reserved2_size 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|    244|#define PVD_volume_space_size_size 8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  ------------------
  |  |  |  |  102|    244|#define PVD_reserved3_size 32
  |  |  ------------------
  ------------------
  |  Branch (910:6): [True: 2, False: 242]
  ------------------
  911|      2|		return (0);
  912|      2|	}
  913|       |
  914|       |	/* Volume sequence number must be encoded according to 7.2.3 */
  915|    242|	if (!isValid723Integer(h + PVD_volume_sequence_number_offset)) {
  ------------------
  |  |  105|    242|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  ------------------
  |  |  |  |  103|    242|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  101|    242|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   99|    242|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   97|    242|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   95|    242|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    242|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    242|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    242|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    242|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   85|    242|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    242|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    242|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    242|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    242|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    242|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   96|    242|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   98|    242|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  100|    242|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|    242|#define PVD_reserved3_size 32
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  ------------------
  |  |  |  |  104|    242|#define PVD_volume_set_size_size 4
  |  |  ------------------
  ------------------
  |  Branch (915:6): [True: 1, False: 241]
  ------------------
  916|      1|		return (0);
  917|      1|	}
  918|       |
  919|       |	/* Logical block size must be > 0. */
  920|       |	/* I've looked at Ecma 119 and can't find any stronger
  921|       |	 * restriction on this field. */
  922|    241|	if (!isValid723Integer(h + PVD_logical_block_size_offset)) {
  ------------------
  |  |  107|    241|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  ------------------
  |  |  |  |  105|    241|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|    241|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  101|    241|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   99|    241|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   97|    241|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    241|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    241|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    241|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    241|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    241|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   85|    241|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    241|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    241|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    241|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    241|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    241|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    241|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   98|    241|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  100|    241|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|    241|#define PVD_reserved3_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  104|    241|#define PVD_volume_set_size_size 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  ------------------
  |  |  |  |  106|    241|#define PVD_volume_sequence_number_size 4
  |  |  ------------------
  ------------------
  |  Branch (922:6): [True: 1, False: 240]
  ------------------
  923|      1|		return (0);
  924|      1|	}
  925|    240|	logical_block_size =
  926|    240|	    archive_le16dec(h + PVD_logical_block_size_offset);
  ------------------
  |  |  107|    240|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  ------------------
  |  |  |  |  105|    240|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|    240|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  101|    240|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   99|    240|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   97|    240|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    240|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    240|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    240|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    240|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    240|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   85|    240|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    240|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    240|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    240|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    240|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    240|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    240|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   98|    240|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  100|    240|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|    240|#define PVD_reserved3_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  104|    240|#define PVD_volume_set_size_size 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  ------------------
  |  |  |  |  106|    240|#define PVD_volume_sequence_number_size 4
  |  |  ------------------
  ------------------
  927|    240|	if (logical_block_size <= 0)
  ------------------
  |  Branch (927:6): [True: 1, False: 239]
  ------------------
  928|      1|		return (0);
  929|       |
  930|       |	/* Path Table size must be encoded according to 7.3.3 */
  931|    239|	if (!isValid733Integer(h + PVD_path_table_size_offset)) {
  ------------------
  |  |  109|    239|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  ------------------
  |  |  |  |  107|    239|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  105|    239|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|    239|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  101|    239|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   99|    239|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    239|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    239|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    239|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    239|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    239|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    239|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   85|    239|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    239|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    239|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    239|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    239|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    239|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    239|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    239|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  100|    239|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|    239|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  104|    239|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  106|    239|#define PVD_volume_sequence_number_size 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  ------------------
  |  |  |  |  108|    239|#define PVD_logical_block_size_size 4
  |  |  ------------------
  ------------------
  |  Branch (931:6): [True: 3, False: 236]
  ------------------
  932|      3|		return (0);
  933|      3|	}
  934|       |
  935|       |	/* File structure version must be 1 for ISO9660/ECMA119. */
  936|    236|	if (h[PVD_file_structure_version_offset] != 1)
  ------------------
  |  |  143|    236|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  ------------------
  |  |  |  |  141|    236|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  139|    236|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  137|    236|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  135|    236|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  133|    236|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|    236|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|    236|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|    236|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|    236|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|    236|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  121|    236|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  119|    236|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  117|    236|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  115|    236|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  113|    236|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  111|    236|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|    236|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|    236|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|    236|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|    236|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|    236|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    236|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    236|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    236|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    236|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    236|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    236|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    236|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   85|    236|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    236|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    236|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    236|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    236|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    236|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    236|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    236|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|    236|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|    236|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|    236|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|    236|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|    236|#define PVD_logical_block_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|    236|#define PVD_path_table_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|    236|#define PVD_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|    236|#define PVD_opt_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|    236|#define PVD_type_m_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|    236|#define PVD_opt_type_m_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|    236|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|    236|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|    236|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|    236|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|    236|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|    236|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|    236|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  134|    236|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  136|    236|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  138|    236|#define PVD_modification_date_size 17
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  140|    236|#define PVD_expiration_date_size 17
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  ------------------
  |  |  |  |  142|    236|#define PVD_effective_date_size 17
  |  |  ------------------
  ------------------
  |  Branch (936:6): [True: 1, False: 235]
  ------------------
  937|      1|		return (0);
  938|       |
  939|       |	/* Location of Occurrence of Type L Path Table must be
  940|       |	 * available location,
  941|       |	 * > SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */
  942|    235|	location = archive_le32dec(h+PVD_type_1_path_table_offset);
  ------------------
  |  |  111|    235|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  ------------------
  |  |  |  |  109|    235|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  107|    235|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  105|    235|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  103|    235|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  101|    235|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    235|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    235|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    235|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    235|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    235|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    235|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    235|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   85|    235|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    235|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    235|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    235|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    235|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    235|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    235|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    235|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|    235|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  102|    235|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  104|    235|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|    235|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|    235|#define PVD_logical_block_size_size 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  ------------------
  |  |  |  |  110|    235|#define PVD_path_table_size_size 8
  |  |  ------------------
  ------------------
  943|    235|	if (location < SYSTEM_AREA_BLOCK+2 || location >= volume_block)
  ------------------
  |  |   82|    235|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (943:6): [True: 1, False: 234]
  |  Branch (943:40): [True: 1, False: 233]
  ------------------
  944|      2|		return (0);
  945|       |
  946|       |	/* The Type M Path Table must also be at a valid location
  947|       |	 * (although ECMA 119 requires a Type M Path Table, WinISO and
  948|       |	 * probably other programs omit it, so we permit a zero here)
  949|       |	 *
  950|       |	 * >= SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */
  951|    233|	location = archive_be32dec(h+PVD_type_m_path_table_offset);
  ------------------
  |  |  115|    233|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  ------------------
  |  |  |  |  113|    233|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  111|    233|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|    233|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  107|    233|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  105|    233|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|    233|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|    233|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    233|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    233|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    233|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    233|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    233|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    233|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    233|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   85|    233|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    233|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    233|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    233|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    233|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    233|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    233|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    233|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|    233|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|    233|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|    233|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  106|    233|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  108|    233|#define PVD_logical_block_size_size 4
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|    233|#define PVD_path_table_size_size 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  112|    233|#define PVD_type_1_path_table_size 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  ------------------
  |  |  |  |  114|    233|#define PVD_opt_type_1_path_table_size 4
  |  |  ------------------
  ------------------
  952|    233|	if ((location > 0 && location < SYSTEM_AREA_BLOCK+2)
  ------------------
  |  |   82|    230|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (952:7): [True: 230, False: 3]
  |  Branch (952:23): [True: 1, False: 229]
  ------------------
  953|    232|	    || location >= volume_block)
  ------------------
  |  Branch (953:9): [True: 1, False: 231]
  ------------------
  954|      2|		return (0);
  955|       |
  956|       |	/* Reserved field must be 0. */
  957|       |	/* But accept NetBSD/FreeBSD "makefs" images with 0x20 here. */
  958|    461|	for (i = 0; i < PVD_reserved4_size; ++i)
  ------------------
  |  |  146|    461|#define PVD_reserved4_size 1
  ------------------
  |  Branch (958:14): [True: 231, False: 230]
  ------------------
  959|    231|		if (h[PVD_reserved4_offset + i] != 0
  ------------------
  |  |  145|    231|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  ------------------
  |  |  |  |  143|    231|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  141|    231|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  139|    231|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  137|    231|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  135|    231|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|    231|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|    231|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|    231|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|    231|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|    231|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|    231|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  121|    231|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  119|    231|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  117|    231|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  115|    231|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  113|    231|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  111|    231|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|    231|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|    231|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|    231|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|    231|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|    231|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    231|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    231|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    231|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    231|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    231|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    231|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    231|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   85|    231|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    231|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    231|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    231|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    231|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    231|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    231|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    231|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|    231|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|    231|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|    231|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|    231|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|    231|#define PVD_logical_block_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|    231|#define PVD_path_table_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|    231|#define PVD_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|    231|#define PVD_opt_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|    231|#define PVD_type_m_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|    231|#define PVD_opt_type_m_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|    231|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|    231|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|    231|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|    231|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|    231|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|    231|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|    231|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|    231|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  136|    231|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  138|    231|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  140|    231|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  142|    231|#define PVD_effective_date_size 17
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  ------------------
  |  |  |  |  144|    231|#define PVD_file_structure_version_size 1
  |  |  ------------------
  ------------------
  |  Branch (959:7): [True: 64, False: 167]
  ------------------
  960|     64|		    && h[PVD_reserved4_offset + i] != 0x20)
  ------------------
  |  |  145|     64|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  ------------------
  |  |  |  |  143|     64|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  141|     64|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  139|     64|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  137|     64|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  135|     64|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|     64|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|     64|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|     64|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|     64|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|     64|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|     64|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  121|     64|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  119|     64|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  117|     64|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  115|     64|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  113|     64|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  111|     64|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|     64|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|     64|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|     64|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|     64|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|     64|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|     64|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|     64|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|     64|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|     64|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|     64|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|     64|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|     64|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   85|     64|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|     64|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|     64|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|     64|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|     64|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|     64|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|     64|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|     64|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|     64|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|     64|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|     64|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|     64|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|     64|#define PVD_logical_block_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|     64|#define PVD_path_table_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|     64|#define PVD_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|     64|#define PVD_opt_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|     64|#define PVD_type_m_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|     64|#define PVD_opt_type_m_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|     64|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|     64|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|     64|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|     64|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|     64|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|     64|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|     64|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|     64|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  136|     64|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  138|     64|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  140|     64|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  142|     64|#define PVD_effective_date_size 17
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  ------------------
  |  |  |  |  144|     64|#define PVD_file_structure_version_size 1
  |  |  ------------------
  ------------------
  |  Branch (960:10): [True: 1, False: 63]
  ------------------
  961|      1|			return (0);
  962|       |
  963|       |	/* Reserved field must be 0. */
  964|    230|	if (!isNull(iso9660, h, PVD_reserved5_offset, PVD_reserved5_size))
  ------------------
  |  |  149|    230|#define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  ------------------
  |  |  |  |  147|    230|#define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|    230|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  143|    230|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  141|    230|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  139|    230|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  137|    230|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  135|    230|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|    230|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|    230|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|    230|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|    230|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|    230|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|    230|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  121|    230|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  119|    230|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  117|    230|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  115|    230|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  113|    230|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  111|    230|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|    230|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|    230|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|    230|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|    230|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|    230|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    230|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    230|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    230|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    230|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    230|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    230|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    230|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   85|    230|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    230|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    230|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    230|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    230|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    230|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    230|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    230|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|    230|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|    230|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|    230|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|    230|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|    230|#define PVD_logical_block_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|    230|#define PVD_path_table_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|    230|#define PVD_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|    230|#define PVD_opt_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|    230|#define PVD_type_m_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|    230|#define PVD_opt_type_m_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|    230|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|    230|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|    230|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|    230|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|    230|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|    230|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|    230|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|    230|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  136|    230|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  138|    230|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  140|    230|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  142|    230|#define PVD_effective_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|    230|#define PVD_file_structure_version_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  146|    230|#define PVD_reserved4_size 1
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  ------------------
  |  |  |  |  148|    230|#define PVD_application_data_size 512
  |  |  ------------------
  ------------------
              	if (!isNull(iso9660, h, PVD_reserved5_offset, PVD_reserved5_size))
  ------------------
  |  |  150|    230|#define PVD_reserved5_size (2048 - PVD_reserved5_offset)
  |  |  ------------------
  |  |  |  |  149|    230|#define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  147|    230|#define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  145|    230|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  143|    230|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  141|    230|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  139|    230|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  137|    230|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  135|    230|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|    230|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|    230|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|    230|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|    230|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|    230|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|    230|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  121|    230|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  119|    230|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  117|    230|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  115|    230|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  113|    230|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  111|    230|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|    230|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|    230|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|    230|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|    230|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|    230|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    230|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    230|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    230|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    230|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    230|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    230|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    230|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   85|    230|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    230|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    230|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    230|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    230|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    230|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    230|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    230|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|    230|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|    230|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|    230|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|    230|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|    230|#define PVD_logical_block_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|    230|#define PVD_path_table_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|    230|#define PVD_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|    230|#define PVD_opt_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|    230|#define PVD_type_m_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|    230|#define PVD_opt_type_m_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|    230|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|    230|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|    230|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|    230|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|    230|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|    230|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|    230|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|    230|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  136|    230|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  138|    230|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  140|    230|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  142|    230|#define PVD_effective_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  144|    230|#define PVD_file_structure_version_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  146|    230|#define PVD_reserved4_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  148|    230|#define PVD_application_data_size 512
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (964:6): [True: 5, False: 225]
  ------------------
  965|      5|		return (0);
  966|       |
  967|       |	/* XXX TODO: Check other values for sanity; reject more
  968|       |	 * malformed PVDs. XXX */
  969|       |
  970|       |	/* Read Root Directory Record in Volume Descriptor. */
  971|    225|	p = h + PVD_root_directory_record_offset;
  ------------------
  |  |  119|    225|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  ------------------
  |  |  |  |  117|    225|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  115|    225|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  113|    225|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  111|    225|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  109|    225|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|    225|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|    225|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|    225|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|    225|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    225|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    225|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    225|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    225|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    225|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    225|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    225|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   85|    225|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    225|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    225|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    225|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    225|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    225|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    225|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    225|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|    225|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|    225|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|    225|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|    225|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|    225|#define PVD_logical_block_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  110|    225|#define PVD_path_table_size_size 8
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  112|    225|#define PVD_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  114|    225|#define PVD_opt_type_1_path_table_size 4
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|    225|#define PVD_type_m_path_table_size 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  ------------------
  |  |  |  |  118|    225|#define PVD_opt_type_m_path_table_size 4
  |  |  ------------------
  ------------------
  972|    225|	if (!isRootDirectoryRecord(p)) {
  ------------------
  |  Branch (972:6): [True: 11, False: 214]
  ------------------
  973|     11|		return (0);
  974|     11|	}
  975|       |
  976|    214|	if (!iso9660->primary.location) {
  ------------------
  |  Branch (976:6): [True: 213, False: 1]
  ------------------
  977|    213|		iso9660->logical_block_size = logical_block_size;
  978|    213|		iso9660->volume_block = volume_block;
  979|    213|		iso9660->volume_size =
  980|    213|		    logical_block_size * (uint64_t)volume_block;
  981|    213|		iso9660->primary.location =
  982|    213|		    archive_le32dec(p + DR_extent_offset);
  ------------------
  |  |  199|    213|#define DR_extent_offset 2
  ------------------
  983|    213|		iso9660->primary.size = archive_le32dec(p + DR_size_offset);
  ------------------
  |  |  201|    213|#define DR_size_offset 10
  ------------------
  984|    213|	}
  985|       |
  986|    214|	return (48);
  987|    225|}
archive_read_support_format_iso9660.c:isNull:
  608|  1.54k|{
  609|       |
  610|  1.54k|	while (bytes >= sizeof(iso9660->null)) {
  ------------------
  |  Branch (610:9): [True: 0, False: 1.54k]
  ------------------
  611|      0|		if (!memcmp(iso9660->null, h + offset, sizeof(iso9660->null)))
  ------------------
  |  Branch (611:7): [True: 0, False: 0]
  ------------------
  612|      0|			return (0);
  613|      0|		offset += sizeof(iso9660->null);
  614|      0|		bytes -= sizeof(iso9660->null);
  615|      0|	}
  616|  1.54k|	if (bytes)
  ------------------
  |  Branch (616:6): [True: 1.54k, False: 0]
  ------------------
  617|  1.54k|		return memcmp(iso9660->null, h + offset, bytes) == 0;
  618|      0|	else
  619|      0|		return (1);
  620|  1.54k|}
archive_read_support_format_iso9660.c:isValid733Integer:
 3271|  1.31k|{
 3272|  1.31k|	return (p[0] == p[7]
  ------------------
  |  Branch (3272:10): [True: 1.31k, False: 8]
  ------------------
 3273|  1.31k|		&& p[1] == p[6]
  ------------------
  |  Branch (3273:6): [True: 1.30k, False: 6]
  ------------------
 3274|  1.30k|		&& p[2] == p[5]
  ------------------
  |  Branch (3274:6): [True: 1.29k, False: 6]
  ------------------
 3275|  1.29k|		&& p[3] == p[4]);
  ------------------
  |  Branch (3275:6): [True: 1.29k, False: 4]
  ------------------
 3276|  1.31k|}
archive_read_support_format_iso9660.c:isValid723Integer:
 3265|  1.12k|isValid723Integer(const unsigned char *p) {
 3266|  1.12k|	return (p[0] == p[3] && p[1] == p[2]);
  ------------------
  |  Branch (3266:10): [True: 1.12k, False: 4]
  |  Branch (3266:26): [True: 1.12k, False: 2]
  ------------------
 3267|  1.12k|}
archive_read_support_format_iso9660.c:isRootDirectoryRecord:
  990|    419|isRootDirectoryRecord(const unsigned char *p) {
  991|    419|	int flags;
  992|       |
  993|       |	/* ECMA119/ISO9660 requires that the root directory record be _exactly_ 34 bytes.
  994|       |	 * However, we've seen images that have root directory records up to 68 bytes. */
  995|    419|	if (p[DR_length_offset] < 34 || p[DR_length_offset] > 68) {
  ------------------
  |  |  195|    419|#define DR_length_offset 0
  ------------------
              	if (p[DR_length_offset] < 34 || p[DR_length_offset] > 68) {
  ------------------
  |  |  195|    418|#define DR_length_offset 0
  ------------------
  |  Branch (995:6): [True: 1, False: 418]
  |  Branch (995:34): [True: 0, False: 418]
  ------------------
  996|      1|		return (0);
  997|      1|	}
  998|       |
  999|       |	/* The root directory location must be a 7.3.3 32-bit integer. */
 1000|    418|	if (!isValid733Integer(p + DR_extent_offset)) {
  ------------------
  |  |  199|    418|#define DR_extent_offset 2
  ------------------
  |  Branch (1000:6): [True: 7, False: 411]
  ------------------
 1001|      7|		return (0);
 1002|      7|	}
 1003|       |
 1004|       |	/* The root directory size must be a 7.3.3 integer. */
 1005|    411|	if (!isValid733Integer(p + DR_size_offset)) {
  ------------------
  |  |  201|    411|#define DR_size_offset 10
  ------------------
  |  Branch (1005:6): [True: 11, False: 400]
  ------------------
 1006|     11|		return (0);
 1007|     11|	}
 1008|       |
 1009|       |	/* According to the standard, certain bits must be one or zero:
 1010|       |	 * Bit 1: must be 1 (this is a directory)
 1011|       |	 * Bit 2: must be 0 (not an associated file)
 1012|       |	 * Bit 3: must be 0 (doesn't use extended attribute record)
 1013|       |	 * Bit 7: must be 0 (final directory record for this file)
 1014|       |	 */
 1015|    400|	flags = p[DR_flags_offset];
  ------------------
  |  |  205|    400|#define DR_flags_offset 25
  ------------------
 1016|    400|	if ((flags & 0x8E) != 0x02) {
  ------------------
  |  Branch (1016:6): [True: 0, False: 400]
  ------------------
 1017|      0|		return (0);
 1018|      0|	}
 1019|       |
 1020|       |	/* Volume sequence number must be a 7.2.3 integer. */
 1021|    400|	if (!isValid723Integer(p + DR_volume_sequence_number_offset)) {
  ------------------
  |  |  211|    400|#define DR_volume_sequence_number_offset 28
  ------------------
  |  Branch (1021:6): [True: 2, False: 398]
  ------------------
 1022|      2|		return (0);
 1023|      2|	}
 1024|       |
 1025|       |	/* Root directory name is a single zero byte... */
 1026|    398|	if (p[DR_name_len_offset] != 1 || p[DR_name_offset] != 0) {
  ------------------
  |  |  213|    398|#define DR_name_len_offset 32
  ------------------
              	if (p[DR_name_len_offset] != 1 || p[DR_name_offset] != 0) {
  ------------------
  |  |  215|    398|#define DR_name_offset 33
  ------------------
  |  Branch (1026:6): [True: 0, False: 398]
  |  Branch (1026:36): [True: 3, False: 395]
  ------------------
 1027|      3|		return (0);
 1028|      3|	}
 1029|       |
 1030|       |	/* Nothing looked wrong, so let's accept it. */
 1031|    395|	return (1);
 1032|    398|}
archive_read_support_format_iso9660.c:isJolietSVD:
  686|    338|{
  687|    338|	const unsigned char *p;
  688|    338|	ssize_t logical_block_size;
  689|    338|	int32_t volume_block;
  690|       |
  691|       |	/* Check if current sector is a kind of Supplementary Volume
  692|       |	 * Descriptor. */
  693|    338|	if (!isSVD(iso9660, h))
  ------------------
  |  Branch (693:6): [True: 235, False: 103]
  ------------------
  694|    235|		return (0);
  695|       |
  696|       |	/* FIXME: do more validations according to joliet spec. */
  697|       |
  698|       |	/* check if this SVD contains joliet extension! */
  699|    103|	p = h + SVD_escape_sequences_offset;
  ------------------
  |  |  172|    103|#define SVD_escape_sequences_offset (SVD_volume_space_size_offset + SVD_volume_space_size_size)
  |  |  ------------------
  |  |  |  |  170|    103|#define SVD_volume_space_size_offset 80
  |  |  ------------------
  |  |               #define SVD_escape_sequences_offset (SVD_volume_space_size_offset + SVD_volume_space_size_size)
  |  |  ------------------
  |  |  |  |  171|    103|#define SVD_volume_space_size_size 8
  |  |  ------------------
  ------------------
  700|       |	/* N.B. Joliet spec says p[1] == '\\', but.... */
  701|    103|	if (p[0] == '%' && p[1] == '/') {
  ------------------
  |  Branch (701:6): [True: 96, False: 7]
  |  Branch (701:21): [True: 41, False: 55]
  ------------------
  702|     41|		int level = 0;
  703|       |
  704|     41|		if (p[2] == '@')
  ------------------
  |  Branch (704:7): [True: 8, False: 33]
  ------------------
  705|      8|			level = 1;
  706|     33|		else if (p[2] == 'C')
  ------------------
  |  Branch (706:12): [True: 0, False: 33]
  ------------------
  707|      0|			level = 2;
  708|     33|		else if (p[2] == 'E')
  ------------------
  |  Branch (708:12): [True: 17, False: 16]
  ------------------
  709|     17|			level = 3;
  710|     16|		else /* not joliet */
  711|     16|			return (0);
  712|       |
  713|     25|		iso9660->seenJoliet = level;
  714|       |
  715|     25|	} else /* not joliet */
  716|     62|		return (0);
  717|       |
  718|     25|	logical_block_size =
  719|     25|	    archive_le16dec(h + SVD_logical_block_size_offset);
  ------------------
  |  |  175|     25|#define SVD_logical_block_size_offset 128
  ------------------
  720|     25|	volume_block = archive_le32dec(h + SVD_volume_space_size_offset);
  ------------------
  |  |  170|     25|#define SVD_volume_space_size_offset 80
  ------------------
  721|       |
  722|     25|	iso9660->logical_block_size = logical_block_size;
  723|     25|	iso9660->volume_block = volume_block;
  724|     25|	iso9660->volume_size = logical_block_size * (uint64_t)volume_block;
  725|       |	/* Read Root Directory Record in Volume Descriptor. */
  726|     25|	p = h + SVD_root_directory_record_offset;
  ------------------
  |  |  180|     25|#define SVD_root_directory_record_offset 156
  ------------------
  727|     25|	iso9660->joliet.location = archive_le32dec(p + DR_extent_offset);
  ------------------
  |  |  199|     25|#define DR_extent_offset 2
  ------------------
  728|     25|	iso9660->joliet.size = archive_le32dec(p + DR_size_offset);
  ------------------
  |  |  201|     25|#define DR_size_offset 10
  ------------------
  729|       |
  730|     25|	return (48);
  731|    103|}
archive_read_support_format_iso9660.c:isBootRecord:
  624|    337|{
  625|    337|	(void)iso9660; /* UNUSED */
  626|       |
  627|       |	/* Type of the Volume Descriptor Boot Record must be 0. */
  628|    337|	if (h[0] != 0)
  ------------------
  |  Branch (628:6): [True: 330, False: 7]
  ------------------
  629|    330|		return (0);
  630|       |
  631|       |	/* Volume Descriptor Version must be 1. */
  632|      7|	if (h[6] != 1)
  ------------------
  |  Branch (632:6): [True: 0, False: 7]
  ------------------
  633|      0|		return (0);
  634|       |
  635|      7|	return (1);
  636|      7|}
archive_read_support_format_iso9660.c:isEVD:
  795|    330|{
  796|    330|	const unsigned char *p;
  797|    330|	ssize_t logical_block_size;
  798|    330|	int32_t volume_block;
  799|    330|	int32_t location;
  800|       |
  801|    330|	(void)iso9660; /* UNUSED */
  802|       |
  803|       |	/* Type of the Enhanced Volume Descriptor must be 2. */
  804|    330|	if (h[PVD_type_offset] != 2)
  ------------------
  |  |   85|    330|#define PVD_type_offset 0
  ------------------
  |  Branch (804:6): [True: 234, False: 96]
  ------------------
  805|    234|		return (0);
  806|       |
  807|       |	/* EVD version must be 2. */
  808|     96|	if (h[PVD_version_offset] != 2)
  ------------------
  |  |   89|     96|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  ------------------
  |  |  |  |   87|     96|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   85|     96|#define PVD_type_offset 0
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   86|     96|#define PVD_type_size 1
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  ------------------
  |  |  |  |   88|     96|#define PVD_id_size 5
  |  |  ------------------
  ------------------
  |  Branch (808:6): [True: 96, False: 0]
  ------------------
  809|     96|		return (0);
  810|       |
  811|       |	/* Reserved field must be 0. */
  812|      0|	if (h[PVD_reserved1_offset] != 0)
  ------------------
  |  |   91|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  ------------------
  |  |  |  |   89|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   87|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   85|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   88|      0|#define PVD_id_size 5
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  ------------------
  |  |  |  |   90|      0|#define PVD_version_size 1
  |  |  ------------------
  ------------------
  |  Branch (812:6): [True: 0, False: 0]
  ------------------
  813|      0|		return (0);
  814|       |
  815|       |	/* Reserved field must be 0. */
  816|      0|	if (!isNull(iso9660, h, PVD_reserved2_offset, PVD_reserved2_size))
  ------------------
  |  |   97|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  ------------------
  |  |  |  |   95|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   91|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   85|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   94|      0|#define PVD_system_id_size 32
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  ------------------
  |  |  |  |   96|      0|#define PVD_volume_id_size 32
  |  |  ------------------
  ------------------
              	if (!isNull(iso9660, h, PVD_reserved2_offset, PVD_reserved2_size))
  ------------------
  |  |   98|      0|#define PVD_reserved2_size 8
  ------------------
  |  Branch (816:6): [True: 0, False: 0]
  ------------------
  817|      0|		return (0);
  818|       |
  819|       |	/* Reserved field must be 0. */
  820|      0|	if (!isNull(iso9660, h, PVD_reserved3_offset, PVD_reserved3_size))
  ------------------
  |  |  101|      0|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  ------------------
  |  |  |  |   99|      0|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   93|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   85|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   94|      0|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|      0|#define PVD_volume_id_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|      0|#define PVD_reserved2_size 8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  ------------------
  |  |  |  |  100|      0|#define PVD_volume_space_size_size 8
  |  |  ------------------
  ------------------
              	if (!isNull(iso9660, h, PVD_reserved3_offset, PVD_reserved3_size))
  ------------------
  |  |  102|      0|#define PVD_reserved3_size 32
  ------------------
  |  Branch (820:6): [True: 0, False: 0]
  ------------------
  821|      0|		return (0);
  822|       |
  823|       |	/* Logical block size must be > 0. */
  824|       |	/* I've looked at Ecma 119 and can't find any stronger
  825|       |	 * restriction on this field. */
  826|      0|	logical_block_size =
  827|      0|	    archive_le16dec(h + PVD_logical_block_size_offset);
  ------------------
  |  |  107|      0|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  ------------------
  |  |  |  |  105|      0|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|      0|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  101|      0|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   99|      0|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   97|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   85|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|      0|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|      0|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   98|      0|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  100|      0|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|      0|#define PVD_reserved3_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  104|      0|#define PVD_volume_set_size_size 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  ------------------
  |  |  |  |  106|      0|#define PVD_volume_sequence_number_size 4
  |  |  ------------------
  ------------------
  828|      0|	if (logical_block_size <= 0)
  ------------------
  |  Branch (828:6): [True: 0, False: 0]
  ------------------
  829|      0|		return (0);
  830|       |
  831|      0|	volume_block =
  832|      0|	    archive_le32dec(h + PVD_volume_space_size_offset);
  ------------------
  |  |   99|      0|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  ------------------
  |  |  |  |   97|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   85|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|      0|#define PVD_system_id_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|      0|#define PVD_volume_id_size 32
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  ------------------
  |  |  |  |   98|      0|#define PVD_reserved2_size 8
  |  |  ------------------
  ------------------
  833|      0|	if (volume_block <= SYSTEM_AREA_BLOCK+4)
  ------------------
  |  |   82|      0|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (833:6): [True: 0, False: 0]
  ------------------
  834|      0|		return (0);
  835|       |
  836|       |	/* File structure version must be 2 for ISO9660:1999. */
  837|      0|	if (h[PVD_file_structure_version_offset] != 2)
  ------------------
  |  |  143|      0|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  ------------------
  |  |  |  |  141|      0|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  139|      0|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  137|      0|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  135|      0|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  133|      0|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|      0|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|      0|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|      0|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|      0|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|      0|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  121|      0|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  119|      0|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  117|      0|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  115|      0|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  113|      0|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  111|      0|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|      0|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|      0|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|      0|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|      0|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|      0|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|      0|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   85|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|      0|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|      0|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|      0|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|      0|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|      0|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|      0|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|      0|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|      0|#define PVD_logical_block_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|      0|#define PVD_path_table_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|      0|#define PVD_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|      0|#define PVD_opt_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|      0|#define PVD_type_m_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|      0|#define PVD_opt_type_m_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|      0|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|      0|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|      0|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|      0|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|      0|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|      0|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|      0|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  134|      0|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  136|      0|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  138|      0|#define PVD_modification_date_size 17
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  140|      0|#define PVD_expiration_date_size 17
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  ------------------
  |  |  |  |  142|      0|#define PVD_effective_date_size 17
  |  |  ------------------
  ------------------
  |  Branch (837:6): [True: 0, False: 0]
  ------------------
  838|      0|		return (0);
  839|       |
  840|       |	/* Location of Occurrence of Type L Path Table must be
  841|       |	 * available location,
  842|       |	 * >= SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */
  843|      0|	location = archive_le32dec(h+PVD_type_1_path_table_offset);
  ------------------
  |  |  111|      0|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  ------------------
  |  |  |  |  109|      0|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  107|      0|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  105|      0|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  103|      0|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  101|      0|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|      0|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   85|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|      0|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|      0|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|      0|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|      0|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  102|      0|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  104|      0|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|      0|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|      0|#define PVD_logical_block_size_size 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  ------------------
  |  |  |  |  110|      0|#define PVD_path_table_size_size 8
  |  |  ------------------
  ------------------
  844|      0|	if (location < SYSTEM_AREA_BLOCK+2 || location >= volume_block)
  ------------------
  |  |   82|      0|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (844:6): [True: 0, False: 0]
  |  Branch (844:40): [True: 0, False: 0]
  ------------------
  845|      0|		return (0);
  846|       |
  847|       |	/* Location of Occurrence of Type M Path Table must be
  848|       |	 * available location,
  849|       |	 * >= SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */
  850|      0|	location = archive_be32dec(h+PVD_type_m_path_table_offset);
  ------------------
  |  |  115|      0|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  ------------------
  |  |  |  |  113|      0|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  111|      0|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  107|      0|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  105|      0|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|      0|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|      0|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|      0|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   85|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|      0|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|      0|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|      0|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|      0|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|      0|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|      0|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  106|      0|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  108|      0|#define PVD_logical_block_size_size 4
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|      0|#define PVD_path_table_size_size 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  112|      0|#define PVD_type_1_path_table_size 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  ------------------
  |  |  |  |  114|      0|#define PVD_opt_type_1_path_table_size 4
  |  |  ------------------
  ------------------
  851|      0|	if ((location > 0 && location < SYSTEM_AREA_BLOCK+2)
  ------------------
  |  |   82|      0|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (851:7): [True: 0, False: 0]
  |  Branch (851:23): [True: 0, False: 0]
  ------------------
  852|      0|	    || location >= volume_block)
  ------------------
  |  Branch (852:9): [True: 0, False: 0]
  ------------------
  853|      0|		return (0);
  854|       |
  855|       |	/* Reserved field must be 0. */
  856|      0|	if (!isNull(iso9660, h, PVD_reserved4_offset, PVD_reserved4_size))
  ------------------
  |  |  145|      0|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  ------------------
  |  |  |  |  143|      0|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  141|      0|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  139|      0|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  137|      0|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  135|      0|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|      0|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|      0|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|      0|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|      0|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|      0|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|      0|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  121|      0|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  119|      0|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  117|      0|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  115|      0|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  113|      0|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  111|      0|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|      0|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|      0|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|      0|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|      0|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|      0|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|      0|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   85|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|      0|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|      0|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|      0|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|      0|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|      0|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|      0|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|      0|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|      0|#define PVD_logical_block_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|      0|#define PVD_path_table_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|      0|#define PVD_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|      0|#define PVD_opt_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|      0|#define PVD_type_m_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|      0|#define PVD_opt_type_m_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|      0|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|      0|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|      0|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|      0|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|      0|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|      0|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|      0|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|      0|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  136|      0|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  138|      0|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  140|      0|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  142|      0|#define PVD_effective_date_size 17
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  ------------------
  |  |  |  |  144|      0|#define PVD_file_structure_version_size 1
  |  |  ------------------
  ------------------
              	if (!isNull(iso9660, h, PVD_reserved4_offset, PVD_reserved4_size))
  ------------------
  |  |  146|      0|#define PVD_reserved4_size 1
  ------------------
  |  Branch (856:6): [True: 0, False: 0]
  ------------------
  857|      0|		return (0);
  858|       |
  859|       |	/* Reserved field must be 0. */
  860|      0|	if (!isNull(iso9660, h, PVD_reserved5_offset, PVD_reserved5_size))
  ------------------
  |  |  149|      0|#define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  ------------------
  |  |  |  |  147|      0|#define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|      0|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  143|      0|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  141|      0|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  139|      0|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  137|      0|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  135|      0|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|      0|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|      0|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|      0|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|      0|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|      0|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|      0|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  121|      0|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  119|      0|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  117|      0|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  115|      0|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  113|      0|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  111|      0|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|      0|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|      0|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|      0|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|      0|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|      0|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|      0|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   85|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|      0|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|      0|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|      0|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|      0|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|      0|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|      0|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|      0|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|      0|#define PVD_logical_block_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|      0|#define PVD_path_table_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|      0|#define PVD_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|      0|#define PVD_opt_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|      0|#define PVD_type_m_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|      0|#define PVD_opt_type_m_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|      0|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|      0|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|      0|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|      0|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|      0|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|      0|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|      0|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|      0|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  136|      0|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  138|      0|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  140|      0|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  142|      0|#define PVD_effective_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|      0|#define PVD_file_structure_version_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  146|      0|#define PVD_reserved4_size 1
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  ------------------
  |  |  |  |  148|      0|#define PVD_application_data_size 512
  |  |  ------------------
  ------------------
              	if (!isNull(iso9660, h, PVD_reserved5_offset, PVD_reserved5_size))
  ------------------
  |  |  150|      0|#define PVD_reserved5_size (2048 - PVD_reserved5_offset)
  |  |  ------------------
  |  |  |  |  149|      0|#define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  147|      0|#define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  145|      0|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  143|      0|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  141|      0|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  139|      0|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  137|      0|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  135|      0|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|      0|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|      0|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|      0|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|      0|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|      0|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|      0|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  121|      0|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  119|      0|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  117|      0|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  115|      0|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  113|      0|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  111|      0|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|      0|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|      0|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|      0|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|      0|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|      0|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|      0|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   85|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|      0|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|      0|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|      0|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|      0|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|      0|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|      0|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|      0|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|      0|#define PVD_logical_block_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|      0|#define PVD_path_table_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|      0|#define PVD_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|      0|#define PVD_opt_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|      0|#define PVD_type_m_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|      0|#define PVD_opt_type_m_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|      0|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|      0|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|      0|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|      0|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|      0|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|      0|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|      0|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|      0|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  136|      0|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  138|      0|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  140|      0|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  142|      0|#define PVD_effective_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  144|      0|#define PVD_file_structure_version_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  146|      0|#define PVD_reserved4_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  148|      0|#define PVD_application_data_size 512
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (860:6): [True: 0, False: 0]
  ------------------
  861|      0|		return (0);
  862|       |
  863|       |	/* Read Root Directory Record in Volume Descriptor. */
  864|      0|	p = h + PVD_root_directory_record_offset;
  ------------------
  |  |  119|      0|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  ------------------
  |  |  |  |  117|      0|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  115|      0|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  113|      0|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  111|      0|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  109|      0|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|      0|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|      0|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|      0|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|      0|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|      0|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   85|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|      0|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|      0|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|      0|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|      0|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|      0|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|      0|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|      0|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|      0|#define PVD_logical_block_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  110|      0|#define PVD_path_table_size_size 8
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  112|      0|#define PVD_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  114|      0|#define PVD_opt_type_1_path_table_size 4
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|      0|#define PVD_type_m_path_table_size 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  ------------------
  |  |  |  |  118|      0|#define PVD_opt_type_m_path_table_size 4
  |  |  ------------------
  ------------------
  865|      0|	if (!isRootDirectoryRecord(p)) {
  ------------------
  |  Branch (865:6): [True: 0, False: 0]
  ------------------
  866|      0|		return (0);
  867|      0|	}
  868|       |
  869|      0|	return (48);
  870|      0|}
archive_read_support_format_iso9660.c:isSVD:
  735|    668|{
  736|    668|	const unsigned char *p;
  737|    668|	ssize_t logical_block_size;
  738|    668|	int32_t volume_block;
  739|    668|	int32_t location;
  740|       |
  741|    668|	(void)iso9660; /* UNUSED */
  742|       |
  743|       |	/* Type 2 means it's a SVD. */
  744|    668|	if (h[SVD_type_offset] != 2)
  ------------------
  |  |  161|    668|#define SVD_type_offset 0
  ------------------
  |  Branch (744:6): [True: 461, False: 207]
  ------------------
  745|    461|		return (0);
  746|       |
  747|       |	/* Reserved field must be 0. */
  748|    207|	if (!isNull(iso9660, h, SVD_reserved1_offset, SVD_reserved1_size))
  ------------------
  |  |  168|    207|#define SVD_reserved1_offset	72
  ------------------
              	if (!isNull(iso9660, h, SVD_reserved1_offset, SVD_reserved1_size))
  ------------------
  |  |  169|    207|#define SVD_reserved1_size	8
  ------------------
  |  Branch (748:6): [True: 1, False: 206]
  ------------------
  749|      1|		return (0);
  750|    206|	if (!isNull(iso9660, h, SVD_reserved2_offset, SVD_reserved2_size))
  ------------------
  |  |  183|    206|#define SVD_reserved2_offset	882
  ------------------
              	if (!isNull(iso9660, h, SVD_reserved2_offset, SVD_reserved2_size))
  ------------------
  |  |  184|    206|#define SVD_reserved2_size	1
  ------------------
  |  Branch (750:6): [True: 1, False: 205]
  ------------------
  751|      1|		return (0);
  752|    205|	if (!isNull(iso9660, h, SVD_reserved3_offset, SVD_reserved3_size))
  ------------------
  |  |  185|    205|#define SVD_reserved3_offset	1395
  ------------------
              	if (!isNull(iso9660, h, SVD_reserved3_offset, SVD_reserved3_size))
  ------------------
  |  |  186|    205|#define SVD_reserved3_size	653
  ------------------
  |  Branch (752:6): [True: 5, False: 200]
  ------------------
  753|      5|		return (0);
  754|       |
  755|       |	/* File structure version must be 1 for ISO9660/ECMA119. */
  756|    200|	if (h[SVD_file_structure_version_offset] != 1)
  ------------------
  |  |  182|    200|#define SVD_file_structure_version_offset 881
  ------------------
  |  Branch (756:6): [True: 1, False: 199]
  ------------------
  757|      1|		return (0);
  758|       |
  759|    199|	logical_block_size =
  760|    199|	    archive_le16dec(h + SVD_logical_block_size_offset);
  ------------------
  |  |  175|    199|#define SVD_logical_block_size_offset 128
  ------------------
  761|    199|	if (logical_block_size <= 0)
  ------------------
  |  Branch (761:6): [True: 1, False: 198]
  ------------------
  762|      1|		return (0);
  763|       |
  764|    198|	volume_block = archive_le32dec(h + SVD_volume_space_size_offset);
  ------------------
  |  |  170|    198|#define SVD_volume_space_size_offset 80
  ------------------
  765|    198|	if (volume_block <= SYSTEM_AREA_BLOCK+4)
  ------------------
  |  |   82|    198|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (765:6): [True: 1, False: 197]
  ------------------
  766|      1|		return (0);
  767|       |
  768|       |	/* Location of Occurrence of Type L Path Table must be
  769|       |	 * available location,
  770|       |	 * >= SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */
  771|    197|	location = archive_le32dec(h+SVD_type_L_path_table_offset);
  ------------------
  |  |  177|    197|#define SVD_type_L_path_table_offset 140
  ------------------
  772|    197|	if (location < SYSTEM_AREA_BLOCK+2 || location >= volume_block)
  ------------------
  |  |   82|    197|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (772:6): [True: 1, False: 196]
  |  Branch (772:40): [True: 1, False: 195]
  ------------------
  773|      2|		return (0);
  774|       |
  775|       |	/* The Type M Path Table must be at a valid location (WinISO
  776|       |	 * and probably other programs omit this, so we allow zero)
  777|       |	 *
  778|       |	 * >= SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */
  779|    195|	location = archive_be32dec(h+SVD_type_M_path_table_offset);
  ------------------
  |  |  178|    195|#define SVD_type_M_path_table_offset 148
  ------------------
  780|    195|	if ((location > 0 && location < SYSTEM_AREA_BLOCK+2)
  ------------------
  |  |   82|    195|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (780:7): [True: 195, False: 0]
  |  Branch (780:23): [True: 0, False: 195]
  ------------------
  781|    195|	    || location >= volume_block)
  ------------------
  |  Branch (781:9): [True: 1, False: 194]
  ------------------
  782|      1|		return (0);
  783|       |
  784|       |	/* Read Root Directory Record in Volume Descriptor. */
  785|    194|	p = h + SVD_root_directory_record_offset;
  ------------------
  |  |  180|    194|#define SVD_root_directory_record_offset 156
  ------------------
  786|    194|	if (!isRootDirectoryRecord(p)) {
  ------------------
  |  Branch (786:6): [True: 13, False: 181]
  ------------------
  787|     13|		return (0);
  788|     13|	}
  789|       |
  790|    181|	return (48);
  791|    194|}
archive_read_support_format_iso9660.c:isVolumePartition:
  640|    252|{
  641|    252|	int32_t location;
  642|       |
  643|       |	/* Type of the Volume Partition Descriptor must be 3. */
  644|    252|	if (h[0] != 3)
  ------------------
  |  Branch (644:6): [True: 252, False: 0]
  ------------------
  645|    252|		return (0);
  646|       |
  647|       |	/* Volume Descriptor Version must be 1. */
  648|      0|	if (h[6] != 1)
  ------------------
  |  Branch (648:6): [True: 0, False: 0]
  ------------------
  649|      0|		return (0);
  650|       |	/* Unused Field */
  651|      0|	if (h[7] != 0)
  ------------------
  |  Branch (651:6): [True: 0, False: 0]
  ------------------
  652|      0|		return (0);
  653|       |
  654|      0|	location = archive_le32dec(h + 72);
  655|      0|	if (location <= SYSTEM_AREA_BLOCK ||
  ------------------
  |  |   82|      0|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (655:6): [True: 0, False: 0]
  ------------------
  656|      0|	    location >= iso9660->volume_block)
  ------------------
  |  Branch (656:6): [True: 0, False: 0]
  ------------------
  657|      0|		return (0);
  658|      0|	if ((uint32_t)location != archive_be32dec(h + 76))
  ------------------
  |  Branch (658:6): [True: 0, False: 0]
  ------------------
  659|      0|		return (0);
  660|       |
  661|      0|	return (1);
  662|      0|}
archive_read_support_format_iso9660.c:isVDSetTerminator:
  666|    252|{
  667|    252|	(void)iso9660; /* UNUSED */
  668|       |
  669|       |	/* Type of the Volume Descriptor Set Terminator must be 255. */
  670|    252|	if (h[0] != 255)
  ------------------
  |  Branch (670:6): [True: 54, False: 198]
  ------------------
  671|     54|		return (0);
  672|       |
  673|       |	/* Volume Descriptor Version must be 1. */
  674|    198|	if (h[6] != 1)
  ------------------
  |  Branch (674:6): [True: 1, False: 197]
  ------------------
  675|      1|		return (0);
  676|       |
  677|       |	/* Reserved field must be 0. */
  678|    197|	if (!isNull(iso9660, h, 7, 2048-7))
  ------------------
  |  Branch (678:6): [True: 4, False: 193]
  ------------------
  679|      4|		return (0);
  680|       |
  681|    193|	return (1);
  682|    197|}
archive_read_support_format_iso9660.c:archive_read_format_iso9660_read_header:
 1249|    872|{
 1250|    872|	struct iso9660 *iso9660;
 1251|    872|	struct file_info *file;
 1252|    872|	int r, rd_r = ARCHIVE_OK;
  ------------------
  |  |  233|    872|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1253|       |
 1254|    872|	iso9660 = (struct iso9660 *)(a->format->data);
 1255|       |
 1256|    872|	if (!a->archive.archive_format) {
  ------------------
  |  Branch (1256:6): [True: 192, False: 680]
  ------------------
 1257|    192|		a->archive.archive_format = ARCHIVE_FORMAT_ISO9660;
  ------------------
  |  |  372|    192|#define	ARCHIVE_FORMAT_ISO9660			0x40000
  ------------------
 1258|    192|		a->archive.archive_format_name = "ISO9660";
 1259|    192|	}
 1260|       |
 1261|    872|	if (iso9660->current_position == 0) {
  ------------------
  |  Branch (1261:6): [True: 192, False: 680]
  ------------------
 1262|    192|		r = choose_volume(a, iso9660);
 1263|    192|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    192|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1263:7): [True: 19, False: 173]
  ------------------
 1264|     19|			return (r);
 1265|    192|	}
 1266|       |
 1267|    853|	file = NULL;/* Eliminate a warning. */
 1268|       |	/* Get the next entry that appears after the current offset. */
 1269|    853|	r = next_entry_seek(a, iso9660, &file);
 1270|    853|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    853|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1270:6): [True: 231, False: 622]
  ------------------
 1271|    231|		return (r);
 1272|       |
 1273|    622|	if (iso9660->seenJoliet) {
  ------------------
  |  Branch (1273:6): [True: 12, False: 610]
  ------------------
 1274|       |		/*
 1275|       |		 * Convert UTF-16BE of a filename to local locale MBS
 1276|       |		 * and store the result into a filename field.
 1277|       |		 */
 1278|     12|		if (iso9660->sconv_utf16be == NULL) {
  ------------------
  |  Branch (1278:7): [True: 6, False: 6]
  ------------------
 1279|      6|			iso9660->sconv_utf16be =
 1280|      6|			    archive_string_conversion_from_charset(
 1281|      6|				&(a->archive), "UTF-16BE", 1);
 1282|      6|			if (iso9660->sconv_utf16be == NULL)
  ------------------
  |  Branch (1282:8): [True: 0, False: 6]
  ------------------
 1283|       |				/* Couldn't allocate memory */
 1284|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1285|      6|		}
 1286|     12|		if (iso9660->utf16be_path == NULL) {
  ------------------
  |  Branch (1286:7): [True: 6, False: 6]
  ------------------
 1287|      6|			iso9660->utf16be_path = malloc(UTF16_NAME_MAX);
  ------------------
  |  |  376|      6|#define UTF16_NAME_MAX	1024
  ------------------
 1288|      6|			if (iso9660->utf16be_path == NULL) {
  ------------------
  |  Branch (1288:8): [True: 0, False: 6]
  ------------------
 1289|      0|				archive_set_error(&a->archive, ENOMEM,
 1290|      0|				    "No memory");
 1291|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1292|      0|			}
 1293|      6|		}
 1294|     12|		if (iso9660->utf16be_previous_path == NULL) {
  ------------------
  |  Branch (1294:7): [True: 6, False: 6]
  ------------------
 1295|      6|			iso9660->utf16be_previous_path = calloc(1, UTF16_NAME_MAX);
  ------------------
  |  |  376|      6|#define UTF16_NAME_MAX	1024
  ------------------
 1296|      6|			if (iso9660->utf16be_previous_path == NULL) {
  ------------------
  |  Branch (1296:8): [True: 0, False: 6]
  ------------------
 1297|      0|				archive_set_error(&a->archive, ENOMEM,
 1298|      0|				    "No memory");
 1299|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1300|      0|			}
 1301|      6|		}
 1302|       |
 1303|     12|		iso9660->utf16be_path_len = 0;
 1304|     12|		if (build_pathname_utf16be(iso9660->utf16be_path,
  ------------------
  |  Branch (1304:7): [True: 0, False: 12]
  ------------------
 1305|     12|		    UTF16_NAME_MAX, &(iso9660->utf16be_path_len), file) != 0) {
  ------------------
  |  |  376|     12|#define UTF16_NAME_MAX	1024
  ------------------
 1306|      0|			archive_set_error(&a->archive,
 1307|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1308|      0|			    "Pathname is too long");
 1309|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1310|      0|		}
 1311|       |
 1312|     12|		r = archive_entry_copy_pathname_l(entry,
  ------------------
  |  |   80|     12|#define archive_entry_copy_pathname_l	_archive_entry_copy_pathname_l
  ------------------
 1313|     12|		    (const char *)iso9660->utf16be_path,
 1314|     12|		    iso9660->utf16be_path_len,
 1315|     12|		    iso9660->sconv_utf16be);
 1316|     12|		if (r != 0) {
  ------------------
  |  Branch (1316:7): [True: 4, False: 8]
  ------------------
 1317|      4|			if (errno == ENOMEM) {
  ------------------
  |  Branch (1317:8): [True: 0, False: 4]
  ------------------
 1318|      0|				archive_set_error(&a->archive, ENOMEM,
 1319|      0|				    "No memory for Pathname");
 1320|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1321|      0|			}
 1322|      4|			archive_set_error(&a->archive,
 1323|      4|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      4|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1324|      4|			    "Pathname cannot be converted "
 1325|      4|			    "from %s to current locale",
 1326|      4|			    archive_string_conversion_charset_name(
 1327|      4|			      iso9660->sconv_utf16be));
 1328|       |
 1329|      4|			rd_r = ARCHIVE_WARN;
  ------------------
  |  |  235|      4|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1330|      4|		}
 1331|    610|	} else {
 1332|    610|		const char *path = build_pathname(&iso9660->pathname, file, 0);
 1333|    610|		if (path == NULL) {
  ------------------
  |  Branch (1333:7): [True: 0, False: 610]
  ------------------
 1334|      0|			archive_set_error(&a->archive,
 1335|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1336|      0|			    "Pathname is too long");
 1337|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1338|    610|		} else {
 1339|    610|			archive_string_empty(&iso9660->pathname);
  ------------------
  |  |  181|    610|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 1340|    610|			archive_entry_set_pathname(entry, path);
 1341|    610|		}
 1342|    610|	}
 1343|       |
 1344|    622|	iso9660->entry_bytes_remaining = file->size;
 1345|       |	/* Offset for sparse-file-aware clients. */
 1346|    622|	iso9660->entry_sparse_offset = 0;
 1347|       |
 1348|    622|	if (file->offset + file->size > iso9660->volume_size) {
  ------------------
  |  Branch (1348:6): [True: 105, False: 517]
  ------------------
 1349|    105|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|    105|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1350|    105|		    "File is beyond end-of-media: %s",
 1351|    105|		    archive_entry_pathname(entry));
 1352|    105|		iso9660->entry_bytes_remaining = 0;
 1353|    105|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|    105|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1354|    105|	}
 1355|       |
 1356|       |	/* Set up the entry structure with information about this entry. */
 1357|    517|	archive_entry_set_mode(entry, file->mode);
 1358|    517|	archive_entry_set_uid(entry, file->uid);
 1359|    517|	archive_entry_set_gid(entry, file->gid);
 1360|    517|	archive_entry_set_nlink(entry, file->nlinks);
 1361|    517|	if ((file->time_is_set & BIRTHTIME_IS_SET))
  ------------------
  |  |  309|    517|#define BIRTHTIME_IS_SET 1
  ------------------
  |  Branch (1361:6): [True: 2, False: 515]
  ------------------
 1362|      2|		archive_entry_set_birthtime(entry, file->birthtime, 0);
 1363|    515|	else
 1364|    515|		archive_entry_unset_birthtime(entry);
 1365|    517|	if ((file->time_is_set & MTIME_IS_SET))
  ------------------
  |  |  310|    517|#define MTIME_IS_SET 2
  ------------------
  |  Branch (1365:6): [True: 193, False: 324]
  ------------------
 1366|    193|		archive_entry_set_mtime(entry, file->mtime, 0);
 1367|    324|	else
 1368|    324|		archive_entry_unset_mtime(entry);
 1369|    517|	if ((file->time_is_set & CTIME_IS_SET))
  ------------------
  |  |  312|    517|#define CTIME_IS_SET 8
  ------------------
  |  Branch (1369:6): [True: 192, False: 325]
  ------------------
 1370|    192|		archive_entry_set_ctime(entry, file->ctime, 0);
 1371|    325|	else
 1372|    325|		archive_entry_unset_ctime(entry);
 1373|    517|	if ((file->time_is_set & ATIME_IS_SET))
  ------------------
  |  |  311|    517|#define ATIME_IS_SET 4
  ------------------
  |  Branch (1373:6): [True: 194, False: 323]
  ------------------
 1374|    194|		archive_entry_set_atime(entry, file->atime, 0);
 1375|    323|	else
 1376|    323|		archive_entry_unset_atime(entry);
 1377|       |	/* N.B.: Rock Ridge supports 64-bit device numbers. */
 1378|    517|	archive_entry_set_rdev(entry, (dev_t)file->rdev);
 1379|    517|	archive_entry_set_size(entry, iso9660->entry_bytes_remaining);
 1380|    517|	if (file->symlink.s != NULL)
  ------------------
  |  Branch (1380:6): [True: 20, False: 497]
  ------------------
 1381|     20|		archive_entry_copy_symlink(entry, file->symlink.s);
 1382|       |
 1383|       |	/* Note: If the input isn't seekable, we can't rewind to
 1384|       |	 * return the same body again, so if the next entry refers to
 1385|       |	 * the same data, we have to return it as a hardlink to the
 1386|       |	 * original entry. */
 1387|    517|	if (file->number != -1 &&
  ------------------
  |  Branch (1387:6): [True: 386, False: 131]
  ------------------
 1388|    386|	    file->number == iso9660->previous_number) {
  ------------------
  |  Branch (1388:6): [True: 67, False: 319]
  ------------------
 1389|     67|		if (iso9660->seenJoliet) {
  ------------------
  |  Branch (1389:7): [True: 0, False: 67]
  ------------------
 1390|      0|			r = archive_entry_copy_hardlink_l(entry,
  ------------------
  |  |   74|      0|#define archive_entry_copy_hardlink_l	_archive_entry_copy_hardlink_l
  ------------------
 1391|      0|			    (const char *)iso9660->utf16be_previous_path,
 1392|      0|			    iso9660->utf16be_previous_path_len,
 1393|      0|			    iso9660->sconv_utf16be);
 1394|      0|			if (r != 0) {
  ------------------
  |  Branch (1394:8): [True: 0, False: 0]
  ------------------
 1395|      0|				if (errno == ENOMEM) {
  ------------------
  |  Branch (1395:9): [True: 0, False: 0]
  ------------------
 1396|      0|					archive_set_error(&a->archive, ENOMEM,
 1397|      0|					    "No memory for Linkname");
 1398|      0|					return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1399|      0|				}
 1400|      0|				archive_set_error(&a->archive,
 1401|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1402|      0|				    "Linkname cannot be converted "
 1403|      0|				    "from %s to current locale",
 1404|      0|				    archive_string_conversion_charset_name(
 1405|      0|				      iso9660->sconv_utf16be));
 1406|      0|				rd_r = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1407|      0|			}
 1408|      0|		} else
 1409|     67|			archive_entry_set_hardlink(entry,
 1410|     67|			    iso9660->previous_pathname.s);
 1411|     67|		archive_entry_unset_size(entry);
 1412|     67|		iso9660->entry_bytes_remaining = 0;
 1413|     67|		return (rd_r);
 1414|     67|	}
 1415|       |
 1416|    450|	if ((file->mode & AE_IFMT) != AE_IFDIR &&
  ------------------
  |  |  215|    450|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              	if ((file->mode & AE_IFMT) != AE_IFDIR &&
  ------------------
  |  |  221|    900|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (1416:6): [True: 311, False: 139]
  ------------------
 1417|    311|	    file->offset < iso9660->current_position) {
  ------------------
  |  Branch (1417:6): [True: 75, False: 236]
  ------------------
 1418|     75|		int64_t r64;
 1419|       |
 1420|     75|		r64 = __archive_read_seek(a, file->offset, SEEK_SET);
 1421|     75|		if (r64 != (int64_t)file->offset) {
  ------------------
  |  Branch (1421:7): [True: 0, False: 75]
  ------------------
 1422|       |			/* We can't seek backwards to extract it, so issue
 1423|       |			 * a warning.  Note that this can only happen if
 1424|       |			 * this entry was added to the heap after we passed
 1425|       |			 * this offset, that is, only if the directory
 1426|       |			 * mentioning this entry is later than the body of
 1427|       |			 * the entry. Such layouts are very unusual; most
 1428|       |			 * ISO9660 writers lay out and record all directory
 1429|       |			 * information first, then store all file bodies. */
 1430|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1431|      0|			    "Ignoring out-of-order file @%jx (%s) %jd < %jd",
 1432|      0|			    (uintmax_t)file->number,
 1433|      0|			    iso9660->pathname.s,
 1434|      0|			    (intmax_t)file->offset,
 1435|      0|			    (intmax_t)iso9660->current_position);
 1436|      0|			iso9660->entry_bytes_remaining = 0;
 1437|      0|			return (ARCHIVE_WARN);
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1438|      0|		}
 1439|     75|		iso9660->current_position = (uint64_t)r64;
 1440|     75|	}
 1441|       |
 1442|       |	/* Initialize zisofs variables. */
 1443|    450|	iso9660->entry_zisofs.pz = file->pz;
 1444|    450|	if (file->pz) {
  ------------------
  |  Branch (1444:6): [True: 0, False: 450]
  ------------------
 1445|      0|#ifdef HAVE_ZLIB_H
 1446|      0|		struct zisofs  *zisofs;
 1447|       |
 1448|      0|		zisofs = &iso9660->entry_zisofs;
 1449|      0|		zisofs->initialized = 0;
 1450|      0|		zisofs->pz_log2_bs = file->pz_log2_bs;
 1451|      0|		zisofs->pz_uncompressed_size = file->pz_uncompressed_size;
 1452|      0|		zisofs->pz_offset = 0;
 1453|      0|		zisofs->header_avail = 0;
 1454|      0|		zisofs->header_passed = 0;
 1455|      0|		zisofs->block_pointers_avail = 0;
 1456|      0|#endif
 1457|      0|		archive_entry_set_size(entry, file->pz_uncompressed_size);
 1458|      0|	}
 1459|       |
 1460|    450|	iso9660->previous_number = file->number;
 1461|    450|	if (iso9660->seenJoliet) {
  ------------------
  |  Branch (1461:6): [True: 12, False: 438]
  ------------------
 1462|     12|		memcpy(iso9660->utf16be_previous_path, iso9660->utf16be_path,
 1463|     12|		    iso9660->utf16be_path_len);
 1464|     12|		iso9660->utf16be_previous_path_len = iso9660->utf16be_path_len;
 1465|     12|	} else
 1466|    450|		archive_strcpy(
  ------------------
  |  |  165|    438|	archive_strncpy((as), (p), ((p) == NULL ? 0 : strlen(p)))
  |  |  ------------------
  |  |  |  |  173|    876|	((as)->length=0, archive_strncat((as), (p), (l)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (173:47): [True: 0, False: 438]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1467|    450|		    &iso9660->previous_pathname, iso9660->pathname.s);
 1468|       |
 1469|       |	/* Reset entry_bytes_remaining if the file is multi extent. */
 1470|    450|	iso9660->entry_content = file->contents.first;
 1471|    450|	if (iso9660->entry_content != NULL)
  ------------------
  |  Branch (1471:6): [True: 14, False: 436]
  ------------------
 1472|     14|		iso9660->entry_bytes_remaining = iso9660->entry_content->size;
 1473|       |
 1474|    450|	if (archive_entry_filetype(entry) == AE_IFDIR) {
  ------------------
  |  |  221|    450|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (1474:6): [True: 139, False: 311]
  ------------------
 1475|       |		/* Overwrite nlinks by proper link number which is
 1476|       |		 * calculated from number of sub directories. */
 1477|    139|		archive_entry_set_nlink(entry, 2 + file->subdirs);
 1478|       |		/* Directory data has been read completely. */
 1479|    139|		iso9660->entry_bytes_remaining = 0;
 1480|    139|	}
 1481|       |
 1482|    450|	if (rd_r != ARCHIVE_OK)
  ------------------
  |  |  233|    450|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1482:6): [True: 4, False: 446]
  ------------------
 1483|      4|		return (rd_r);
 1484|    446|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    446|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1485|    450|}
archive_read_support_format_iso9660.c:choose_volume:
 1160|    192|{
 1161|    192|	struct file_info *file;
 1162|    192|	int64_t skipsize;
 1163|    192|	struct vd *vd;
 1164|    192|	const void *block;
 1165|    192|	char seenJoliet;
 1166|       |
 1167|    192|	vd = &(iso9660->primary);
 1168|    192|	if (!iso9660->opt_support_joliet)
  ------------------
  |  Branch (1168:6): [True: 0, False: 192]
  ------------------
 1169|      0|		iso9660->seenJoliet = 0;
 1170|    192|	if (iso9660->seenJoliet &&
  ------------------
  |  Branch (1170:6): [True: 14, False: 178]
  ------------------
 1171|     14|		vd->location > iso9660->joliet.location)
  ------------------
  |  Branch (1171:3): [True: 1, False: 13]
  ------------------
 1172|       |		/* This condition is unlikely; by way of caution. */
 1173|      1|		vd = &(iso9660->joliet);
 1174|       |
 1175|    192|	skipsize = LOGICAL_BLOCK_SIZE * (int64_t)vd->location;
  ------------------
  |  |   81|    192|#define	LOGICAL_BLOCK_SIZE	2048
  ------------------
 1176|    192|	skipsize = __archive_read_consume(a, skipsize);
 1177|    192|	if (skipsize < 0)
  ------------------
  |  Branch (1177:6): [True: 3, False: 189]
  ------------------
 1178|      3|		return ((int)skipsize);
 1179|    189|	iso9660->current_position = skipsize;
 1180|       |
 1181|    189|	block = __archive_read_ahead(a, vd->size, NULL);
 1182|    189|	if (block == NULL) {
  ------------------
  |  Branch (1182:6): [True: 1, False: 188]
  ------------------
 1183|      1|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1184|      1|		    "Failed to read full block when scanning "
 1185|      1|		    "ISO9660 directory list");
 1186|      1|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1187|      1|	}
 1188|       |
 1189|       |	/*
 1190|       |	 * While reading Root Directory, flag seenJoliet must be zero to
 1191|       |	 * avoid converting special name 0x00(Current Directory) and
 1192|       |	 * next byte to UCS2.
 1193|       |	 */
 1194|    188|	seenJoliet = iso9660->seenJoliet;/* Save flag. */
 1195|    188|	iso9660->seenJoliet = 0;
 1196|    188|	file = parse_file_info(a, NULL, block, vd->size);
 1197|    188|	if (file == NULL)
  ------------------
  |  Branch (1197:6): [True: 12, False: 176]
  ------------------
 1198|     12|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     12|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1199|    176|	iso9660->seenJoliet = seenJoliet;
 1200|       |
 1201|       |	/*
 1202|       |	 * If the iso image has both RockRidge and Joliet, we preferentially
 1203|       |	 * use RockRidge Extensions rather than Joliet ones.
 1204|       |	 */
 1205|    176|	if (vd == &(iso9660->primary) && iso9660->seenRockridge
  ------------------
  |  Branch (1205:6): [True: 176, False: 0]
  |  Branch (1205:35): [True: 71, False: 105]
  ------------------
 1206|     71|	    && iso9660->seenJoliet)
  ------------------
  |  Branch (1206:9): [True: 0, False: 71]
  ------------------
 1207|      0|		iso9660->seenJoliet = 0;
 1208|       |
 1209|    176|	if (vd == &(iso9660->primary) && !iso9660->seenRockridge
  ------------------
  |  Branch (1209:6): [True: 176, False: 0]
  |  Branch (1209:35): [True: 105, False: 71]
  ------------------
 1210|    105|	    && iso9660->seenJoliet) {
  ------------------
  |  Branch (1210:9): [True: 13, False: 92]
  ------------------
 1211|       |		/* Switch reading data from primary to joliet. */
 1212|     13|		vd = &(iso9660->joliet);
 1213|     13|		skipsize = LOGICAL_BLOCK_SIZE * (int64_t)vd->location;
  ------------------
  |  |   81|     13|#define	LOGICAL_BLOCK_SIZE	2048
  ------------------
 1214|     13|		skipsize -= iso9660->current_position;
 1215|     13|		skipsize = __archive_read_consume(a, skipsize);
 1216|     13|		if (skipsize < 0)
  ------------------
  |  Branch (1216:7): [True: 1, False: 12]
  ------------------
 1217|      1|			return ((int)skipsize);
 1218|     12|		iso9660->current_position += skipsize;
 1219|       |
 1220|     12|		block = __archive_read_ahead(a, vd->size, NULL);
 1221|     12|		if (block == NULL) {
  ------------------
  |  Branch (1221:7): [True: 1, False: 11]
  ------------------
 1222|      1|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1223|      1|			    "Failed to read full block when scanning "
 1224|      1|			    "ISO9660 directory list");
 1225|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1226|      1|		}
 1227|     11|		iso9660->seenJoliet = 0;
 1228|     11|		file = parse_file_info(a, NULL, block, vd->size);
 1229|     11|		if (file == NULL)
  ------------------
  |  Branch (1229:7): [True: 1, False: 10]
  ------------------
 1230|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1231|     10|		iso9660->seenJoliet = seenJoliet;
 1232|     10|	}
 1233|       |
 1234|       |	/* Store the root directory in the pending list. */
 1235|    173|	if (add_entry(a, iso9660, file) != ARCHIVE_OK)
  ------------------
  |  |  452|    173|	heap_add_entry(arch, &((iso9660)->pending_files), file, file->offset)
  ------------------
              	if (add_entry(a, iso9660, file) != ARCHIVE_OK)
  ------------------
  |  |  233|    173|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1235:6): [True: 0, False: 173]
  ------------------
 1236|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1237|    173|	if (iso9660->seenRockridge) {
  ------------------
  |  Branch (1237:6): [True: 71, False: 102]
  ------------------
 1238|     71|		a->archive.archive_format = ARCHIVE_FORMAT_ISO9660_ROCKRIDGE;
  ------------------
  |  |  373|     71|#define	ARCHIVE_FORMAT_ISO9660_ROCKRIDGE	(ARCHIVE_FORMAT_ISO9660 | 1)
  |  |  ------------------
  |  |  |  |  372|     71|#define	ARCHIVE_FORMAT_ISO9660			0x40000
  |  |  ------------------
  ------------------
 1239|     71|		a->archive.archive_format_name =
 1240|     71|		    "ISO9660 with Rockridge extensions";
 1241|     71|	}
 1242|       |
 1243|    173|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    173|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1244|    173|}
archive_read_support_format_iso9660.c:parse_file_info:
 1842|    982|{
 1843|    982|	struct iso9660 *iso9660;
 1844|    982|	struct file_info *file, *filep;
 1845|    982|	size_t name_len;
 1846|    982|	const unsigned char *rr_start, *rr_end;
 1847|    982|	const unsigned char *p;
 1848|    982|	size_t dr_len = 0;
 1849|    982|	uint64_t fsize, offset;
 1850|    982|	int32_t location;
 1851|    982|	int flags;
 1852|       |
 1853|    982|	iso9660 = (struct iso9660 *)(a->format->data);
 1854|       |
 1855|    982|	if (reclen != 0)
  ------------------
  |  Branch (1855:6): [True: 981, False: 1]
  ------------------
 1856|    981|		dr_len = (size_t)isodirrec[DR_length_offset];
  ------------------
  |  |  195|    981|#define DR_length_offset 0
  ------------------
 1857|       |	/*
 1858|       |	 * Sanity check that reclen is not zero and dr_len is greater than
 1859|       |	 * reclen but at least 34
 1860|       |	 */
 1861|    982|	if (reclen == 0 || reclen < dr_len || dr_len < 34) {
  ------------------
  |  Branch (1861:6): [True: 1, False: 981]
  |  Branch (1861:21): [True: 0, False: 981]
  |  Branch (1861:40): [True: 9, False: 972]
  ------------------
 1862|     10|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     10|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1863|     10|			"Invalid length of directory record");
 1864|     10|		return (NULL);
 1865|     10|	}
 1866|    972|	name_len = (size_t)isodirrec[DR_name_len_offset];
  ------------------
  |  |  213|    972|#define DR_name_len_offset 32
  ------------------
 1867|    972|	location = archive_le32dec(isodirrec + DR_extent_offset);
  ------------------
  |  |  199|    972|#define DR_extent_offset 2
  ------------------
 1868|    972|	fsize = toi(isodirrec + DR_size_offset, DR_size_size);
  ------------------
  |  |  201|    972|#define DR_size_offset 10
  ------------------
              	fsize = toi(isodirrec + DR_size_offset, DR_size_size);
  ------------------
  |  |  202|    972|#define DR_size_size 4
  ------------------
 1869|       |	/* Sanity check that name_len doesn't exceed dr_len. */
 1870|    972|	if (dr_len - 33 < name_len || name_len == 0) {
  ------------------
  |  Branch (1870:6): [True: 4, False: 968]
  |  Branch (1870:32): [True: 3, False: 965]
  ------------------
 1871|      7|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      7|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1872|      7|		    "Invalid length of file identifier");
 1873|      7|		return (NULL);
 1874|      7|	}
 1875|       |	/* Sanity check that location doesn't exceed volume block.
 1876|       |	 * Don't check lower limit of location; it's possibility
 1877|       |	 * the location has negative value when file type is symbolic
 1878|       |	 * link or file size is zero. As far as I know latest mkisofs
 1879|       |	 * do that.
 1880|       |	 */
 1881|    965|	if (location > 0 &&
  ------------------
  |  Branch (1881:6): [True: 436, False: 529]
  ------------------
 1882|    436|	    (location + ((fsize + iso9660->logical_block_size -1)
  ------------------
  |  Branch (1882:6): [True: 5, False: 431]
  ------------------
 1883|    436|	       / iso9660->logical_block_size))
 1884|    436|			> (uint32_t)iso9660->volume_block) {
 1885|      5|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      5|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1886|      5|		    "Invalid location of extent of file");
 1887|      5|		return (NULL);
 1888|      5|	}
 1889|       |	/* Sanity check that location doesn't have a negative value
 1890|       |	 * when the file is not empty. it's too large. */
 1891|    960|	if (fsize != 0 && location < 0) {
  ------------------
  |  Branch (1891:6): [True: 576, False: 384]
  |  Branch (1891:20): [True: 2, False: 574]
  ------------------
 1892|      2|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      2|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1893|      2|		    "Invalid location of extent of file");
 1894|      2|		return (NULL);
 1895|      2|	}
 1896|       |
 1897|       |	/* Sanity check that this entry does not create a cycle. */
 1898|    958|	offset = iso9660->logical_block_size * (uint64_t)location;
 1899|  1.91k|	for (filep = parent; filep != NULL; filep = filep->parent) {
  ------------------
  |  Branch (1899:23): [True: 957, False: 954]
  ------------------
 1900|    957|		if (filep->offset == offset) {
  ------------------
  |  Branch (1900:7): [True: 4, False: 953]
  ------------------
 1901|      4|			archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      4|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1902|      4|			    "Directory structure contains loop");
 1903|      4|			return (NULL);
 1904|      4|		}
 1905|    957|	}
 1906|       |
 1907|       |	/* Create a new file entry and copy data from the ISO dir record. */
 1908|    954|	file = calloc(1, sizeof(*file));
 1909|    954|	if (file == NULL) {
  ------------------
  |  Branch (1909:6): [True: 0, False: 954]
  ------------------
 1910|      0|		archive_set_error(&a->archive, ENOMEM,
 1911|      0|		    "No memory for file entry");
 1912|      0|		return (NULL);
 1913|      0|	}
 1914|    954|	file->parent = parent;
 1915|    954|	file->offset = offset;
 1916|    954|	file->size = fsize;
 1917|    954|	if (isodate7_valid(isodirrec + DR_date_offset)) {
  ------------------
  |  |  203|    954|#define DR_date_offset 18
  ------------------
  |  Branch (1917:6): [True: 347, False: 607]
  ------------------
 1918|    347|		file->time_is_set |= MTIME_IS_SET | ATIME_IS_SET | CTIME_IS_SET;
  ------------------
  |  |  310|    347|#define MTIME_IS_SET 2
  ------------------
              		file->time_is_set |= MTIME_IS_SET | ATIME_IS_SET | CTIME_IS_SET;
  ------------------
  |  |  311|    347|#define ATIME_IS_SET 4
  ------------------
              		file->time_is_set |= MTIME_IS_SET | ATIME_IS_SET | CTIME_IS_SET;
  ------------------
  |  |  312|    347|#define CTIME_IS_SET 8
  ------------------
 1919|    347|		file->mtime = isodate7(isodirrec + DR_date_offset);
  ------------------
  |  |  203|    347|#define DR_date_offset 18
  ------------------
 1920|    347|		file->ctime = file->atime = file->mtime;
 1921|    347|	}
 1922|    954|	file->rede_files.first = NULL;
 1923|    954|	file->rede_files.last = &(file->rede_files.first);
 1924|       |
 1925|    954|	p = isodirrec + DR_name_offset;
  ------------------
  |  |  215|    954|#define DR_name_offset 33
  ------------------
 1926|       |	/* Rockridge extensions (if any) follow name.  Compute this
 1927|       |	 * before fidgeting the name_len below. */
 1928|    954|	rr_start = p + name_len + (name_len & 1 ? 0 : 1);
  ------------------
  |  Branch (1928:29): [True: 248, False: 706]
  ------------------
 1929|    954|	rr_end = isodirrec + dr_len;
 1930|       |
 1931|    954|	if (iso9660->seenJoliet) {
  ------------------
  |  Branch (1931:6): [True: 18, False: 936]
  ------------------
 1932|       |		/* Joliet names are max 64 chars (128 bytes) according to spec,
 1933|       |		 * but genisoimage/mkisofs allows recording longer Joliet
 1934|       |		 * names which are 103 UCS2 characters(206 bytes) by their
 1935|       |		 * option '-joliet-long'.
 1936|       |		 */
 1937|     18|		if (name_len > 206)
  ------------------
  |  Branch (1937:7): [True: 0, False: 18]
  ------------------
 1938|      0|			name_len = 206;
 1939|     18|		name_len &= ~1;
 1940|       |
 1941|       |		/* trim trailing first version and dot from filename.
 1942|       |		 *
 1943|       |		 * Remember we were in UTF-16BE land!
 1944|       |		 * SEPARATOR 1 (.) and SEPARATOR 2 (;) are both
 1945|       |		 * 16 bits big endian characters on Joliet.
 1946|       |		 *
 1947|       |		 * TODO: sanitize filename?
 1948|       |		 *       Joliet allows any UCS-2 char except:
 1949|       |		 *       *, /, :, ;, ? and \.
 1950|       |		 */
 1951|       |		/* Chop off trailing ';1' from files. */
 1952|     18|		if (name_len > 4 && p[name_len-4] == 0 && p[name_len-3] == ';'
  ------------------
  |  Branch (1952:7): [True: 17, False: 1]
  |  Branch (1952:23): [True: 8, False: 9]
  |  Branch (1952:45): [True: 1, False: 7]
  ------------------
 1953|      1|		    && p[name_len-2] == 0 && p[name_len-1] == '1')
  ------------------
  |  Branch (1953:10): [True: 1, False: 0]
  |  Branch (1953:32): [True: 0, False: 1]
  ------------------
 1954|      0|			name_len -= 4;
 1955|       |#if 0 /* XXX: this somehow manages to strip of single-character file extensions, like '.c'. */
 1956|       |		/* Chop off trailing '.' from filenames. */
 1957|       |		if (name_len > 2 && p[name_len-2] == 0 && p[name_len-1] == '.')
 1958|       |			name_len -= 2;
 1959|       |#endif
 1960|     18|		if ((file->utf16be_name = malloc(name_len)) == NULL) {
  ------------------
  |  Branch (1960:7): [True: 0, False: 18]
  ------------------
 1961|      0|			archive_set_error(&a->archive, ENOMEM,
 1962|      0|			    "No memory for file name");
 1963|      0|			goto fail;
 1964|      0|		}
 1965|     18|		memcpy(file->utf16be_name, p, name_len);
 1966|     18|		file->utf16be_bytes = name_len;
 1967|    936|	} else {
 1968|       |		/* Chop off trailing ';1' from files. */
 1969|    936|		if (name_len > 2 && p[name_len - 2] == ';' &&
  ------------------
  |  Branch (1969:7): [True: 752, False: 184]
  |  Branch (1969:23): [True: 348, False: 404]
  ------------------
 1970|    348|				p[name_len - 1] == '1')
  ------------------
  |  Branch (1970:5): [True: 316, False: 32]
  ------------------
 1971|    316|			name_len -= 2;
 1972|       |		/* Chop off trailing '.' from filenames. */
 1973|    936|		if (name_len > 1 && p[name_len - 1] == '.')
  ------------------
  |  Branch (1973:7): [True: 752, False: 184]
  |  Branch (1973:23): [True: 9, False: 743]
  ------------------
 1974|      9|			--name_len;
 1975|       |
 1976|    936|		archive_strncpy(&file->name, (const char *)p, name_len);
  ------------------
  |  |  173|    936|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 1977|    936|	}
 1978|       |
 1979|    954|	flags = isodirrec[DR_flags_offset];
  ------------------
  |  |  205|    954|#define DR_flags_offset 25
  ------------------
 1980|    954|	if (flags & 0x02)
  ------------------
  |  Branch (1980:6): [True: 380, False: 574]
  ------------------
 1981|    380|		file->mode = AE_IFDIR | 0700;
  ------------------
  |  |  221|    380|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 1982|    574|	else
 1983|    574|		file->mode = AE_IFREG | 0400;
  ------------------
  |  |  216|    574|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1984|    954|	if (flags & 0x80)
  ------------------
  |  Branch (1984:6): [True: 91, False: 863]
  ------------------
 1985|     91|		file->multi_extent = 1;
 1986|    863|	else
 1987|    863|		file->multi_extent = 0;
 1988|       |	/*
 1989|       |	 * Use a location for the file number, which is treated as an inode
 1990|       |	 * number to find out hardlink target. If Rockridge extensions is
 1991|       |	 * being used, the file number will be overwritten by FILE SERIAL
 1992|       |	 * NUMBER of RRIP "PX" extension.
 1993|       |	 * Note: Old mkisofs did not record that FILE SERIAL NUMBER
 1994|       |	 * in ISO images.
 1995|       |	 * Note2: xorriso set 0 to the location of a symlink file.
 1996|       |	 */
 1997|    954|	if (file->size == 0 && location >= 0) {
  ------------------
  |  Branch (1997:6): [True: 384, False: 570]
  |  Branch (1997:25): [True: 240, False: 144]
  ------------------
 1998|       |		/* If file->size is zero, its location points wrong place,
 1999|       |		 * and so we should not use it for the file number.
 2000|       |		 * When the location has negative value, it can be used
 2001|       |		 * for the file number.
 2002|       |		 */
 2003|    240|		file->number = -1;
 2004|       |		/* Do not appear before any directory entries. */
 2005|    240|		file->offset = -1;
 2006|    240|	} else
 2007|    714|		file->number = (int64_t)(uint32_t)location;
 2008|       |
 2009|       |	/* Rockridge extensions overwrite information from above. */
 2010|    954|	if (iso9660->opt_support_rockridge) {
  ------------------
  |  Branch (2010:6): [True: 178, False: 776]
  ------------------
 2011|    178|		if (parent == NULL && rr_end - rr_start >= 7) {
  ------------------
  |  Branch (2011:7): [True: 178, False: 0]
  |  Branch (2011:25): [True: 93, False: 85]
  ------------------
 2012|     93|			p = rr_start;
 2013|     93|			if (memcmp(p, "SP\x07\x01\xbe\xef", 6) == 0) {
  ------------------
  |  Branch (2013:8): [True: 87, False: 6]
  ------------------
 2014|       |				/*
 2015|       |				 * SP extension stores the suspOffset
 2016|       |				 * (Number of bytes to skip between
 2017|       |				 * filename and SUSP records.)
 2018|       |				 * It is mandatory by the SUSP standard
 2019|       |				 * (IEEE 1281).
 2020|       |				 *
 2021|       |				 * It allows SUSP to coexist with
 2022|       |				 * non-SUSP uses of the System
 2023|       |				 * Use Area by placing non-SUSP data
 2024|       |				 * before SUSP data.
 2025|       |				 *
 2026|       |				 * SP extension must be in the root
 2027|       |				 * directory entry, disable all SUSP
 2028|       |				 * processing if not found.
 2029|       |				 */
 2030|     87|				iso9660->suspOffset = p[6];
 2031|     87|				iso9660->seenSUSP = 1;
 2032|     87|				rr_start += 7;
 2033|     87|			}
 2034|     93|		}
 2035|    178|		if (iso9660->seenSUSP) {
  ------------------
  |  Branch (2035:7): [True: 87, False: 91]
  ------------------
 2036|     87|			int r;
 2037|       |
 2038|     87|			file->name_continues = 0;
 2039|     87|			file->symlink_continues = 0;
 2040|     87|			rr_start += iso9660->suspOffset;
 2041|     87|			r = parse_rockridge(a, file, rr_start, rr_end);
 2042|     87|			if (r != ARCHIVE_OK)
  ------------------
  |  |  233|     87|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2042:8): [True: 1, False: 86]
  ------------------
 2043|      1|				goto fail;
 2044|       |			/*
 2045|       |			 * A file size of symbolic link files in ISO images
 2046|       |			 * made by makefs is not zero and its location is
 2047|       |			 * the same as those of next regular file. That is
 2048|       |			 * the same as hard like file and it causes unexpected
 2049|       |			 * error.
 2050|       |			 */
 2051|     86|			if (file->size > 0 &&
  ------------------
  |  Branch (2051:8): [True: 3, False: 83]
  ------------------
 2052|      3|			    (file->mode & AE_IFMT) == AE_IFLNK) {
  ------------------
  |  |  215|      3|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              			    (file->mode & AE_IFMT) == AE_IFLNK) {
  ------------------
  |  |  217|      3|#define AE_IFLNK	((__LA_MODE_T)0120000)
  ------------------
  |  Branch (2052:8): [True: 0, False: 3]
  ------------------
 2053|      0|				file->size = 0;
 2054|      0|				file->number = -1;
 2055|      0|				file->offset = -1;
 2056|      0|			}
 2057|     86|		} else
 2058|       |			/* If there isn't SUSP, disable parsing
 2059|       |			 * rock ridge extensions. */
 2060|     91|			iso9660->opt_support_rockridge = 0;
 2061|    178|	}
 2062|       |
 2063|    953|	file->nlinks = 1;/* Reset nlink. we'll calculate it later. */
 2064|       |	/* Tell file's parent how many children that parent has. */
 2065|    953|	if (parent != NULL && (flags & 0x02))
  ------------------
  |  Branch (2065:6): [True: 766, False: 187]
  |  Branch (2065:24): [True: 284, False: 482]
  ------------------
 2066|    284|		parent->subdirs++;
 2067|       |
 2068|    953|	if (iso9660->seenRockridge) {
  ------------------
  |  Branch (2068:6): [True: 72, False: 881]
  ------------------
 2069|     72|		if (parent != NULL && parent->parent == NULL &&
  ------------------
  |  Branch (2069:7): [True: 0, False: 72]
  |  Branch (2069:25): [True: 0, False: 0]
  ------------------
 2070|      0|		    (flags & 0x02) && iso9660->rr_moved == NULL &&
  ------------------
  |  Branch (2070:7): [True: 0, False: 0]
  |  Branch (2070:25): [True: 0, False: 0]
  ------------------
 2071|      0|		    file->name.s &&
  ------------------
  |  Branch (2071:7): [True: 0, False: 0]
  ------------------
 2072|      0|		    (strcmp(file->name.s, "rr_moved") == 0 ||
  ------------------
  |  Branch (2072:8): [True: 0, False: 0]
  ------------------
 2073|      0|		     strcmp(file->name.s, ".rr_moved") == 0)) {
  ------------------
  |  Branch (2073:8): [True: 0, False: 0]
  ------------------
 2074|      0|			iso9660->rr_moved = file;
 2075|      0|			file->rr_moved = 1;
 2076|      0|			file->rr_moved_has_re_only = 1;
 2077|      0|			file->re = 0;
 2078|      0|			parent->subdirs--;
 2079|     72|		} else if (file->re) {
  ------------------
  |  Branch (2079:14): [True: 1, False: 71]
  ------------------
 2080|       |			/*
 2081|       |			 * Sanity check: file's parent is rr_moved.
 2082|       |			 */
 2083|      1|			if (parent == NULL || parent->rr_moved == 0) {
  ------------------
  |  Branch (2083:8): [True: 1, False: 0]
  |  Branch (2083:26): [True: 0, False: 0]
  ------------------
 2084|      1|				archive_set_error(&a->archive,
 2085|      1|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2086|      1|				    "Invalid Rockridge RE");
 2087|      1|				goto fail;
 2088|      1|			}
 2089|       |			/*
 2090|       |			 * Sanity check: file does not have "CL" extension.
 2091|       |			 */
 2092|      0|			if (file->cl_offset) {
  ------------------
  |  Branch (2092:8): [True: 0, False: 0]
  ------------------
 2093|      0|				archive_set_error(&a->archive,
 2094|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2095|      0|				    "Invalid Rockridge RE and CL");
 2096|      0|				goto fail;
 2097|      0|			}
 2098|       |			/*
 2099|       |			 * Sanity check: The file type must be a directory.
 2100|       |			 */
 2101|      0|			if ((flags & 0x02) == 0) {
  ------------------
  |  Branch (2101:8): [True: 0, False: 0]
  ------------------
 2102|      0|				archive_set_error(&a->archive,
 2103|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2104|      0|				    "Invalid Rockridge RE");
 2105|      0|				goto fail;
 2106|      0|			}
 2107|     71|		} else if (parent != NULL && parent->rr_moved)
  ------------------
  |  Branch (2107:14): [True: 0, False: 71]
  |  Branch (2107:32): [True: 0, False: 0]
  ------------------
 2108|      0|			file->rr_moved_has_re_only = 0;
 2109|     71|		else if (parent != NULL && (flags & 0x02) &&
  ------------------
  |  Branch (2109:12): [True: 0, False: 71]
  |  Branch (2109:30): [True: 0, False: 0]
  ------------------
 2110|      0|		    (parent->re || parent->re_descendant))
  ------------------
  |  Branch (2110:8): [True: 0, False: 0]
  |  Branch (2110:22): [True: 0, False: 0]
  ------------------
 2111|      0|			file->re_descendant = 1;
 2112|     71|		if (file->cl_offset) {
  ------------------
  |  Branch (2112:7): [True: 0, False: 71]
  ------------------
 2113|      0|			struct file_info *r;
 2114|       |
 2115|      0|			if (parent == NULL || parent->parent == NULL) {
  ------------------
  |  Branch (2115:8): [True: 0, False: 0]
  |  Branch (2115:26): [True: 0, False: 0]
  ------------------
 2116|      0|				archive_set_error(&a->archive,
 2117|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2118|      0|				    "Invalid Rockridge CL");
 2119|      0|				goto fail;
 2120|      0|			}
 2121|       |			/*
 2122|       |			 * Sanity check: The file type must be a regular file.
 2123|       |			 */
 2124|      0|			if ((flags & 0x02) != 0) {
  ------------------
  |  Branch (2124:8): [True: 0, False: 0]
  ------------------
 2125|      0|				archive_set_error(&a->archive,
 2126|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2127|      0|				    "Invalid Rockridge CL");
 2128|      0|				goto fail;
 2129|      0|			}
 2130|      0|			parent->subdirs++;
 2131|       |			/* Overwrite an offset and a number of this "CL" entry
 2132|       |			 * to appear before other dirs. "+1" to those is to
 2133|       |			 * make sure to appear after "RE" entry which this
 2134|       |			 * "CL" entry should be connected with. */
 2135|      0|			file->offset = file->number = file->cl_offset + 1;
 2136|       |
 2137|       |			/*
 2138|       |			 * Sanity check: cl_offset does not point at its
 2139|       |			 * the parents or itself.
 2140|       |			 */
 2141|      0|			for (r = parent; r; r = r->parent) {
  ------------------
  |  Branch (2141:21): [True: 0, False: 0]
  ------------------
 2142|      0|				if (r->offset == file->cl_offset) {
  ------------------
  |  Branch (2142:9): [True: 0, False: 0]
  ------------------
 2143|      0|					archive_set_error(&a->archive,
 2144|      0|					    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2145|      0|					    "Invalid Rockridge CL");
 2146|      0|					goto fail;
 2147|      0|				}
 2148|      0|			}
 2149|      0|			if (file->cl_offset == file->offset ||
  ------------------
  |  Branch (2149:8): [True: 0, False: 0]
  ------------------
 2150|      0|			    parent->rr_moved) {
  ------------------
  |  Branch (2150:8): [True: 0, False: 0]
  ------------------
 2151|      0|				archive_set_error(&a->archive,
 2152|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2153|      0|				    "Invalid Rockridge CL");
 2154|      0|				goto fail;
 2155|      0|			}
 2156|      0|		}
 2157|     71|	}
 2158|       |
 2159|       |#if DEBUG
 2160|       |	/* DEBUGGING: Warn about attributes I don't yet fully support. */
 2161|       |	if ((flags & ~0x02) != 0) {
 2162|       |		fprintf(stderr, "\n ** Unrecognized flag: ");
 2163|       |		dump_isodirrec(stderr, isodirrec);
 2164|       |		fprintf(stderr, "\n");
 2165|       |	} else if (toi(isodirrec + DR_volume_sequence_number_offset, 2) != 1) {
 2166|       |		fprintf(stderr, "\n ** Unrecognized sequence number: ");
 2167|       |		dump_isodirrec(stderr, isodirrec);
 2168|       |		fprintf(stderr, "\n");
 2169|       |	} else if (*(isodirrec + DR_file_unit_size_offset) != 0) {
 2170|       |		fprintf(stderr, "\n ** Unexpected file unit size: ");
 2171|       |		dump_isodirrec(stderr, isodirrec);
 2172|       |		fprintf(stderr, "\n");
 2173|       |	} else if (*(isodirrec + DR_interleave_offset) != 0) {
 2174|       |		fprintf(stderr, "\n ** Unexpected interleave: ");
 2175|       |		dump_isodirrec(stderr, isodirrec);
 2176|       |		fprintf(stderr, "\n");
 2177|       |	} else if (*(isodirrec + DR_ext_attr_length_offset) != 0) {
 2178|       |		fprintf(stderr, "\n ** Unexpected extended attribute length: ");
 2179|       |		dump_isodirrec(stderr, isodirrec);
 2180|       |		fprintf(stderr, "\n");
 2181|       |	}
 2182|       |#endif
 2183|    952|	register_file(iso9660, file);
 2184|    952|	return (file);
 2185|      2|fail:
 2186|      2|	archive_string_free(&file->name);
 2187|      2|	free(file);
 2188|       |	return (NULL);
 2189|    953|}
archive_read_support_format_iso9660.c:toi:
 3243|  3.88k|{
 3244|  3.88k|	const unsigned char *v = (const unsigned char *)p;
 3245|  3.88k|	if (n > 1)
  ------------------
  |  Branch (3245:6): [True: 2.91k, False: 972]
  ------------------
 3246|  2.91k|		return v[0] + 256 * toi(v + 1, n - 1);
 3247|    972|	if (n == 1)
  ------------------
  |  Branch (3247:6): [True: 972, False: 0]
  ------------------
 3248|    972|		return v[0];
 3249|      0|	return (0);
 3250|    972|}
archive_read_support_format_iso9660.c:isodate7_valid:
 3280|  1.00k|{
 3281|  1.00k|	int year = v[0];
 3282|  1.00k|	int month = v[1];
 3283|  1.00k|	int day = v[2];
 3284|  1.00k|	int hour = v[3];
 3285|  1.00k|	int minute = v[4];
 3286|  1.00k|	int second = v[5];
 3287|  1.00k|	int gmt_off = (signed char)v[6];
 3288|       |
 3289|       |	/* ECMA-119 9.1.5 "If all seven values are zero, it shall mean
 3290|       |	 * that the date is unspecified" */
 3291|  1.00k|	if (year == 0
  ------------------
  |  Branch (3291:6): [True: 423, False: 583]
  ------------------
 3292|    423|	    && month == 0
  ------------------
  |  Branch (3292:9): [True: 381, False: 42]
  ------------------
 3293|    381|	    && day == 0
  ------------------
  |  Branch (3293:9): [True: 369, False: 12]
  ------------------
 3294|    369|	    && hour == 0
  ------------------
  |  Branch (3294:9): [True: 363, False: 6]
  ------------------
 3295|    363|	    && minute == 0
  ------------------
  |  Branch (3295:9): [True: 355, False: 8]
  ------------------
 3296|    355|	    && second == 0
  ------------------
  |  Branch (3296:9): [True: 338, False: 17]
  ------------------
 3297|    338|	    && gmt_off == 0)
  ------------------
  |  Branch (3297:9): [True: 283, False: 55]
  ------------------
 3298|    283|		return 0;
 3299|       |	/*
 3300|       |	 * Sanity-test each individual field
 3301|       |	 */
 3302|       |	/* Year can have any value */
 3303|       |	/* Month must be 1-12 */
 3304|    723|	if (month < 1 || month > 12)
  ------------------
  |  Branch (3304:6): [True: 103, False: 620]
  |  Branch (3304:19): [True: 82, False: 538]
  ------------------
 3305|    185|		return 0;
 3306|       |	/* Day must be 1-31 */
 3307|    538|	if (day < 1 || day > 31)
  ------------------
  |  Branch (3307:6): [True: 66, False: 472]
  |  Branch (3307:17): [True: 50, False: 422]
  ------------------
 3308|    116|		return 0;
 3309|       |	/* Hour must be 0-23 */
 3310|    422|	if (hour > 23)
  ------------------
  |  Branch (3310:6): [True: 22, False: 400]
  ------------------
 3311|     22|		return 0;
 3312|       |	/* Minute must be 0-59 */
 3313|    400|	if (minute > 59)
  ------------------
  |  Branch (3313:6): [True: 17, False: 383]
  ------------------
 3314|     17|		return 0;
 3315|       |	/* second must be 0-59 according to ECMA-119 9.1.5 */
 3316|       |	/* BUT: we should probably allow for the time being in UTC, which
 3317|       |	   allows up to 61 seconds in a minute in certain cases */
 3318|    383|	if (second > 61)
  ------------------
  |  Branch (3318:6): [True: 13, False: 370]
  ------------------
 3319|     13|		return 0;
 3320|       |	/* Offset from GMT must be -48 to +52 */
 3321|    370|	if (gmt_off < -48 || gmt_off > +52)
  ------------------
  |  Branch (3321:6): [True: 4, False: 366]
  |  Branch (3321:23): [True: 9, False: 357]
  ------------------
 3322|     13|		return 0;
 3323|       |
 3324|       |	/* All tests pass, this is OK */
 3325|    357|	return 1;
 3326|    370|}
archive_read_support_format_iso9660.c:isodate7:
 3330|    357|{
 3331|    357|	struct tm tm;
 3332|    357|	int offset;
 3333|    357|	time_t t;
 3334|       |
 3335|    357|	memset(&tm, 0, sizeof(tm));
 3336|    357|	tm.tm_year = v[0];
 3337|    357|	tm.tm_mon = v[1] - 1;
 3338|    357|	tm.tm_mday = v[2];
 3339|    357|	tm.tm_hour = v[3];
 3340|    357|	tm.tm_min = v[4];
 3341|    357|	tm.tm_sec = v[5];
 3342|       |	/* v[6] is the signed timezone offset, in 1/4-hour increments. */
 3343|    357|	offset = ((const signed char *)v)[6];
 3344|    357|	if (offset > -48 && offset < 52) {
  ------------------
  |  Branch (3344:6): [True: 353, False: 4]
  |  Branch (3344:22): [True: 348, False: 5]
  ------------------
 3345|    348|		tm.tm_hour -= offset / 4;
 3346|    348|		tm.tm_min -= (offset % 4) * 15;
 3347|    348|	}
 3348|    357|	t = time_from_tm(&tm);
 3349|    357|	if (t == (time_t)-1)
  ------------------
  |  Branch (3349:6): [True: 0, False: 357]
  ------------------
 3350|      0|		return ((time_t)0);
 3351|    357|	return (t);
 3352|    357|}
archive_read_support_format_iso9660.c:time_from_tm:
 3445|    364|{
 3446|       |#if HAVE__MKGMTIME
 3447|       |        return _mkgmtime(t);
 3448|       |#elif HAVE_TIMEGM
 3449|       |        /* Use platform timegm() if available. */
 3450|    364|        return (timegm(t));
 3451|       |#else
 3452|       |        /* Else use direct calculation using POSIX assumptions. */
 3453|       |        /* First, fix up tm_yday based on the year/month/day. */
 3454|       |        if (mktime(t) == (time_t)-1)
 3455|       |                return ((time_t)-1);
 3456|       |        /* Then we can compute timegm() from first principles. */
 3457|       |        return (t->tm_sec
 3458|       |            + t->tm_min * 60
 3459|       |            + t->tm_hour * 3600
 3460|       |            + t->tm_yday * 86400
 3461|       |            + (t->tm_year - 70) * 31536000
 3462|       |            + ((t->tm_year - 69) / 4) * 86400
 3463|       |            - ((t->tm_year - 1) / 100) * 86400
 3464|       |            + ((t->tm_year + 299) / 400) * 86400);
 3465|       |#endif
 3466|    364|}
archive_read_support_format_iso9660.c:parse_rockridge:
 2194|     87|{
 2195|     87|	struct iso9660 *iso9660;
 2196|     87|	int entry_seen = 0;
 2197|       |
 2198|     87|	iso9660 = (struct iso9660 *)(a->format->data);
 2199|       |
 2200|    206|	while (p + 4 <= end  /* Enough space for another entry. */
  ------------------
  |  Branch (2200:9): [True: 196, False: 10]
  ------------------
 2201|    196|	    && p[0] >= 'A' && p[0] <= 'Z' /* Sanity-check 1st char of name. */
  ------------------
  |  Branch (2201:9): [True: 143, False: 53]
  |  Branch (2201:24): [True: 124, False: 19]
  ------------------
 2202|    124|	    && p[1] >= 'A' && p[1] <= 'Z' /* Sanity-check 2nd char of name. */
  ------------------
  |  Branch (2202:9): [True: 123, False: 1]
  |  Branch (2202:24): [True: 120, False: 3]
  ------------------
 2203|    120|	    && p[2] >= 4 /* Sanity-check length. */
  ------------------
  |  Branch (2203:9): [True: 120, False: 0]
  ------------------
 2204|    120|	    && p + p[2] <= end) { /* Sanity-check length. */
  ------------------
  |  Branch (2204:9): [True: 120, False: 0]
  ------------------
 2205|    120|		const unsigned char *data = p + 4;
 2206|    120|		int data_length = p[2] - 4;
 2207|    120|		int version = p[3];
 2208|       |
 2209|    120|		switch(p[0]) {
 2210|      3|		case 'C':
  ------------------
  |  Branch (2210:3): [True: 3, False: 117]
  ------------------
 2211|      3|			if (p[1] == 'E') {
  ------------------
  |  Branch (2211:8): [True: 1, False: 2]
  ------------------
 2212|      1|				if (version == 1 && data_length == 24) {
  ------------------
  |  Branch (2212:9): [True: 0, False: 1]
  |  Branch (2212:25): [True: 0, False: 0]
  ------------------
 2213|       |					/*
 2214|       |					 * CE extension comprises:
 2215|       |					 *   8 byte sector containing extension
 2216|       |					 *   8 byte offset w/in above sector
 2217|       |					 *   8 byte length of continuation
 2218|       |					 */
 2219|      0|					int32_t location =
 2220|      0|					    archive_le32dec(data);
 2221|      0|					file->ce_offset =
 2222|      0|					    archive_le32dec(data+8);
 2223|      0|					file->ce_size =
 2224|      0|					    archive_le32dec(data+16);
 2225|      0|					if (register_CE(a, location, file)
  ------------------
  |  Branch (2225:10): [True: 0, False: 0]
  ------------------
 2226|      0|					    != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2227|      0|						return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2228|      0|				}
 2229|      1|			}
 2230|      2|			else if (p[1] == 'L') {
  ------------------
  |  Branch (2230:13): [True: 1, False: 1]
  ------------------
 2231|      1|				if (version == 1 && data_length == 8) {
  ------------------
  |  Branch (2231:9): [True: 0, False: 1]
  |  Branch (2231:25): [True: 0, False: 0]
  ------------------
 2232|      0|					file->cl_offset = (uint64_t)
 2233|      0|					    iso9660->logical_block_size *
 2234|      0|					    (uint64_t)archive_le32dec(data);
 2235|      0|					iso9660->seenRockridge = 1;
 2236|      0|				}
 2237|      1|			}
 2238|      3|			break;
 2239|      3|		case 'N':
  ------------------
  |  Branch (2239:3): [True: 1, False: 119]
  ------------------
 2240|      1|			if (p[1] == 'M') {
  ------------------
  |  Branch (2240:8): [True: 0, False: 1]
  ------------------
 2241|      0|				if (version == 1) {
  ------------------
  |  Branch (2241:9): [True: 0, False: 0]
  ------------------
 2242|      0|					parse_rockridge_NM1(file,
 2243|      0|					    data, data_length);
 2244|      0|					iso9660->seenRockridge = 1;
 2245|      0|				}
 2246|      0|			}
 2247|      1|			break;
 2248|      5|		case 'P':
  ------------------
  |  Branch (2248:3): [True: 5, False: 115]
  ------------------
 2249|       |			/*
 2250|       |			 * PD extension is padding;
 2251|       |			 * contents are always ignored.
 2252|       |			 *
 2253|       |			 * PL extension won't appear;
 2254|       |			 * contents are always ignored.
 2255|       |			 */
 2256|      5|			if (p[1] == 'N') {
  ------------------
  |  Branch (2256:8): [True: 2, False: 3]
  ------------------
 2257|      2|				if (version == 1 && data_length == 16) {
  ------------------
  |  Branch (2257:9): [True: 0, False: 2]
  |  Branch (2257:25): [True: 0, False: 0]
  ------------------
 2258|      0|					file->rdev = toi(data,4);
 2259|      0|					file->rdev <<= 32;
 2260|      0|					file->rdev |= toi(data + 8, 4);
 2261|      0|					iso9660->seenRockridge = 1;
 2262|      0|				}
 2263|      2|			}
 2264|      3|			else if (p[1] == 'X') {
  ------------------
  |  Branch (2264:13): [True: 1, False: 2]
  ------------------
 2265|       |				/*
 2266|       |				 * PX extension comprises:
 2267|       |				 *   8 bytes for mode,
 2268|       |				 *   8 bytes for nlinks,
 2269|       |				 *   8 bytes for uid,
 2270|       |				 *   8 bytes for gid,
 2271|       |				 *   8 bytes for inode.
 2272|       |				 */
 2273|      1|				if (version == 1) {
  ------------------
  |  Branch (2273:9): [True: 0, False: 1]
  ------------------
 2274|      0|					if (data_length >= 8)
  ------------------
  |  Branch (2274:10): [True: 0, False: 0]
  ------------------
 2275|      0|						file->mode
 2276|      0|						    = (__LA_MODE_T)toi(data, 4);
 2277|      0|					if (data_length >= 16)
  ------------------
  |  Branch (2277:10): [True: 0, False: 0]
  ------------------
 2278|      0|						file->nlinks
 2279|      0|						    = toi(data + 8, 4);
 2280|      0|					if (data_length >= 24)
  ------------------
  |  Branch (2280:10): [True: 0, False: 0]
  ------------------
 2281|      0|						file->uid
 2282|      0|						    = toi(data + 16, 4);
 2283|      0|					if (data_length >= 32)
  ------------------
  |  Branch (2283:10): [True: 0, False: 0]
  ------------------
 2284|      0|						file->gid
 2285|      0|						    = toi(data + 24, 4);
 2286|      0|					if (data_length >= 40)
  ------------------
  |  Branch (2286:10): [True: 0, False: 0]
  ------------------
 2287|      0|						file->number
 2288|      0|						    = toi(data + 32, 4);
 2289|      0|					iso9660->seenRockridge = 1;
 2290|      0|				}
 2291|      1|			}
 2292|      5|			break;
 2293|      4|		case 'R':
  ------------------
  |  Branch (2293:3): [True: 4, False: 116]
  ------------------
 2294|      4|			if (p[1] == 'E' && version == 1) {
  ------------------
  |  Branch (2294:8): [True: 1, False: 3]
  |  Branch (2294:23): [True: 1, False: 0]
  ------------------
 2295|      1|				file->re = 1;
 2296|      1|				iso9660->seenRockridge = 1;
 2297|      1|			}
 2298|      3|			else if (p[1] == 'R' && version == 1) {
  ------------------
  |  Branch (2298:13): [True: 0, False: 3]
  |  Branch (2298:28): [True: 0, False: 0]
  ------------------
 2299|       |				/*
 2300|       |				 * RR extension comprises:
 2301|       |				 *    one byte flag value
 2302|       |				 * This extension is obsolete,
 2303|       |				 * so contents are always ignored.
 2304|       |				 */
 2305|      0|			}
 2306|      4|			break;
 2307|     50|		case 'S':
  ------------------
  |  Branch (2307:3): [True: 50, False: 70]
  ------------------
 2308|     50|			if (p[1] == 'L') {
  ------------------
  |  Branch (2308:8): [True: 23, False: 27]
  ------------------
 2309|     23|				if (version == 1) {
  ------------------
  |  Branch (2309:9): [True: 22, False: 1]
  ------------------
 2310|     22|					parse_rockridge_SL1(file,
 2311|     22|					    data, data_length);
 2312|     22|					iso9660->seenRockridge = 1;
 2313|     22|				}
 2314|     23|			}
 2315|     27|			else if (p[1] == 'T'
  ------------------
  |  Branch (2315:13): [True: 2, False: 25]
  ------------------
 2316|      2|			    && data_length == 0 && version == 1) {
  ------------------
  |  Branch (2316:11): [True: 1, False: 1]
  |  Branch (2316:31): [True: 1, False: 0]
  ------------------
 2317|       |				/*
 2318|       |				 * ST extension marks end of this
 2319|       |				 * block of SUSP entries.
 2320|       |				 *
 2321|       |				 * It allows SUSP to coexist with
 2322|       |				 * non-SUSP uses of the System
 2323|       |				 * Use Area by placing non-SUSP data
 2324|       |				 * after SUSP data.
 2325|       |				 */
 2326|      1|				iso9660->seenSUSP = 0;
 2327|      1|				iso9660->seenRockridge = 0;
 2328|      1|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      1|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2329|      1|			}
 2330|     49|			break;
 2331|     51|		case 'T':
  ------------------
  |  Branch (2331:3): [True: 51, False: 69]
  ------------------
 2332|     51|			if (p[1] == 'F') {
  ------------------
  |  Branch (2332:8): [True: 50, False: 1]
  ------------------
 2333|     50|				if (version == 1) {
  ------------------
  |  Branch (2333:9): [True: 49, False: 1]
  ------------------
 2334|     49|					parse_rockridge_TF1(file,
 2335|     49|					    data, data_length);
 2336|     49|					iso9660->seenRockridge = 1;
 2337|     49|				}
 2338|     50|			}
 2339|     51|			break;
 2340|      2|		case 'Z':
  ------------------
  |  Branch (2340:3): [True: 2, False: 118]
  ------------------
 2341|      2|			if (p[1] == 'F') {
  ------------------
  |  Branch (2341:8): [True: 2, False: 0]
  ------------------
 2342|      2|				if (version == 1)
  ------------------
  |  Branch (2342:9): [True: 1, False: 1]
  ------------------
 2343|      1|					parse_rockridge_ZF1(file,
 2344|      1|					    data, data_length);
 2345|      2|			}
 2346|      2|			break;
 2347|      4|		default:
  ------------------
  |  Branch (2347:3): [True: 4, False: 116]
  ------------------
 2348|      4|			break;
 2349|    120|		}
 2350|       |
 2351|    119|		p += p[2];
 2352|    119|		entry_seen = 1;
 2353|    119|	}
 2354|       |
 2355|     86|	if (entry_seen)
  ------------------
  |  Branch (2355:6): [True: 85, False: 1]
  ------------------
 2356|     85|		return (ARCHIVE_OK);
  ------------------
  |  |  233|     85|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2357|      1|	else {
 2358|      1|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2359|      1|				  "Tried to parse Rockridge extensions, but none found");
 2360|      1|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|      1|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2361|      1|	}
 2362|     86|}
archive_read_support_format_iso9660.c:parse_rockridge_SL1:
 2669|     22|{
 2670|     22|	const char *separator = "";
 2671|       |
 2672|     22|	if (!file->symlink_continues || file->symlink.length < 1)
  ------------------
  |  Branch (2672:6): [True: 22, False: 0]
  |  Branch (2672:34): [True: 0, False: 0]
  ------------------
 2673|     22|		archive_string_empty(&file->symlink);
  ------------------
  |  |  181|     22|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 2674|     22|	file->symlink_continues = 0;
 2675|       |
 2676|       |	/*
 2677|       |	 * Defined flag values:
 2678|       |	 *  0: This is the last SL record for this symbolic link
 2679|       |	 *  1: this symbolic link field continues in next SL entry
 2680|       |	 *  All other values are reserved.
 2681|       |	 */
 2682|     22|	if (data_length < 1)
  ------------------
  |  Branch (2682:6): [True: 1, False: 21]
  ------------------
 2683|      1|		return;
 2684|     21|	switch(*data) {
 2685|     18|	case 0:
  ------------------
  |  Branch (2685:2): [True: 18, False: 3]
  ------------------
 2686|     18|		break;
 2687|      2|	case 1:
  ------------------
  |  Branch (2687:2): [True: 2, False: 19]
  ------------------
 2688|      2|		file->symlink_continues = 1;
 2689|      2|		break;
 2690|      1|	default:
  ------------------
  |  Branch (2690:2): [True: 1, False: 20]
  ------------------
 2691|      1|		return;
 2692|     21|	}
 2693|     20|	++data;  /* Skip flag byte. */
 2694|     20|	--data_length;
 2695|       |
 2696|       |	/*
 2697|       |	 * SL extension body stores "components".
 2698|       |	 * Basically, this is a complicated way of storing
 2699|       |	 * a POSIX path.  It also interferes with using
 2700|       |	 * symlinks for storing non-path data. <sigh>
 2701|       |	 *
 2702|       |	 * Each component is 2 bytes (flag and length)
 2703|       |	 * possibly followed by name data.
 2704|       |	 */
 2705|    110|	while (data_length >= 2) {
  ------------------
  |  Branch (2705:9): [True: 97, False: 13]
  ------------------
 2706|     97|		unsigned char flag = *data++;
 2707|     97|		unsigned char nlen = *data++;
 2708|     97|		data_length -= 2;
 2709|       |
 2710|     97|		archive_strcat(&file->symlink, separator);
 2711|     97|		separator = "/";
 2712|       |
 2713|     97|		switch(flag) {
 2714|     38|		case 0: /* Usual case, this is text. */
  ------------------
  |  Branch (2714:3): [True: 38, False: 59]
  ------------------
 2715|     38|			if (data_length < nlen)
  ------------------
  |  Branch (2715:8): [True: 1, False: 37]
  ------------------
 2716|      1|				return;
 2717|     37|			archive_strncat(&file->symlink,
 2718|     37|			    (const char *)data, nlen);
 2719|     37|			break;
 2720|     24|		case 0x01: /* Text continues in next component. */
  ------------------
  |  Branch (2720:3): [True: 24, False: 73]
  ------------------
 2721|     24|			if (data_length < nlen)
  ------------------
  |  Branch (2721:8): [True: 2, False: 22]
  ------------------
 2722|      2|				return;
 2723|     22|			archive_strncat(&file->symlink,
 2724|     22|			    (const char *)data, nlen);
 2725|     22|			separator = "";
 2726|     22|			break;
 2727|     13|		case 0x02: /* Current dir. */
  ------------------
  |  Branch (2727:3): [True: 13, False: 84]
  ------------------
 2728|     13|			archive_strcat(&file->symlink, ".");
 2729|     13|			break;
 2730|      6|		case 0x04: /* Parent dir. */
  ------------------
  |  Branch (2730:3): [True: 6, False: 91]
  ------------------
 2731|      6|			archive_strcat(&file->symlink, "..");
 2732|      6|			break;
 2733|      1|		case 0x08: /* Root of filesystem. */
  ------------------
  |  Branch (2733:3): [True: 1, False: 96]
  ------------------
 2734|      1|			archive_strcat(&file->symlink, "/");
 2735|      1|			separator = "";
 2736|      1|			break;
 2737|      5|		case 0x10: /* Undefined (historically "volume root" */
  ------------------
  |  Branch (2737:3): [True: 5, False: 92]
  ------------------
 2738|      5|			archive_string_empty(&file->symlink);
  ------------------
  |  |  181|      5|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 2739|      5|			archive_strcat(&file->symlink, "ROOT");
 2740|      5|			break;
 2741|      6|		case 0x20: /* Undefined (historically "hostname") */
  ------------------
  |  Branch (2741:3): [True: 6, False: 91]
  ------------------
 2742|      6|			archive_strcat(&file->symlink, "hostname");
 2743|      6|			break;
 2744|      4|		default:
  ------------------
  |  Branch (2744:3): [True: 4, False: 93]
  ------------------
 2745|       |			/* TODO: issue a warning ? */
 2746|      4|			return;
 2747|     97|		}
 2748|     90|		data += nlen;
 2749|     90|		data_length -= nlen;
 2750|     90|	}
 2751|     20|}
archive_read_support_format_iso9660.c:parse_rockridge_TF1:
 2574|     49|{
 2575|     49|	char flag;
 2576|       |	/*
 2577|       |	 * TF extension comprises:
 2578|       |	 *   one byte flag
 2579|       |	 *   create time (optional)
 2580|       |	 *   modify time (optional)
 2581|       |	 *   access time (optional)
 2582|       |	 *   attribute time (optional)
 2583|       |	 *  Time format and presence of fields
 2584|       |	 *  is controlled by flag bits.
 2585|       |	 */
 2586|     49|	if (data_length < 1)
  ------------------
  |  Branch (2586:6): [True: 1, False: 48]
  ------------------
 2587|      1|		return;
 2588|     48|	flag = data[0];
 2589|     48|	++data;
 2590|     48|	--data_length;
 2591|     48|	if (flag & 0x80) {
  ------------------
  |  Branch (2591:6): [True: 31, False: 17]
  ------------------
 2592|       |		/* Use 17-byte time format. */
 2593|     31|		if ((flag & 1) && data_length >= 17) {
  ------------------
  |  Branch (2593:7): [True: 28, False: 3]
  |  Branch (2593:21): [True: 28, False: 0]
  ------------------
 2594|       |			/* Create time. */
 2595|     28|			if (isodate17_valid(data)) {
  ------------------
  |  Branch (2595:8): [True: 0, False: 28]
  ------------------
 2596|      0|				file->time_is_set |= BIRTHTIME_IS_SET;
  ------------------
  |  |  309|      0|#define BIRTHTIME_IS_SET 1
  ------------------
 2597|      0|				file->birthtime = isodate17(data);
 2598|      0|			}
 2599|     28|			data += 17;
 2600|     28|			data_length -= 17;
 2601|     28|		}
 2602|     31|		if ((flag & 2) && data_length >= 17) {
  ------------------
  |  Branch (2602:7): [True: 28, False: 3]
  |  Branch (2602:21): [True: 27, False: 1]
  ------------------
 2603|       |			/* Modify time. */
 2604|     27|			if (isodate17_valid(data)) {
  ------------------
  |  Branch (2604:8): [True: 1, False: 26]
  ------------------
 2605|      1|				file->time_is_set |= MTIME_IS_SET;
  ------------------
  |  |  310|      1|#define MTIME_IS_SET 2
  ------------------
 2606|      1|				file->mtime = isodate17(data);
 2607|      1|			}
 2608|     27|			data += 17;
 2609|     27|			data_length -= 17;
 2610|     27|		}
 2611|     31|		if ((flag & 4) && data_length >= 17) {
  ------------------
  |  Branch (2611:7): [True: 28, False: 3]
  |  Branch (2611:21): [True: 26, False: 2]
  ------------------
 2612|       |			/* Access time. */
 2613|     26|			if (isodate17_valid(data)) {
  ------------------
  |  Branch (2613:8): [True: 4, False: 22]
  ------------------
 2614|      4|				file->time_is_set |= ATIME_IS_SET;
  ------------------
  |  |  311|      4|#define ATIME_IS_SET 4
  ------------------
 2615|      4|				file->atime = isodate17(data);
 2616|      4|			}
 2617|     26|			data += 17;
 2618|     26|			data_length -= 17;
 2619|     26|		}
 2620|     31|		if ((flag & 8) && data_length >= 17) {
  ------------------
  |  Branch (2620:7): [True: 28, False: 3]
  |  Branch (2620:21): [True: 24, False: 4]
  ------------------
 2621|       |			/* Attribute change time. */
 2622|     24|			if (isodate17_valid(data)) {
  ------------------
  |  Branch (2622:8): [True: 2, False: 22]
  ------------------
 2623|      2|				file->time_is_set |= CTIME_IS_SET;
  ------------------
  |  |  312|      2|#define CTIME_IS_SET 8
  ------------------
 2624|      2|				file->ctime = isodate17(data);
 2625|      2|			}
 2626|     24|		}
 2627|     31|	} else {
 2628|       |		/* Use 7-byte time format. */
 2629|     17|		if ((flag & 1) && data_length >= 7) {
  ------------------
  |  Branch (2629:7): [True: 12, False: 5]
  |  Branch (2629:21): [True: 11, False: 1]
  ------------------
 2630|       |			/* Create time. */
 2631|     11|			if (isodate7_valid(data)) {
  ------------------
  |  Branch (2631:8): [True: 2, False: 9]
  ------------------
 2632|      2|				file->time_is_set |= BIRTHTIME_IS_SET;
  ------------------
  |  |  309|      2|#define BIRTHTIME_IS_SET 1
  ------------------
 2633|      2|				file->birthtime = isodate7(data);
 2634|      2|			}
 2635|     11|			data += 7;
 2636|     11|			data_length -= 7;
 2637|     11|		}
 2638|     17|		if ((flag & 2) && data_length >= 7) {
  ------------------
  |  Branch (2638:7): [True: 13, False: 4]
  |  Branch (2638:21): [True: 12, False: 1]
  ------------------
 2639|       |			/* Modify time. */
 2640|     12|			if (isodate7_valid(data)) {
  ------------------
  |  Branch (2640:8): [True: 4, False: 8]
  ------------------
 2641|      4|				file->time_is_set |= MTIME_IS_SET;
  ------------------
  |  |  310|      4|#define MTIME_IS_SET 2
  ------------------
 2642|      4|				file->mtime = isodate7(data);
 2643|      4|			}
 2644|     12|			data += 7;
 2645|     12|			data_length -= 7;
 2646|     12|		}
 2647|     17|		if ((flag & 4) && data_length >= 7) {
  ------------------
  |  Branch (2647:7): [True: 15, False: 2]
  |  Branch (2647:21): [True: 14, False: 1]
  ------------------
 2648|       |			/* Access time. */
 2649|     14|			if (isodate7_valid(data)) {
  ------------------
  |  Branch (2649:8): [True: 2, False: 12]
  ------------------
 2650|      2|				file->time_is_set |= ATIME_IS_SET;
  ------------------
  |  |  311|      2|#define ATIME_IS_SET 4
  ------------------
 2651|      2|				file->atime = isodate7(data);
 2652|      2|			}
 2653|     14|			data += 7;
 2654|     14|			data_length -= 7;
 2655|     14|		}
 2656|     17|		if ((flag & 8) && data_length >= 7) {
  ------------------
  |  Branch (2656:7): [True: 16, False: 1]
  |  Branch (2656:21): [True: 15, False: 1]
  ------------------
 2657|       |			/* Attribute change time. */
 2658|     15|			if (isodate7_valid(data)) {
  ------------------
  |  Branch (2658:8): [True: 2, False: 13]
  ------------------
 2659|      2|				file->time_is_set |= CTIME_IS_SET;
  ------------------
  |  |  312|      2|#define CTIME_IS_SET 8
  ------------------
 2660|      2|				file->ctime = isodate7(data);
 2661|      2|			}
 2662|     15|		}
 2663|     17|	}
 2664|     48|}
archive_read_support_format_iso9660.c:isodate17_valid:
 3356|    105|{
 3357|       |	/* First 16 bytes are all ASCII digits */
 3358|    935|	for (int i = 0; i < 16; i++) {
  ------------------
  |  Branch (3358:18): [True: 898, False: 37]
  ------------------
 3359|    898|		if (v[i] < '0' || v[i] > '9')
  ------------------
  |  Branch (3359:7): [True: 22, False: 876]
  |  Branch (3359:21): [True: 46, False: 830]
  ------------------
 3360|     68|			return 0;
 3361|    898|	}
 3362|       |
 3363|     37|	int year = (v[0] - '0') * 1000 + (v[1] - '0') * 100
 3364|     37|		+ (v[2] - '0') * 10 + (v[3] - '0');
 3365|     37|	int month = (v[4] - '0') * 10 + (v[5] - '0');
 3366|     37|	int day = (v[6] - '0') * 10 + (v[7] - '0');
 3367|     37|	int hour = (v[8] - '0') * 10 + (v[9] - '0');
 3368|     37|	int minute = (v[10] - '0') * 10 + (v[11] - '0');
 3369|     37|	int second = (v[12] - '0') * 10 + (v[13] - '0');
 3370|     37|	int hundredths = (v[14] - '0') * 10 + (v[15] - '0');
 3371|     37|	int gmt_off = (signed char)v[16];
 3372|       |
 3373|     37|	if (year == 0 && month == 0 && day == 0
  ------------------
  |  Branch (3373:6): [True: 10, False: 27]
  |  Branch (3373:19): [True: 8, False: 2]
  |  Branch (3373:33): [True: 8, False: 0]
  ------------------
 3374|      8|	    && hour == 0 && minute == 0 && second == 0
  ------------------
  |  Branch (3374:9): [True: 8, False: 0]
  |  Branch (3374:22): [True: 6, False: 2]
  |  Branch (3374:37): [True: 5, False: 1]
  ------------------
 3375|      5|	    && hundredths == 0 && gmt_off == 0)
  ------------------
  |  Branch (3375:9): [True: 4, False: 1]
  |  Branch (3375:28): [True: 1, False: 3]
  ------------------
 3376|      1|		return 0;
 3377|       |	/*
 3378|       |	 * Sanity-test each individual field
 3379|       |	 */
 3380|       |
 3381|       |	/* Year must be 1900-2300 */
 3382|       |	/* (Not specified in ECMA-119, but these seem
 3383|       |	   like reasonable limits. */
 3384|     36|	if (year < 1900 || year > 2300)
  ------------------
  |  Branch (3384:6): [True: 9, False: 27]
  |  Branch (3384:21): [True: 11, False: 16]
  ------------------
 3385|     20|		return 0;
 3386|       |	/* Month must be 1-12 */
 3387|     16|	if (month < 1 || month > 12)
  ------------------
  |  Branch (3387:6): [True: 0, False: 16]
  |  Branch (3387:19): [True: 1, False: 15]
  ------------------
 3388|      1|		return 0;
 3389|       |	/* Day must be 1-31 */
 3390|     15|	if (day < 1 || day > 31)
  ------------------
  |  Branch (3390:6): [True: 1, False: 14]
  |  Branch (3390:17): [True: 1, False: 13]
  ------------------
 3391|      2|		return 0;
 3392|       |	/* Hour must be 0-23 */
 3393|     13|	if (hour > 23)
  ------------------
  |  Branch (3393:6): [True: 4, False: 9]
  ------------------
 3394|      4|		return 0;
 3395|       |	/* Minute must be 0-59 */
 3396|      9|	if (minute > 59)
  ------------------
  |  Branch (3396:6): [True: 0, False: 9]
  ------------------
 3397|      0|		return 0;
 3398|       |	/* second must be 0-59 according to ECMA-119 9.1.5 */
 3399|       |	/* BUT: we should probably allow for the time being in UTC, which
 3400|       |	   allows up to 61 seconds in a minute in certain cases */
 3401|      9|	if (second > 61)
  ------------------
  |  Branch (3401:6): [True: 1, False: 8]
  ------------------
 3402|      1|		return 0;
 3403|       |	/* Hundredths must be 0-99 */
 3404|      8|	if (hundredths > 99)
  ------------------
  |  Branch (3404:6): [True: 0, False: 8]
  ------------------
 3405|      0|		return 0;
 3406|       |	/* Offset from GMT must be -48 to +52 */
 3407|      8|	if (gmt_off < -48 || gmt_off > +52)
  ------------------
  |  Branch (3407:6): [True: 0, False: 8]
  |  Branch (3407:23): [True: 1, False: 7]
  ------------------
 3408|      1|		return 0;
 3409|       |
 3410|       |	/* All tests pass, this is OK */
 3411|      7|	return 1;
 3412|       |
 3413|      8|}
archive_read_support_format_iso9660.c:isodate17:
 3417|      7|{
 3418|      7|	struct tm tm;
 3419|      7|	int offset;
 3420|      7|	time_t t;
 3421|       |
 3422|      7|	memset(&tm, 0, sizeof(tm));
 3423|      7|	tm.tm_year = (v[0] - '0') * 1000 + (v[1] - '0') * 100
 3424|      7|	    + (v[2] - '0') * 10 + (v[3] - '0')
 3425|      7|	    - 1900;
 3426|      7|	tm.tm_mon = (v[4] - '0') * 10 + (v[5] - '0') - 1;
 3427|      7|	tm.tm_mday = (v[6] - '0') * 10 + (v[7] - '0');
 3428|      7|	tm.tm_hour = (v[8] - '0') * 10 + (v[9] - '0');
 3429|      7|	tm.tm_min = (v[10] - '0') * 10 + (v[11] - '0');
 3430|      7|	tm.tm_sec = (v[12] - '0') * 10 + (v[13] - '0');
 3431|       |	/* v[16] is the signed timezone offset, in 1/4-hour increments. */
 3432|      7|	offset = ((const signed char *)v)[16];
 3433|      7|	if (offset > -48 && offset < 52) {
  ------------------
  |  Branch (3433:6): [True: 7, False: 0]
  |  Branch (3433:22): [True: 4, False: 3]
  ------------------
 3434|      4|		tm.tm_hour -= offset / 4;
 3435|      4|		tm.tm_min -= (offset % 4) * 15;
 3436|      4|	}
 3437|      7|	t = time_from_tm(&tm);
 3438|      7|	if (t == (time_t)-1)
  ------------------
  |  Branch (3438:6): [True: 0, False: 7]
  ------------------
 3439|      0|		return ((time_t)0);
 3440|      7|	return (t);
 3441|      7|}
archive_read_support_format_iso9660.c:parse_rockridge_ZF1:
 2756|      1|{
 2757|       |
 2758|      1|	if (data[0] == 0x70 && data[1] == 0x7a && data_length == 12) {
  ------------------
  |  Branch (2758:6): [True: 0, False: 1]
  |  Branch (2758:25): [True: 0, False: 0]
  |  Branch (2758:44): [True: 0, False: 0]
  ------------------
 2759|       |        /* paged zlib */
 2760|      0|        file->pz = 1;
 2761|      0|        file->pz_log2_bs = data[3];
 2762|      0|        if (file->pz_log2_bs < 15 || file->pz_log2_bs > 17) {
  ------------------
  |  Branch (2762:13): [True: 0, False: 0]
  |  Branch (2762:38): [True: 0, False: 0]
  ------------------
 2763|       |            /* TODO: Return an error here instead of silently
 2764|       |             * disabling zisofs. That requires propagating an
 2765|       |             * error return through parse_rockridge() and its
 2766|       |             * callers. */
 2767|      0|            file->pz = 0;
 2768|      0|            return;
 2769|      0|        }
 2770|      0|        file->pz_uncompressed_size = archive_le32dec(&data[4]);
 2771|      0|    }
 2772|      1|}
archive_read_support_format_iso9660.c:register_file:
 2776|    952|{
 2777|       |
 2778|    952|	file->use_next = iso9660->use_files;
 2779|    952|	iso9660->use_files = file;
 2780|    952|}
archive_read_support_format_iso9660.c:heap_add_entry:
 3135|    871|{
 3136|    871|	uint64_t file_key, parent_key;
 3137|    871|	int hole, parent;
 3138|       |
 3139|       |	/* Reserve 16 bits for possible key collisions (needed for linked items) */
 3140|       |	/* For ISO files with more than 65535 entries, reordering will still occur */
 3141|    871|	key <<= 16;
 3142|    871|	key += heap->used & 0xFFFF;
 3143|       |
 3144|       |	/* Expand our pending files list as necessary. */
 3145|    871|	if (heap->used >= heap->allocated) {
  ------------------
  |  Branch (3145:6): [True: 173, False: 698]
  ------------------
 3146|    173|		struct file_info **new_pending_files;
 3147|    173|		int new_size = heap->allocated * 2;
 3148|       |
 3149|    173|		if (heap->allocated < 1024)
  ------------------
  |  Branch (3149:7): [True: 173, False: 0]
  ------------------
 3150|    173|			new_size = 1024;
 3151|       |		/* Overflow might keep us from growing the list. */
 3152|    173|		if (new_size <= heap->allocated) {
  ------------------
  |  Branch (3152:7): [True: 0, False: 173]
  ------------------
 3153|      0|			archive_set_error(&a->archive,
 3154|      0|			    ENOMEM, "Out of memory");
 3155|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3156|      0|		}
 3157|    173|		new_pending_files = (struct file_info **)
 3158|    173|		    calloc(new_size, sizeof(new_pending_files[0]));
 3159|    173|		if (new_pending_files == NULL) {
  ------------------
  |  Branch (3159:7): [True: 0, False: 173]
  ------------------
 3160|      0|			archive_set_error(&a->archive,
 3161|      0|			    ENOMEM, "Out of memory");
 3162|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3163|      0|		}
 3164|    173|		if (heap->allocated)
  ------------------
  |  Branch (3164:7): [True: 0, False: 173]
  ------------------
 3165|      0|			memcpy(new_pending_files, heap->files,
 3166|      0|			    heap->allocated * sizeof(new_pending_files[0]));
 3167|    173|		free(heap->files);
 3168|    173|		heap->files = new_pending_files;
 3169|    173|		heap->allocated = new_size;
 3170|    173|	}
 3171|       |
 3172|    871|	file_key = file->key = key;
 3173|       |
 3174|       |	/*
 3175|       |	 * Start with hole at end, walk it up tree to find insertion point.
 3176|       |	 */
 3177|    871|	hole = heap->used++;
 3178|  1.26k|	while (hole > 0) {
  ------------------
  |  Branch (3178:9): [True: 914, False: 354]
  ------------------
 3179|    914|		parent = (hole - 1)/2;
 3180|    914|		parent_key = heap->files[parent]->key;
 3181|    914|		if (file_key >= parent_key) {
  ------------------
  |  Branch (3181:7): [True: 517, False: 397]
  ------------------
 3182|    517|			heap->files[hole] = file;
 3183|    517|			return (ARCHIVE_OK);
  ------------------
  |  |  233|    517|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3184|    517|		}
 3185|       |		/* Move parent into hole <==> move hole up tree. */
 3186|    397|		heap->files[hole] = heap->files[parent];
 3187|    397|		hole = parent;
 3188|    397|	}
 3189|    354|	heap->files[0] = file;
 3190|       |
 3191|    354|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    354|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3192|    871|}
archive_read_support_format_iso9660.c:next_entry_seek:
 2809|    853|{
 2810|    853|	struct file_info *file;
 2811|    853|	int r;
 2812|       |
 2813|    853|	r = next_cache_entry(a, iso9660, pfile);
 2814|    853|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    853|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2814:6): [True: 214, False: 639]
  ------------------
 2815|    214|		return (r);
 2816|    639|	file = *pfile;
 2817|       |
 2818|       |	/* Don't waste time seeking for zero-length bodies. */
 2819|    639|	if (file->size == 0)
  ------------------
  |  Branch (2819:6): [True: 240, False: 399]
  ------------------
 2820|    240|		file->offset = iso9660->current_position;
 2821|       |
 2822|       |	/* flush any remaining bytes from the last round to ensure
 2823|       |	 * we're positioned */
 2824|    639|	if (iso9660->entry_bytes_unconsumed) {
  ------------------
  |  Branch (2824:6): [True: 0, False: 639]
  ------------------
 2825|      0|		__archive_read_consume(a, iso9660->entry_bytes_unconsumed);
 2826|      0|		iso9660->entry_bytes_unconsumed = 0;
 2827|      0|	}
 2828|       |
 2829|       |	/* Seek forward to the start of the entry. */
 2830|    639|	if (iso9660->current_position < file->offset) {
  ------------------
  |  Branch (2830:6): [True: 29, False: 610]
  ------------------
 2831|     29|		int64_t step;
 2832|       |
 2833|     29|		step = file->offset - iso9660->current_position;
 2834|     29|		step = __archive_read_consume(a, step);
 2835|     29|		if (step < 0)
  ------------------
  |  Branch (2835:7): [True: 17, False: 12]
  ------------------
 2836|     17|			return ((int)step);
 2837|     12|		iso9660->current_position = file->offset;
 2838|     12|	}
 2839|       |
 2840|       |	/* We found body of file; handle it now. */
 2841|    622|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    622|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2842|    639|}
archive_read_support_format_iso9660.c:next_cache_entry:
 2847|    853|{
 2848|    853|	struct file_info *file;
 2849|    853|	struct {
 2850|    853|		struct file_info	*first;
 2851|    853|		struct file_info	**last;
 2852|    853|	}	empty_files;
 2853|    853|	int64_t number;
 2854|    853|	int count;
 2855|       |
 2856|    853|	file = cache_get_entry(iso9660);
 2857|    853|	if (file != NULL) {
  ------------------
  |  Branch (2857:6): [True: 251, False: 602]
  ------------------
 2858|    251|		*pfile = file;
 2859|    251|		return (ARCHIVE_OK);
  ------------------
  |  |  233|    251|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2860|    251|	}
 2861|       |
 2862|    602|	for (;;) {
 2863|    602|		struct file_info *re, *d;
 2864|       |
 2865|    602|		*pfile = file = next_entry(iso9660);
  ------------------
  |  |  454|    602|	heap_get_entry(&((iso9660)->pending_files))
  ------------------
 2866|    602|		if (file == NULL) {
  ------------------
  |  Branch (2866:7): [True: 125, False: 477]
  ------------------
 2867|       |			/*
 2868|       |			 * If directory entries all which are descendant of
 2869|       |			 * rr_moved are still remaining, expose their.
 2870|       |			 */
 2871|    125|			if (iso9660->re_files.first != NULL &&
  ------------------
  |  Branch (2871:8): [True: 0, False: 125]
  ------------------
 2872|      0|			    iso9660->rr_moved != NULL &&
  ------------------
  |  Branch (2872:8): [True: 0, False: 0]
  ------------------
 2873|      0|			    iso9660->rr_moved->rr_moved_has_re_only)
  ------------------
  |  Branch (2873:8): [True: 0, False: 0]
  ------------------
 2874|       |				/* Expose "rr_moved" entry. */
 2875|      0|				cache_add_entry(iso9660, iso9660->rr_moved);
 2876|    125|			while ((re = re_get_entry(iso9660)) != NULL) {
  ------------------
  |  Branch (2876:11): [True: 0, False: 125]
  ------------------
 2877|       |				/* Expose its descendant dirs. */
 2878|      0|				while ((d = rede_get_entry(re)) != NULL)
  ------------------
  |  Branch (2878:12): [True: 0, False: 0]
  ------------------
 2879|      0|					cache_add_entry(iso9660, d);
 2880|      0|			}
 2881|    125|			if (iso9660->cache_files.first != NULL)
  ------------------
  |  Branch (2881:8): [True: 0, False: 125]
  ------------------
 2882|      0|				return (next_cache_entry(a, iso9660, pfile));
 2883|    125|			return (ARCHIVE_EOF);
  ------------------
  |  |  232|    125|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2884|    125|		}
 2885|       |
 2886|    477|		if (file->cl_offset) {
  ------------------
  |  Branch (2886:7): [True: 0, False: 477]
  ------------------
 2887|      0|			struct file_info *first_re = NULL;
 2888|      0|			int nexted_re = 0;
 2889|       |
 2890|       |			/*
 2891|       |			 * Find "RE" dir for the current file, which
 2892|       |			 * has "CL" flag.
 2893|       |			 */
 2894|      0|			while ((re = re_get_entry(iso9660))
  ------------------
  |  Branch (2894:11): [True: 0, False: 0]
  ------------------
 2895|      0|			    != first_re) {
 2896|      0|				if (first_re == NULL)
  ------------------
  |  Branch (2896:9): [True: 0, False: 0]
  ------------------
 2897|      0|					first_re = re;
 2898|      0|				if (re->offset == file->cl_offset) {
  ------------------
  |  Branch (2898:9): [True: 0, False: 0]
  ------------------
 2899|      0|					re->parent->subdirs--;
 2900|      0|					re->parent = file->parent;
 2901|      0|					re->re = 0;
 2902|      0|					if (re->parent->re_descendant) {
  ------------------
  |  Branch (2902:10): [True: 0, False: 0]
  ------------------
 2903|      0|						nexted_re = 1;
 2904|      0|						re->re_descendant = 1;
 2905|      0|						if (rede_add_entry(re) < 0)
  ------------------
  |  Branch (2905:11): [True: 0, False: 0]
  ------------------
 2906|      0|							goto fatal_rr;
 2907|       |						/* Move a list of descendants
 2908|       |						 * to a new ancestor. */
 2909|      0|						while ((d = rede_get_entry(
  ------------------
  |  Branch (2909:14): [True: 0, False: 0]
  ------------------
 2910|      0|						    re)) != NULL)
 2911|      0|							if (rede_add_entry(d)
  ------------------
  |  Branch (2911:12): [True: 0, False: 0]
  ------------------
 2912|      0|							    < 0)
 2913|      0|								goto fatal_rr;
 2914|      0|						break;
 2915|      0|					}
 2916|       |					/* Replace the current file
 2917|       |					 * with "RE" dir */
 2918|      0|					*pfile = file = re;
 2919|       |					/* Expose its descendant */
 2920|      0|					while ((d = rede_get_entry(
  ------------------
  |  Branch (2920:13): [True: 0, False: 0]
  ------------------
 2921|      0|					    file)) != NULL)
 2922|      0|						cache_add_entry(
 2923|      0|						    iso9660, d);
 2924|      0|					break;
 2925|      0|				} else
 2926|      0|					re_add_entry(iso9660, re);
 2927|      0|			}
 2928|      0|			if (nexted_re) {
  ------------------
  |  Branch (2928:8): [True: 0, False: 0]
  ------------------
 2929|       |				/*
 2930|       |				 * Do not expose this at this time
 2931|       |				 * because we have not gotten its full-path
 2932|       |				 * name yet.
 2933|       |				 */
 2934|      0|				continue;
 2935|      0|			}
 2936|    477|		} else if ((file->mode & AE_IFMT) == AE_IFDIR) {
  ------------------
  |  |  215|    477|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              		} else if ((file->mode & AE_IFMT) == AE_IFDIR) {
  ------------------
  |  |  221|    477|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (2936:14): [True: 215, False: 262]
  ------------------
 2937|    215|			int r;
 2938|       |
 2939|       |			/* Read file entries in this dir. */
 2940|    215|			r = read_children(a, file);
 2941|    215|			if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    215|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2941:8): [True: 89, False: 126]
  ------------------
 2942|     89|				return (r);
 2943|       |
 2944|       |			/*
 2945|       |			 * Handle a special dir of Rockridge extensions,
 2946|       |			 * "rr_moved".
 2947|       |			 */
 2948|    126|			if (file->rr_moved) {
  ------------------
  |  Branch (2948:8): [True: 0, False: 126]
  ------------------
 2949|       |				/*
 2950|       |				 * If this has only the subdirectories which
 2951|       |				 * have "RE" flags, do not expose at this time.
 2952|       |				 */
 2953|      0|				if (file->rr_moved_has_re_only)
  ------------------
  |  Branch (2953:9): [True: 0, False: 0]
  ------------------
 2954|      0|					continue;
 2955|       |				/* Otherwise expose "rr_moved" entry. */
 2956|    126|			} else if (file->re) {
  ------------------
  |  Branch (2956:15): [True: 0, False: 126]
  ------------------
 2957|       |				/*
 2958|       |				 * Do not expose this at this time
 2959|       |				 * because we have not gotten its full-path
 2960|       |				 * name yet.
 2961|       |				 */
 2962|      0|				re_add_entry(iso9660, file);
 2963|      0|				continue;
 2964|    126|			} else if (file->re_descendant) {
  ------------------
  |  Branch (2964:15): [True: 0, False: 126]
  ------------------
 2965|       |				/*
 2966|       |				 * If the top level "RE" entry of this entry
 2967|       |				 * is not exposed, we, accordingly, should not
 2968|       |				 * expose this entry at this time because
 2969|       |				 * we cannot make its proper full-path name.
 2970|       |				 */
 2971|      0|				if (rede_add_entry(file) == 0)
  ------------------
  |  Branch (2971:9): [True: 0, False: 0]
  ------------------
 2972|      0|					continue;
 2973|       |				/* Otherwise we can expose this entry because
 2974|       |				 * it seems its top level "RE" has already been
 2975|       |				 * exposed. */
 2976|      0|			}
 2977|    126|		}
 2978|    388|		break;
 2979|    477|	}
 2980|       |
 2981|    388|	if ((file->mode & AE_IFMT) != AE_IFREG || file->number == -1)
  ------------------
  |  |  215|    388|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              	if ((file->mode & AE_IFMT) != AE_IFREG || file->number == -1)
  ------------------
  |  |  216|    776|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
  |  Branch (2981:6): [True: 126, False: 262]
  |  Branch (2981:44): [True: 33, False: 229]
  ------------------
 2982|    159|		return (ARCHIVE_OK);
  ------------------
  |  |  233|    159|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2983|       |
 2984|    229|	count = 0;
 2985|    229|	number = file->number;
 2986|    229|	iso9660->cache_files.first = NULL;
 2987|    229|	iso9660->cache_files.last = &(iso9660->cache_files.first);
 2988|    229|	empty_files.first = NULL;
 2989|    229|	empty_files.last = &empty_files.first;
 2990|       |	/* Collect files which has the same file serial number.
 2991|       |	 * Peek pending_files so that file which number is different
 2992|       |	 * is not put back. */
 2993|    510|	while (iso9660->pending_files.used > 0 &&
  ------------------
  |  Branch (2993:9): [True: 385, False: 125]
  ------------------
 2994|    385|	    (iso9660->pending_files.files[0]->number == -1 ||
  ------------------
  |  Branch (2994:7): [True: 116, False: 269]
  ------------------
 2995|    281|	     iso9660->pending_files.files[0]->number == number)) {
  ------------------
  |  Branch (2995:7): [True: 165, False: 104]
  ------------------
 2996|    281|		if (file->number == -1) {
  ------------------
  |  Branch (2996:7): [True: 84, False: 197]
  ------------------
 2997|       |			/* This file has the same offset
 2998|       |			 * but it's wrong offset which empty files
 2999|       |			 * and symlink files have.
 3000|       |			 * NOTE: This wrong offset was recorded by
 3001|       |			 * old mkisofs utility. If ISO images is
 3002|       |			 * created by latest mkisofs, this does not
 3003|       |			 * happen.
 3004|       |			 */
 3005|     84|			file->next = NULL;
 3006|     84|			*empty_files.last = file;
 3007|     84|			empty_files.last = &(file->next);
 3008|    197|		} else {
 3009|    197|			count++;
 3010|    197|			cache_add_entry(iso9660, file);
 3011|    197|		}
 3012|    281|		file = next_entry(iso9660);
  ------------------
  |  |  454|    281|	heap_get_entry(&((iso9660)->pending_files))
  ------------------
 3013|    281|	}
 3014|       |
 3015|    229|	if (count == 0) {
  ------------------
  |  Branch (3015:6): [True: 132, False: 97]
  ------------------
 3016|    132|		*pfile = file;
 3017|    132|		return ((file == NULL)?ARCHIVE_EOF:ARCHIVE_OK);
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
              		return ((file == NULL)?ARCHIVE_EOF:ARCHIVE_OK);
  ------------------
  |  |  233|    132|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3017:11): [True: 0, False: 132]
  ------------------
 3018|    132|	}
 3019|     97|	if (file->number == -1) {
  ------------------
  |  Branch (3019:6): [True: 32, False: 65]
  ------------------
 3020|     32|		file->next = NULL;
 3021|     32|		*empty_files.last = file;
 3022|     32|		empty_files.last = &(file->next);
 3023|     65|	} else {
 3024|     65|		count++;
 3025|     65|		cache_add_entry(iso9660, file);
 3026|     65|	}
 3027|       |
 3028|     97|	if (count > 1) {
  ------------------
  |  Branch (3028:6): [True: 75, False: 22]
  ------------------
 3029|       |		/* The count is the same as number of hardlink,
 3030|       |		 * so much so that each nlinks of files in cache_file
 3031|       |		 * is overwritten by value of the count.
 3032|       |		 */
 3033|     75|		for (file = iso9660->cache_files.first;
 3034|    315|		    file != NULL; file = file->next)
  ------------------
  |  Branch (3034:7): [True: 240, False: 75]
  ------------------
 3035|    240|			file->nlinks = count;
 3036|     75|	}
 3037|       |	/* If there are empty files, that files are added
 3038|       |	 * to the tail of the cache_files. */
 3039|     97|	if (empty_files.first != NULL) {
  ------------------
  |  Branch (3039:6): [True: 32, False: 65]
  ------------------
 3040|     32|		*iso9660->cache_files.last = empty_files.first;
 3041|     32|		iso9660->cache_files.last = empty_files.last;
 3042|     32|	}
 3043|     97|	*pfile = cache_get_entry(iso9660);
 3044|     97|	return ((*pfile == NULL)?ARCHIVE_EOF:ARCHIVE_OK);
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
              	return ((*pfile == NULL)?ARCHIVE_EOF:ARCHIVE_OK);
  ------------------
  |  |  233|     97|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3044:10): [True: 0, False: 97]
  ------------------
 3045|       |
 3046|      0|fatal_rr:
 3047|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3048|      0|	    "Failed to connect 'CL' pointer to 'RE' rr_moved pointer of "
 3049|      0|	    "Rockridge extensions: current position = %jd, CL offset = %jd",
 3050|      0|	    (intmax_t)iso9660->current_position, (intmax_t)file->cl_offset);
 3051|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3052|    229|}
archive_read_support_format_iso9660.c:cache_get_entry:
 3120|    950|{
 3121|    950|	struct file_info *file;
 3122|       |
 3123|    950|	if ((file = iso9660->cache_files.first) != NULL) {
  ------------------
  |  Branch (3123:6): [True: 348, False: 602]
  ------------------
 3124|    348|		iso9660->cache_files.first = file->next;
 3125|    348|		if (iso9660->cache_files.first == NULL)
  ------------------
  |  Branch (3125:7): [True: 81, False: 267]
  ------------------
 3126|     81|			iso9660->cache_files.last =
 3127|     81|			    &(iso9660->cache_files.first);
 3128|    348|	}
 3129|    950|	return (file);
 3130|    950|}
archive_read_support_format_iso9660.c:heap_get_entry:
 3196|    883|{
 3197|    883|	uint64_t a_key, b_key, c_key;
 3198|    883|	int a, b, c;
 3199|    883|	struct file_info *r, *tmp;
 3200|       |
 3201|    883|	if (heap->used < 1)
  ------------------
  |  Branch (3201:6): [True: 125, False: 758]
  ------------------
 3202|    125|		return (NULL);
 3203|       |
 3204|       |	/*
 3205|       |	 * The first file in the list is the earliest; we'll return this.
 3206|       |	 */
 3207|    758|	r = heap->files[0];
 3208|       |
 3209|       |	/*
 3210|       |	 * Move the last item in the heap to the root of the tree
 3211|       |	 */
 3212|    758|	heap->files[0] = heap->files[--(heap->used)];
 3213|       |
 3214|       |	/*
 3215|       |	 * Rebalance the heap.
 3216|       |	 */
 3217|    758|	a = 0; /* Starting element and its heap key */
 3218|    758|	a_key = heap->files[a]->key;
 3219|  1.53k|	for (;;) {
 3220|  1.53k|		b = a + a + 1; /* First child */
 3221|  1.53k|		if (b >= heap->used)
  ------------------
  |  Branch (3221:7): [True: 648, False: 888]
  ------------------
 3222|    648|			return (r);
 3223|    888|		b_key = heap->files[b]->key;
 3224|    888|		c = b + 1; /* Use second child if it is smaller. */
 3225|    888|		if (c < heap->used) {
  ------------------
  |  Branch (3225:7): [True: 736, False: 152]
  ------------------
 3226|    736|			c_key = heap->files[c]->key;
 3227|    736|			if (c_key < b_key) {
  ------------------
  |  Branch (3227:8): [True: 297, False: 439]
  ------------------
 3228|    297|				b = c;
 3229|    297|				b_key = c_key;
 3230|    297|			}
 3231|    736|		}
 3232|    888|		if (a_key <= b_key)
  ------------------
  |  Branch (3232:7): [True: 110, False: 778]
  ------------------
 3233|    110|			return (r);
 3234|    778|		tmp = heap->files[a];
 3235|    778|		heap->files[a] = heap->files[b];
 3236|    778|		heap->files[b] = tmp;
 3237|    778|		a = b;
 3238|    778|	}
 3239|    758|}
archive_read_support_format_iso9660.c:cache_add_entry:
 3112|    262|{
 3113|       |	file->next = NULL;
 3114|    262|	*iso9660->cache_files.last = file;
 3115|    262|	iso9660->cache_files.last = &(file->next);
 3116|    262|}
archive_read_support_format_iso9660.c:re_get_entry:
 3064|    125|{
 3065|    125|	struct file_info *file;
 3066|       |
 3067|    125|	if ((file = iso9660->re_files.first) != NULL) {
  ------------------
  |  Branch (3067:6): [True: 0, False: 125]
  ------------------
 3068|      0|		iso9660->re_files.first = file->re_next;
 3069|      0|		if (iso9660->re_files.first == NULL)
  ------------------
  |  Branch (3069:7): [True: 0, False: 0]
  ------------------
 3070|      0|			iso9660->re_files.last =
 3071|      0|			    &(iso9660->re_files.first);
 3072|      0|	}
 3073|    125|	return (file);
 3074|    125|}
archive_read_support_format_iso9660.c:read_children:
 1036|    215|{
 1037|    215|	struct iso9660 *iso9660;
 1038|    215|	const unsigned char *b, *p;
 1039|    215|	struct file_info *multi;
 1040|    215|	size_t step, skip_size;
 1041|       |
 1042|    215|	iso9660 = (struct iso9660 *)(a->format->data);
 1043|       |	/* flush any remaining bytes from the last round to ensure
 1044|       |	 * we're positioned */
 1045|    215|	if (iso9660->entry_bytes_unconsumed) {
  ------------------
  |  Branch (1045:6): [True: 0, False: 215]
  ------------------
 1046|      0|		__archive_read_consume(a, iso9660->entry_bytes_unconsumed);
 1047|      0|		iso9660->entry_bytes_unconsumed = 0;
 1048|      0|	}
 1049|    215|	if (iso9660->current_position > parent->offset) {
  ------------------
  |  Branch (1049:6): [True: 31, False: 184]
  ------------------
 1050|     31|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     31|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1051|     31|		    "Ignoring out-of-order directory (%s) %jd > %jd",
 1052|     31|		    parent->name.s,
 1053|     31|		    (intmax_t)iso9660->current_position,
 1054|     31|		    (intmax_t)parent->offset);
 1055|     31|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|     31|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1056|     31|	}
 1057|    184|	if (parent->offset + parent->size > iso9660->volume_size) {
  ------------------
  |  Branch (1057:6): [True: 36, False: 148]
  ------------------
 1058|     36|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     36|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1059|     36|		    "Directory is beyond end-of-media: %s",
 1060|     36|		    parent->name.s);
 1061|     36|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|     36|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1062|     36|	}
 1063|    148|	if (iso9660->current_position < parent->offset) {
  ------------------
  |  Branch (1063:6): [True: 61, False: 87]
  ------------------
 1064|     61|		int64_t skipsize;
 1065|       |
 1066|     61|		skipsize = parent->offset - iso9660->current_position;
 1067|     61|		skipsize = __archive_read_consume(a, skipsize);
 1068|     61|		if (skipsize < 0)
  ------------------
  |  Branch (1068:7): [True: 2, False: 59]
  ------------------
 1069|      2|			return ((int)skipsize);
 1070|     59|		iso9660->current_position = parent->offset;
 1071|     59|	}
 1072|       |
 1073|    146|	step = (size_t)(((parent->size + iso9660->logical_block_size -1) /
 1074|    146|	    iso9660->logical_block_size) * iso9660->logical_block_size);
 1075|    146|	b = __archive_read_ahead(a, step, NULL);
 1076|    146|	if (b == NULL) {
  ------------------
  |  Branch (1076:6): [True: 3, False: 143]
  ------------------
 1077|      3|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      3|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1078|      3|		    "Failed to read full block when scanning "
 1079|      3|		    "ISO9660 directory list");
 1080|      3|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      3|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1081|      3|	}
 1082|    143|	iso9660->current_position += step;
 1083|    143|	multi = NULL;
 1084|    143|	skip_size = step;
 1085|    520|	while (step) {
  ------------------
  |  Branch (1085:9): [True: 394, False: 126]
  ------------------
 1086|    394|		p = b;
 1087|    394|		b += iso9660->logical_block_size;
 1088|    394|		step -= iso9660->logical_block_size;
 1089|   292k|		for (; *p != 0 && p + DR_name_offset < b && p + *p <= b;
  ------------------
  |  |  215|   292k|#define DR_name_offset 33
  ------------------
  |  Branch (1089:10): [True: 292k, False: 233]
  |  Branch (1089:21): [True: 291k, False: 144]
  |  Branch (1089:47): [True: 291k, False: 0]
  ------------------
 1090|   291k|			p += *p) {
 1091|   291k|			struct file_info *child;
 1092|       |
 1093|       |			/* N.B.: these special directory identifiers
 1094|       |			 * are 8 bit "values" even on a
 1095|       |			 * Joliet CD with UCS-2 (16bit) encoding.
 1096|       |			 */
 1097|       |
 1098|       |			/* Skip '.' entry. */
 1099|   291k|			if (*(p + DR_name_len_offset) == 1
  ------------------
  |  |  213|   291k|#define DR_name_len_offset 32
  ------------------
  |  Branch (1099:8): [True: 291k, False: 686]
  ------------------
 1100|   291k|			    && *(p + DR_name_offset) == '\0')
  ------------------
  |  |  215|   291k|#define DR_name_offset 33
  ------------------
  |  Branch (1100:11): [True: 90, False: 291k]
  ------------------
 1101|     90|				continue;
 1102|       |			/* Skip '..' entry. */
 1103|   291k|			if (*(p + DR_name_len_offset) == 1
  ------------------
  |  |  213|   291k|#define DR_name_len_offset 32
  ------------------
  |  Branch (1103:8): [True: 291k, False: 686]
  ------------------
 1104|   291k|			    && *(p + DR_name_offset) == '\001')
  ------------------
  |  |  215|   291k|#define DR_name_offset 33
  ------------------
  |  Branch (1104:11): [True: 291k, False: 97]
  ------------------
 1105|   291k|				continue;
 1106|    783|			child = parse_file_info(a, parent, p, b - p);
 1107|    783|			if (child == NULL) {
  ------------------
  |  Branch (1107:8): [True: 17, False: 766]
  ------------------
 1108|     17|				__archive_read_consume(a, skip_size);
 1109|     17|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     17|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1110|     17|			}
 1111|    766|			if (child->cl_offset == 0 &&
  ------------------
  |  Branch (1111:8): [True: 766, False: 0]
  ------------------
 1112|    766|			    (child->multi_extent || multi != NULL)) {
  ------------------
  |  Branch (1112:9): [True: 90, False: 676]
  |  Branch (1112:32): [True: 37, False: 639]
  ------------------
 1113|    127|				struct content *con;
 1114|       |
 1115|    127|				if (multi == NULL) {
  ------------------
  |  Branch (1115:9): [True: 59, False: 68]
  ------------------
 1116|     59|					multi = child;
 1117|     59|					multi->contents.first = NULL;
 1118|     59|					multi->contents.last =
 1119|     59|					    &(multi->contents.first);
 1120|     59|				}
 1121|    127|				con = malloc(sizeof(struct content));
 1122|    127|				if (con == NULL) {
  ------------------
  |  Branch (1122:9): [True: 0, False: 127]
  ------------------
 1123|      0|					archive_set_error(
 1124|      0|					    &a->archive, ENOMEM,
 1125|      0|					    "No memory for multi extent");
 1126|      0|					__archive_read_consume(a, skip_size);
 1127|      0|					return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1128|      0|				}
 1129|    127|				con->offset = child->offset;
 1130|    127|				con->size = child->size;
 1131|    127|				con->next = NULL;
 1132|    127|				*multi->contents.last = con;
 1133|    127|				multi->contents.last = &(con->next);
 1134|    127|				if (multi == child) {
  ------------------
  |  Branch (1134:9): [True: 59, False: 68]
  ------------------
 1135|     59|					if (add_entry(a, iso9660, child)
  ------------------
  |  |  452|     59|	heap_add_entry(arch, &((iso9660)->pending_files), file, file->offset)
  ------------------
  |  Branch (1135:10): [True: 0, False: 59]
  ------------------
 1136|     59|					    != ARCHIVE_OK)
  ------------------
  |  |  233|     59|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1137|      0|						return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1138|     68|				} else {
 1139|     68|					multi->size += child->size;
 1140|     68|					if (!child->multi_extent)
  ------------------
  |  Branch (1140:10): [True: 37, False: 31]
  ------------------
 1141|     37|						multi = NULL;
 1142|     68|				}
 1143|    127|			} else
 1144|    639|				if (add_entry(a, iso9660, child) != ARCHIVE_OK)
  ------------------
  |  |  452|    639|	heap_add_entry(arch, &((iso9660)->pending_files), file, file->offset)
  ------------------
              				if (add_entry(a, iso9660, child) != ARCHIVE_OK)
  ------------------
  |  |  233|    639|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1144:9): [True: 0, False: 639]
  ------------------
 1145|      0|					return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1146|    766|		}
 1147|    394|	}
 1148|       |
 1149|    126|	__archive_read_consume(a, skip_size);
 1150|       |
 1151|       |	/* Read data which recorded by RRIP "CE" extension. */
 1152|    126|	if (read_CE(a, iso9660) != ARCHIVE_OK)
  ------------------
  |  |  233|    126|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1152:6): [True: 0, False: 126]
  ------------------
 1153|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1154|       |
 1155|    126|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    126|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1156|    126|}
archive_read_support_format_iso9660.c:read_CE:
 2481|    126|{
 2482|    126|	struct read_ce_queue *heap;
 2483|    126|	const unsigned char *b, *p, *end;
 2484|    126|	struct file_info *file;
 2485|    126|	size_t step;
 2486|    126|	int r;
 2487|       |
 2488|       |	/* Read data which RRIP "CE" extension points. */
 2489|    126|	heap = &(iso9660->read_ce_req);
 2490|    126|	step = iso9660->logical_block_size;
 2491|    126|	while (heap->cnt &&
  ------------------
  |  Branch (2491:9): [True: 0, False: 126]
  ------------------
 2492|      0|	    heap->reqs[0].offset == iso9660->current_position) {
  ------------------
  |  Branch (2492:6): [True: 0, False: 0]
  ------------------
 2493|      0|		b = __archive_read_ahead(a, step, NULL);
 2494|      0|		if (b == NULL) {
  ------------------
  |  Branch (2494:7): [True: 0, False: 0]
  ------------------
 2495|      0|			archive_set_error(&a->archive,
 2496|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2497|      0|			    "Failed to read full block when scanning "
 2498|      0|			    "ISO9660 directory list");
 2499|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2500|      0|		}
 2501|      0|		do {
 2502|      0|			file = heap->reqs[0].file;
 2503|      0|			if (file->ce_offset + file->ce_size > step) {
  ------------------
  |  Branch (2503:8): [True: 0, False: 0]
  ------------------
 2504|      0|				archive_set_error(&a->archive,
 2505|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2506|      0|				    "Malformed CE information");
 2507|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2508|      0|			}
 2509|      0|			p = b + file->ce_offset;
 2510|      0|			end = p + file->ce_size;
 2511|      0|			next_CE(heap);
 2512|      0|			r = parse_rockridge(a, file, p, end);
 2513|      0|			if (r != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2513:8): [True: 0, False: 0]
  ------------------
 2514|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2515|      0|		} while (heap->cnt &&
  ------------------
  |  Branch (2515:12): [True: 0, False: 0]
  ------------------
 2516|      0|		    heap->reqs[0].offset == iso9660->current_position);
  ------------------
  |  Branch (2516:7): [True: 0, False: 0]
  ------------------
 2517|       |		/* NOTE: Do not move this consume's code to front of
 2518|       |		 * do-while loop. Registration of nested CE extension
 2519|       |		 * might cause error because of current position. */
 2520|      0|		__archive_read_consume(a, step);
 2521|      0|		iso9660->current_position += step;
 2522|      0|	}
 2523|    126|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    126|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2524|    126|}
archive_read_support_format_iso9660.c:build_pathname_utf16be:
 3492|     12|{
 3493|     12|	if (file->parent != NULL && file->parent->utf16be_bytes > 0) {
  ------------------
  |  Branch (3493:6): [True: 6, False: 6]
  |  Branch (3493:30): [True: 0, False: 6]
  ------------------
 3494|      0|		if (build_pathname_utf16be(p, max, len, file->parent) != 0)
  ------------------
  |  Branch (3494:7): [True: 0, False: 0]
  ------------------
 3495|      0|			return (-1);
 3496|      0|		if (*len + 2 > max)
  ------------------
  |  Branch (3496:7): [True: 0, False: 0]
  ------------------
 3497|      0|			return (-1);/* Path is too long! */
 3498|      0|		p[*len] = 0;
 3499|      0|		p[*len + 1] = '/';
 3500|      0|		*len += 2;
 3501|      0|	}
 3502|     12|	if (file->utf16be_bytes == 0) {
  ------------------
  |  Branch (3502:6): [True: 7, False: 5]
  ------------------
 3503|      7|		if (*len + 2 > max)
  ------------------
  |  Branch (3503:7): [True: 0, False: 7]
  ------------------
 3504|      0|			return (-1);/* Path is too long! */
 3505|      7|		p[*len] = 0;
 3506|      7|		p[*len + 1] = '.';
 3507|      7|		*len += 2;
 3508|      7|	} else {
 3509|      5|		if (*len + file->utf16be_bytes > max)
  ------------------
  |  Branch (3509:7): [True: 0, False: 5]
  ------------------
 3510|      0|			return (-1);/* Path is too long! */
 3511|      5|		memcpy(p + *len, file->utf16be_name, file->utf16be_bytes);
 3512|      5|		*len += file->utf16be_bytes;
 3513|      5|	}
 3514|     12|	return (0);
 3515|     12|}
archive_read_support_format_iso9660.c:build_pathname:
 3470|    752|{
 3471|       |	// Plain ISO9660 only allows 8 dir levels; if we get
 3472|       |	// to 1000, then something is very, very wrong.
 3473|    752|	if (depth > 1000) {
  ------------------
  |  Branch (3473:6): [True: 0, False: 752]
  ------------------
 3474|      0|		return NULL;
 3475|      0|	}
 3476|    752|	if (file->parent != NULL && archive_strlen(&file->parent->name) > 0) {
  ------------------
  |  |  178|    571|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (3476:6): [True: 571, False: 181]
  |  Branch (3476:30): [True: 142, False: 429]
  ------------------
 3477|    142|		if (build_pathname(as, file->parent, depth + 1) == NULL) {
  ------------------
  |  Branch (3477:7): [True: 0, False: 142]
  ------------------
 3478|      0|			return NULL;
 3479|      0|		}
 3480|    142|		archive_strcat(as, "/");
 3481|    142|	}
 3482|    752|	if (archive_strlen(&file->name) == 0)
  ------------------
  |  |  178|    752|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (3482:6): [True: 70, False: 682]
  ------------------
 3483|     70|		archive_strcat(as, ".");
 3484|    682|	else
 3485|    682|		archive_string_concat(as, &file->name);
 3486|    752|	return (as->s);
 3487|    752|}
archive_read_support_format_iso9660.c:archive_read_format_iso9660_read_data_skip:
 1489|    680|{
 1490|       |	/* Because read_next_header always does an explicit skip
 1491|       |	 * to the next entry, we don't need to do anything here. */
 1492|    680|	(void)a; /* UNUSED */
 1493|    680|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    680|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1494|    680|}
archive_read_support_format_iso9660.c:archive_read_format_iso9660_read_data:
 1740|    877|{
 1741|    877|	ssize_t bytes_read;
 1742|    877|	struct iso9660 *iso9660;
 1743|       |
 1744|    877|	iso9660 = (struct iso9660 *)(a->format->data);
 1745|       |
 1746|    877|	if (iso9660->entry_bytes_unconsumed) {
  ------------------
  |  Branch (1746:6): [True: 91, False: 786]
  ------------------
 1747|     91|		__archive_read_consume(a, iso9660->entry_bytes_unconsumed);
 1748|     91|		iso9660->entry_bytes_unconsumed = 0;
 1749|     91|	}
 1750|       |
 1751|    877|	if (iso9660->entry_bytes_remaining <= 0) {
  ------------------
  |  Branch (1751:6): [True: 782, False: 95]
  ------------------
 1752|    782|		if (iso9660->entry_content != NULL)
  ------------------
  |  Branch (1752:7): [True: 15, False: 767]
  ------------------
 1753|     15|			iso9660->entry_content = iso9660->entry_content->next;
 1754|    782|		if (iso9660->entry_content == NULL) {
  ------------------
  |  Branch (1754:7): [True: 773, False: 9]
  ------------------
 1755|    773|			*buff = NULL;
 1756|    773|			*size = 0;
 1757|    773|			*offset = iso9660->entry_sparse_offset;
 1758|    773|			return (ARCHIVE_EOF);
  ------------------
  |  |  232|    773|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1759|    773|		}
 1760|       |		/* Seek forward to the start of the entry. */
 1761|      9|		if (iso9660->current_position < iso9660->entry_content->offset) {
  ------------------
  |  Branch (1761:7): [True: 5, False: 4]
  ------------------
 1762|      5|			int64_t step;
 1763|       |
 1764|      5|			step = iso9660->entry_content->offset -
 1765|      5|			    iso9660->current_position;
 1766|      5|			step = __archive_read_consume(a, step);
 1767|      5|			if (step < 0)
  ------------------
  |  Branch (1767:8): [True: 2, False: 3]
  ------------------
 1768|      2|				return ((int)step);
 1769|      3|			iso9660->current_position =
 1770|      3|			    iso9660->entry_content->offset;
 1771|      3|		}
 1772|      7|		if (iso9660->entry_content->offset < iso9660->current_position) {
  ------------------
  |  Branch (1772:7): [True: 4, False: 3]
  ------------------
 1773|      4|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      4|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1774|      4|			    "Ignoring out-of-order file (%s) %jd < %jd",
 1775|      4|			    iso9660->pathname.s,
 1776|      4|			    (intmax_t)iso9660->entry_content->offset,
 1777|      4|			    (intmax_t)iso9660->current_position);
 1778|      4|			*buff = NULL;
 1779|      4|			*size = 0;
 1780|      4|			*offset = iso9660->entry_sparse_offset;
 1781|      4|			return (ARCHIVE_WARN);
  ------------------
  |  |  235|      4|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1782|      4|		}
 1783|      3|		iso9660->entry_bytes_remaining = iso9660->entry_content->size;
 1784|      3|	}
 1785|     98|	if (iso9660->entry_zisofs.pz)
  ------------------
  |  Branch (1785:6): [True: 0, False: 98]
  ------------------
 1786|      0|		return (zisofs_read_data(a, buff, size, offset));
 1787|       |
 1788|     98|	*buff = __archive_read_ahead(a, 1, &bytes_read);
 1789|     98|	if (bytes_read == 0)
  ------------------
  |  Branch (1789:6): [True: 7, False: 91]
  ------------------
 1790|      7|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      7|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1791|      7|		    "Truncated input file");
 1792|     98|	if (*buff == NULL)
  ------------------
  |  Branch (1792:6): [True: 7, False: 91]
  ------------------
 1793|      7|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      7|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1794|     91|	if (bytes_read > iso9660->entry_bytes_remaining)
  ------------------
  |  Branch (1794:6): [True: 84, False: 7]
  ------------------
 1795|     84|		bytes_read = (ssize_t)iso9660->entry_bytes_remaining;
 1796|     91|	*size = bytes_read;
 1797|     91|	*offset = iso9660->entry_sparse_offset;
 1798|     91|	iso9660->entry_sparse_offset += bytes_read;
 1799|     91|	iso9660->entry_bytes_remaining -= bytes_read;
 1800|     91|	iso9660->entry_bytes_unconsumed = bytes_read;
 1801|     91|	iso9660->current_position += bytes_read;
 1802|     91|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     91|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1803|     98|}
archive_read_support_format_iso9660.c:archive_read_format_iso9660_cleanup:
 1807|  2.49k|{
 1808|  2.49k|	struct iso9660 *iso9660;
 1809|  2.49k|	int r = ARCHIVE_OK;
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1810|       |
 1811|  2.49k|	iso9660 = (struct iso9660 *)(a->format->data);
 1812|  2.49k|	release_files(iso9660);
 1813|  2.49k|	free(iso9660->read_ce_req.reqs);
 1814|  2.49k|	archive_string_free(&iso9660->pathname);
 1815|  2.49k|	archive_string_free(&iso9660->previous_pathname);
 1816|  2.49k|	free(iso9660->pending_files.files);
 1817|  2.49k|#ifdef HAVE_ZLIB_H
 1818|  2.49k|	free(iso9660->entry_zisofs.uncompressed_buffer);
 1819|  2.49k|	free(iso9660->entry_zisofs.block_pointers);
 1820|  2.49k|	if (iso9660->entry_zisofs.stream_valid) {
  ------------------
  |  Branch (1820:6): [True: 0, False: 2.49k]
  ------------------
 1821|      0|		if (inflateEnd(&iso9660->entry_zisofs.stream) != Z_OK) {
  ------------------
  |  Branch (1821:7): [True: 0, False: 0]
  ------------------
 1822|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1823|      0|			    "Failed to clean up zlib decompressor");
 1824|      0|			r = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1825|      0|		}
 1826|      0|	}
 1827|  2.49k|#endif
 1828|  2.49k|	free(iso9660->utf16be_path);
 1829|  2.49k|	free(iso9660->utf16be_previous_path);
 1830|  2.49k|	free(iso9660);
 1831|       |	(a->format->data) = NULL;
 1832|  2.49k|	return (r);
 1833|  2.49k|}
archive_read_support_format_iso9660.c:release_files:
 2784|  2.49k|{
 2785|  2.49k|	struct content *con, *connext;
 2786|  2.49k|	struct file_info *file;
 2787|       |
 2788|  2.49k|	file = iso9660->use_files;
 2789|  3.45k|	while (file != NULL) {
  ------------------
  |  Branch (2789:9): [True: 952, False: 2.49k]
  ------------------
 2790|    952|		struct file_info *next = file->use_next;
 2791|       |
 2792|    952|		archive_string_free(&file->name);
 2793|    952|		archive_string_free(&file->symlink);
 2794|    952|		free(file->utf16be_name);
 2795|    952|		con = file->contents.first;
 2796|  1.07k|		while (con != NULL) {
  ------------------
  |  Branch (2796:10): [True: 127, False: 952]
  ------------------
 2797|    127|			connext = con->next;
 2798|    127|			free(con);
 2799|    127|			con = connext;
 2800|    127|		}
 2801|    952|		free(file);
 2802|    952|		file = next;
 2803|    952|	}
 2804|  2.49k|}

archive_read_support_format_lha:
  259|  2.49k|{
  260|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
  261|  2.49k|	struct lha *lha;
  262|  2.49k|	int r;
  263|       |
  264|  2.49k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  151|  2.49k|	do { \
  |  |  152|  2.49k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|  2.49k|			(allowed_states), (function_name)); \
  |  |  154|  2.49k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  2.49k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 2.49k]
  |  |  ------------------
  |  |  155|  2.49k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|  2.49k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 2.49k]
  |  |  ------------------
  ------------------
  265|  2.49k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_lha");
  266|       |
  267|  2.49k|	lha = calloc(1, sizeof(*lha));
  268|  2.49k|	if (lha == NULL) {
  ------------------
  |  Branch (268:6): [True: 0, False: 2.49k]
  ------------------
  269|      0|		archive_set_error(&a->archive, ENOMEM,
  270|      0|		    "Can't allocate lha data");
  271|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  272|      0|	}
  273|  2.49k|	archive_string_init(&lha->ws);
  ------------------
  |  |   71|  2.49k|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 2.49k]
  |  |  ------------------
  ------------------
  274|       |
  275|  2.49k|	r = __archive_read_register_format(a,
  276|  2.49k|	    lha,
  277|  2.49k|	    "lha",
  278|  2.49k|	    archive_read_format_lha_bid,
  279|  2.49k|	    archive_read_format_lha_options,
  280|  2.49k|	    archive_read_format_lha_read_header,
  281|  2.49k|	    archive_read_format_lha_read_data,
  282|  2.49k|	    archive_read_format_lha_read_data_skip,
  283|  2.49k|	    NULL,
  284|  2.49k|	    archive_read_format_lha_cleanup,
  285|  2.49k|	    NULL,
  286|  2.49k|	    NULL);
  287|       |
  288|  2.49k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (288:6): [True: 0, False: 2.49k]
  ------------------
  289|      0|		free(lha);
  290|  2.49k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  291|  2.49k|}
archive_read_support_format_lha.c:archive_read_format_lha_bid:
  348|  2.46k|{
  349|  2.46k|	const char *p;
  350|  2.46k|	const void *buff;
  351|  2.46k|	ssize_t bytes_avail, offset, window;
  352|  2.46k|	size_t next;
  353|       |
  354|       |	/* If there's already a better bid than we can ever
  355|       |	   make, don't bother testing. */
  356|  2.46k|	if (best_bid > 30)
  ------------------
  |  Branch (356:6): [True: 152, False: 2.30k]
  ------------------
  357|    152|		return (-1);
  358|       |
  359|  2.30k|	if ((p = __archive_read_ahead(a, H_SIZE, NULL)) == NULL)
  ------------------
  |  |  212|  2.30k|#define H_SIZE		22	/* Minimum header size. */
  ------------------
  |  Branch (359:6): [True: 24, False: 2.28k]
  ------------------
  360|     24|		return (-1);
  361|       |
  362|  2.28k|	if (lha_check_header_format(p) == 0)
  ------------------
  |  Branch (362:6): [True: 19, False: 2.26k]
  ------------------
  363|     19|		return (30);
  364|       |
  365|  2.26k|	if (p[0] == 'M' && p[1] == 'Z') {
  ------------------
  |  Branch (365:6): [True: 137, False: 2.12k]
  |  Branch (365:21): [True: 109, False: 28]
  ------------------
  366|       |		/* PE file */
  367|    109|		offset = 0;
  368|    109|		window = 4096;
  369|    292|		while (offset < (1024 * 20)) {
  ------------------
  |  Branch (369:10): [True: 273, False: 19]
  ------------------
  370|    273|			buff = __archive_read_ahead(a, offset + window,
  371|    273|			    &bytes_avail);
  372|    273|			if (buff == NULL) {
  ------------------
  |  Branch (372:8): [True: 141, False: 132]
  ------------------
  373|       |				/* Remaining bytes are less than window. */
  374|    141|				window >>= 1;
  375|    141|				if (window < (H_SIZE + 3))
  ------------------
  |  |  212|    141|#define H_SIZE		22	/* Minimum header size. */
  ------------------
  |  Branch (375:9): [True: 17, False: 124]
  ------------------
  376|     17|					return (0);
  377|    124|				continue;
  378|    141|			}
  379|    132|			p = (const char *)buff + offset;
  380|  1.74M|			while (p + H_SIZE < (const char *)buff + bytes_avail) {
  ------------------
  |  |  212|  1.74M|#define H_SIZE		22	/* Minimum header size. */
  ------------------
  |  Branch (380:11): [True: 1.74M, False: 59]
  ------------------
  381|  1.74M|				if ((next = lha_check_header_format(p)) == 0)
  ------------------
  |  Branch (381:9): [True: 73, False: 1.74M]
  ------------------
  382|     73|					return (30);
  383|  1.74M|				p += next;
  384|  1.74M|			}
  385|     59|			offset = p - (const char *)buff;
  386|     59|		}
  387|    109|	}
  388|  2.17k|	return (0);
  389|  2.26k|}
archive_read_support_format_lha.c:lha_check_header_format:
  295|  1.75M|{
  296|  1.75M|	const unsigned char *p = h;
  297|  1.75M|	size_t next_skip_bytes;
  298|       |
  299|  1.75M|	switch (p[H_METHOD_OFFSET+3]) {
  ------------------
  |  |  209|  1.75M|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  300|       |	/*
  301|       |	 * "-lh0-" ... "-lh7-" "-lhd-"
  302|       |	 * "-lzs-" "-lz5-"
  303|       |	 */
  304|  6.50k|	case '0': case '1': case '2': case '3':
  ------------------
  |  Branch (304:2): [True: 3.56k, False: 1.74M]
  |  Branch (304:12): [True: 811, False: 1.75M]
  |  Branch (304:22): [True: 688, False: 1.75M]
  |  Branch (304:32): [True: 1.44k, False: 1.75M]
  ------------------
  305|  11.8k|	case '4': case '5': case '6': case '7':
  ------------------
  |  Branch (305:2): [True: 544, False: 1.75M]
  |  Branch (305:12): [True: 3.11k, False: 1.75M]
  |  Branch (305:22): [True: 978, False: 1.75M]
  |  Branch (305:32): [True: 719, False: 1.75M]
  ------------------
  306|  12.3k|	case 'd':
  ------------------
  |  Branch (306:2): [True: 493, False: 1.75M]
  ------------------
  307|  12.7k|	case 's':
  ------------------
  |  Branch (307:2): [True: 436, False: 1.75M]
  ------------------
  308|  12.7k|		next_skip_bytes = 4;
  309|       |
  310|       |		/* b0 == 0 means the end of an LHa archive file.	*/
  311|  12.7k|		if (p[0] == 0)
  ------------------
  |  Branch (311:7): [True: 2.22k, False: 10.5k]
  ------------------
  312|  2.22k|			break;
  313|  10.5k|		if (p[H_METHOD_OFFSET] != '-' || p[H_METHOD_OFFSET+1] != 'l'
  ------------------
  |  |  209|  10.5k|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
              		if (p[H_METHOD_OFFSET] != '-' || p[H_METHOD_OFFSET+1] != 'l'
  ------------------
  |  |  209|  3.12k|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  |  Branch (313:7): [True: 7.44k, False: 3.12k]
  |  Branch (313:36): [True: 111, False: 3.01k]
  ------------------
  314|  3.01k|		    ||  p[H_METHOD_OFFSET+4] != '-')
  ------------------
  |  |  209|  3.01k|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  |  Branch (314:11): [True: 0, False: 3.01k]
  ------------------
  315|  7.55k|			break;
  316|       |
  317|  3.01k|		if (p[H_METHOD_OFFSET+2] == 'h') {
  ------------------
  |  |  209|  3.01k|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  |  Branch (317:7): [True: 3.01k, False: 0]
  ------------------
  318|       |			/* "-lh?-" */
  319|  3.01k|			if (p[H_METHOD_OFFSET+3] == 's')
  ------------------
  |  |  209|  3.01k|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  |  Branch (319:8): [True: 0, False: 3.01k]
  ------------------
  320|      0|				break;
  321|  3.01k|			if (p[H_LEVEL_OFFSET] == 0)
  ------------------
  |  |  211|  3.01k|#define H_LEVEL_OFFSET	20	/* Header Level.  */
  ------------------
  |  Branch (321:8): [True: 31, False: 2.98k]
  ------------------
  322|     31|				return (0);
  323|  2.98k|			if (p[H_LEVEL_OFFSET] <= 3 && p[H_ATTR_OFFSET] == 0x20)
  ------------------
  |  |  211|  2.98k|#define H_LEVEL_OFFSET	20	/* Header Level.  */
  ------------------
              			if (p[H_LEVEL_OFFSET] <= 3 && p[H_ATTR_OFFSET] == 0x20)
  ------------------
  |  |  210|  2.96k|#define H_ATTR_OFFSET	19	/* DOS attribute. */
  ------------------
  |  Branch (323:8): [True: 2.96k, False: 12]
  |  Branch (323:34): [True: 2.96k, False: 0]
  ------------------
  324|  2.96k|				return (0);
  325|  2.98k|		}
  326|     12|		if (p[H_METHOD_OFFSET+2] == 'z') {
  ------------------
  |  |  209|     12|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  |  Branch (326:7): [True: 0, False: 12]
  ------------------
  327|       |			/* LArc extensions: -lzs-,-lz4- and -lz5- */
  328|      0|			if (p[H_LEVEL_OFFSET] != 0)
  ------------------
  |  |  211|      0|#define H_LEVEL_OFFSET	20	/* Header Level.  */
  ------------------
  |  Branch (328:8): [True: 0, False: 0]
  ------------------
  329|      0|				break;
  330|      0|			if (p[H_METHOD_OFFSET+3] == 's'
  ------------------
  |  |  209|      0|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  |  Branch (330:8): [True: 0, False: 0]
  ------------------
  331|      0|			    || p[H_METHOD_OFFSET+3] == '4'
  ------------------
  |  |  209|      0|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  |  Branch (331:11): [True: 0, False: 0]
  ------------------
  332|      0|			    || p[H_METHOD_OFFSET+3] == '5')
  ------------------
  |  |  209|      0|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  |  Branch (332:11): [True: 0, False: 0]
  ------------------
  333|      0|				return (0);
  334|      0|		}
  335|     12|		break;
  336|    385|	case 'h': next_skip_bytes = 1; break;
  ------------------
  |  Branch (336:2): [True: 385, False: 1.75M]
  ------------------
  337|    114|	case 'z': next_skip_bytes = 1; break;
  ------------------
  |  Branch (337:2): [True: 114, False: 1.75M]
  ------------------
  338|    421|	case 'l': next_skip_bytes = 2; break;
  ------------------
  |  Branch (338:2): [True: 421, False: 1.75M]
  ------------------
  339|    409|	case '-': next_skip_bytes = 3; break;
  ------------------
  |  Branch (339:2): [True: 409, False: 1.75M]
  ------------------
  340|  1.73M|	default : next_skip_bytes = 4; break;
  ------------------
  |  Branch (340:2): [True: 1.73M, False: 14.1k]
  ------------------
  341|  1.75M|	}
  342|       |
  343|  1.75M|	return (next_skip_bytes);
  344|  1.75M|}
archive_read_support_format_lha.c:archive_read_format_lha_read_header:
  476|  2.90k|{
  477|  2.90k|	struct archive_wstring linkname;
  478|  2.90k|	struct archive_wstring pathname;
  479|  2.90k|	struct lha *lha;
  480|  2.90k|	const unsigned char *p;
  481|  2.90k|	const char *signature;
  482|  2.90k|	int err;
  483|  2.90k|	struct archive_mstring conv_buffer;
  484|  2.90k|	const wchar_t *conv_buffer_p;
  485|       |
  486|  2.90k|	lha_crc16_init();
  487|       |
  488|  2.90k|	a->archive.archive_format = ARCHIVE_FORMAT_LHA;
  ------------------
  |  |  382|  2.90k|#define	ARCHIVE_FORMAT_LHA			0xB0000
  ------------------
  489|  2.90k|	if (a->archive.archive_format_name == NULL)
  ------------------
  |  Branch (489:6): [True: 58, False: 2.84k]
  ------------------
  490|     58|		a->archive.archive_format_name = "lha";
  491|       |
  492|  2.90k|	lha = (struct lha *)(a->format->data);
  493|  2.90k|	lha->decompress_init = 0;
  494|  2.90k|	lha->end_of_entry = 0;
  495|  2.90k|	lha->end_of_entry_cleanup = 0;
  496|  2.90k|	lha->entry_unconsumed = 0;
  497|       |
  498|  2.90k|	if ((p = __archive_read_ahead(a, H_SIZE, NULL)) == NULL) {
  ------------------
  |  |  212|  2.90k|#define H_SIZE		22	/* Minimum header size. */
  ------------------
  |  Branch (498:6): [True: 7, False: 2.89k]
  ------------------
  499|       |		/*
  500|       |		 * LHa archiver added 0 to the tail of its archive file as
  501|       |		 * the mark of the end of the archive.
  502|       |		 */
  503|      7|		signature = __archive_read_ahead(a, sizeof(signature[0]), NULL);
  504|      7|		if (signature == NULL || signature[0] == 0)
  ------------------
  |  Branch (504:7): [True: 0, False: 7]
  |  Branch (504:28): [True: 0, False: 7]
  ------------------
  505|      0|			return (ARCHIVE_EOF);
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  506|      7|		return (truncated_error(a));
  507|      7|	}
  508|       |
  509|  2.89k|	signature = (const char *)p;
  510|  2.89k|	if (lha->found_first_header == 0 &&
  ------------------
  |  Branch (510:6): [True: 58, False: 2.83k]
  ------------------
  511|     58|	    signature[0] == 'M' && signature[1] == 'Z') {
  ------------------
  |  Branch (511:6): [True: 39, False: 19]
  |  Branch (511:29): [True: 39, False: 0]
  ------------------
  512|       |                /* This is an executable?  Must be self-extracting... 	*/
  513|     39|		err = lha_skip_sfx(a);
  514|     39|		if (err < ARCHIVE_WARN)
  ------------------
  |  |  235|     39|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (514:7): [True: 0, False: 39]
  ------------------
  515|      0|			return (err);
  516|       |
  517|     39|		if ((p = __archive_read_ahead(a, sizeof(*p), NULL)) == NULL)
  ------------------
  |  Branch (517:7): [True: 0, False: 39]
  ------------------
  518|      0|			return (truncated_error(a));
  519|     39|		signature = (const char *)p;
  520|     39|	}
  521|       |	/* signature[0] == 0 means the end of an LHa archive file. */
  522|  2.89k|	if (signature[0] == 0)
  ------------------
  |  Branch (522:6): [True: 17, False: 2.87k]
  ------------------
  523|     17|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|     17|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  524|       |
  525|       |	/*
  526|       |	 * Check the header format and method type.
  527|       |	 */
  528|  2.87k|	if (lha_check_header_format(p) != 0) {
  ------------------
  |  Branch (528:6): [True: 9, False: 2.86k]
  ------------------
  529|      9|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      9|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  530|      9|		    "Bad LHa file");
  531|      9|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      9|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  532|      9|	}
  533|       |
  534|       |	/* We've found the first header. */
  535|  2.86k|	lha->found_first_header = 1;
  536|       |	/* Set a default value and common data */
  537|  2.86k|	lha->header_size = 0;
  538|  2.86k|	lha->level = p[H_LEVEL_OFFSET];
  ------------------
  |  |  211|  2.86k|#define H_LEVEL_OFFSET	20	/* Header Level.  */
  ------------------
  539|  2.86k|	lha->method[0] = p[H_METHOD_OFFSET+1];
  ------------------
  |  |  209|  2.86k|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  540|  2.86k|	lha->method[1] = p[H_METHOD_OFFSET+2];
  ------------------
  |  |  209|  2.86k|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  541|  2.86k|	lha->method[2] = p[H_METHOD_OFFSET+3];
  ------------------
  |  |  209|  2.86k|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  542|  2.86k|	if (memcmp(lha->method, "lhd", 3) == 0)
  ------------------
  |  Branch (542:6): [True: 0, False: 2.86k]
  ------------------
  543|      0|		lha->directory = 1;
  544|  2.86k|	else
  545|  2.86k|		lha->directory = 0;
  546|  2.86k|	if (memcmp(lha->method, "lh0", 3) == 0 ||
  ------------------
  |  Branch (546:6): [True: 304, False: 2.56k]
  ------------------
  547|  2.56k|	    memcmp(lha->method, "lz4", 3) == 0)
  ------------------
  |  Branch (547:6): [True: 0, False: 2.56k]
  ------------------
  548|    304|		lha->entry_is_compressed = 0;
  549|  2.56k|	else
  550|  2.56k|		lha->entry_is_compressed = 1;
  551|       |
  552|  2.86k|	lha->compsize = 0;
  553|  2.86k|	lha->origsize = 0;
  554|  2.86k|	lha->setflag = 0;
  555|  2.86k|	lha->birthtime = 0;
  556|  2.86k|	lha->birthtime_tv_nsec = 0;
  557|  2.86k|	lha->mtime = 0;
  558|  2.86k|	lha->mtime_tv_nsec = 0;
  559|  2.86k|	lha->atime = 0;
  560|  2.86k|	lha->atime_tv_nsec = 0;
  561|  2.86k|	lha->mode = (lha->directory)? 0777 : 0666;
  ------------------
  |  Branch (561:14): [True: 0, False: 2.86k]
  ------------------
  562|  2.86k|	lha->uid = 0;
  563|  2.86k|	lha->gid = 0;
  564|  2.86k|	archive_string_empty(&lha->dirname);
  ------------------
  |  |  181|  2.86k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  565|  2.86k|	archive_string_empty(&lha->filename);
  ------------------
  |  |  181|  2.86k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  566|  2.86k|	lha->dos_attr = 0;
  567|  2.86k|	if (lha->opt_sconv != NULL) {
  ------------------
  |  Branch (567:6): [True: 0, False: 2.86k]
  ------------------
  568|      0|		lha->sconv_dir = lha->opt_sconv;
  569|      0|		lha->sconv_fname = lha->opt_sconv;
  570|  2.86k|	} else {
  571|  2.86k|		lha->sconv_dir = NULL;
  572|  2.86k|		lha->sconv_fname = NULL;
  573|  2.86k|	}
  574|       |
  575|  2.86k|	switch (p[H_LEVEL_OFFSET]) {
  ------------------
  |  |  211|  2.86k|#define H_LEVEL_OFFSET	20	/* Header Level.  */
  ------------------
  576|      0|	case 0:
  ------------------
  |  Branch (576:2): [True: 0, False: 2.86k]
  ------------------
  577|      0|		err = lha_read_file_header_0(a, lha);
  578|      0|		break;
  579|      3|	case 1:
  ------------------
  |  Branch (579:2): [True: 3, False: 2.86k]
  ------------------
  580|      3|		err = lha_read_file_header_1(a, lha);
  581|      3|		break;
  582|  2.86k|	case 2:
  ------------------
  |  Branch (582:2): [True: 2.86k, False: 4]
  ------------------
  583|  2.86k|		err = lha_read_file_header_2(a, lha);
  584|  2.86k|		break;
  585|      1|	case 3:
  ------------------
  |  Branch (585:2): [True: 1, False: 2.86k]
  ------------------
  586|      1|		err = lha_read_file_header_3(a, lha);
  587|      1|		break;
  588|      0|	default:
  ------------------
  |  Branch (588:2): [True: 0, False: 2.86k]
  ------------------
  589|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  590|      0|		    "Unsupported LHa header level %d", p[H_LEVEL_OFFSET]);
  ------------------
  |  |  211|      0|#define H_LEVEL_OFFSET	20	/* Header Level.  */
  ------------------
  591|      0|		err = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  592|      0|		break;
  593|  2.86k|	}
  594|  2.86k|	if (err < ARCHIVE_WARN)
  ------------------
  |  |  235|  2.86k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (594:6): [True: 13, False: 2.85k]
  ------------------
  595|     13|		return (err);
  596|       |
  597|       |
  598|  2.85k|	if (!lha->directory && archive_strlen(&lha->filename) == 0)
  ------------------
  |  |  178|  2.85k|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (598:6): [True: 2.85k, False: 0]
  |  Branch (598:25): [True: 0, False: 2.85k]
  ------------------
  599|       |		/* The filename has not been set */
  600|      0|		return (truncated_error(a));
  601|       |
  602|       |	/*
  603|       |	 * Make a pathname from a dirname and a filename, after converting to Unicode.
  604|       |	 * This is because codepages might differ between dirname and filename.
  605|       |	*/
  606|  2.85k|	archive_string_init(&pathname);
  ------------------
  |  |   71|  2.85k|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 2.85k]
  |  |  ------------------
  ------------------
  607|  2.85k|	archive_string_init(&linkname);
  ------------------
  |  |   71|  2.85k|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 2.85k]
  |  |  ------------------
  ------------------
  608|  2.85k|	archive_string_init(&conv_buffer.aes_mbs);
  ------------------
  |  |   71|  2.85k|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 2.85k]
  |  |  ------------------
  ------------------
  609|  2.85k|	archive_string_init(&conv_buffer.aes_mbs_in_locale);
  ------------------
  |  |   71|  2.85k|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 2.85k]
  |  |  ------------------
  ------------------
  610|  2.85k|	archive_string_init(&conv_buffer.aes_utf8);
  ------------------
  |  |   71|  2.85k|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 2.85k]
  |  |  ------------------
  ------------------
  611|  2.85k|	archive_string_init(&conv_buffer.aes_wcs);
  ------------------
  |  |   71|  2.85k|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 2.85k]
  |  |  ------------------
  ------------------
  612|  2.85k|	if (0 != archive_mstring_copy_mbs_len_l(&conv_buffer, lha->dirname.s, lha->dirname.length, lha->sconv_dir)) {
  ------------------
  |  Branch (612:6): [True: 0, False: 2.85k]
  ------------------
  613|      0|		archive_set_error(&a->archive,
  614|      0|			ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  615|      0|			"Pathname cannot be converted "
  616|      0|			"from %s to Unicode",
  617|      0|			archive_string_conversion_charset_name(lha->sconv_dir));
  618|      0|		err = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  619|  2.85k|	} else if (0 != archive_mstring_get_wcs(&a->archive, &conv_buffer, &conv_buffer_p))
  ------------------
  |  Branch (619:13): [True: 0, False: 2.85k]
  ------------------
  620|      0|		err = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  621|  2.85k|	if (err == ARCHIVE_FATAL) {
  ------------------
  |  |  239|  2.85k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (621:6): [True: 0, False: 2.85k]
  ------------------
  622|      0|		archive_mstring_clean(&conv_buffer);
  623|      0|		archive_wstring_free(&pathname);
  624|      0|		archive_wstring_free(&linkname);
  625|      0|		return (err);
  626|      0|	}
  627|  2.85k|	archive_wstring_copy(&pathname, &conv_buffer.aes_wcs);
  ------------------
  |  |  135|  2.85k|	((dest)->length = 0, archive_wstring_concat((dest), (src)))
  ------------------
  628|       |
  629|  2.85k|	archive_string_empty(&conv_buffer.aes_mbs);
  ------------------
  |  |  181|  2.85k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  630|  2.85k|	archive_string_empty(&conv_buffer.aes_mbs_in_locale);
  ------------------
  |  |  181|  2.85k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  631|  2.85k|	archive_string_empty(&conv_buffer.aes_utf8);
  ------------------
  |  |  181|  2.85k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  632|  2.85k|	archive_wstring_empty(&conv_buffer.aes_wcs);
  ------------------
  |  |  182|  2.85k|#define	archive_wstring_empty(a) ((a)->length = 0)
  ------------------
  633|  2.85k|	if (0 != archive_mstring_copy_mbs_len_l(&conv_buffer, lha->filename.s, lha->filename.length, lha->sconv_fname)) {
  ------------------
  |  Branch (633:6): [True: 0, False: 2.85k]
  ------------------
  634|      0|		archive_set_error(&a->archive,
  635|      0|			ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  636|      0|			"Pathname cannot be converted "
  637|      0|			"from %s to Unicode",
  638|      0|			archive_string_conversion_charset_name(lha->sconv_fname));
  639|      0|		err = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  640|      0|	}
  641|  2.85k|	else if (0 != archive_mstring_get_wcs(&a->archive, &conv_buffer, &conv_buffer_p))
  ------------------
  |  Branch (641:11): [True: 1, False: 2.85k]
  ------------------
  642|      1|		err = ARCHIVE_FATAL;
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  643|  2.85k|	if (err == ARCHIVE_FATAL) {
  ------------------
  |  |  239|  2.85k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (643:6): [True: 1, False: 2.85k]
  ------------------
  644|      1|		archive_mstring_clean(&conv_buffer);
  645|      1|		archive_wstring_free(&pathname);
  646|      1|		archive_wstring_free(&linkname);
  647|      1|		return (err);
  648|      1|	}
  649|  2.85k|	archive_wstring_concat(&pathname, &conv_buffer.aes_wcs);
  650|  2.85k|	archive_mstring_clean(&conv_buffer);
  651|       |
  652|  2.85k|	if ((lha->mode & AE_IFMT) == AE_IFLNK) {
  ------------------
  |  |  215|  2.85k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              	if ((lha->mode & AE_IFMT) == AE_IFLNK) {
  ------------------
  |  |  217|  2.85k|#define AE_IFLNK	((__LA_MODE_T)0120000)
  ------------------
  |  Branch (652:6): [True: 0, False: 2.85k]
  ------------------
  653|       |		/*
  654|       |	 	 * Extract the symlink-name if it's included in the pathname.
  655|       |	 	 */
  656|      0|		if (!lha_parse_linkname(&linkname, &pathname)) {
  ------------------
  |  Branch (656:7): [True: 0, False: 0]
  ------------------
  657|       |			/* We couldn't get the symlink-name. */
  658|      0|			archive_set_error(&a->archive,
  659|      0|		    	    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  660|      0|			    "Unknown symlink-name");
  661|      0|			archive_wstring_free(&pathname);
  662|      0|			archive_wstring_free(&linkname);
  663|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  664|      0|		}
  665|  2.85k|	} else {
  666|       |		/*
  667|       |		 * Make sure a file-type is set.
  668|       |		 * The mode has been overridden if it is in the extended data.
  669|       |		 */
  670|  2.85k|		lha->mode = (lha->mode & ~AE_IFMT) |
  ------------------
  |  |  215|  2.85k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
  671|  2.85k|		    ((lha->directory)? AE_IFDIR: AE_IFREG);
  ------------------
  |  |  221|      0|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
              		    ((lha->directory)? AE_IFDIR: AE_IFREG);
  ------------------
  |  |  216|  2.85k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
  |  Branch (671:8): [True: 0, False: 2.85k]
  ------------------
  672|  2.85k|	}
  673|  2.85k|	if ((lha->setflag & UNIX_MODE_IS_SET) == 0 &&
  ------------------
  |  |  164|  2.85k|#define UNIX_MODE_IS_SET	4
  ------------------
  |  Branch (673:6): [True: 2.85k, False: 0]
  ------------------
  674|  2.85k|	    (lha->dos_attr & 1) != 0)
  ------------------
  |  Branch (674:6): [True: 5, False: 2.85k]
  ------------------
  675|      5|		lha->mode &= ~(0222);/* read only. */
  676|       |
  677|       |	/*
  678|       |	 * Set basic file parameters.
  679|       |	 */
  680|  2.85k|	archive_entry_copy_pathname_w(entry, pathname.s);
  681|  2.85k|	archive_wstring_free(&pathname);
  682|  2.85k|	if (archive_strlen(&linkname) > 0) {
  ------------------
  |  |  178|  2.85k|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (682:6): [True: 0, False: 2.85k]
  ------------------
  683|      0|		archive_entry_copy_symlink_w(entry, linkname.s);
  684|      0|	} else
  685|  2.85k|		archive_entry_set_symlink(entry, NULL);
  686|  2.85k|	archive_wstring_free(&linkname);
  687|       |	/*
  688|       |	 * When a header level is 0, there is a possibility that
  689|       |	 * a pathname and a symlink has '\' character, a directory
  690|       |	 * separator in DOS/Windows. So we should convert it to '/'.
  691|       |	 */
  692|  2.85k|	if (lha->level == 0)
  ------------------
  |  Branch (692:6): [True: 0, False: 2.85k]
  ------------------
  693|      0|		lha_replace_path_separator(lha, entry);
  694|       |
  695|  2.85k|	archive_entry_set_mode(entry, lha->mode);
  696|  2.85k|	archive_entry_set_uid(entry, lha->uid);
  697|  2.85k|	archive_entry_set_gid(entry, lha->gid);
  698|  2.85k|	if (archive_strlen(&lha->uname) > 0)
  ------------------
  |  |  178|  2.85k|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (698:6): [True: 18, False: 2.83k]
  ------------------
  699|     18|		archive_entry_set_uname(entry, lha->uname.s);
  700|  2.85k|	if (archive_strlen(&lha->gname) > 0)
  ------------------
  |  |  178|  2.85k|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (700:6): [True: 318, False: 2.53k]
  ------------------
  701|    318|		archive_entry_set_gname(entry, lha->gname.s);
  702|  2.85k|	if (lha->setflag & BIRTHTIME_IS_SET) {
  ------------------
  |  |  162|  2.85k|#define BIRTHTIME_IS_SET	1
  ------------------
  |  Branch (702:6): [True: 0, False: 2.85k]
  ------------------
  703|      0|		archive_entry_set_birthtime(entry, lha->birthtime,
  704|      0|		    lha->birthtime_tv_nsec);
  705|      0|		archive_entry_set_ctime(entry, lha->birthtime,
  706|      0|		    lha->birthtime_tv_nsec);
  707|  2.85k|	} else {
  708|  2.85k|		archive_entry_unset_birthtime(entry);
  709|  2.85k|		archive_entry_unset_ctime(entry);
  710|  2.85k|	}
  711|  2.85k|	archive_entry_set_mtime(entry, lha->mtime, lha->mtime_tv_nsec);
  712|  2.85k|	if (lha->setflag & ATIME_IS_SET)
  ------------------
  |  |  163|  2.85k|#define ATIME_IS_SET		2
  ------------------
  |  Branch (712:6): [True: 0, False: 2.85k]
  ------------------
  713|      0|		archive_entry_set_atime(entry, lha->atime,
  714|      0|		    lha->atime_tv_nsec);
  715|  2.85k|	else
  716|  2.85k|		archive_entry_unset_atime(entry);
  717|  2.85k|	if (lha->directory || archive_entry_symlink(entry) != NULL)
  ------------------
  |  Branch (717:6): [True: 0, False: 2.85k]
  |  Branch (717:24): [True: 0, False: 2.85k]
  ------------------
  718|      0|		archive_entry_unset_size(entry);
  719|  2.85k|	else
  720|  2.85k|		archive_entry_set_size(entry, lha->origsize);
  721|       |
  722|       |	/*
  723|       |	 * Prepare variables used to read a file content.
  724|       |	 */
  725|  2.85k|	lha->entry_bytes_remaining = lha->compsize;
  726|  2.85k|	if (lha->entry_bytes_remaining < 0) {
  ------------------
  |  Branch (726:6): [True: 0, False: 2.85k]
  ------------------
  727|      0|		archive_set_error(&a->archive,
  728|      0|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  729|      0|		    "Invalid LHa entry size");
  730|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  731|      0|	}
  732|  2.85k|	lha->entry_offset = 0;
  733|  2.85k|	lha->entry_crc_calculated = 0;
  734|       |
  735|       |	/*
  736|       |	 * This file does not have a content.
  737|       |	 */
  738|  2.85k|	if (lha->directory || lha->compsize == 0)
  ------------------
  |  Branch (738:6): [True: 0, False: 2.85k]
  |  Branch (738:24): [True: 0, False: 2.85k]
  ------------------
  739|      0|		lha->end_of_entry = 1;
  740|       |
  741|  2.85k|	snprintf(lha->format_name, sizeof(lha->format_name), "lha -%c%c%c-",
  742|  2.85k|	    lha->method[0], lha->method[1], lha->method[2]);
  743|  2.85k|	a->archive.archive_format_name = lha->format_name;
  744|       |
  745|  2.85k|	return (err);
  746|  2.85k|}
archive_read_support_format_lha.c:lha_crc16_init:
 1739|  2.90k|{
 1740|  2.90k|	unsigned int i;
 1741|  2.90k|	static int crc16init = 0;
 1742|       |
 1743|  2.90k|	if (crc16init)
  ------------------
  |  Branch (1743:6): [True: 2.90k, False: 1]
  ------------------
 1744|  2.90k|		return;
 1745|      1|	crc16init = 1;
 1746|       |
 1747|    257|	for (i = 0; i < 256; i++) {
  ------------------
  |  Branch (1747:14): [True: 256, False: 1]
  ------------------
 1748|    256|		unsigned int j;
 1749|    256|		uint16_t crc = (uint16_t)i;
 1750|  2.30k|		for (j = 8; j; j--)
  ------------------
  |  Branch (1750:15): [True: 2.04k, False: 256]
  ------------------
 1751|  2.04k|			crc = (crc >> 1) ^ ((crc & 1) * 0xA001);
 1752|    256|		crc16tbl[0][i] = crc;
 1753|    256|	}
 1754|       |
 1755|    257|	for (i = 0; i < 256; i++) {
  ------------------
  |  Branch (1755:14): [True: 256, False: 1]
  ------------------
 1756|    256|		crc16tbl[1][i] = (crc16tbl[0][i] >> 8)
 1757|    256|			^ crc16tbl[0][crc16tbl[0][i] & 0xff];
 1758|    256|	}
 1759|      1|}
archive_read_support_format_lha.c:truncated_error:
  467|     13|{
  468|     13|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     13|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  469|     13|	    "Truncated LHa header");
  470|     13|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     13|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  471|     13|}
archive_read_support_format_lha.c:lha_skip_sfx:
  423|     39|{
  424|     39|	const void *h;
  425|     39|	const char *p, *q;
  426|     39|	size_t next, skip;
  427|     39|	ssize_t bytes, window;
  428|       |
  429|     39|	window = 4096;
  430|     42|	for (;;) {
  431|     42|		h = __archive_read_ahead(a, window, &bytes);
  432|     42|		if (h == NULL) {
  ------------------
  |  Branch (432:7): [True: 3, False: 39]
  ------------------
  433|       |			/* Remaining bytes are less than window. */
  434|      3|			window >>= 1;
  435|      3|			if (window < (H_SIZE + 3))
  ------------------
  |  |  212|      3|#define H_SIZE		22	/* Minimum header size. */
  ------------------
  |  Branch (435:8): [True: 0, False: 3]
  ------------------
  436|      0|				goto fatal;
  437|      3|			continue;
  438|      3|		}
  439|     39|		if (bytes < H_SIZE)
  ------------------
  |  |  212|     39|#define H_SIZE		22	/* Minimum header size. */
  ------------------
  |  Branch (439:7): [True: 0, False: 39]
  ------------------
  440|      0|			goto fatal;
  441|     39|		p = h;
  442|     39|		q = p + bytes;
  443|       |
  444|       |		/*
  445|       |		 * Scan ahead until we find something that looks
  446|       |		 * like the lha header.
  447|       |		 */
  448|  3.62k|		while (p + H_SIZE < q) {
  ------------------
  |  |  212|  3.62k|#define H_SIZE		22	/* Minimum header size. */
  ------------------
  |  Branch (448:10): [True: 3.62k, False: 0]
  ------------------
  449|  3.62k|			if ((next = lha_check_header_format(p)) == 0) {
  ------------------
  |  Branch (449:8): [True: 39, False: 3.58k]
  ------------------
  450|     39|				skip = p - (const char *)h;
  451|     39|				__archive_read_consume(a, skip);
  452|     39|				return (ARCHIVE_OK);
  ------------------
  |  |  233|     39|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  453|     39|			}
  454|  3.58k|			p += next;
  455|  3.58k|		}
  456|      0|		skip = p - (const char *)h;
  457|      0|		__archive_read_consume(a, skip);
  458|      0|	}
  459|      0|fatal:
  460|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  461|      0|	    "Couldn't find out LHa header");
  462|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  463|     39|}
archive_read_support_format_lha.c:lha_calcsum:
 1727|      3|{
 1728|      3|	unsigned char const *p = (unsigned char const *)pp;
 1729|       |
 1730|      3|	p += offset;
 1731|    109|	for (;size > 0; --size)
  ------------------
  |  Branch (1731:8): [True: 106, False: 3]
  ------------------
 1732|    106|		sum += *p++;
 1733|      3|	return (sum);
 1734|      3|}
archive_read_support_format_lha.c:lha_read_file_header_1:
  904|      3|{
  905|      3|	const unsigned char *p;
  906|      3|	size_t extdsize;
  907|      3|	int i, err, err2;
  908|      3|	int namelen, padding;
  909|      3|	unsigned char headersum, sum_calculated;
  910|       |
  911|      3|	err = ARCHIVE_OK;
  ------------------
  |  |  233|      3|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  912|       |
  913|      3|	if ((p = __archive_read_ahead(a, H1_FIXED_SIZE, NULL)) == NULL)
  ------------------
  |  |  901|      3|#define H1_FIXED_SIZE		27
  ------------------
  |  Branch (913:6): [True: 0, False: 3]
  ------------------
  914|      0|		return (truncated_error(a));
  915|       |
  916|      3|	lha->header_size = p[H1_HEADER_SIZE_OFFSET] + 2;
  ------------------
  |  |  894|      3|#define H1_HEADER_SIZE_OFFSET	0
  ------------------
  917|      3|	headersum = p[H1_HEADER_SUM_OFFSET];
  ------------------
  |  |  895|      3|#define H1_HEADER_SUM_OFFSET	1
  ------------------
  918|       |	/* Note: An extended header size is included in a compsize. */
  919|      3|	lha->compsize = archive_le32dec(p + H1_COMP_SIZE_OFFSET);
  ------------------
  |  |  896|      3|#define H1_COMP_SIZE_OFFSET	7
  ------------------
  920|      3|	lha->origsize = archive_le32dec(p + H1_ORIG_SIZE_OFFSET);
  ------------------
  |  |  897|      3|#define H1_ORIG_SIZE_OFFSET	11
  ------------------
  921|      3|	lha->mtime = dos_to_unix(archive_le32dec(p + H1_DOS_TIME_OFFSET));
  ------------------
  |  |  898|      3|#define H1_DOS_TIME_OFFSET	15
  ------------------
  922|      3|	namelen = p[H1_NAME_LEN_OFFSET];
  ------------------
  |  |  899|      3|#define H1_NAME_LEN_OFFSET	21
  ------------------
  923|       |	/* Calculate a padding size. The result will be normally 0 only(?) */
  924|      3|	padding = ((int)lha->header_size) - H1_FIXED_SIZE - namelen;
  ------------------
  |  |  901|      3|#define H1_FIXED_SIZE		27
  ------------------
  925|       |
  926|      3|	if (namelen > 230 || padding < 0)
  ------------------
  |  Branch (926:6): [True: 0, False: 3]
  |  Branch (926:23): [True: 0, False: 3]
  ------------------
  927|      0|		goto invalid;
  928|       |
  929|      3|	if ((p = __archive_read_ahead(a, lha->header_size, NULL)) == NULL)
  ------------------
  |  Branch (929:6): [True: 0, False: 3]
  ------------------
  930|      0|		return (truncated_error(a));
  931|       |
  932|      3|	for (i = 0; i < namelen; i++) {
  ------------------
  |  Branch (932:14): [True: 0, False: 3]
  ------------------
  933|      0|		if (p[i + H1_FILE_NAME_OFFSET] == 0xff)
  ------------------
  |  |  900|      0|#define H1_FILE_NAME_OFFSET	22
  ------------------
  |  Branch (933:7): [True: 0, False: 0]
  ------------------
  934|      0|			goto invalid;/* Invalid filename. */
  935|      0|	}
  936|      3|	archive_strncpy(&lha->filename, p + H1_FILE_NAME_OFFSET, namelen);
  ------------------
  |  |  173|      3|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
  937|      3|	lha->crc = archive_le16dec(p + H1_FILE_NAME_OFFSET + namelen);
  ------------------
  |  |  900|      3|#define H1_FILE_NAME_OFFSET	22
  ------------------
  938|      3|	lha->setflag |= CRC_IS_SET;
  ------------------
  |  |  165|      3|#define CRC_IS_SET		8
  ------------------
  939|       |
  940|      3|	sum_calculated = lha_calcsum(0, p, 2, lha->header_size - 2);
  941|       |	/* Consume used bytes but not include `next header size' data
  942|       |	 * since it will be consumed in lha_read_file_extended_header(). */
  943|      3|	__archive_read_consume(a, lha->header_size - 2);
  944|       |
  945|       |	/* Read extended headers */
  946|      3|	err2 = lha_read_file_extended_header(a, lha, NULL, 2,
  947|      3|	    (uint64_t)(lha->compsize + 2), &extdsize);
  948|      3|	if (err2 < ARCHIVE_WARN)
  ------------------
  |  |  235|      3|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (948:6): [True: 3, False: 0]
  ------------------
  949|      3|		return (err2);
  950|      0|	if (err2 < err)
  ------------------
  |  Branch (950:6): [True: 0, False: 0]
  ------------------
  951|      0|		err = err2;
  952|       |	/* Get a real compressed file size. */
  953|      0|	lha->compsize -= extdsize - 2;
  954|       |
  955|      0|	if (lha->compsize < 0)
  ------------------
  |  Branch (955:6): [True: 0, False: 0]
  ------------------
  956|      0|		goto invalid;	/* Invalid compressed file size */
  957|       |
  958|      0|	if (sum_calculated != headersum) {
  ------------------
  |  Branch (958:6): [True: 0, False: 0]
  ------------------
  959|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  960|      0|		    "LHa header sum error");
  961|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  962|      0|	}
  963|      0|	return (err);
  964|      0|invalid:
  965|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  966|      0|	    "Invalid LHa header");
  967|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  968|      0|}
archive_read_support_format_lha.c:lha_read_file_extended_header:
 1148|  2.86k|{
 1149|  2.86k|	const void *h;
 1150|  2.86k|	const unsigned char *extdheader;
 1151|  2.86k|	size_t	extdsize;
 1152|  2.86k|	size_t	datasize;
 1153|  2.86k|	unsigned int i;
 1154|  2.86k|	unsigned char extdtype;
 1155|       |
 1156|  2.86k|#define EXT_HEADER_CRC		0x00		/* Header CRC and information*/
 1157|  2.86k|#define EXT_FILENAME		0x01		/* Filename 		    */
 1158|  2.86k|#define EXT_DIRECTORY		0x02		/* Directory name	    */
 1159|  2.86k|#define EXT_DOS_ATTR		0x40		/* MS-DOS attribute	    */
 1160|  2.86k|#define EXT_TIMESTAMP		0x41		/* Windows time stamp	    */
 1161|  2.86k|#define EXT_FILESIZE		0x42		/* Large file size	    */
 1162|  2.86k|#define EXT_TIMEZONE		0x43		/* Time zone		    */
 1163|  2.86k|#define EXT_UTF16_FILENAME	0x44		/* UTF-16 filename 	    */
 1164|  2.86k|#define EXT_UTF16_DIRECTORY	0x45		/* UTF-16 directory name    */
 1165|  2.86k|#define EXT_CODEPAGE		0x46		/* Codepage		    */
 1166|  2.86k|#define EXT_UNIX_MODE		0x50		/* File permission	    */
 1167|  2.86k|#define EXT_UNIX_GID_UID	0x51		/* gid,uid		    */
 1168|  2.86k|#define EXT_UNIX_GNAME		0x52		/* Group name		    */
 1169|  2.86k|#define EXT_UNIX_UNAME		0x53		/* User name		    */
 1170|  2.86k|#define EXT_UNIX_MTIME		0x54		/* Modified time	    */
 1171|  2.86k|#define EXT_OS2_NEW_ATTR	0x7f		/* new attribute(OS/2 only) */
 1172|  2.86k|#define EXT_NEW_ATTR		0xff		/* new attribute	    */
 1173|       |
 1174|  2.86k|	*total_size = sizefield_length;
 1175|       |
 1176|  9.36k|	for (;;) {
 1177|       |		/* Read an extended header size. */
 1178|  9.36k|		if ((h =
  ------------------
  |  Branch (1178:7): [True: 1, False: 9.35k]
  ------------------
 1179|  9.36k|		    __archive_read_ahead(a, sizefield_length, NULL)) == NULL)
 1180|      1|			return (truncated_error(a));
 1181|       |		/* Check if the size is the zero indicates the end of the
 1182|       |		 * extended header. */
 1183|  9.35k|		if (sizefield_length == sizeof(uint16_t))
  ------------------
  |  Branch (1183:7): [True: 9.35k, False: 0]
  ------------------
 1184|  9.35k|			extdsize = archive_le16dec(h);
 1185|      0|		else
 1186|      0|			extdsize = archive_le32dec(h);
 1187|  9.35k|		if (extdsize == 0) {
  ------------------
  |  Branch (1187:7): [True: 2.85k, False: 6.50k]
  ------------------
 1188|       |			/* End of extended header */
 1189|  2.85k|			if (crc != NULL)
  ------------------
  |  Branch (1189:8): [True: 2.85k, False: 0]
  ------------------
 1190|  2.85k|				*crc = lha_crc16(*crc, h, sizefield_length);
 1191|  2.85k|			__archive_read_consume(a, sizefield_length);
 1192|  2.85k|			return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.85k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1193|  2.85k|		}
 1194|       |
 1195|       |		/* Sanity check to the extended header size. */
 1196|  6.50k|		if (((uint64_t)*total_size + extdsize) > limitsize ||
  ------------------
  |  Branch (1196:7): [True: 5, False: 6.49k]
  ------------------
 1197|  6.49k|		    extdsize <= (size_t)sizefield_length)
  ------------------
  |  Branch (1197:7): [True: 0, False: 6.49k]
  ------------------
 1198|      5|			goto invalid;
 1199|       |
 1200|       |		/* Read the extended header. */
 1201|  6.49k|		if ((h = __archive_read_ahead(a, extdsize, NULL)) == NULL)
  ------------------
  |  Branch (1201:7): [True: 5, False: 6.49k]
  ------------------
 1202|      5|			return (truncated_error(a));
 1203|  6.49k|		*total_size += extdsize;
 1204|       |
 1205|  6.49k|		extdheader = (const unsigned char *)h;
 1206|       |		/* Get the extended header type. */
 1207|  6.49k|		extdtype = extdheader[sizefield_length];
 1208|       |		/* Calculate an extended data size. */
 1209|  6.49k|		datasize = extdsize - (1 + sizefield_length);
 1210|       |		/* Skip an extended header size field and type field. */
 1211|  6.49k|		extdheader += sizefield_length + 1;
 1212|       |
 1213|  6.49k|		if (crc != NULL && extdtype != EXT_HEADER_CRC)
  ------------------
  |  | 1156|  6.07k|#define EXT_HEADER_CRC		0x00		/* Header CRC and information*/
  ------------------
  |  Branch (1213:7): [True: 6.07k, False: 423]
  |  Branch (1213:22): [True: 3.51k, False: 2.55k]
  ------------------
 1214|  3.51k|			*crc = lha_crc16(*crc, h, extdsize);
 1215|  6.49k|		switch (extdtype) {
 1216|  2.55k|		case EXT_HEADER_CRC:
  ------------------
  |  | 1156|  2.55k|#define EXT_HEADER_CRC		0x00		/* Header CRC and information*/
  ------------------
  |  Branch (1216:3): [True: 2.55k, False: 3.93k]
  ------------------
 1217|       |			/* We only use a header CRC. Following data will not
 1218|       |			 * be used. */
 1219|  2.55k|			if (datasize >= 2) {
  ------------------
  |  Branch (1219:8): [True: 2.55k, False: 0]
  ------------------
 1220|  2.55k|				lha->header_crc = archive_le16dec(extdheader);
 1221|  2.55k|				if (crc != NULL) {
  ------------------
  |  Branch (1221:9): [True: 2.55k, False: 0]
  ------------------
 1222|  2.55k|					static const char zeros[2] = {0, 0};
 1223|  2.55k|					*crc = lha_crc16(*crc, h,
 1224|  2.55k|					    extdsize - datasize);
 1225|       |					/* CRC value itself as zero */
 1226|  2.55k|					*crc = lha_crc16(*crc, zeros, 2);
 1227|  2.55k|					*crc = lha_crc16(*crc,
 1228|  2.55k|					    extdheader+2, datasize - 2);
 1229|  2.55k|				}
 1230|  2.55k|			}
 1231|  2.55k|			break;
 1232|  2.85k|		case EXT_FILENAME:
  ------------------
  |  | 1157|  2.85k|#define EXT_FILENAME		0x01		/* Filename 		    */
  ------------------
  |  Branch (1232:3): [True: 2.85k, False: 3.63k]
  ------------------
 1233|  2.85k|			if (datasize == 0) {
  ------------------
  |  Branch (1233:8): [True: 0, False: 2.85k]
  ------------------
 1234|       |				/* maybe directory header */
 1235|      0|				archive_string_empty(&lha->filename);
  ------------------
  |  |  181|      0|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 1236|      0|				break;
 1237|      0|			}
 1238|  2.85k|			if (extdheader[0] == '\0')
  ------------------
  |  Branch (1238:8): [True: 0, False: 2.85k]
  ------------------
 1239|      0|				goto invalid;
 1240|  2.85k|			archive_strncpy(&lha->filename,
  ------------------
  |  |  173|  2.85k|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 1241|  2.85k|			    (const char *)extdheader, datasize);
 1242|  2.85k|			break;
 1243|      0|		case EXT_UTF16_FILENAME:
  ------------------
  |  | 1163|      0|#define EXT_UTF16_FILENAME	0x44		/* UTF-16 filename 	    */
  ------------------
  |  Branch (1243:3): [True: 0, False: 6.49k]
  ------------------
 1244|      0|			if (datasize == 0) {
  ------------------
  |  Branch (1244:8): [True: 0, False: 0]
  ------------------
 1245|       |				/* maybe directory header */
 1246|      0|				archive_string_empty(&lha->filename);
  ------------------
  |  |  181|      0|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 1247|      0|				break;
 1248|      0|			} else if (datasize & 1) {
  ------------------
  |  Branch (1248:15): [True: 0, False: 0]
  ------------------
 1249|       |				/* UTF-16 characters take always 2 or 4 bytes */
 1250|      0|				goto invalid;
 1251|      0|			}
 1252|      0|			if (extdheader[0] == '\0')
  ------------------
  |  Branch (1252:8): [True: 0, False: 0]
  ------------------
 1253|      0|				goto invalid;
 1254|      0|			archive_string_empty(&lha->filename);
  ------------------
  |  |  181|      0|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 1255|      0|			archive_array_append(&lha->filename,
 1256|      0|				(const char *)extdheader, datasize);
 1257|       |			/* Setup a string conversion for a filename. */
 1258|      0|			lha->sconv_fname =
 1259|      0|			    archive_string_conversion_from_charset(&a->archive,
 1260|      0|			        "UTF-16LE", 1);
 1261|      0|			if (lha->sconv_fname == NULL)
  ------------------
  |  Branch (1261:8): [True: 0, False: 0]
  ------------------
 1262|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1263|      0|			break;
 1264|      1|		case EXT_DIRECTORY:
  ------------------
  |  | 1158|      1|#define EXT_DIRECTORY		0x02		/* Directory name	    */
  ------------------
  |  Branch (1264:3): [True: 1, False: 6.49k]
  ------------------
 1265|      1|			if (datasize == 0 || extdheader[0] == '\0')
  ------------------
  |  Branch (1265:8): [True: 0, False: 1]
  |  Branch (1265:25): [True: 0, False: 1]
  ------------------
 1266|       |				/* no directory name data. exit this case. */
 1267|      0|				goto invalid;
 1268|       |
 1269|      1|			archive_strncpy(&lha->dirname,
  ------------------
  |  |  173|      1|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 1270|      1|		  	    (const char *)extdheader, datasize);
 1271|       |			/*
 1272|       |			 * Convert directory delimiter from 0xFF
 1273|       |			 * to '/' for local system.
 1274|       |	 		 */
 1275|      2|			for (i = 0; i < lha->dirname.length; i++) {
  ------------------
  |  Branch (1275:16): [True: 1, False: 1]
  ------------------
 1276|      1|				if ((unsigned char)lha->dirname.s[i] == 0xFF)
  ------------------
  |  Branch (1276:9): [True: 0, False: 1]
  ------------------
 1277|      0|					lha->dirname.s[i] = '/';
 1278|      1|			}
 1279|       |			/* Is last character directory separator? */
 1280|      1|			if (lha->dirname.s[lha->dirname.length-1] != '/')
  ------------------
  |  Branch (1280:8): [True: 1, False: 0]
  ------------------
 1281|       |				/* invalid directory data */
 1282|      1|				goto invalid;
 1283|      0|			break;
 1284|      0|		case EXT_UTF16_DIRECTORY:
  ------------------
  |  | 1164|      0|#define EXT_UTF16_DIRECTORY	0x45		/* UTF-16 directory name    */
  ------------------
  |  Branch (1284:3): [True: 0, False: 6.49k]
  ------------------
 1285|       |			/* UTF-16 characters take always 2 or 4 bytes */
 1286|      0|			if (datasize == 0 || (datasize & 1) ||
  ------------------
  |  Branch (1286:8): [True: 0, False: 0]
  |  Branch (1286:25): [True: 0, False: 0]
  ------------------
 1287|      0|			    extdheader[0] == '\0') {
  ------------------
  |  Branch (1287:8): [True: 0, False: 0]
  ------------------
 1288|       |				/* no directory name data. exit this case. */
 1289|      0|				goto invalid;
 1290|      0|			}
 1291|       |
 1292|      0|			archive_string_empty(&lha->dirname);
  ------------------
  |  |  181|      0|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 1293|      0|			archive_array_append(&lha->dirname,
 1294|      0|				(const char *)extdheader, datasize);
 1295|      0|			lha->sconv_dir =
 1296|      0|			    archive_string_conversion_from_charset(&a->archive,
 1297|      0|			        "UTF-16LE", 1);
 1298|      0|			if (lha->sconv_dir == NULL)
  ------------------
  |  Branch (1298:8): [True: 0, False: 0]
  ------------------
 1299|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1300|      0|			else {
 1301|       |				/*
 1302|       |				 * Convert directory delimiter from 0xFFFF
 1303|       |				 * to '/' for local system.
 1304|       |				 */
 1305|      0|				uint16_t dirSep;
 1306|      0|				uint16_t d = 1;
 1307|      0|				if (archive_be16dec(&d) == 1)
  ------------------
  |  Branch (1307:9): [True: 0, False: 0]
  ------------------
 1308|      0|					dirSep = 0x2F00;
 1309|      0|				else
 1310|      0|					dirSep = 0x002F;
 1311|       |
 1312|       |				/* UTF-16LE character */
 1313|      0|				uint16_t *utf16name =
 1314|      0|				    (uint16_t *)lha->dirname.s;
 1315|      0|				for (i = 0; i < lha->dirname.length / 2; i++) {
  ------------------
  |  Branch (1315:17): [True: 0, False: 0]
  ------------------
 1316|      0|					if (utf16name[i] == 0xFFFF) {
  ------------------
  |  Branch (1316:10): [True: 0, False: 0]
  ------------------
 1317|      0|						utf16name[i] = dirSep;
 1318|      0|					}
 1319|      0|				}
 1320|       |				/* Is last character directory separator? */
 1321|      0|				if (utf16name[lha->dirname.length / 2 - 1] !=
  ------------------
  |  Branch (1321:9): [True: 0, False: 0]
  ------------------
 1322|      0|				    dirSep) {
 1323|       |					/* invalid directory data */
 1324|      0|					goto invalid;
 1325|      0|				}
 1326|      0|			}
 1327|      0|			break;
 1328|      5|		case EXT_DOS_ATTR:
  ------------------
  |  | 1159|      5|#define EXT_DOS_ATTR		0x40		/* MS-DOS attribute	    */
  ------------------
  |  Branch (1328:3): [True: 5, False: 6.48k]
  ------------------
 1329|      5|			if (datasize == 2)
  ------------------
  |  Branch (1329:8): [True: 5, False: 0]
  ------------------
 1330|      5|				lha->dos_attr = (unsigned char)
 1331|      5|				    (archive_le16dec(extdheader) & 0xff);
 1332|      5|			break;
 1333|      0|		case EXT_TIMESTAMP:
  ------------------
  |  | 1160|      0|#define EXT_TIMESTAMP		0x41		/* Windows time stamp	    */
  ------------------
  |  Branch (1333:3): [True: 0, False: 6.49k]
  ------------------
 1334|      0|			if (datasize == (sizeof(uint64_t) * 3)) {
  ------------------
  |  Branch (1334:8): [True: 0, False: 0]
  ------------------
 1335|      0|				ntfs_to_unix(archive_le64dec(extdheader),
 1336|      0|					&lha->birthtime,
 1337|      0|				    &lha->birthtime_tv_nsec);
 1338|      0|				extdheader += sizeof(uint64_t);
 1339|      0|				ntfs_to_unix(archive_le64dec(extdheader),
 1340|      0|					&lha->mtime,
 1341|      0|				    &lha->mtime_tv_nsec);
 1342|      0|				extdheader += sizeof(uint64_t);
 1343|      0|				ntfs_to_unix(archive_le64dec(extdheader),
 1344|      0|					&lha->atime,
 1345|      0|				    &lha->atime_tv_nsec);
 1346|      0|				lha->setflag |= BIRTHTIME_IS_SET |
  ------------------
  |  |  162|      0|#define BIRTHTIME_IS_SET	1
  ------------------
 1347|      0|				    ATIME_IS_SET;
  ------------------
  |  |  163|      0|#define ATIME_IS_SET		2
  ------------------
 1348|      0|			}
 1349|      0|			break;
 1350|      4|		case EXT_FILESIZE:
  ------------------
  |  | 1161|      4|#define EXT_FILESIZE		0x42		/* Large file size	    */
  ------------------
  |  Branch (1350:3): [True: 4, False: 6.48k]
  ------------------
 1351|      4|			if (datasize == sizeof(uint64_t) * 2) {
  ------------------
  |  Branch (1351:8): [True: 0, False: 4]
  ------------------
 1352|      0|				lha->compsize = archive_le64dec(extdheader);
 1353|      0|				extdheader += sizeof(uint64_t);
 1354|      0|				lha->origsize = archive_le64dec(extdheader);
 1355|      0|				if (lha->compsize < 0 || lha->origsize < 0)
  ------------------
  |  Branch (1355:9): [True: 0, False: 0]
  |  Branch (1355:30): [True: 0, False: 0]
  ------------------
 1356|      0|					goto invalid;
 1357|      0|			}
 1358|      4|			break;
 1359|      4|		case EXT_CODEPAGE:
  ------------------
  |  | 1165|      0|#define EXT_CODEPAGE		0x46		/* Codepage		    */
  ------------------
  |  Branch (1359:3): [True: 0, False: 6.49k]
  ------------------
 1360|       |			/* Get an archived filename charset from codepage.
 1361|       |			 * This overwrites the charset specified by
 1362|       |			 * hdrcharset option. */
 1363|      0|			if (datasize == sizeof(uint32_t)) {
  ------------------
  |  Branch (1363:8): [True: 0, False: 0]
  ------------------
 1364|      0|				struct archive_string cp;
 1365|      0|				const char *charset;
 1366|       |
 1367|      0|				archive_string_init(&cp);
  ------------------
  |  |   71|      0|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1368|      0|				switch (archive_le32dec(extdheader)) {
 1369|      0|				case 65001: /* UTF-8 */
  ------------------
  |  Branch (1369:5): [True: 0, False: 0]
  ------------------
 1370|      0|					charset = "UTF-8";
 1371|      0|					break;
 1372|      0|				default:
  ------------------
  |  Branch (1372:5): [True: 0, False: 0]
  ------------------
 1373|      0|					archive_string_sprintf(&cp, "CP%d",
 1374|      0|					    (int)archive_le32dec(extdheader));
 1375|      0|					charset = cp.s;
 1376|      0|					break;
 1377|      0|				}
 1378|      0|				lha->sconv_dir =
 1379|      0|				    archive_string_conversion_from_charset(
 1380|      0|					&(a->archive), charset, 1);
 1381|      0|				lha->sconv_fname =
 1382|      0|				    archive_string_conversion_from_charset(
 1383|      0|					&(a->archive), charset, 1);
 1384|      0|				archive_string_free(&cp);
 1385|      0|				if (lha->sconv_dir == NULL)
  ------------------
  |  Branch (1385:9): [True: 0, False: 0]
  ------------------
 1386|      0|					return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1387|      0|				if (lha->sconv_fname == NULL)
  ------------------
  |  Branch (1387:9): [True: 0, False: 0]
  ------------------
 1388|      0|					return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1389|      0|			}
 1390|      0|			break;
 1391|    175|		case EXT_UNIX_MODE:
  ------------------
  |  | 1166|    175|#define EXT_UNIX_MODE		0x50		/* File permission	    */
  ------------------
  |  Branch (1391:3): [True: 175, False: 6.31k]
  ------------------
 1392|    175|			if (datasize == sizeof(uint16_t)) {
  ------------------
  |  Branch (1392:8): [True: 0, False: 175]
  ------------------
 1393|      0|				lha->mode = archive_le16dec(extdheader);
 1394|      0|				lha->setflag |= UNIX_MODE_IS_SET;
  ------------------
  |  |  164|      0|#define UNIX_MODE_IS_SET	4
  ------------------
 1395|      0|			}
 1396|    175|			break;
 1397|    239|		case EXT_UNIX_GID_UID:
  ------------------
  |  | 1167|    239|#define EXT_UNIX_GID_UID	0x51		/* gid,uid		    */
  ------------------
  |  Branch (1397:3): [True: 239, False: 6.25k]
  ------------------
 1398|    239|			if (datasize == (sizeof(uint16_t) * 2)) {
  ------------------
  |  Branch (1398:8): [True: 239, False: 0]
  ------------------
 1399|    239|				lha->gid = archive_le16dec(extdheader);
 1400|    239|				lha->uid = archive_le16dec(extdheader+2);
 1401|    239|			}
 1402|    239|			break;
 1403|    179|		case EXT_UNIX_GNAME:
  ------------------
  |  | 1168|    179|#define EXT_UNIX_GNAME		0x52		/* Group name		    */
  ------------------
  |  Branch (1403:3): [True: 179, False: 6.31k]
  ------------------
 1404|    179|			if (datasize > 0)
  ------------------
  |  Branch (1404:8): [True: 179, False: 0]
  ------------------
 1405|    179|				archive_strncpy(&lha->gname,
  ------------------
  |  |  173|    179|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 1406|    179|				    (const char *)extdheader, datasize);
 1407|    179|			break;
 1408|      1|		case EXT_UNIX_UNAME:
  ------------------
  |  | 1169|      1|#define EXT_UNIX_UNAME		0x53		/* User name		    */
  ------------------
  |  Branch (1408:3): [True: 1, False: 6.49k]
  ------------------
 1409|      1|			if (datasize > 0)
  ------------------
  |  Branch (1409:8): [True: 1, False: 0]
  ------------------
 1410|      1|				archive_strncpy(&lha->uname,
  ------------------
  |  |  173|      1|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 1411|      1|				    (const char *)extdheader, datasize);
 1412|      1|			break;
 1413|      0|		case EXT_UNIX_MTIME:
  ------------------
  |  | 1170|      0|#define EXT_UNIX_MTIME		0x54		/* Modified time	    */
  ------------------
  |  Branch (1413:3): [True: 0, False: 6.49k]
  ------------------
 1414|      0|			if (datasize == sizeof(uint32_t))
  ------------------
  |  Branch (1414:8): [True: 0, False: 0]
  ------------------
 1415|      0|				lha->mtime = archive_le32dec(extdheader);
 1416|      0|			break;
 1417|      0|		case EXT_OS2_NEW_ATTR:
  ------------------
  |  | 1171|      0|#define EXT_OS2_NEW_ATTR	0x7f		/* new attribute(OS/2 only) */
  ------------------
  |  Branch (1417:3): [True: 0, False: 6.49k]
  ------------------
 1418|       |			/* This extended header is OS/2 depend. */
 1419|      0|			if (datasize == 16) {
  ------------------
  |  Branch (1419:8): [True: 0, False: 0]
  ------------------
 1420|      0|				lha->dos_attr = (unsigned char)
 1421|      0|				    (archive_le16dec(extdheader) & 0xff);
 1422|      0|				lha->mode = archive_le16dec(extdheader+2);
 1423|      0|				lha->gid = archive_le16dec(extdheader+4);
 1424|      0|				lha->uid = archive_le16dec(extdheader+6);
 1425|      0|				lha->birthtime = archive_le32dec(extdheader+8);
 1426|      0|				lha->atime = archive_le32dec(extdheader+12);
 1427|      0|				lha->setflag |= UNIX_MODE_IS_SET
  ------------------
  |  |  164|      0|#define UNIX_MODE_IS_SET	4
  ------------------
 1428|      0|				    | BIRTHTIME_IS_SET | ATIME_IS_SET;
  ------------------
  |  |  162|      0|#define BIRTHTIME_IS_SET	1
  ------------------
              				    | BIRTHTIME_IS_SET | ATIME_IS_SET;
  ------------------
  |  |  163|      0|#define ATIME_IS_SET		2
  ------------------
 1429|      0|			}
 1430|      0|			break;
 1431|      8|		case EXT_NEW_ATTR:
  ------------------
  |  | 1172|      8|#define EXT_NEW_ATTR		0xff		/* new attribute	    */
  ------------------
  |  Branch (1431:3): [True: 8, False: 6.48k]
  ------------------
 1432|      8|			if (datasize == 20) {
  ------------------
  |  Branch (1432:8): [True: 0, False: 8]
  ------------------
 1433|      0|				lha->mode = (mode_t)archive_le32dec(extdheader);
 1434|      0|				lha->gid = archive_le32dec(extdheader+4);
 1435|      0|				lha->uid = archive_le32dec(extdheader+8);
 1436|      0|				lha->birthtime = archive_le32dec(extdheader+12);
 1437|      0|				lha->atime = archive_le32dec(extdheader+16);
 1438|      0|				lha->setflag |= UNIX_MODE_IS_SET
  ------------------
  |  |  164|      0|#define UNIX_MODE_IS_SET	4
  ------------------
 1439|      0|				    | BIRTHTIME_IS_SET | ATIME_IS_SET;
  ------------------
  |  |  162|      0|#define BIRTHTIME_IS_SET	1
  ------------------
              				    | BIRTHTIME_IS_SET | ATIME_IS_SET;
  ------------------
  |  |  163|      0|#define ATIME_IS_SET		2
  ------------------
 1440|      0|			}
 1441|      8|			break;
 1442|      0|		case EXT_TIMEZONE:		/* Not supported */
  ------------------
  |  | 1162|      0|#define EXT_TIMEZONE		0x43		/* Time zone		    */
  ------------------
  |  Branch (1442:3): [True: 0, False: 6.49k]
  ------------------
 1443|      0|			break;
 1444|    467|		default:
  ------------------
  |  Branch (1444:3): [True: 467, False: 6.02k]
  ------------------
 1445|    467|			break;
 1446|  6.49k|		}
 1447|       |
 1448|  6.49k|		__archive_read_consume(a, extdsize);
 1449|  6.49k|	}
 1450|      6|invalid:
 1451|      6|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      6|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1452|      6|	    "Invalid extended LHa header");
 1453|      6|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      6|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1454|  2.86k|}
archive_read_support_format_lha.c:lha_crc16:
 1763|  26.8k|{
 1764|  26.8k|	const unsigned char *p = (const unsigned char *)pp;
 1765|  26.8k|	const uint16_t *buff;
 1766|  26.8k|	const union {
 1767|  26.8k|		uint32_t i;
 1768|  26.8k|		char c[4];
 1769|  26.8k|	} u = { 0x01020304 };
 1770|       |
 1771|  26.8k|	if (len == 0)
  ------------------
  |  Branch (1771:6): [True: 2.55k, False: 24.3k]
  ------------------
 1772|  2.55k|		return crc;
 1773|       |
 1774|       |	/* Process unaligned address. */
 1775|  24.3k|	if (((uintptr_t)p) & (uintptr_t)0x1) {
  ------------------
  |  Branch (1775:6): [True: 7.97k, False: 16.3k]
  ------------------
 1776|  7.97k|		crc = (crc >> 8) ^ crc16tbl[0][(crc ^ *p++) & 0xff];
 1777|  7.97k|		len--;
 1778|  7.97k|	}
 1779|  24.3k|	buff = (const uint16_t *)p;
 1780|       |	/*
 1781|       |	 * Modern C compiler such as GCC does not unroll automatically yet
 1782|       |	 * without unrolling pragma, and Clang is so. So we should
 1783|       |	 * unroll this loop for its performance.
 1784|       |	 */
 1785|   153M|	for (;len >= 8; len -= 8) {
  ------------------
  |  Branch (1785:8): [True: 153M, False: 24.3k]
  ------------------
 1786|       |		/* This if statement expects compiler optimization will
 1787|       |		 * remove the statement which will not be executed. */
 1788|   153M|#undef bswap16
 1789|       |#ifndef __has_builtin
 1790|       |#define __has_builtin(x) 0
 1791|       |#endif
 1792|       |#if defined(_MSC_VER) && _MSC_VER >= 1400  /* Visual Studio */
 1793|       |#  define bswap16(x) _byteswap_ushort(x)
 1794|       |#elif defined(__GNUC__) && ((__GNUC__ == 4 && __GNUC_MINOR__ >= 8) || __GNUC__ > 4)
 1795|       |/* GCC 4.8 and later has __builtin_bswap16() */
 1796|       |#  define bswap16(x) __builtin_bswap16(x)
 1797|       |#elif defined(__clang__) && __has_builtin(__builtin_bswap16)
 1798|       |/* Newer clang versions have __builtin_bswap16() */
 1799|   153M|#  define bswap16(x) __builtin_bswap16(x)
 1800|       |#else
 1801|       |#  define bswap16(x) ((((x) >> 8) & 0xff) | ((x) << 8))
 1802|       |#endif
 1803|   153M|#define CRC16W	do { 	\
 1804|   153M|		if(u.c[0] == 1) { /* Big endian */		\
 1805|   153M|			crc ^= bswap16(*buff); buff++;		\
 1806|   153M|		} else						\
 1807|   153M|			crc ^= *buff++;				\
 1808|   153M|		crc = crc16tbl[1][crc & 0xff] ^ crc16tbl[0][crc >> 8];\
 1809|   153M|} while (0)
 1810|   153M|		CRC16W;
  ------------------
  |  | 1803|   153M|#define CRC16W	do { 	\
  |  | 1804|   153M|		if(u.c[0] == 1) { /* Big endian */		\
  |  |  ------------------
  |  |  |  Branch (1804:6): [True: 0, False: 153M]
  |  |  ------------------
  |  | 1805|      0|			crc ^= bswap16(*buff); buff++;		\
  |  |  ------------------
  |  |  |  | 1799|      0|#  define bswap16(x) __builtin_bswap16(x)
  |  |  ------------------
  |  | 1806|      0|		} else						\
  |  | 1807|   153M|			crc ^= *buff++;				\
  |  | 1808|   153M|		crc = crc16tbl[1][crc & 0xff] ^ crc16tbl[0][crc >> 8];\
  |  | 1809|   153M|} while (0)
  |  |  ------------------
  |  |  |  Branch (1809:10): [Folded, False: 153M]
  |  |  ------------------
  ------------------
 1811|   153M|		CRC16W;
  ------------------
  |  | 1803|   153M|#define CRC16W	do { 	\
  |  | 1804|   153M|		if(u.c[0] == 1) { /* Big endian */		\
  |  |  ------------------
  |  |  |  Branch (1804:6): [True: 0, False: 153M]
  |  |  ------------------
  |  | 1805|      0|			crc ^= bswap16(*buff); buff++;		\
  |  |  ------------------
  |  |  |  | 1799|      0|#  define bswap16(x) __builtin_bswap16(x)
  |  |  ------------------
  |  | 1806|      0|		} else						\
  |  | 1807|   153M|			crc ^= *buff++;				\
  |  | 1808|   153M|		crc = crc16tbl[1][crc & 0xff] ^ crc16tbl[0][crc >> 8];\
  |  | 1809|   153M|} while (0)
  |  |  ------------------
  |  |  |  Branch (1809:10): [Folded, False: 153M]
  |  |  ------------------
  ------------------
 1812|   153M|		CRC16W;
  ------------------
  |  | 1803|   153M|#define CRC16W	do { 	\
  |  | 1804|   153M|		if(u.c[0] == 1) { /* Big endian */		\
  |  |  ------------------
  |  |  |  Branch (1804:6): [True: 0, False: 153M]
  |  |  ------------------
  |  | 1805|      0|			crc ^= bswap16(*buff); buff++;		\
  |  |  ------------------
  |  |  |  | 1799|      0|#  define bswap16(x) __builtin_bswap16(x)
  |  |  ------------------
  |  | 1806|      0|		} else						\
  |  | 1807|   153M|			crc ^= *buff++;				\
  |  | 1808|   153M|		crc = crc16tbl[1][crc & 0xff] ^ crc16tbl[0][crc >> 8];\
  |  | 1809|   153M|} while (0)
  |  |  ------------------
  |  |  |  Branch (1809:10): [Folded, False: 153M]
  |  |  ------------------
  ------------------
 1813|   153M|		CRC16W;
  ------------------
  |  | 1803|   153M|#define CRC16W	do { 	\
  |  | 1804|   153M|		if(u.c[0] == 1) { /* Big endian */		\
  |  |  ------------------
  |  |  |  Branch (1804:6): [True: 0, False: 153M]
  |  |  ------------------
  |  | 1805|      0|			crc ^= bswap16(*buff); buff++;		\
  |  |  ------------------
  |  |  |  | 1799|      0|#  define bswap16(x) __builtin_bswap16(x)
  |  |  ------------------
  |  | 1806|      0|		} else						\
  |  | 1807|   153M|			crc ^= *buff++;				\
  |  | 1808|   153M|		crc = crc16tbl[1][crc & 0xff] ^ crc16tbl[0][crc >> 8];\
  |  | 1809|   153M|} while (0)
  |  |  ------------------
  |  |  |  Branch (1809:10): [Folded, False: 153M]
  |  |  ------------------
  ------------------
 1814|   153M|#undef CRC16W
 1815|   153M|#undef bswap16
 1816|   153M|	}
 1817|       |
 1818|  24.3k|	p = (const unsigned char *)buff;
 1819|  69.9k|	for (;len; len--) {
  ------------------
  |  Branch (1819:8): [True: 45.5k, False: 24.3k]
  ------------------
 1820|  45.5k|		crc = (crc >> 8) ^ crc16tbl[0][(crc ^ *p++) & 0xff];
 1821|  45.5k|	}
 1822|  24.3k|	return crc;
 1823|  26.8k|}
archive_read_support_format_lha.c:lha_read_file_header_2:
 1000|  2.86k|{
 1001|  2.86k|	const unsigned char *p;
 1002|  2.86k|	size_t extdsize;
 1003|  2.86k|	int err, padding;
 1004|  2.86k|	uint16_t header_crc;
 1005|       |
 1006|  2.86k|	if ((p = __archive_read_ahead(a, H2_FIXED_SIZE, NULL)) == NULL)
  ------------------
  |  |  997|  2.86k|#define H2_FIXED_SIZE		24
  ------------------
  |  Branch (1006:6): [True: 0, False: 2.86k]
  ------------------
 1007|      0|		return (truncated_error(a));
 1008|       |
 1009|  2.86k|	lha->header_size =archive_le16dec(p + H2_HEADER_SIZE_OFFSET);
  ------------------
  |  |  992|  2.86k|#define H2_HEADER_SIZE_OFFSET	0
  ------------------
 1010|  2.86k|	lha->compsize = archive_le32dec(p + H2_COMP_SIZE_OFFSET);
  ------------------
  |  |  993|  2.86k|#define H2_COMP_SIZE_OFFSET	7
  ------------------
 1011|  2.86k|	lha->origsize = archive_le32dec(p + H2_ORIG_SIZE_OFFSET);
  ------------------
  |  |  994|  2.86k|#define H2_ORIG_SIZE_OFFSET	11
  ------------------
 1012|  2.86k|	lha->mtime = archive_le32dec(p + H2_TIME_OFFSET);
  ------------------
  |  |  995|  2.86k|#define H2_TIME_OFFSET		15
  ------------------
 1013|  2.86k|	lha->crc = archive_le16dec(p + H2_CRC_OFFSET);
  ------------------
  |  |  996|  2.86k|#define H2_CRC_OFFSET		21
  ------------------
 1014|  2.86k|	lha->setflag |= CRC_IS_SET;
  ------------------
  |  |  165|  2.86k|#define CRC_IS_SET		8
  ------------------
 1015|       |
 1016|  2.86k|	if (lha->header_size < H2_FIXED_SIZE) {
  ------------------
  |  |  997|  2.86k|#define H2_FIXED_SIZE		24
  ------------------
  |  Branch (1016:6): [True: 0, False: 2.86k]
  ------------------
 1017|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1018|      0|		    "Invalid LHa header size");
 1019|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1020|      0|	}
 1021|       |
 1022|  2.86k|	header_crc = lha_crc16(0, p, H2_FIXED_SIZE);
  ------------------
  |  |  997|  2.86k|#define H2_FIXED_SIZE		24
  ------------------
 1023|  2.86k|	__archive_read_consume(a, H2_FIXED_SIZE);
  ------------------
  |  |  997|  2.86k|#define H2_FIXED_SIZE		24
  ------------------
 1024|       |
 1025|       |	/* Read extended headers */
 1026|  2.86k|	err = lha_read_file_extended_header(a, lha, &header_crc, 2,
 1027|  2.86k|		  lha->header_size - H2_FIXED_SIZE, &extdsize);
  ------------------
  |  |  997|  2.86k|#define H2_FIXED_SIZE		24
  ------------------
 1028|  2.86k|	if (err < ARCHIVE_WARN)
  ------------------
  |  |  235|  2.86k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (1028:6): [True: 9, False: 2.85k]
  ------------------
 1029|      9|		return (err);
 1030|       |
 1031|       |	/* Calculate a padding size. The result will be normally 0 or 1. */
 1032|  2.85k|	padding = (int)lha->header_size - (int)(H2_FIXED_SIZE + extdsize);
  ------------------
  |  |  997|  2.85k|#define H2_FIXED_SIZE		24
  ------------------
 1033|  2.85k|	if (padding > 0) {
  ------------------
  |  Branch (1033:6): [True: 0, False: 2.85k]
  ------------------
 1034|      0|		if ((p = __archive_read_ahead(a, padding, NULL)) == NULL)
  ------------------
  |  Branch (1034:7): [True: 0, False: 0]
  ------------------
 1035|      0|			return (truncated_error(a));
 1036|      0|		header_crc = lha_crc16(header_crc, p, padding);
 1037|      0|		__archive_read_consume(a, padding);
 1038|      0|	}
 1039|       |
 1040|  2.85k|	if (header_crc != lha->header_crc) {
  ------------------
  |  Branch (1040:6): [True: 1.13k, False: 1.72k]
  ------------------
 1041|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 1042|       |		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
 1043|       |		    "LHa header CRC error");
 1044|       |		return (ARCHIVE_FATAL);
 1045|       |#endif
 1046|  1.13k|	}
 1047|  2.85k|	return (err);
 1048|  2.85k|}
archive_read_support_format_lha.c:lha_read_file_header_3:
 1081|      1|{
 1082|      1|	const unsigned char *p;
 1083|      1|	size_t extdsize;
 1084|      1|	int err;
 1085|      1|	uint16_t header_crc;
 1086|       |
 1087|      1|	if ((p = __archive_read_ahead(a, H3_FIXED_SIZE, NULL)) == NULL)
  ------------------
  |  | 1078|      1|#define H3_FIXED_SIZE		28
  ------------------
  |  Branch (1087:6): [True: 0, False: 1]
  ------------------
 1088|      0|		return (truncated_error(a));
 1089|       |
 1090|      1|	if (archive_le16dec(p + H3_FIELD_LEN_OFFSET) != 4)
  ------------------
  |  | 1072|      1|#define H3_FIELD_LEN_OFFSET	0
  ------------------
  |  Branch (1090:6): [True: 0, False: 1]
  ------------------
 1091|      0|		goto invalid;
 1092|      1|	lha->header_size = archive_le32dec(p + H3_HEADER_SIZE_OFFSET);
  ------------------
  |  | 1077|      1|#define H3_HEADER_SIZE_OFFSET	24
  ------------------
 1093|      1|	lha->compsize = archive_le32dec(p + H3_COMP_SIZE_OFFSET);
  ------------------
  |  | 1073|      1|#define H3_COMP_SIZE_OFFSET	7
  ------------------
 1094|      1|	lha->origsize = archive_le32dec(p + H3_ORIG_SIZE_OFFSET);
  ------------------
  |  | 1074|      1|#define H3_ORIG_SIZE_OFFSET	11
  ------------------
 1095|      1|	lha->mtime = archive_le32dec(p + H3_TIME_OFFSET);
  ------------------
  |  | 1075|      1|#define H3_TIME_OFFSET		15
  ------------------
 1096|      1|	lha->crc = archive_le16dec(p + H3_CRC_OFFSET);
  ------------------
  |  | 1076|      1|#define H3_CRC_OFFSET		21
  ------------------
 1097|      1|	lha->setflag |= CRC_IS_SET;
  ------------------
  |  |  165|      1|#define CRC_IS_SET		8
  ------------------
 1098|       |
 1099|      1|	if (lha->header_size < H3_FIXED_SIZE + 4)
  ------------------
  |  | 1078|      1|#define H3_FIXED_SIZE		28
  ------------------
  |  Branch (1099:6): [True: 0, False: 1]
  ------------------
 1100|      0|		goto invalid;
 1101|      1|	header_crc = lha_crc16(0, p, H3_FIXED_SIZE);
  ------------------
  |  | 1078|      1|#define H3_FIXED_SIZE		28
  ------------------
 1102|      1|	__archive_read_consume(a, H3_FIXED_SIZE);
  ------------------
  |  | 1078|      1|#define H3_FIXED_SIZE		28
  ------------------
 1103|       |
 1104|       |	/* Reject rediculously large header */
 1105|      1|	if (lha->header_size > 65536) {
  ------------------
  |  Branch (1105:6): [True: 1, False: 0]
  ------------------
 1106|      1|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1107|      1|		    "LHa header size too large");
 1108|      1|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1109|      1|	}
 1110|       |
 1111|       |	/* Read extended headers */
 1112|      0|	err = lha_read_file_extended_header(a, lha, &header_crc, 4,
 1113|      0|		  lha->header_size - H3_FIXED_SIZE, &extdsize);
  ------------------
  |  | 1078|      0|#define H3_FIXED_SIZE		28
  ------------------
 1114|      0|	if (err < ARCHIVE_WARN)
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (1114:6): [True: 0, False: 0]
  ------------------
 1115|      0|		return (err);
 1116|       |
 1117|      0|	if (header_crc != lha->header_crc) {
  ------------------
  |  Branch (1117:6): [True: 0, False: 0]
  ------------------
 1118|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 1119|       |		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
 1120|       |		    "LHa header CRC error");
 1121|       |		return (ARCHIVE_FATAL);
 1122|       |#endif
 1123|      0|	}
 1124|      0|	return (err);
 1125|      0|invalid:
 1126|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1127|      0|	    "Invalid LHa header");
 1128|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1129|      0|}
archive_read_support_format_lha.c:archive_read_format_lha_read_data:
 1479|  12.8k|{
 1480|  12.8k|	struct lha *lha = (struct lha *)(a->format->data);
 1481|  12.8k|	int r;
 1482|       |
 1483|  12.8k|	if (lha->entry_unconsumed) {
  ------------------
  |  Branch (1483:6): [True: 1.16k, False: 11.6k]
  ------------------
 1484|       |		/* Consume as much as the decompressor actually used. */
 1485|  1.16k|		__archive_read_consume(a, lha->entry_unconsumed);
 1486|  1.16k|		lha->entry_unconsumed = 0;
 1487|  1.16k|	}
 1488|  12.8k|	if (lha->end_of_entry) {
  ------------------
  |  Branch (1488:6): [True: 300, False: 12.5k]
  ------------------
 1489|    300|		*offset = lha->entry_offset;
 1490|    300|		*size = 0;
 1491|    300|		*buff = NULL;
 1492|    300|		return (lha_end_of_entry(a));
 1493|    300|	}
 1494|       |
 1495|  12.5k|	if (lha->entry_is_compressed)
  ------------------
  |  Branch (1495:6): [True: 12.2k, False: 300]
  ------------------
 1496|  12.2k|		r =  lha_read_data_lzh(a, buff, size, offset);
 1497|    300|	else
 1498|       |		/* No compression. */
 1499|    300|		r =  lha_read_data_none(a, buff, size, offset);
 1500|  12.5k|	return (r);
 1501|  12.8k|}
archive_read_support_format_lha.c:lha_end_of_entry:
 1458|    615|{
 1459|    615|	struct lha *lha = (struct lha *)(a->format->data);
 1460|    615|	int r = ARCHIVE_EOF;
  ------------------
  |  |  232|    615|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1461|       |
 1462|    615|	if (!lha->end_of_entry_cleanup) {
  ------------------
  |  Branch (1462:6): [True: 615, False: 0]
  ------------------
 1463|    615|		if ((lha->setflag & CRC_IS_SET) &&
  ------------------
  |  |  165|    615|#define CRC_IS_SET		8
  ------------------
  |  Branch (1463:7): [True: 615, False: 0]
  ------------------
 1464|    615|		    lha->crc != lha->entry_crc_calculated) {
  ------------------
  |  Branch (1464:7): [True: 615, False: 0]
  ------------------
 1465|    615|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|    615|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1466|    615|			    "LHa data CRC error");
 1467|    615|			r = ARCHIVE_WARN;
  ------------------
  |  |  235|    615|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1468|    615|		}
 1469|       |
 1470|       |		/* End-of-entry cleanup done. */
 1471|    615|		lha->end_of_entry_cleanup = 1;
 1472|    615|	}
 1473|    615|	return (r);
 1474|    615|}
archive_read_support_format_lha.c:lha_read_data_lzh:
 1559|  12.2k|{
 1560|  12.2k|	struct lha *lha = (struct lha *)(a->format->data);
 1561|  12.2k|	ssize_t bytes_avail;
 1562|  12.2k|	int r;
 1563|       |
 1564|       |	/* If we haven't yet read any data, initialize the decompressor. */
 1565|  12.2k|	if (!lha->decompress_init) {
  ------------------
  |  Branch (1565:6): [True: 2.55k, False: 9.67k]
  ------------------
 1566|  2.55k|		r = lzh_decode_init(&(lha->strm), lha->method);
 1567|  2.55k|		switch (r) {
 1568|  2.41k|		case ARCHIVE_OK:
  ------------------
  |  |  233|  2.41k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1568:3): [True: 2.41k, False: 143]
  ------------------
 1569|  2.41k|			break;
 1570|    143|		case ARCHIVE_FAILED:
  ------------------
  |  |  237|    143|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (1570:3): [True: 143, False: 2.41k]
  ------------------
 1571|       |        		/* Unsupported compression. */
 1572|    143|			*buff = NULL;
 1573|    143|			*size = 0;
 1574|    143|			*offset = 0;
 1575|    143|			archive_set_error(&a->archive,
 1576|    143|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    143|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1577|    143|			    "Unsupported lzh compression method -%c%c%c-",
 1578|    143|			    lha->method[0], lha->method[1], lha->method[2]);
 1579|       |			/* We know compressed size; just skip it. */
 1580|    143|			archive_read_format_lha_read_data_skip(a);
 1581|    143|			return (ARCHIVE_WARN);
  ------------------
  |  |  235|    143|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1582|      0|		default:
  ------------------
  |  Branch (1582:3): [True: 0, False: 2.55k]
  ------------------
 1583|      0|			archive_set_error(&a->archive, ENOMEM,
 1584|      0|			    "Couldn't allocate memory "
 1585|      0|			    "for lzh decompression");
 1586|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1587|  2.55k|		}
 1588|       |		/* We've initialized decompression for this stream. */
 1589|  2.41k|		lha->decompress_init = 1;
 1590|  2.41k|		lha->strm.avail_out = 0;
 1591|  2.41k|		lha->strm.total_out = 0;
 1592|  2.41k|	}
 1593|       |
 1594|       |	/*
 1595|       |	 * Note: '1' here is a performance optimization.
 1596|       |	 * Recall that the decompression layer returns a count of
 1597|       |	 * available bytes; asking for more than that forces the
 1598|       |	 * decompressor to combine reads by copying data.
 1599|       |	 */
 1600|  12.0k|	lha->strm.next_in = __archive_read_ahead(a, 1, &bytes_avail);
 1601|  12.0k|	if (bytes_avail <= 0) {
  ------------------
  |  Branch (1601:6): [True: 7, False: 12.0k]
  ------------------
 1602|      7|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      7|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1603|      7|		    "Truncated LHa file body");
 1604|      7|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      7|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1605|      7|	}
 1606|  12.0k|	if (bytes_avail > lha->entry_bytes_remaining)
  ------------------
  |  Branch (1606:6): [True: 11.7k, False: 330]
  ------------------
 1607|  11.7k|		bytes_avail = (ssize_t)lha->entry_bytes_remaining;
 1608|       |
 1609|  12.0k|	lha->strm.avail_in = (int)bytes_avail;
 1610|  12.0k|	lha->strm.total_in = 0;
 1611|  12.0k|	lha->strm.avail_out = 0;
 1612|       |
 1613|  12.0k|	r = lzh_decode(&(lha->strm), bytes_avail == lha->entry_bytes_remaining);
 1614|  12.0k|	switch (r) {
 1615|  9.67k|	case ARCHIVE_OK:
  ------------------
  |  |  233|  9.67k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1615:2): [True: 9.67k, False: 2.40k]
  ------------------
 1616|  9.67k|		break;
 1617|    315|	case ARCHIVE_EOF:
  ------------------
  |  |  232|    315|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (1617:2): [True: 315, False: 11.7k]
  ------------------
 1618|    315|		lha->end_of_entry = 1;
 1619|    315|		break;
 1620|  2.09k|	default:
  ------------------
  |  Branch (1620:2): [True: 2.09k, False: 9.98k]
  ------------------
 1621|  2.09k|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|  2.09k|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1622|  2.09k|		    "Bad lzh data");
 1623|  2.09k|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|  2.09k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1624|  12.0k|	}
 1625|  9.98k|	lha->entry_unconsumed = lha->strm.total_in;
 1626|  9.98k|	lha->entry_bytes_remaining -= lha->strm.total_in;
 1627|       |
 1628|  9.98k|	if (lha->strm.avail_out) {
  ------------------
  |  Branch (1628:6): [True: 9.66k, False: 322]
  ------------------
 1629|  9.66k|		*offset = lha->entry_offset;
 1630|  9.66k|		*size = lha->strm.avail_out;
 1631|  9.66k|		*buff = lha->strm.ref_ptr;
 1632|  9.66k|		lha->entry_crc_calculated =
 1633|  9.66k|		    lha_crc16(lha->entry_crc_calculated, *buff, *size);
 1634|  9.66k|		lha->entry_offset += *size;
 1635|  9.66k|	} else {
 1636|    322|		*offset = lha->entry_offset;
 1637|    322|		*size = 0;
 1638|    322|		*buff = NULL;
 1639|    322|		if (lha->end_of_entry)
  ------------------
  |  Branch (1639:7): [True: 315, False: 7]
  ------------------
 1640|    315|			return (lha_end_of_entry(a));
 1641|    322|	}
 1642|  9.67k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  9.67k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1643|  9.98k|}
archive_read_support_format_lha.c:lzh_decode_init:
 1835|  2.55k|{
 1836|  2.55k|	struct lzh_dec *ds;
 1837|  2.55k|	int w_bits, w_size;
 1838|       |
 1839|  2.55k|	if (strm->ds == NULL) {
  ------------------
  |  Branch (1839:6): [True: 52, False: 2.50k]
  ------------------
 1840|     52|		strm->ds = calloc(1, sizeof(*strm->ds));
 1841|     52|		if (strm->ds == NULL)
  ------------------
  |  Branch (1841:7): [True: 0, False: 52]
  ------------------
 1842|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1843|     52|	}
 1844|  2.55k|	ds = strm->ds;
 1845|  2.55k|	ds->error = ARCHIVE_FAILED;
  ------------------
  |  |  237|  2.55k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1846|  2.55k|	if (method == NULL || method[0] != 'l' || method[1] != 'h')
  ------------------
  |  Branch (1846:6): [True: 0, False: 2.55k]
  |  Branch (1846:24): [True: 0, False: 2.55k]
  |  Branch (1846:44): [True: 0, False: 2.55k]
  ------------------
 1847|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1848|  2.55k|	switch (method[2]) {
 1849|  2.40k|	case '5':
  ------------------
  |  Branch (1849:2): [True: 2.40k, False: 146]
  ------------------
 1850|  2.40k|		w_bits = 13;/* 8KiB for window */
 1851|  2.40k|		break;
 1852|      3|	case '6':
  ------------------
  |  Branch (1852:2): [True: 3, False: 2.55k]
  ------------------
 1853|      3|		w_bits = 15;/* 32KiB for window */
 1854|      3|		break;
 1855|      0|	case '7':
  ------------------
  |  Branch (1855:2): [True: 0, False: 2.55k]
  ------------------
 1856|      0|		w_bits = 16;/* 64KiB for window */
 1857|      0|		break;
 1858|    143|	default:
  ------------------
  |  Branch (1858:2): [True: 143, False: 2.41k]
  ------------------
 1859|    143|		return (ARCHIVE_FAILED);/* Not supported. */
  ------------------
  |  |  237|    143|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1860|  2.55k|	}
 1861|  2.41k|	ds->error = ARCHIVE_FATAL;
  ------------------
  |  |  239|  2.41k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1862|       |	/* Expand a window size up to 128 KiB for decompressing process
 1863|       |	 * performance whatever its original window size is. */
 1864|  2.41k|	ds->w_size = 1U << 17;
 1865|  2.41k|	ds->w_mask = ds->w_size -1;
 1866|  2.41k|	if (ds->w_buff == NULL) {
  ------------------
  |  Branch (1866:6): [True: 52, False: 2.36k]
  ------------------
 1867|     52|		ds->w_buff = malloc(ds->w_size);
 1868|     52|		if (ds->w_buff == NULL)
  ------------------
  |  Branch (1868:7): [True: 0, False: 52]
  ------------------
 1869|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1870|     52|	}
 1871|  2.41k|	w_size = 1U << w_bits;
 1872|  2.41k|	memset(ds->w_buff + ds->w_size - w_size, 0x20, w_size);
 1873|  2.41k|	ds->w_pos = 0;
 1874|  2.41k|	ds->state = 0;
 1875|  2.41k|	ds->pos_pt_len_size = w_bits + 1;
 1876|  2.41k|	ds->pos_pt_len_bits = (w_bits == 15 || w_bits == 16)? 5: 4;
  ------------------
  |  Branch (1876:25): [True: 3, False: 2.40k]
  |  Branch (1876:41): [True: 0, False: 2.40k]
  ------------------
 1877|  2.41k|	ds->literal_pt_len_size = PT_BITLEN_SIZE;
  ------------------
  |  |   65|  2.41k|#define PT_BITLEN_SIZE		(3 + 16)
  ------------------
 1878|  2.41k|	ds->literal_pt_len_bits = 5;
 1879|  2.41k|	ds->br.cache_buffer = 0;
 1880|  2.41k|	ds->br.cache_avail = 0;
 1881|       |
 1882|  2.41k|	if (lzh_huffman_init(&(ds->lt), LT_BITLEN_SIZE, 16)
  ------------------
  |  |   62|  2.41k|#define LT_BITLEN_SIZE		(UCHAR_MAX + 1 + MAXMATCH - MINMATCH + 1)
  |  |  ------------------
  |  |  |  |   50|  2.41k|#define MAXMATCH		256	/* Maximum match length. */
  |  |  ------------------
  |  |               #define LT_BITLEN_SIZE		(UCHAR_MAX + 1 + MAXMATCH - MINMATCH + 1)
  |  |  ------------------
  |  |  |  |   51|  2.41k|#define MINMATCH		3	/* Minimum match length. */
  |  |  ------------------
  ------------------
  |  Branch (1882:6): [True: 0, False: 2.41k]
  ------------------
 1883|  2.41k|	    != ARCHIVE_OK)
  ------------------
  |  |  233|  2.41k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1884|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1885|  2.41k|	ds->lt.len_bits = 9;
 1886|  2.41k|	if (lzh_huffman_init(&(ds->pt), PT_BITLEN_SIZE, 16)
  ------------------
  |  |   65|  2.41k|#define PT_BITLEN_SIZE		(3 + 16)
  ------------------
  |  Branch (1886:6): [True: 0, False: 2.41k]
  ------------------
 1887|  2.41k|	    != ARCHIVE_OK)
  ------------------
  |  |  233|  2.41k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1888|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1889|  2.41k|	ds->error = 0;
 1890|       |
 1891|  2.41k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.41k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1892|  2.41k|}
archive_read_support_format_lha.c:lzh_huffman_init:
 2517|  4.82k|{
 2518|  4.82k|	int bits;
 2519|       |
 2520|  4.82k|	if (hf->bitlen == NULL) {
  ------------------
  |  Branch (2520:6): [True: 104, False: 4.72k]
  ------------------
 2521|    104|		hf->bitlen = malloc(len_size * sizeof(hf->bitlen[0]));
 2522|    104|		if (hf->bitlen == NULL)
  ------------------
  |  Branch (2522:7): [True: 0, False: 104]
  ------------------
 2523|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2524|    104|	}
 2525|  4.82k|	if (hf->tbl == NULL) {
  ------------------
  |  Branch (2525:6): [True: 104, False: 4.72k]
  ------------------
 2526|    104|		if (tbl_bits < HTBL_BITS)
  ------------------
  |  |  114|    104|#define HTBL_BITS	10
  ------------------
  |  Branch (2526:7): [True: 0, False: 104]
  ------------------
 2527|      0|			bits = tbl_bits;
 2528|    104|		else
 2529|    104|			bits = HTBL_BITS;
  ------------------
  |  |  114|    104|#define HTBL_BITS	10
  ------------------
 2530|    104|		hf->tbl = malloc(((size_t)1 << bits) * sizeof(hf->tbl[0]));
 2531|    104|		if (hf->tbl == NULL)
  ------------------
  |  Branch (2531:7): [True: 0, False: 104]
  ------------------
 2532|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2533|    104|	}
 2534|  4.82k|	if (hf->tree == NULL && tbl_bits > HTBL_BITS) {
  ------------------
  |  |  114|    104|#define HTBL_BITS	10
  ------------------
  |  Branch (2534:6): [True: 104, False: 4.72k]
  |  Branch (2534:26): [True: 104, False: 0]
  ------------------
 2535|    104|		hf->tree_avail = 1 << (tbl_bits - HTBL_BITS + 4);
  ------------------
  |  |  114|    104|#define HTBL_BITS	10
  ------------------
 2536|    104|		hf->tree = malloc(hf->tree_avail * sizeof(hf->tree[0]));
 2537|    104|		if (hf->tree == NULL)
  ------------------
  |  Branch (2537:7): [True: 0, False: 104]
  ------------------
 2538|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2539|    104|	}
 2540|  4.82k|	hf->len_size = (int)len_size;
 2541|  4.82k|	hf->tbl_bits = tbl_bits;
 2542|  4.82k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  4.82k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2543|  4.82k|}
archive_read_support_format_lha.c:lzh_decode:
 2063|  12.0k|{
 2064|  12.0k|	struct lzh_dec *ds = strm->ds;
 2065|  12.0k|	int avail_in;
 2066|  12.0k|	int r;
 2067|       |
 2068|  12.0k|	if (ds->error)
  ------------------
  |  Branch (2068:6): [True: 0, False: 12.0k]
  ------------------
 2069|      0|		return (ds->error);
 2070|       |
 2071|  12.0k|	avail_in = strm->avail_in;
 2072|  16.7k|	do {
 2073|  16.7k|		if (ds->state < ST_GET_LITERAL)
  ------------------
  |  | 2056|  16.7k|#define ST_GET_LITERAL		9
  ------------------
  |  Branch (2073:7): [True: 4.82k, False: 11.8k]
  ------------------
 2074|  4.82k|			r = lzh_read_blocks(strm, last);
 2075|  11.8k|		else
 2076|  11.8k|			r = lzh_decode_blocks(strm, last);
 2077|  16.7k|	} while (r == 100);
  ------------------
  |  Branch (2077:11): [True: 4.63k, False: 12.0k]
  ------------------
 2078|  12.0k|	strm->total_in += avail_in - strm->avail_in;
 2079|  12.0k|	return (r);
 2080|  12.0k|}
archive_read_support_format_lha.c:lzh_read_blocks:
 2092|  4.82k|{
 2093|  4.82k|	struct lzh_dec *ds = strm->ds;
 2094|  4.82k|	struct lzh_br *br = &(ds->br);
 2095|  4.82k|	int c = 0, i;
 2096|  4.82k|	unsigned rbits;
 2097|       |
 2098|  14.6k|	for (;;) {
 2099|  14.6k|		switch (ds->state) {
  ------------------
  |  Branch (2099:11): [True: 14.6k, False: 0]
  ------------------
 2100|  4.82k|		case ST_RD_BLOCK:
  ------------------
  |  | 2047|  4.82k|#define ST_RD_BLOCK		0
  ------------------
  |  Branch (2100:3): [True: 4.82k, False: 9.79k]
  ------------------
 2101|       |			/*
 2102|       |			 * Read a block number indicates how many blocks
 2103|       |			 * we will handle. The block is composed of a
 2104|       |			 * literal and a match, sometimes a literal only
 2105|       |			 * in particular, there are no reference data at
 2106|       |			 * the beginning of the decompression.
 2107|       |			 */
 2108|  4.82k|			if (!lzh_br_read_ahead_0(strm, br, 16)) {
  ------------------
  |  | 1928|  4.82k|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  ------------------
  |  |  |  | 1914|  9.65k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1914:27): [True: 1.77k, False: 3.04k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (1928:26): [True: 2.41k, False: 630]
  |  |  ------------------
  ------------------
 2109|    630|				if (!last)
  ------------------
  |  Branch (2109:9): [True: 0, False: 630]
  ------------------
 2110|       |					/* We need following data. */
 2111|      0|					return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2112|    630|				if (lzh_br_has(br, 8)) {
  ------------------
  |  | 1914|    630|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  ------------------
  |  |  |  Branch (1914:27): [True: 0, False: 630]
  |  |  ------------------
  ------------------
 2113|       |					/*
 2114|       |					 * It seems there are extra bits.
 2115|       |					 *  1. Compressed data is broken.
 2116|       |					 *  2. `last' flag does not properly
 2117|       |					 *     set.
 2118|       |					 */
 2119|      0|					goto failed;
 2120|      0|				}
 2121|    630|				if (ds->w_pos > 0) {
  ------------------
  |  Branch (2121:9): [True: 315, False: 315]
  ------------------
 2122|    315|					lzh_emit_window(strm, ds->w_pos);
 2123|    315|					ds->w_pos = 0;
 2124|    315|					return (ARCHIVE_OK);
  ------------------
  |  |  233|    315|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2125|    315|				}
 2126|       |				/* End of compressed data; we have completely
 2127|       |				 * handled all compressed data. */
 2128|    315|				return (ARCHIVE_EOF);
  ------------------
  |  |  232|    315|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2129|    630|			}
 2130|  4.19k|			ds->blocks_avail = lzh_br_bits(br, 16);
  ------------------
  |  | 1917|  4.19k|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1918|  4.19k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2131|  4.19k|			if (ds->blocks_avail == 0)
  ------------------
  |  Branch (2131:8): [True: 27, False: 4.16k]
  ------------------
 2132|     27|				goto failed;
 2133|  4.16k|			lzh_br_consume(br, 16);
  ------------------
  |  | 1936|  4.16k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2134|       |			/*
 2135|       |			 * Read a literal table compressed in huffman
 2136|       |			 * coding.
 2137|       |			 */
 2138|  4.16k|			ds->pt.len_size = ds->literal_pt_len_size;
 2139|  4.16k|			ds->pt.len_bits = ds->literal_pt_len_bits;
 2140|  4.16k|			ds->reading_position = 0;
 2141|       |			/* FALL THROUGH */
 2142|  7.14k|		case ST_RD_PT_1:
  ------------------
  |  | 2048|  7.14k|#define ST_RD_PT_1		1
  ------------------
  |  Branch (2142:3): [True: 2.98k, False: 11.6k]
  ------------------
 2143|       |			/* Note: ST_RD_PT_1, ST_RD_PT_2 and ST_RD_PT_4 are
 2144|       |			 * used in reading both a literal table and a
 2145|       |			 * position table. */
 2146|  7.14k|			if (!lzh_br_read_ahead(strm, br, ds->pt.len_bits)) {
  ------------------
  |  | 1933|  7.14k|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1928|  14.2k|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1914|  14.2k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1914:27): [True: 7.14k, False: 5]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1928:26): [True: 4, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1914|      1|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1914:27): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2147|      1|				if (last)
  ------------------
  |  Branch (2147:9): [True: 1, False: 0]
  ------------------
 2148|      1|					goto failed;/* Truncated data. */
 2149|      0|				ds->state = ST_RD_PT_1;
  ------------------
  |  | 2048|      0|#define ST_RD_PT_1		1
  ------------------
 2150|      0|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2151|      1|			}
 2152|  7.14k|			ds->pt.len_avail = lzh_br_bits(br, ds->pt.len_bits);
  ------------------
  |  | 1917|  7.14k|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1918|  7.14k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2153|  7.14k|			lzh_br_consume(br, ds->pt.len_bits);
  ------------------
  |  | 1936|  7.14k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2154|       |			/* FALL THROUGH */
 2155|  7.14k|		case ST_RD_PT_2:
  ------------------
  |  | 2049|  7.14k|#define ST_RD_PT_2		2
  ------------------
  |  Branch (2155:3): [True: 0, False: 14.6k]
  ------------------
 2156|  7.14k|			if (ds->pt.len_avail == 0) {
  ------------------
  |  Branch (2156:8): [True: 1.28k, False: 5.86k]
  ------------------
 2157|       |				/* There is no bitlen. */
 2158|  1.28k|				if (!lzh_br_read_ahead(strm, br,
  ------------------
  |  | 1933|  1.28k|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1928|  2.57k|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1914|  2.57k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1914:27): [True: 1.27k, False: 11]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1928:26): [True: 1, False: 10]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1914|     10|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1914:27): [True: 10, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2159|  1.28k|				    ds->pt.len_bits)) {
 2160|      0|					if (last)
  ------------------
  |  Branch (2160:10): [True: 0, False: 0]
  ------------------
 2161|      0|						goto failed;/* Truncated data.*/
 2162|      0|					ds->state = ST_RD_PT_2;
  ------------------
  |  | 2049|      0|#define ST_RD_PT_2		2
  ------------------
 2163|      0|					return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2164|      0|				}
 2165|  1.28k|				if (!lzh_make_fake_table(&(ds->pt),
  ------------------
  |  Branch (2165:9): [True: 1, False: 1.28k]
  ------------------
 2166|  1.28k|				    lzh_br_bits(br, ds->pt.len_bits)))
  ------------------
  |  | 1917|  1.28k|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1918|  1.28k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2167|      1|					goto failed;/* Invalid data. */
 2168|  1.28k|				lzh_br_consume(br, ds->pt.len_bits);
  ------------------
  |  | 1936|  1.28k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2169|  1.28k|				if (ds->reading_position)
  ------------------
  |  Branch (2169:9): [True: 412, False: 874]
  ------------------
 2170|    412|					ds->state = ST_GET_LITERAL;
  ------------------
  |  | 2056|    412|#define ST_GET_LITERAL		9
  ------------------
 2171|    874|				else
 2172|    874|					ds->state = ST_RD_LITERAL_1;
  ------------------
  |  | 2052|    874|#define ST_RD_LITERAL_1		5
  ------------------
 2173|  1.28k|				break;
 2174|  5.86k|			} else if (ds->pt.len_avail > ds->pt.len_size)
  ------------------
  |  Branch (2174:15): [True: 71, False: 5.79k]
  ------------------
 2175|     71|				goto failed;/* Invalid data. */
 2176|  5.79k|			ds->loop = 0;
 2177|  5.79k|			memset(ds->pt.freq, 0, sizeof(ds->pt.freq));
 2178|  5.79k|			if (ds->pt.len_avail < 3 ||
  ------------------
  |  Branch (2178:8): [True: 6, False: 5.78k]
  ------------------
 2179|  5.78k|			    ds->pt.len_size == ds->pos_pt_len_size) {
  ------------------
  |  Branch (2179:8): [True: 2.56k, False: 3.21k]
  ------------------
 2180|  2.57k|				ds->state = ST_RD_PT_4;
  ------------------
  |  | 2051|  2.57k|#define ST_RD_PT_4		4
  ------------------
 2181|  2.57k|				break;
 2182|  2.57k|			}
 2183|       |			/* FALL THROUGH */
 2184|  3.21k|		case ST_RD_PT_3:
  ------------------
  |  | 2050|  3.21k|#define ST_RD_PT_3		3
  ------------------
  |  Branch (2184:3): [True: 0, False: 14.6k]
  ------------------
 2185|  3.21k|			ds->loop = lzh_read_pt_bitlen(strm, ds->loop, 3);
 2186|  3.21k|			if (ds->loop < 3) {
  ------------------
  |  Branch (2186:8): [True: 0, False: 3.21k]
  ------------------
 2187|      0|				if (ds->loop < 0 || last)
  ------------------
  |  Branch (2187:9): [True: 0, False: 0]
  |  Branch (2187:25): [True: 0, False: 0]
  ------------------
 2188|      0|					goto failed;/* Invalid data. */
 2189|       |				/* Not completed, get following data. */
 2190|      0|				ds->state = ST_RD_PT_3;
  ------------------
  |  | 2050|      0|#define ST_RD_PT_3		3
  ------------------
 2191|      0|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2192|      0|			}
 2193|       |			/* There are some null in bitlen of the literal. */
 2194|  3.21k|			if (!lzh_br_read_ahead(strm, br, 2)) {
  ------------------
  |  | 1933|  3.21k|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1928|  6.43k|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1914|  6.43k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1914:27): [True: 3.18k, False: 30]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1928:26): [True: 1, False: 29]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1914|     29|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1914:27): [True: 29, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2195|      0|				if (last)
  ------------------
  |  Branch (2195:9): [True: 0, False: 0]
  ------------------
 2196|      0|					goto failed;/* Truncated data. */
 2197|      0|				ds->state = ST_RD_PT_3;
  ------------------
  |  | 2050|      0|#define ST_RD_PT_3		3
  ------------------
 2198|      0|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2199|      0|			}
 2200|  3.21k|			c = lzh_br_bits(br, 2);
  ------------------
  |  | 1917|  3.21k|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1918|  3.21k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2201|  3.21k|			lzh_br_consume(br, 2);
  ------------------
  |  | 1936|  3.21k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2202|  3.21k|			if (c > ds->pt.len_avail - 3)
  ------------------
  |  Branch (2202:8): [True: 0, False: 3.21k]
  ------------------
 2203|      0|				goto failed;/* Invalid data. */
 2204|  8.41k|			for (i = 3; c-- > 0 ;)
  ------------------
  |  Branch (2204:16): [True: 5.19k, False: 3.21k]
  ------------------
 2205|  5.19k|				ds->pt.bitlen[i++] = 0;
 2206|  3.21k|			ds->loop = i;
 2207|       |			/* FALL THROUGH */
 2208|  5.79k|		case ST_RD_PT_4:
  ------------------
  |  | 2051|  5.79k|#define ST_RD_PT_4		4
  ------------------
  |  Branch (2208:3): [True: 2.57k, False: 12.0k]
  ------------------
 2209|  5.79k|			ds->loop = lzh_read_pt_bitlen(strm, ds->loop,
 2210|  5.79k|			    ds->pt.len_avail);
 2211|  5.79k|			if (ds->loop < ds->pt.len_avail) {
  ------------------
  |  Branch (2211:8): [True: 257, False: 5.53k]
  ------------------
 2212|    257|				if (ds->loop < 0 || last)
  ------------------
  |  Branch (2212:9): [True: 119, False: 138]
  |  Branch (2212:25): [True: 138, False: 0]
  ------------------
 2213|    257|					goto failed;/* Invalid data. */
 2214|       |				/* Not completed, get following data. */
 2215|      0|				ds->state = ST_RD_PT_4;
  ------------------
  |  | 2051|      0|#define ST_RD_PT_4		4
  ------------------
 2216|      0|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2217|    257|			}
 2218|  5.53k|			if (!lzh_make_huffman_table(&(ds->pt)))
  ------------------
  |  Branch (2218:8): [True: 1.09k, False: 4.43k]
  ------------------
 2219|  1.09k|				goto failed;/* Invalid data */
 2220|  4.43k|			if (ds->reading_position) {
  ------------------
  |  Branch (2220:8): [True: 2.12k, False: 2.31k]
  ------------------
 2221|  2.12k|				ds->state = ST_GET_LITERAL;
  ------------------
  |  | 2056|  2.12k|#define ST_GET_LITERAL		9
  ------------------
 2222|  2.12k|				break;
 2223|  2.12k|			}
 2224|       |			/* FALL THROUGH */
 2225|  3.18k|		case ST_RD_LITERAL_1:
  ------------------
  |  | 2052|  3.18k|#define ST_RD_LITERAL_1		5
  ------------------
  |  Branch (2225:3): [True: 874, False: 13.7k]
  ------------------
 2226|  3.18k|			if (!lzh_br_read_ahead(strm, br, ds->lt.len_bits)) {
  ------------------
  |  | 1933|  3.18k|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1928|  6.37k|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1914|  6.37k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1914:27): [True: 2.81k, False: 374]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1928:26): [True: 0, False: 374]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1914|    374|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1914:27): [True: 347, False: 27]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2227|     27|				if (last)
  ------------------
  |  Branch (2227:9): [True: 27, False: 0]
  ------------------
 2228|     27|					goto failed;/* Truncated data. */
 2229|      0|				ds->state = ST_RD_LITERAL_1;
  ------------------
  |  | 2052|      0|#define ST_RD_LITERAL_1		5
  ------------------
 2230|      0|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2231|     27|			}
 2232|  3.16k|			ds->lt.len_avail = lzh_br_bits(br, ds->lt.len_bits);
  ------------------
  |  | 1917|  3.16k|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1918|  3.16k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2233|  3.16k|			lzh_br_consume(br, ds->lt.len_bits);
  ------------------
  |  | 1936|  3.16k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2234|       |			/* FALL THROUGH */
 2235|  3.16k|		case ST_RD_LITERAL_2:
  ------------------
  |  | 2053|  3.16k|#define ST_RD_LITERAL_2		6
  ------------------
  |  Branch (2235:3): [True: 0, False: 14.6k]
  ------------------
 2236|  3.16k|			if (ds->lt.len_avail == 0) {
  ------------------
  |  Branch (2236:8): [True: 836, False: 2.32k]
  ------------------
 2237|       |				/* There is no bitlen. */
 2238|    836|				if (!lzh_br_read_ahead(strm, br,
  ------------------
  |  | 1933|    836|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1928|  1.67k|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1914|  1.67k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1914:27): [True: 354, False: 482]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1928:26): [True: 121, False: 361]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1914|    361|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1914:27): [True: 361, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2239|    836|				    ds->lt.len_bits)) {
 2240|      0|					if (last)
  ------------------
  |  Branch (2240:10): [True: 0, False: 0]
  ------------------
 2241|      0|						goto failed;/* Truncated data.*/
 2242|      0|					ds->state = ST_RD_LITERAL_2;
  ------------------
  |  | 2053|      0|#define ST_RD_LITERAL_2		6
  ------------------
 2243|      0|					return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2244|      0|				}
 2245|    836|				if (!lzh_make_fake_table(&(ds->lt),
  ------------------
  |  Branch (2245:9): [True: 0, False: 836]
  ------------------
 2246|    836|				    lzh_br_bits(br, ds->lt.len_bits)))
  ------------------
  |  | 1917|    836|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1918|    836|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2247|      0|					goto failed;/* Invalid data */
 2248|    836|				lzh_br_consume(br, ds->lt.len_bits);
  ------------------
  |  | 1936|    836|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2249|    836|				ds->state = ST_RD_POS_DATA_1;
  ------------------
  |  | 2055|    836|#define ST_RD_POS_DATA_1	8
  ------------------
 2250|    836|				break;
 2251|  2.32k|			} else if (ds->lt.len_avail > ds->lt.len_size)
  ------------------
  |  Branch (2251:15): [True: 0, False: 2.32k]
  ------------------
 2252|      0|				goto failed;/* Invalid data */
 2253|  2.32k|			ds->loop = 0;
 2254|  2.32k|			memset(ds->lt.freq, 0, sizeof(ds->lt.freq));
 2255|       |			/* FALL THROUGH */
 2256|  2.32k|		case ST_RD_LITERAL_3:
  ------------------
  |  | 2054|  2.32k|#define ST_RD_LITERAL_3		7
  ------------------
  |  Branch (2256:3): [True: 0, False: 14.6k]
  ------------------
 2257|  2.32k|			i = ds->loop;
 2258|   112k|			while (i < ds->lt.len_avail) {
  ------------------
  |  Branch (2258:11): [True: 110k, False: 2.18k]
  ------------------
 2259|   110k|				if (!lzh_br_read_ahead(strm, br,
  ------------------
  |  | 1933|   110k|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1928|   220k|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1914|   220k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1914:27): [True: 103k, False: 6.73k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1928:26): [True: 6.72k, False: 6]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1914|      6|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1914:27): [True: 3, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2260|   110k|				    ds->pt.max_bits)) {
 2261|      3|					if (last)
  ------------------
  |  Branch (2261:10): [True: 0, False: 3]
  ------------------
 2262|      0|						goto failed;/* Truncated data.*/
 2263|      3|					ds->loop = i;
 2264|      3|					ds->state = ST_RD_LITERAL_3;
  ------------------
  |  | 2054|      3|#define ST_RD_LITERAL_3		7
  ------------------
 2265|      3|					return (ARCHIVE_OK);
  ------------------
  |  |  233|      3|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2266|      3|				}
 2267|   110k|				rbits = lzh_br_bits(br, ds->pt.max_bits);
  ------------------
  |  | 1917|   110k|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1918|   110k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2268|   110k|				c = lzh_decode_huffman(&(ds->pt), rbits);
 2269|   110k|				if (c > 2) {
  ------------------
  |  Branch (2269:9): [True: 74.3k, False: 36.1k]
  ------------------
 2270|       |					/* Note: 'c' will never be more than
 2271|       |					 * eighteen since it's limited by
 2272|       |					 * PT_BITLEN_SIZE, which is being set
 2273|       |					 * to ds->pt.len_size through
 2274|       |					 * ds->literal_pt_len_size. */
 2275|  74.3k|					lzh_br_consume(br, ds->pt.bitlen[c]);
  ------------------
  |  | 1936|  74.3k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2276|  74.3k|					c -= 2;
 2277|  74.3k|					ds->lt.freq[c]++;
 2278|  74.3k|					ds->lt.bitlen[i++] = c;
 2279|  74.3k|				} else if (c == 0) {
  ------------------
  |  Branch (2279:16): [True: 13.5k, False: 22.5k]
  ------------------
 2280|  13.5k|					lzh_br_consume(br, ds->pt.bitlen[c]);
  ------------------
  |  | 1936|  13.5k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2281|  13.5k|					ds->lt.bitlen[i++] = 0;
 2282|  22.5k|				} else {
 2283|       |					/* c == 1 or c == 2 */
 2284|  22.5k|					int n = (c == 1)?4:9;
  ------------------
  |  Branch (2284:14): [True: 18.0k, False: 4.56k]
  ------------------
 2285|  22.5k|					if (!lzh_br_read_ahead(strm, br,
  ------------------
  |  | 1933|  22.5k|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1928|  45.1k|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1914|  45.1k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1914:27): [True: 22.4k, False: 86]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1928:26): [True: 86, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1914|      0|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1914:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2286|  22.5k|					     ds->pt.bitlen[c] + n)) {
 2287|      0|						if (last) /* Truncated data. */
  ------------------
  |  Branch (2287:11): [True: 0, False: 0]
  ------------------
 2288|      0|							goto failed;
 2289|      0|						ds->loop = i;
 2290|      0|						ds->state = ST_RD_LITERAL_3;
  ------------------
  |  | 2054|      0|#define ST_RD_LITERAL_3		7
  ------------------
 2291|      0|						return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2292|      0|					}
 2293|  22.5k|					lzh_br_consume(br, ds->pt.bitlen[c]);
  ------------------
  |  | 1936|  22.5k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2294|  22.5k|					c = lzh_br_bits(br, n);
  ------------------
  |  | 1917|  22.5k|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1918|  22.5k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2295|  22.5k|					lzh_br_consume(br, n);
  ------------------
  |  | 1936|  22.5k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2296|  22.5k|					c += (n == 4)?3:20;
  ------------------
  |  Branch (2296:11): [True: 18.0k, False: 4.56k]
  ------------------
 2297|  22.5k|					if (i + c > ds->lt.len_avail)
  ------------------
  |  Branch (2297:10): [True: 140, False: 22.4k]
  ------------------
 2298|    140|						goto failed;/* Invalid data */
 2299|  22.4k|					memset(&(ds->lt.bitlen[i]), 0, c);
 2300|  22.4k|					i += c;
 2301|  22.4k|				}
 2302|   110k|			}
 2303|  2.18k|			if (i > ds->lt.len_avail ||
  ------------------
  |  Branch (2303:8): [True: 0, False: 2.18k]
  ------------------
 2304|  2.18k|			    !lzh_make_huffman_table(&(ds->lt)))
  ------------------
  |  Branch (2304:8): [True: 36, False: 2.14k]
  ------------------
 2305|     36|				goto failed;/* Invalid data */
 2306|       |			/* FALL THROUGH */
 2307|  2.98k|		case ST_RD_POS_DATA_1:
  ------------------
  |  | 2055|  2.98k|#define ST_RD_POS_DATA_1	8
  ------------------
  |  Branch (2307:3): [True: 836, False: 13.7k]
  ------------------
 2308|       |			/*
 2309|       |			 * Read a position table compressed in huffman
 2310|       |			 * coding.
 2311|       |			 */
 2312|  2.98k|			ds->pt.len_size = ds->pos_pt_len_size;
 2313|  2.98k|			ds->pt.len_bits = ds->pos_pt_len_bits;
 2314|  2.98k|			ds->reading_position = 1;
 2315|  2.98k|			ds->state = ST_RD_PT_1;
  ------------------
  |  | 2048|  2.98k|#define ST_RD_PT_1		1
  ------------------
 2316|  2.98k|			break;
 2317|  2.53k|		case ST_GET_LITERAL:
  ------------------
  |  | 2056|  2.53k|#define ST_GET_LITERAL		9
  ------------------
  |  Branch (2317:3): [True: 2.53k, False: 12.0k]
  ------------------
 2318|  2.53k|			return (100);
 2319|  14.6k|		}
 2320|  14.6k|	}
 2321|  1.65k|failed:
 2322|  1.65k|	return (ds->error = ARCHIVE_FAILED);
  ------------------
  |  |  237|  1.65k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2323|  4.82k|}
archive_read_support_format_lha.c:lzh_br_fillup:
 1956|  39.2k|{
 1957|  39.2k|	int n = CACHE_BITS - br->cache_avail;
  ------------------
  |  |   92|  39.2k|#define CACHE_BITS		(8 * sizeof(CACHE_TYPE))
  ------------------
 1958|       |
 1959|  45.3k|	for (;;) {
 1960|  45.3k|		const int x = n >> 3;
 1961|  45.3k|		if (strm->avail_in >= x) {
  ------------------
  |  Branch (1961:7): [True: 35.1k, False: 10.1k]
  ------------------
 1962|  35.1k|			switch (x) {
 1963|  4.97k|			case 8:
  ------------------
  |  Branch (1963:4): [True: 4.97k, False: 30.1k]
  ------------------
 1964|  4.97k|				br->cache_buffer =
 1965|  4.97k|				    ((uint64_t)strm->next_in[0]) << 56 |
 1966|  4.97k|				    ((uint64_t)strm->next_in[1]) << 48 |
 1967|  4.97k|				    ((uint64_t)strm->next_in[2]) << 40 |
 1968|  4.97k|				    ((uint64_t)strm->next_in[3]) << 32 |
 1969|  4.97k|				    ((uint32_t)strm->next_in[4]) << 24 |
 1970|  4.97k|				    ((uint32_t)strm->next_in[5]) << 16 |
 1971|  4.97k|				    ((uint32_t)strm->next_in[6]) << 8 |
 1972|  4.97k|				     (uint32_t)strm->next_in[7];
 1973|  4.97k|				strm->next_in += 8;
 1974|  4.97k|				strm->avail_in -= 8;
 1975|  4.97k|				br->cache_avail += 8 * 8;
 1976|  4.97k|				return (1);
 1977|  30.1k|			case 7:
  ------------------
  |  Branch (1977:4): [True: 30.1k, False: 5.01k]
  ------------------
 1978|  30.1k|				br->cache_buffer =
 1979|  30.1k|		 		   (br->cache_buffer << 56) |
 1980|  30.1k|				    ((uint64_t)strm->next_in[0]) << 48 |
 1981|  30.1k|				    ((uint64_t)strm->next_in[1]) << 40 |
 1982|  30.1k|				    ((uint64_t)strm->next_in[2]) << 32 |
 1983|  30.1k|				    ((uint64_t)strm->next_in[3]) << 24 |
 1984|  30.1k|				    ((uint64_t)strm->next_in[4]) << 16 |
 1985|  30.1k|				    ((uint64_t)strm->next_in[5]) << 8 |
 1986|  30.1k|				     (uint64_t)strm->next_in[6];
 1987|  30.1k|				strm->next_in += 7;
 1988|  30.1k|				strm->avail_in -= 7;
 1989|  30.1k|				br->cache_avail += 7 * 8;
 1990|  30.1k|				return (1);
 1991|     41|			case 6:
  ------------------
  |  Branch (1991:4): [True: 41, False: 35.0k]
  ------------------
 1992|     41|				br->cache_buffer =
 1993|     41|		 		   (br->cache_buffer << 48) |
 1994|     41|				    ((uint64_t)strm->next_in[0]) << 40 |
 1995|     41|				    ((uint64_t)strm->next_in[1]) << 32 |
 1996|     41|				    ((uint64_t)strm->next_in[2]) << 24 |
 1997|     41|				    ((uint64_t)strm->next_in[3]) << 16 |
 1998|     41|				    ((uint64_t)strm->next_in[4]) << 8 |
 1999|     41|				     (uint64_t)strm->next_in[5];
 2000|     41|				strm->next_in += 6;
 2001|     41|				strm->avail_in -= 6;
 2002|     41|				br->cache_avail += 6 * 8;
 2003|     41|				return (1);
 2004|      0|			case 0:
  ------------------
  |  Branch (2004:4): [True: 0, False: 35.1k]
  ------------------
 2005|       |				/* We have enough compressed data in
 2006|       |				 * the cache buffer.*/
 2007|      0|				return (1);
 2008|      0|			default:
  ------------------
  |  Branch (2008:4): [True: 0, False: 35.1k]
  ------------------
 2009|      0|				break;
 2010|  35.1k|			}
 2011|  35.1k|		}
 2012|  10.1k|		if (strm->avail_in == 0) {
  ------------------
  |  Branch (2012:7): [True: 4.14k, False: 6.04k]
  ------------------
 2013|       |			/* There is not enough compressed data to fill up the
 2014|       |			 * cache buffer. */
 2015|  4.14k|			return (0);
 2016|  4.14k|		}
 2017|  6.04k|		br->cache_buffer =
 2018|  6.04k|		   (br->cache_buffer << 8) | *strm->next_in++;
 2019|  6.04k|		strm->avail_in--;
 2020|  6.04k|		br->cache_avail += 8;
 2021|  6.04k|		n -= 8;
 2022|  6.04k|	}
 2023|  39.2k|}
archive_read_support_format_lha.c:lzh_emit_window:
 2084|  9.66k|{
 2085|  9.66k|	strm->ref_ptr = strm->ds->w_buff;
 2086|  9.66k|	strm->avail_out = (int)s;
 2087|  9.66k|	strm->total_out += s;
 2088|  9.66k|}
archive_read_support_format_lha.c:lzh_make_fake_table:
 2659|  2.12k|{
 2660|  2.12k|	if (c >= hf->len_size)
  ------------------
  |  Branch (2660:6): [True: 1, False: 2.12k]
  ------------------
 2661|      1|		return (0);
 2662|  2.12k|	hf->tbl[0] = c;
 2663|  2.12k|	hf->max_bits = 0;
 2664|  2.12k|	hf->shift_bits = 0;
 2665|  2.12k|	hf->bitlen[hf->tbl[0]] = 0;
 2666|  2.12k|	return (1);
 2667|  2.12k|}
archive_read_support_format_lha.c:lzh_read_pt_bitlen:
 2621|  9.00k|{
 2622|  9.00k|	struct lzh_dec *ds = strm->ds;
 2623|  9.00k|	struct lzh_br *br = &(ds->br);
 2624|  9.00k|	int c, i;
 2625|       |
 2626|  54.1k|	for (i = start; i < end; ) {
  ------------------
  |  Branch (2626:18): [True: 45.4k, False: 8.75k]
  ------------------
 2627|       |		/*
 2628|       |		 *  bit pattern     the number we need
 2629|       |		 *     000           ->  0
 2630|       |		 *     001           ->  1
 2631|       |		 *     010           ->  2
 2632|       |		 *     ...
 2633|       |		 *     110           ->  6
 2634|       |		 *     1110          ->  7
 2635|       |		 *     11110         ->  8
 2636|       |		 *     ...
 2637|       |		 *     1111111111110 ->  16
 2638|       |		 */
 2639|  45.4k|		if (!lzh_br_read_ahead(strm, br, 3))
  ------------------
  |  | 1933|  45.4k|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1928|  90.8k|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1914|  90.8k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1914:27): [True: 42.4k, False: 2.90k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1928:26): [True: 2.16k, False: 747]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1914|    747|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1914:27): [True: 648, False: 99]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2640|     99|			return (i);
 2641|  45.3k|		if ((c = lzh_br_bits(br, 3)) == 7) {
  ------------------
  |  | 1917|  45.3k|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1918|  45.3k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
  |  Branch (2641:7): [True: 433, False: 44.8k]
  ------------------
 2642|    433|			if (!lzh_br_read_ahead(strm, br, 13))
  ------------------
  |  | 1933|    433|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1928|    866|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1914|    866|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1914:27): [True: 239, False: 194]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1928:26): [True: 35, False: 159]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1914|    159|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1914:27): [True: 120, False: 39]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2643|     39|				return (i);
 2644|    394|			c = bitlen_tbl[lzh_br_bits(br, 13) & 0x3FF];
  ------------------
  |  | 1917|    394|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1918|    394|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2645|    394|			if (c)
  ------------------
  |  Branch (2645:8): [True: 275, False: 119]
  ------------------
 2646|    275|				lzh_br_consume(br, c - 3);
  ------------------
  |  | 1936|    275|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2647|    119|			else
 2648|    119|				return (-1);/* Invalid data. */
 2649|    394|		} else
 2650|  44.8k|			lzh_br_consume(br, 3);
  ------------------
  |  | 1936|  44.8k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2651|  45.1k|		ds->pt.bitlen[i++] = c;
 2652|  45.1k|		ds->pt.freq[c]++;
 2653|  45.1k|	}
 2654|  8.75k|	return (i);
 2655|  9.00k|}
archive_read_support_format_lha.c:lzh_make_huffman_table:
 2674|  7.71k|{
 2675|  7.71k|	uint16_t *tbl;
 2676|  7.71k|	const unsigned char *bitlen;
 2677|  7.71k|	int bitptn[17], weight[17];
 2678|  7.71k|	int i, maxbits = 0, ptn, tbl_size, w;
 2679|  7.71k|	int diffbits, len_avail;
 2680|       |
 2681|       |	/*
 2682|       |	 * Initialize bit patterns.
 2683|       |	 */
 2684|  7.71k|	ptn = 0;
 2685|   131k|	for (i = 1, w = 1 << 15; i <= 16; i++, w >>= 1) {
  ------------------
  |  Branch (2685:27): [True: 123k, False: 7.71k]
  ------------------
 2686|   123k|		bitptn[i] = ptn;
 2687|   123k|		weight[i] = w;
 2688|   123k|		if (hf->freq[i]) {
  ------------------
  |  Branch (2688:7): [True: 25.3k, False: 98.0k]
  ------------------
 2689|  25.3k|			ptn += hf->freq[i] * w;
 2690|  25.3k|			maxbits = i;
 2691|  25.3k|		}
 2692|   123k|	}
 2693|  7.71k|	if (ptn != 0x10000 || maxbits > hf->tbl_bits)
  ------------------
  |  Branch (2693:6): [True: 1.13k, False: 6.58k]
  |  Branch (2693:24): [True: 0, False: 6.58k]
  ------------------
 2694|  1.13k|		return (0);/* Invalid */
 2695|       |
 2696|  6.58k|	hf->max_bits = maxbits;
 2697|       |
 2698|       |	/*
 2699|       |	 * Cut out extra bits which we won't house in the table.
 2700|       |	 * This preparation reduces the same calculation in the for-loop
 2701|       |	 * making the table.
 2702|       |	 */
 2703|  6.58k|	if (maxbits < 16) {
  ------------------
  |  Branch (2703:6): [True: 6.58k, False: 0]
  ------------------
 2704|  6.58k|		int ebits = 16 - maxbits;
 2705|  37.4k|		for (i = 1; i <= maxbits; i++) {
  ------------------
  |  Branch (2705:15): [True: 30.8k, False: 6.58k]
  ------------------
 2706|  30.8k|			bitptn[i] >>= ebits;
 2707|  30.8k|			weight[i] >>= ebits;
 2708|  30.8k|		}
 2709|  6.58k|	}
 2710|  6.58k|	if (maxbits > HTBL_BITS) {
  ------------------
  |  |  114|  6.58k|#define HTBL_BITS	10
  ------------------
  |  Branch (2710:6): [True: 0, False: 6.58k]
  ------------------
 2711|      0|		unsigned htbl_max;
 2712|      0|		uint16_t *p;
 2713|       |
 2714|      0|		diffbits = maxbits - HTBL_BITS;
  ------------------
  |  |  114|      0|#define HTBL_BITS	10
  ------------------
 2715|      0|		for (i = 1; i <= HTBL_BITS; i++) {
  ------------------
  |  |  114|      0|#define HTBL_BITS	10
  ------------------
  |  Branch (2715:15): [True: 0, False: 0]
  ------------------
 2716|      0|			bitptn[i] >>= diffbits;
 2717|      0|			weight[i] >>= diffbits;
 2718|      0|		}
 2719|      0|		htbl_max = bitptn[HTBL_BITS] +
  ------------------
  |  |  114|      0|#define HTBL_BITS	10
  ------------------
 2720|      0|		    weight[HTBL_BITS] * hf->freq[HTBL_BITS];
  ------------------
  |  |  114|      0|#define HTBL_BITS	10
  ------------------
              		    weight[HTBL_BITS] * hf->freq[HTBL_BITS];
  ------------------
  |  |  114|      0|#define HTBL_BITS	10
  ------------------
 2721|      0|		p = &(hf->tbl[htbl_max]);
 2722|      0|		while (p < &hf->tbl[1U<<HTBL_BITS])
  ------------------
  |  |  114|      0|#define HTBL_BITS	10
  ------------------
  |  Branch (2722:10): [True: 0, False: 0]
  ------------------
 2723|      0|			*p++ = 0;
 2724|      0|	} else
 2725|  6.58k|		diffbits = 0;
 2726|  6.58k|	hf->shift_bits = diffbits;
 2727|       |
 2728|       |	/*
 2729|       |	 * Make the table.
 2730|       |	 */
 2731|  6.58k|	tbl_size = 1 << HTBL_BITS;
  ------------------
  |  |  114|  6.58k|#define HTBL_BITS	10
  ------------------
 2732|  6.58k|	tbl = hf->tbl;
 2733|  6.58k|	bitlen = hf->bitlen;
 2734|  6.58k|	len_avail = hf->len_avail;
 2735|  6.58k|	hf->tree_used = 0;
 2736|   604k|	for (i = 0; i < len_avail; i++) {
  ------------------
  |  Branch (2736:14): [True: 597k, False: 6.58k]
  ------------------
 2737|   597k|		uint16_t *p;
 2738|   597k|		int len, cnt;
 2739|   597k|		uint16_t bit;
 2740|   597k|		int extlen;
 2741|   597k|		struct htree_t *ht;
 2742|       |
 2743|   597k|		if (bitlen[i] == 0)
  ------------------
  |  Branch (2743:7): [True: 502k, False: 95.7k]
  ------------------
 2744|   502k|			continue;
 2745|       |		/* Get a bit pattern */
 2746|  95.7k|		len = bitlen[i];
 2747|  95.7k|		ptn = bitptn[len];
 2748|  95.7k|		cnt = weight[len];
 2749|  95.7k|		if (len <= HTBL_BITS) {
  ------------------
  |  |  114|  95.7k|#define HTBL_BITS	10
  ------------------
  |  Branch (2749:7): [True: 95.7k, False: 0]
  ------------------
 2750|       |			/* Calculate next bit pattern */
 2751|  95.7k|			if ((bitptn[len] = ptn + cnt) > tbl_size)
  ------------------
  |  Branch (2751:8): [True: 0, False: 95.7k]
  ------------------
 2752|      0|				return (0);/* Invalid */
 2753|       |			/* Update the table */
 2754|  95.7k|			p = &(tbl[ptn]);
 2755|  95.7k|			if (cnt > 7) {
  ------------------
  |  Branch (2755:8): [True: 15.2k, False: 80.4k]
  ------------------
 2756|  15.2k|				uint16_t *pc;
 2757|       |
 2758|  15.2k|				cnt -= 8;
 2759|  15.2k|				pc = &p[cnt];
 2760|  15.2k|				pc[0] = (uint16_t)i;
 2761|  15.2k|				pc[1] = (uint16_t)i;
 2762|  15.2k|				pc[2] = (uint16_t)i;
 2763|  15.2k|				pc[3] = (uint16_t)i;
 2764|  15.2k|				pc[4] = (uint16_t)i;
 2765|  15.2k|				pc[5] = (uint16_t)i;
 2766|  15.2k|				pc[6] = (uint16_t)i;
 2767|  15.2k|				pc[7] = (uint16_t)i;
 2768|  15.2k|				if (cnt > 7) {
  ------------------
  |  Branch (2768:9): [True: 6.61k, False: 8.58k]
  ------------------
 2769|  6.61k|					cnt -= 8;
 2770|  6.61k|					memcpy(&p[cnt], pc,
 2771|  6.61k|						8 * sizeof(uint16_t));
 2772|  6.61k|					pc = &p[cnt];
 2773|  6.63k|					while (cnt > 15) {
  ------------------
  |  Branch (2773:13): [True: 12, False: 6.61k]
  ------------------
 2774|     12|						cnt -= 16;
 2775|     12|						memcpy(&p[cnt], pc,
 2776|     12|							16 * sizeof(uint16_t));
 2777|     12|					}
 2778|  6.61k|				}
 2779|  15.2k|				if (cnt)
  ------------------
  |  Branch (2779:9): [True: 0, False: 15.2k]
  ------------------
 2780|      0|					memcpy(p, pc, cnt * sizeof(uint16_t));
 2781|  80.4k|			} else {
 2782|   165k|				while (cnt > 1) {
  ------------------
  |  Branch (2782:12): [True: 84.8k, False: 80.4k]
  ------------------
 2783|  84.8k|					p[--cnt] = (uint16_t)i;
 2784|  84.8k|					p[--cnt] = (uint16_t)i;
 2785|  84.8k|				}
 2786|  80.4k|				if (cnt)
  ------------------
  |  Branch (2786:9): [True: 13.1k, False: 67.3k]
  ------------------
 2787|  13.1k|					p[--cnt] = (uint16_t)i;
 2788|  80.4k|			}
 2789|  95.7k|			continue;
 2790|  95.7k|		}
 2791|       |
 2792|       |		/*
 2793|       |		 * A bit length is too big to be housed to a direct table,
 2794|       |		 * so we use a tree model for its extra bits.
 2795|       |		 */
 2796|      0|		bitptn[len] = ptn + cnt;
 2797|      0|		bit = 1U << (diffbits -1);
 2798|      0|		extlen = len - HTBL_BITS;
  ------------------
  |  |  114|      0|#define HTBL_BITS	10
  ------------------
 2799|       |		
 2800|      0|		p = &(tbl[ptn >> diffbits]);
 2801|      0|		if (*p == 0) {
  ------------------
  |  Branch (2801:7): [True: 0, False: 0]
  ------------------
 2802|      0|			*p = len_avail + hf->tree_used;
 2803|      0|			ht = &(hf->tree[hf->tree_used++]);
 2804|      0|			if (hf->tree_used > hf->tree_avail)
  ------------------
  |  Branch (2804:8): [True: 0, False: 0]
  ------------------
 2805|      0|				return (0);/* Invalid */
 2806|      0|			ht->left = 0;
 2807|      0|			ht->right = 0;
 2808|      0|		} else {
 2809|      0|			if (*p < len_avail ||
  ------------------
  |  Branch (2809:8): [True: 0, False: 0]
  ------------------
 2810|      0|			    *p >= (len_avail + hf->tree_used))
  ------------------
  |  Branch (2810:8): [True: 0, False: 0]
  ------------------
 2811|      0|				return (0);/* Invalid */
 2812|      0|			ht = &(hf->tree[*p - len_avail]);
 2813|      0|		}
 2814|      0|		while (--extlen > 0) {
  ------------------
  |  Branch (2814:10): [True: 0, False: 0]
  ------------------
 2815|      0|			if (ptn & bit) {
  ------------------
  |  Branch (2815:8): [True: 0, False: 0]
  ------------------
 2816|      0|				if (ht->left < len_avail) {
  ------------------
  |  Branch (2816:9): [True: 0, False: 0]
  ------------------
 2817|      0|					ht->left = len_avail + hf->tree_used;
 2818|      0|					ht = &(hf->tree[hf->tree_used++]);
 2819|      0|					if (hf->tree_used > hf->tree_avail)
  ------------------
  |  Branch (2819:10): [True: 0, False: 0]
  ------------------
 2820|      0|						return (0);/* Invalid */
 2821|      0|					ht->left = 0;
 2822|      0|					ht->right = 0;
 2823|      0|				} else {
 2824|      0|					ht = &(hf->tree[ht->left - len_avail]);
 2825|      0|				}
 2826|      0|			} else {
 2827|      0|				if (ht->right < len_avail) {
  ------------------
  |  Branch (2827:9): [True: 0, False: 0]
  ------------------
 2828|      0|					ht->right = len_avail + hf->tree_used;
 2829|      0|					ht = &(hf->tree[hf->tree_used++]);
 2830|      0|					if (hf->tree_used > hf->tree_avail)
  ------------------
  |  Branch (2830:10): [True: 0, False: 0]
  ------------------
 2831|      0|						return (0);/* Invalid */
 2832|      0|					ht->left = 0;
 2833|      0|					ht->right = 0;
 2834|      0|				} else {
 2835|      0|					ht = &(hf->tree[ht->right - len_avail]);
 2836|      0|				}
 2837|      0|			}
 2838|      0|			bit >>= 1;
 2839|      0|		}
 2840|      0|		if (ptn & bit) {
  ------------------
  |  Branch (2840:7): [True: 0, False: 0]
  ------------------
 2841|      0|			if (ht->left != 0)
  ------------------
  |  Branch (2841:8): [True: 0, False: 0]
  ------------------
 2842|      0|				return (0);/* Invalid */
 2843|      0|			ht->left = (uint16_t)i;
 2844|      0|		} else {
 2845|      0|			if (ht->right != 0)
  ------------------
  |  Branch (2845:8): [True: 0, False: 0]
  ------------------
 2846|      0|				return (0);/* Invalid */
 2847|      0|			ht->right = (uint16_t)i;
 2848|      0|		}
 2849|      0|	}
 2850|  6.58k|	return (1);
 2851|  6.58k|}
archive_read_support_format_lha.c:lzh_decode_huffman:
 2875|  23.0M|{
 2876|  23.0M|	int c;
 2877|       |	/*
 2878|       |	 * At first search an index table for a bit pattern.
 2879|       |	 * If it fails, search a huffman tree for.
 2880|       |	 */
 2881|  23.0M|	c = hf->tbl[rbits >> hf->shift_bits];
 2882|  23.0M|	if (c < hf->len_avail || hf->len_avail == 0)
  ------------------
  |  Branch (2882:6): [True: 520k, False: 22.4M]
  |  Branch (2882:27): [True: 22.4M, False: 0]
  ------------------
 2883|  23.0M|		return (c);
 2884|       |	/* This bit pattern needs to be found out at a huffman tree. */
 2885|      0|	return (lzh_decode_huffman_tree(hf, rbits, c));
 2886|  23.0M|}
archive_read_support_format_lha.c:lzh_decode_blocks:
 2327|  11.8k|{
 2328|  11.8k|	struct lzh_dec *ds = strm->ds;
 2329|  11.8k|	struct lzh_br bre = ds->br;
 2330|  11.8k|	struct huffman *lt = &(ds->lt);
 2331|  11.8k|	struct huffman *pt = &(ds->pt);
 2332|  11.8k|	unsigned char *w_buff = ds->w_buff;
 2333|  11.8k|	unsigned char *lt_bitlen = lt->bitlen;
 2334|  11.8k|	unsigned char *pt_bitlen = pt->bitlen;
 2335|  11.8k|	int blocks_avail = ds->blocks_avail, c = 0;
 2336|  11.8k|	int copy_len = ds->copy_len, copy_pos = ds->copy_pos;
 2337|  11.8k|	int w_pos = ds->w_pos, w_mask = ds->w_mask, w_size = ds->w_size;
 2338|  11.8k|	int lt_max_bits = lt->max_bits, pt_max_bits = pt->max_bits;
 2339|  11.8k|	int state = ds->state;
 2340|       |
 2341|  8.54M|	for (;;) {
 2342|  8.54M|		switch (state) {
  ------------------
  |  Branch (2342:11): [True: 8.54M, False: 0]
  ------------------
 2343|  8.53M|		case ST_GET_LITERAL:
  ------------------
  |  | 2056|  8.53M|#define ST_GET_LITERAL		9
  ------------------
  |  Branch (2343:3): [True: 8.53M, False: 8.81k]
  ------------------
 2344|  14.3M|			for (;;) {
 2345|  14.3M|				if (blocks_avail == 0) {
  ------------------
  |  Branch (2345:9): [True: 2.09k, False: 14.3M]
  ------------------
 2346|       |					/* We have decoded all blocks.
 2347|       |					 * Let's handle next blocks. */
 2348|  2.09k|					ds->state = ST_RD_BLOCK;
  ------------------
  |  | 2047|  2.09k|#define ST_RD_BLOCK		0
  ------------------
 2349|  2.09k|					ds->br = bre;
 2350|  2.09k|					ds->blocks_avail = 0;
 2351|  2.09k|					ds->w_pos = w_pos;
 2352|  2.09k|					ds->copy_pos = 0;
 2353|  2.09k|					return (100);
 2354|  2.09k|				}
 2355|       |
 2356|       |				/* lzh_br_read_ahead() always tries to fill the
 2357|       |				 * cache buffer up. In specific situation we
 2358|       |				 * are close to the end of the data, the cache
 2359|       |				 * buffer will not be full and thus we have to
 2360|       |				 * determine if the cache buffer has some bits
 2361|       |				 * as much as we need after lzh_br_read_ahead()
 2362|       |				 * failed. */
 2363|  14.3M|				if (!lzh_br_read_ahead(strm, &bre,
  ------------------
  |  | 1933|  14.3M|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1928|  28.7M|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1914|  28.7M|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1914:27): [True: 14.3M, False: 15.8k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1928:26): [True: 14.0k, False: 1.81k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1914|  1.81k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1914:27): [True: 490, False: 1.32k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2364|  14.3M|				    lt_max_bits)) {
 2365|  1.32k|					if (!last)
  ------------------
  |  Branch (2365:10): [True: 1, False: 1.32k]
  ------------------
 2366|      1|						goto next_data;
 2367|       |					/* Remaining bits are less than
 2368|       |					 * maximum bits(lt.max_bits) but maybe
 2369|       |					 * it still remains as much as we need,
 2370|       |					 * so we should try to use it with
 2371|       |					 * dummy bits. */
 2372|  1.32k|					c = lzh_decode_huffman(lt,
 2373|  1.32k|					      lzh_br_bits_forced(&bre,
  ------------------
  |  | 1920|  1.32k|	(((uint16_t)((br)->cache_buffer <<		\
  |  | 1921|  1.32k|		((n) - (br)->cache_avail))) & cache_masks[n])
  ------------------
 2374|  1.32k|					        lt_max_bits));
 2375|  1.32k|					lzh_br_consume(&bre, lt_bitlen[c]);
  ------------------
  |  | 1936|  1.32k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2376|  1.32k|					if (!lzh_br_has(&bre, 0))
  ------------------
  |  | 1914|  1.32k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  ------------------
  |  Branch (2376:10): [True: 429, False: 894]
  ------------------
 2377|    429|						goto failed;/* Over read. */
 2378|  14.3M|				} else {
 2379|  14.3M|					c = lzh_decode_huffman(lt,
 2380|  14.3M|					      lzh_br_bits(&bre, lt_max_bits));
  ------------------
  |  | 1917|  14.3M|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1918|  14.3M|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2381|  14.3M|					lzh_br_consume(&bre, lt_bitlen[c]);
  ------------------
  |  | 1936|  14.3M|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2382|  14.3M|				}
 2383|  14.3M|				blocks_avail--;
 2384|  14.3M|				if ((unsigned int)c > UCHAR_MAX)
  ------------------
  |  Branch (2384:9): [True: 8.53M, False: 5.82M]
  ------------------
 2385|       |					/* Current block is a match data. */
 2386|  8.53M|					break;
 2387|       |				/*
 2388|       |				 * 'c' is exactly a literal code.
 2389|       |				 */
 2390|       |				/* Save a decoded code to reference it
 2391|       |				 * afterward. */
 2392|  5.82M|				w_buff[w_pos] = c;
 2393|  5.82M|				if (++w_pos >= w_size) {
  ------------------
  |  Branch (2393:9): [True: 1, False: 5.82M]
  ------------------
 2394|      1|					w_pos = 0;
 2395|      1|					lzh_emit_window(strm, w_size);
 2396|      1|					goto next_data;
 2397|      1|				}
 2398|  5.82M|			}
 2399|       |			/* 'c' is the length of a match pattern we have
 2400|       |			 * already extracted, which has be stored in
 2401|       |			 * window(ds->w_buff). */
 2402|  8.53M|			copy_len = c - (UCHAR_MAX + 1) + MINMATCH;
  ------------------
  |  |   51|  8.53M|#define MINMATCH		3	/* Minimum match length. */
  ------------------
 2403|       |			/* FALL THROUGH */
 2404|  8.53M|		case ST_GET_POS_1:
  ------------------
  |  | 2057|  8.53M|#define ST_GET_POS_1		10
  ------------------
  |  Branch (2404:3): [True: 0, False: 8.54M]
  ------------------
 2405|       |			/*
 2406|       |			 * Get a reference position. 
 2407|       |			 */
 2408|  8.53M|			if (!lzh_br_read_ahead(strm, &bre, pt_max_bits)) {
  ------------------
  |  | 1933|  8.53M|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1928|  17.0M|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1914|  17.0M|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1914:27): [True: 8.52M, False: 8.52k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1928:26): [True: 8.50k, False: 14]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1914|     14|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1914:27): [True: 4, False: 10]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2409|     10|				if (!last) {
  ------------------
  |  Branch (2409:9): [True: 3, False: 7]
  ------------------
 2410|      3|					state = ST_GET_POS_1;
  ------------------
  |  | 2057|      3|#define ST_GET_POS_1		10
  ------------------
 2411|      3|					ds->copy_len = copy_len;
 2412|      3|					goto next_data;
 2413|      3|				}
 2414|      7|				copy_pos = lzh_decode_huffman(pt,
 2415|      7|				    lzh_br_bits_forced(&bre, pt_max_bits));
  ------------------
  |  | 1920|      7|	(((uint16_t)((br)->cache_buffer <<		\
  |  | 1921|      7|		((n) - (br)->cache_avail))) & cache_masks[n])
  ------------------
 2416|      7|				lzh_br_consume(&bre, pt_bitlen[copy_pos]);
  ------------------
  |  | 1936|      7|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2417|      7|				if (!lzh_br_has(&bre, 0))
  ------------------
  |  | 1914|      7|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  ------------------
  |  Branch (2417:9): [True: 1, False: 6]
  ------------------
 2418|      1|					goto failed;/* Over read. */
 2419|  8.53M|			} else {
 2420|  8.53M|				copy_pos = lzh_decode_huffman(pt,
 2421|  8.53M|				    lzh_br_bits(&bre, pt_max_bits));
  ------------------
  |  | 1917|  8.53M|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1918|  8.53M|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2422|  8.53M|				lzh_br_consume(&bre, pt_bitlen[copy_pos]);
  ------------------
  |  | 1936|  8.53M|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2423|  8.53M|			}
 2424|       |			/* FALL THROUGH */
 2425|  8.53M|		case ST_GET_POS_2:
  ------------------
  |  | 2058|  8.53M|#define ST_GET_POS_2		11
  ------------------
  |  Branch (2425:3): [True: 0, False: 8.54M]
  ------------------
 2426|  8.53M|			if (copy_pos > 1) {
  ------------------
  |  Branch (2426:8): [True: 42.2k, False: 8.49M]
  ------------------
 2427|       |				/* We need an additional adjustment number to
 2428|       |				 * the position. */
 2429|  42.2k|				int p = copy_pos - 1;
 2430|  42.2k|				if (!lzh_br_read_ahead(strm, &bre, p)) {
  ------------------
  |  | 1933|  42.2k|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1928|  84.5k|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1914|  84.5k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1914:27): [True: 41.2k, False: 1.07k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1928:26): [True: 1.06k, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1914|      4|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1914:27): [True: 0, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2431|      4|					if (last)
  ------------------
  |  Branch (2431:10): [True: 4, False: 0]
  ------------------
 2432|      4|						goto failed;/* Truncated data.*/
 2433|      0|					state = ST_GET_POS_2;
  ------------------
  |  | 2058|      0|#define ST_GET_POS_2		11
  ------------------
 2434|      0|					ds->copy_len = copy_len;
 2435|      0|					ds->copy_pos = copy_pos;
 2436|      0|					goto next_data;
 2437|      4|				}
 2438|  42.2k|				copy_pos = (1 << p) + lzh_br_bits(&bre, p);
  ------------------
  |  | 1917|  42.2k|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1918|  42.2k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2439|  42.2k|				lzh_br_consume(&bre, p);
  ------------------
  |  | 1936|  42.2k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2440|  42.2k|			}
 2441|       |			/* The position is actually a distance from the last
 2442|       |			 * code we had extracted and thus we have to convert
 2443|       |			 * it to a position of the window. */
 2444|  8.53M|			copy_pos = (w_pos - copy_pos - 1) & w_mask;
 2445|       |			/* FALL THROUGH */
 2446|  8.54M|		case ST_COPY_DATA:
  ------------------
  |  | 2059|  8.54M|#define ST_COPY_DATA		12
  ------------------
  |  Branch (2446:3): [True: 8.81k, False: 8.53M]
  ------------------
 2447|       |			/*
 2448|       |			 * Copy `copy_len' bytes as extracted data from
 2449|       |			 * the window into the output buffer.
 2450|       |			 */
 2451|  8.55M|			for (;;) {
 2452|  8.55M|				int l;
 2453|       |
 2454|  8.55M|				l = copy_len;
 2455|  8.55M|				if (copy_pos > w_pos) {
  ------------------
  |  Branch (2455:9): [True: 10.0k, False: 8.54M]
  ------------------
 2456|  10.0k|					if (l > w_size - copy_pos)
  ------------------
  |  Branch (2456:10): [True: 9.80k, False: 255]
  ------------------
 2457|  9.80k|						l = w_size - copy_pos;
 2458|  8.54M|				} else {
 2459|  8.54M|					if (l > w_size - w_pos)
  ------------------
  |  Branch (2459:10): [True: 8.81k, False: 8.53M]
  ------------------
 2460|  8.81k|						l = w_size - w_pos;
 2461|  8.54M|				}
 2462|  8.55M|				if ((copy_pos + l < w_pos)
  ------------------
  |  Branch (2462:9): [True: 6.37k, False: 8.54M]
  ------------------
 2463|  8.54M|				    || (w_pos + l < copy_pos)) {
  ------------------
  |  Branch (2463:12): [True: 10.0k, False: 8.53M]
  ------------------
 2464|       |					/* No overlap. */
 2465|  16.4k|					memcpy(w_buff + w_pos,
 2466|  16.4k|					    w_buff + copy_pos, l);
 2467|  8.53M|				} else {
 2468|  8.53M|					const unsigned char *s;
 2469|  8.53M|					unsigned char *d;
 2470|  8.53M|					int li;
 2471|       |
 2472|  8.53M|					d = w_buff + w_pos;
 2473|  8.53M|					s = w_buff + copy_pos;
 2474|   621M|					for (li = 0; li < l-1;) {
  ------------------
  |  Branch (2474:19): [True: 612M, False: 8.53M]
  ------------------
 2475|   612M|						d[li] = s[li];li++;
 2476|   612M|						d[li] = s[li];li++;
 2477|   612M|					}
 2478|  8.53M|					if (li < l)
  ------------------
  |  Branch (2478:10): [True: 8.31M, False: 221k]
  ------------------
 2479|  8.31M|						d[li] = s[li];
 2480|  8.53M|				}
 2481|  8.55M|				w_pos += l;
 2482|  8.55M|				if (w_pos == w_size) {
  ------------------
  |  Branch (2482:9): [True: 9.34k, False: 8.54M]
  ------------------
 2483|  9.34k|					w_pos = 0;
 2484|  9.34k|					lzh_emit_window(strm, w_size);
 2485|  9.34k|					if (copy_len <= l)
  ------------------
  |  Branch (2485:10): [True: 537, False: 8.81k]
  ------------------
 2486|    537|						state = ST_GET_LITERAL;
  ------------------
  |  | 2056|    537|#define ST_GET_LITERAL		9
  ------------------
 2487|  8.81k|					else {
 2488|  8.81k|						state = ST_COPY_DATA;
  ------------------
  |  | 2059|  8.81k|#define ST_COPY_DATA		12
  ------------------
 2489|  8.81k|						ds->copy_len = copy_len - l;
 2490|  8.81k|						ds->copy_pos =
 2491|  8.81k|						    (copy_pos + l) & w_mask;
 2492|  8.81k|					}
 2493|  9.34k|					goto next_data;
 2494|  9.34k|				}
 2495|  8.54M|				if (copy_len <= l)
  ------------------
  |  Branch (2495:9): [True: 8.53M, False: 9.80k]
  ------------------
 2496|       |					/* A copy of current pattern ended. */
 2497|  8.53M|					break;
 2498|  9.80k|				copy_len -= l;
 2499|  9.80k|				copy_pos = (copy_pos + l) & w_mask;
 2500|  9.80k|			}
 2501|  8.53M|			state = ST_GET_LITERAL;
  ------------------
  |  | 2056|  8.53M|#define ST_GET_LITERAL		9
  ------------------
 2502|  8.53M|			break;
 2503|  8.54M|		}
 2504|  8.54M|	}
 2505|    434|failed:
 2506|    434|	return (ds->error = ARCHIVE_FAILED);
  ------------------
  |  |  237|    434|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2507|  9.35k|next_data:
 2508|  9.35k|	ds->br = bre;
 2509|  9.35k|	ds->blocks_avail = blocks_avail;
 2510|  9.35k|	ds->state = state;
 2511|  9.35k|	ds->w_pos = w_pos;
 2512|  9.35k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  9.35k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2513|  11.8k|}
archive_read_support_format_lha.c:lha_read_data_none:
 1512|    300|{
 1513|    300|	struct lha *lha = (struct lha *)(a->format->data);
 1514|    300|	ssize_t bytes_avail;
 1515|       |
 1516|    300|	if (lha->entry_bytes_remaining == 0) {
  ------------------
  |  Branch (1516:6): [True: 0, False: 300]
  ------------------
 1517|      0|		*buff = NULL;
 1518|      0|		*size = 0;
 1519|      0|		*offset = lha->entry_offset;
 1520|      0|		lha->end_of_entry = 1;
 1521|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1522|      0|	}
 1523|       |	/*
 1524|       |	 * Note: '1' here is a performance optimization.
 1525|       |	 * Recall that the decompression layer returns a count of
 1526|       |	 * available bytes; asking for more than that forces the
 1527|       |	 * decompressor to combine reads by copying data.
 1528|       |	 */
 1529|    300|	*buff = __archive_read_ahead(a, 1, &bytes_avail);
 1530|    300|	if (bytes_avail <= 0) {
  ------------------
  |  Branch (1530:6): [True: 0, False: 300]
  ------------------
 1531|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1532|      0|		    "Truncated LHa file data");
 1533|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1534|      0|	}
 1535|    300|	if (bytes_avail > lha->entry_bytes_remaining)
  ------------------
  |  Branch (1535:6): [True: 300, False: 0]
  ------------------
 1536|    300|		bytes_avail = (ssize_t)lha->entry_bytes_remaining;
 1537|    300|	lha->entry_crc_calculated =
 1538|    300|	    lha_crc16(lha->entry_crc_calculated, *buff, bytes_avail);
 1539|    300|	*size = bytes_avail;
 1540|    300|	*offset = lha->entry_offset;
 1541|    300|	lha->entry_offset += bytes_avail;
 1542|    300|	lha->entry_bytes_remaining -= bytes_avail;
 1543|    300|	if (lha->entry_bytes_remaining == 0)
  ------------------
  |  Branch (1543:6): [True: 300, False: 0]
  ------------------
 1544|    300|		lha->end_of_entry = 1;
 1545|    300|	lha->entry_unconsumed = bytes_avail;
 1546|    300|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    300|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1547|    300|}
archive_read_support_format_lha.c:archive_read_format_lha_read_data_skip:
 1650|  2.99k|{
 1651|  2.99k|	struct lha *lha;
 1652|  2.99k|	int64_t bytes_skipped;
 1653|       |
 1654|  2.99k|	lha = (struct lha *)(a->format->data);
 1655|       |
 1656|  2.99k|	if (lha->entry_unconsumed) {
  ------------------
  |  Branch (1656:6): [True: 0, False: 2.99k]
  ------------------
 1657|       |		/* Consume as much as the decompressor actually used. */
 1658|      0|		__archive_read_consume(a, lha->entry_unconsumed);
 1659|      0|		lha->entry_unconsumed = 0;
 1660|      0|	}
 1661|       |
 1662|       |	/* if we've already read to end of data, we're done. */
 1663|  2.99k|	if (lha->end_of_entry_cleanup)
  ------------------
  |  Branch (1663:6): [True: 758, False: 2.23k]
  ------------------
 1664|    758|		return (ARCHIVE_OK);
  ------------------
  |  |  233|    758|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1665|       |
 1666|       |	/*
 1667|       |	 * If the length is at the beginning, we can skip the
 1668|       |	 * compressed data much more quickly.
 1669|       |	 */
 1670|  2.23k|	bytes_skipped = __archive_read_consume(a, lha->entry_bytes_remaining);
 1671|  2.23k|	if (bytes_skipped < 0)
  ------------------
  |  Branch (1671:6): [True: 4, False: 2.22k]
  ------------------
 1672|      4|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1673|       |
 1674|       |	/* This entry is finished and done. */
 1675|  2.22k|	lha->end_of_entry_cleanup = lha->end_of_entry = 1;
 1676|  2.22k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.22k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1677|  2.23k|}
archive_read_support_format_lha.c:archive_read_format_lha_cleanup:
 1681|  2.49k|{
 1682|  2.49k|	struct lha *lha = (struct lha *)(a->format->data);
 1683|       |
 1684|  2.49k|	lzh_decode_free(&(lha->strm));
 1685|  2.49k|	archive_string_free(&(lha->dirname));
 1686|  2.49k|	archive_string_free(&(lha->filename));
 1687|  2.49k|	archive_string_free(&(lha->uname));
 1688|  2.49k|	archive_string_free(&(lha->gname));
 1689|  2.49k|	archive_wstring_free(&(lha->ws));
 1690|  2.49k|	free(lha);
 1691|  2.49k|	(a->format->data) = NULL;
 1692|  2.49k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1693|  2.49k|}
archive_read_support_format_lha.c:lzh_decode_free:
 1899|  2.49k|{
 1900|       |
 1901|  2.49k|	if (strm->ds == NULL)
  ------------------
  |  Branch (1901:6): [True: 2.44k, False: 52]
  ------------------
 1902|  2.44k|		return;
 1903|     52|	free(strm->ds->w_buff);
 1904|     52|	lzh_huffman_free(&(strm->ds->lt));
 1905|     52|	lzh_huffman_free(&(strm->ds->pt));
 1906|     52|	free(strm->ds);
 1907|       |	strm->ds = NULL;
 1908|     52|}
archive_read_support_format_lha.c:lzh_huffman_free:
 2547|    104|{
 2548|    104|	free(hf->bitlen);
 2549|    104|	free(hf->tbl);
 2550|    104|	free(hf->tree);
 2551|    104|}

archive_read_support_format_mtree:
  266|  2.49k|{
  267|  2.49k|	static const struct archive_rb_tree_ops rb_ops = {
  268|  2.49k|		mtree_cmp_node, mtree_cmp_key,
  269|  2.49k|	};
  270|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
  271|  2.49k|	struct mtree *mtree;
  272|  2.49k|	int r;
  273|       |
  274|  2.49k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  151|  2.49k|	do { \
  |  |  152|  2.49k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|  2.49k|			(allowed_states), (function_name)); \
  |  |  154|  2.49k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  2.49k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 2.49k]
  |  |  ------------------
  |  |  155|  2.49k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|  2.49k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 2.49k]
  |  |  ------------------
  ------------------
  275|  2.49k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_mtree");
  276|       |
  277|  2.49k|	mtree = calloc(1, sizeof(*mtree));
  278|  2.49k|	if (mtree == NULL) {
  ------------------
  |  Branch (278:6): [True: 0, False: 2.49k]
  ------------------
  279|      0|		archive_set_error(&a->archive, ENOMEM,
  280|      0|		    "Can't allocate mtree data");
  281|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  282|      0|	}
  283|  2.49k|	mtree->checkfs = 0;
  284|  2.49k|	mtree->fd = -1;
  285|       |
  286|  2.49k|	__archive_rb_tree_init(&mtree->rbtree, &rb_ops);
  287|       |
  288|  2.49k|	r = __archive_read_register_format(a, mtree, "mtree",
  289|  2.49k|           mtree_bid, archive_read_format_mtree_options, read_header, read_data, skip, NULL, cleanup, NULL, NULL);
  290|       |
  291|  2.49k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (291:6): [True: 0, False: 2.49k]
  ------------------
  292|      0|		free(mtree);
  293|  2.49k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  294|  2.49k|}
archive_read_support_format_mtree.c:mtree_cmp_node:
  249|  1.44k|{
  250|  1.44k|	const struct mtree_entry *e1 = (const struct mtree_entry *)n1;
  251|  1.44k|	const struct mtree_entry *e2 = (const struct mtree_entry *)n2;
  252|       |
  253|  1.44k|	return (strcmp(e1->name, e2->name));
  254|  1.44k|}
archive_read_support_format_mtree.c:mtree_cmp_key:
  258|  1.46k|{
  259|  1.46k|	const struct mtree_entry *e = (const struct mtree_entry *)n;
  260|       |
  261|  1.46k|	return (strcmp(e->name, key));
  262|  1.46k|}
archive_read_support_format_mtree.c:cleanup:
  298|  2.49k|{
  299|  2.49k|	struct mtree *mtree;
  300|  2.49k|	struct mtree_entry *p, *q;
  301|       |
  302|  2.49k|	mtree = (struct mtree *)(a->format->data);
  303|       |	
  304|       |	/* Close any dangling file descriptor before freeing */
  305|  2.49k|    if (mtree->fd >= 0) {
  ------------------
  |  Branch (305:9): [True: 0, False: 2.49k]
  ------------------
  306|      0|        close(mtree->fd);
  307|      0|        mtree->fd = -1;
  308|      0|    }
  309|  2.49k|	p = mtree->entries;
  310|  11.7k|	while (p != NULL) {
  ------------------
  |  Branch (310:9): [True: 9.21k, False: 2.49k]
  ------------------
  311|  9.21k|		q = p->next;
  312|  9.21k|		free(p->name);
  313|  9.21k|		free_options(p->options);
  314|  9.21k|		free(p);
  315|  9.21k|		p = q;
  316|  9.21k|	}
  317|  2.49k|	archive_string_free(&mtree->line);
  318|  2.49k|	archive_string_free(&mtree->current_dir);
  319|  2.49k|	archive_string_free(&mtree->contents_name);
  320|  2.49k|	archive_entry_linkresolver_free(mtree->resolver);
  321|       |
  322|  2.49k|	free(mtree->buff);
  323|  2.49k|	free(mtree);
  324|  2.49k|	(a->format->data) = NULL;
  325|  2.49k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  326|  2.49k|}
archive_read_support_format_mtree.c:free_options:
  236|  9.73k|{
  237|  9.73k|	struct mtree_option *next;
  238|       |
  239|   107k|	for (; head != NULL; head = next) {
  ------------------
  |  Branch (239:9): [True: 97.3k, False: 9.73k]
  ------------------
  240|  97.3k|		next = head->next;
  241|  97.3k|		free(head->value);
  242|  97.3k|		free(head);
  243|  97.3k|	}
  244|  9.73k|}
archive_read_support_format_mtree.c:mtree_bid:
  675|  2.46k|{
  676|  2.46k|	const char *signature = "#mtree";
  677|  2.46k|	const char *p;
  678|       |
  679|  2.46k|	(void)best_bid; /* UNUSED */
  680|       |
  681|       |	/* Now let's look at the actual header and see if it matches. */
  682|  2.46k|	p = __archive_read_ahead(a, strlen(signature), NULL);
  683|  2.46k|	if (p == NULL)
  ------------------
  |  Branch (683:6): [True: 24, False: 2.43k]
  ------------------
  684|     24|		return (-1);
  685|       |
  686|  2.43k|	if (memcmp(p, signature, strlen(signature)) == 0)
  ------------------
  |  Branch (686:6): [True: 5, False: 2.43k]
  ------------------
  687|      5|		return (8 * (int)strlen(signature));
  688|       |
  689|       |	/*
  690|       |	 * There is not a mtree signature. Let's try to detect mtree format.
  691|       |	 */
  692|  2.43k|	return (detect_form(a, NULL));
  693|  2.43k|}
archive_read_support_format_mtree.c:detect_form:
  697|  2.46k|{
  698|  2.46k|	const char *p;
  699|  2.46k|	ssize_t avail, ravail;
  700|  2.46k|	ssize_t len, nl;
  701|  2.46k|	int entry_cnt = 0, multiline = 0;
  702|  2.46k|	int form_D = 0;/* The archive is generated by `NetBSD mtree -D'
  703|       |			* (In this source we call it `form D') . */
  704|       |
  705|  2.46k|	if (is_form_d != NULL)
  ------------------
  |  Branch (705:6): [True: 33, False: 2.43k]
  ------------------
  706|     33|		*is_form_d = 0;
  707|  2.46k|	p = __archive_read_ahead(a, 1, &avail);
  708|  2.46k|	if (p == NULL)
  ------------------
  |  Branch (708:6): [True: 0, False: 2.46k]
  ------------------
  709|      0|		return (-1);
  710|  2.46k|	ravail = avail;
  711|  33.5M|	for (;;) {
  712|  33.5M|		len = next_line(a, &p, &avail, &ravail, &nl);
  713|       |		/* The terminal character of the line should be
  714|       |		 * a new line character, '\r\n' or '\n'. */
  715|  33.5M|		if (len <= 0 || nl == 0)
  ------------------
  |  Branch (715:7): [True: 2.20k, False: 33.5M]
  |  Branch (715:19): [True: 1, False: 33.5M]
  ------------------
  716|  2.20k|			break;
  717|  33.5M|		if (!multiline) {
  ------------------
  |  Branch (717:7): [True: 33.5M, False: 464]
  ------------------
  718|       |			/* Leading whitespace is never significant,
  719|       |			 * ignore it. */
  720|  33.5M|			while (len > 0 && (*p == ' ' || *p == '\t')) {
  ------------------
  |  Branch (720:11): [True: 33.5M, False: 0]
  |  Branch (720:23): [True: 6, False: 33.5M]
  |  Branch (720:36): [True: 3, False: 33.5M]
  ------------------
  721|      9|				++p;
  722|      9|				--avail;
  723|      9|				--len;
  724|      9|			}
  725|       |			/* Skip comment or empty line. */ 
  726|  33.5M|			if (p[0] == '#' || p[0] == '\n' || p[0] == '\r') {
  ------------------
  |  Branch (726:8): [True: 991, False: 33.5M]
  |  Branch (726:23): [True: 2, False: 33.5M]
  |  Branch (726:39): [True: 33.5M, False: 1.65k]
  ------------------
  727|  33.5M|				p += len;
  728|  33.5M|				avail -= len;
  729|  33.5M|				continue;
  730|  33.5M|			}
  731|  33.5M|		} else {
  732|       |			/* A continuance line; the terminal
  733|       |			 * character of previous line was '\' character. */
  734|    464|			if (bid_keyword_list(p, len, 0, 0) <= 0)
  ------------------
  |  Branch (734:8): [True: 0, False: 464]
  ------------------
  735|      0|				break;
  736|    464|			if (p[len-nl-1] != '\\') {
  ------------------
  |  Branch (736:8): [True: 464, False: 0]
  ------------------
  737|    464|				if (multiline == 1 &&
  ------------------
  |  Branch (737:9): [True: 8, False: 456]
  ------------------
  738|      8|				    ++entry_cnt >= MAX_BID_ENTRY)
  ------------------
  |  |  671|      8|#define MAX_BID_ENTRY	3
  ------------------
  |  Branch (738:9): [True: 0, False: 8]
  ------------------
  739|      0|					break;
  740|    464|				multiline = 0;
  741|    464|			}
  742|    464|			p += len;
  743|    464|			avail -= len;
  744|    464|			continue;
  745|    464|		}
  746|  1.65k|		if (p[0] != '/') {
  ------------------
  |  Branch (746:7): [True: 585, False: 1.06k]
  ------------------
  747|    585|			int last_is_path, keywords;
  748|       |
  749|    585|			keywords = bid_entry(p, len, nl, &last_is_path);
  750|    585|			if (keywords >= 0) {
  ------------------
  |  Branch (750:8): [True: 422, False: 163]
  ------------------
  751|    422|				if (form_D == 0) {
  ------------------
  |  Branch (751:9): [True: 408, False: 14]
  ------------------
  752|    408|					if (last_is_path)
  ------------------
  |  Branch (752:10): [True: 0, False: 408]
  ------------------
  753|      0|						form_D = 1;
  754|    408|					else if (keywords > 0)
  ------------------
  |  Branch (754:15): [True: 14, False: 394]
  ------------------
  755|       |						/* This line is not `form D'. */
  756|     14|						form_D = -1;
  757|    408|				} else if (form_D == 1) {
  ------------------
  |  Branch (757:16): [True: 0, False: 14]
  ------------------
  758|      0|					if (!last_is_path && keywords > 0)
  ------------------
  |  Branch (758:10): [True: 0, False: 0]
  |  Branch (758:27): [True: 0, False: 0]
  ------------------
  759|       |						/* This this is not `form D'
  760|       |						 * and we cannot accept mixed
  761|       |						 * format. */
  762|      0|						break;
  763|      0|				}
  764|    422|				if (!last_is_path && p[len-nl-1] == '\\')
  ------------------
  |  Branch (764:9): [True: 422, False: 0]
  |  Branch (764:26): [True: 8, False: 414]
  ------------------
  765|       |					/* This line continues. */
  766|      8|					multiline = 1;
  767|    414|				else {
  768|       |					/* We've got plenty of correct lines
  769|       |					 * to assume that this file is an mtree
  770|       |					 * format. */
  771|    414|					if (++entry_cnt >= MAX_BID_ENTRY)
  ------------------
  |  |  671|    414|#define MAX_BID_ENTRY	3
  ------------------
  |  Branch (771:10): [True: 49, False: 365]
  ------------------
  772|     49|						break;
  773|    414|				}
  774|    422|			} else
  775|    163|				break;
  776|  1.06k|		} else if (len > 4 && strncmp(p, "/set", 4) == 0) {
  ------------------
  |  Branch (776:14): [True: 1.04k, False: 21]
  |  Branch (776:25): [True: 18, False: 1.03k]
  ------------------
  777|     18|			if (bid_keyword_list(p+4, len-4, 0, 0) <= 0)
  ------------------
  |  Branch (777:8): [True: 4, False: 14]
  ------------------
  778|      4|				break;
  779|       |			/* This line continues. */
  780|     14|			if (p[len-nl-1] == '\\')
  ------------------
  |  Branch (780:8): [True: 0, False: 14]
  ------------------
  781|      0|				multiline = 2;
  782|  1.05k|		} else if (len > 6 && strncmp(p, "/unset", 6) == 0) {
  ------------------
  |  Branch (782:14): [True: 1.02k, False: 23]
  |  Branch (782:25): [True: 1.00k, False: 24]
  ------------------
  783|  1.00k|			if (bid_keyword_list(p+6, len-6, 1, 0) <= 0)
  ------------------
  |  Branch (783:8): [True: 0, False: 1.00k]
  ------------------
  784|      0|				break;
  785|       |			/* This line continues. */
  786|  1.00k|			if (p[len-nl-1] == '\\')
  ------------------
  |  Branch (786:8): [True: 456, False: 548]
  ------------------
  787|    456|				multiline = 2;
  788|  1.00k|		} else
  789|     47|			break;
  790|       |
  791|       |		/* Test next line. */
  792|  1.39k|		p += len;
  793|  1.39k|		avail -= len;
  794|  1.39k|	}
  795|  2.46k|	if (entry_cnt >= MAX_BID_ENTRY || (entry_cnt > 0 && len == 0)) {
  ------------------
  |  |  671|  4.92k|#define MAX_BID_ENTRY	3
  ------------------
  |  Branch (795:6): [True: 49, False: 2.41k]
  |  Branch (795:37): [True: 231, False: 2.18k]
  |  Branch (795:54): [True: 10, False: 221]
  ------------------
  796|     59|		if (is_form_d != NULL) {
  ------------------
  |  Branch (796:7): [True: 28, False: 31]
  ------------------
  797|     28|			if (form_D == 1)
  ------------------
  |  Branch (797:8): [True: 0, False: 28]
  ------------------
  798|      0|				*is_form_d = 1;
  799|     28|		}
  800|     59|		return (32);
  801|     59|	}
  802|       |
  803|  2.40k|	return (0);
  804|  2.46k|}
archive_read_support_format_mtree.c:next_line:
  374|  33.5M|{
  375|  33.5M|	ssize_t len;
  376|  33.5M|	int quit;
  377|       |	
  378|  33.5M|	quit = 0;
  379|  33.5M|	if (*avail == 0) {
  ------------------
  |  Branch (379:6): [True: 11, False: 33.5M]
  ------------------
  380|     11|		*nl = 0;
  381|     11|		len = 0;
  382|     11|	} else
  383|  33.5M|		len = get_line_size(*b, *avail, nl);
  384|       |	/*
  385|       |	 * Read bytes more while it does not reach the end of line.
  386|       |	 */
  387|  33.5M|	while (*nl == 0 && len == *avail && !quit) {
  ------------------
  |  Branch (387:9): [True: 2.23k, False: 33.5M]
  |  Branch (387:21): [True: 57, False: 2.17k]
  |  Branch (387:38): [True: 56, False: 1]
  ------------------
  388|     56|		ssize_t diff = *ravail - *avail;
  389|     56|		size_t nbytes_req = (*ravail+1023) & ~1023U;
  390|     56|		ssize_t tested;
  391|       |
  392|       |		/*
  393|       |		 * Place an arbitrary limit on the line length.
  394|       |		 * mtree is almost free-form input and without line length limits,
  395|       |		 * it can consume a lot of memory.
  396|       |		 */
  397|     56|		if (len >= MAX_LINE_LEN)
  ------------------
  |  |   83|     56|#define	MAX_LINE_LEN		(1024 * 1024)
  ------------------
  |  Branch (397:7): [True: 1, False: 55]
  ------------------
  398|      1|			return (-1);
  399|       |
  400|       |		/* Increase reading bytes if it is not enough for at least
  401|       |		 * two new lines. */
  402|     55|		if (nbytes_req < (size_t)*ravail + 160)
  ------------------
  |  Branch (402:7): [True: 31, False: 24]
  ------------------
  403|     31|			nbytes_req <<= 1;
  404|       |
  405|     55|		*b = __archive_read_ahead(a, nbytes_req, avail);
  406|     55|		if (*b == NULL) {
  ------------------
  |  Branch (406:7): [True: 27, False: 28]
  ------------------
  407|     27|			if (*ravail >= *avail)
  ------------------
  |  Branch (407:8): [True: 23, False: 4]
  ------------------
  408|     23|				return (0);
  409|       |			/* Reading bytes reaches the end of file. */
  410|      4|			*b = __archive_read_ahead(a, *avail, avail);
  411|      4|			quit = 1;
  412|      4|		}
  413|     32|		*ravail = *avail;
  414|     32|		*b += diff;
  415|     32|		*avail -= diff;
  416|     32|		tested = len;/* Skip some bytes we already determined. */
  417|     32|		len = get_line_size(*b + len, *avail - len, nl);
  418|     32|		if (len >= 0)
  ------------------
  |  Branch (418:7): [True: 26, False: 6]
  ------------------
  419|     26|			len += tested;
  420|     32|	}
  421|  33.5M|	return (len);
  422|  33.5M|}
archive_read_support_format_mtree.c:get_line_size:
  330|  33.5M|{
  331|  33.5M|	ssize_t len;
  332|       |
  333|  33.5M|	len = 0;
  334|  36.8M|	while (len < avail) {
  ------------------
  |  Branch (334:9): [True: 36.8M, False: 46]
  ------------------
  335|  36.8M|		switch (*b) {
  336|  2.17k|		case '\0':/* Non-ascii character or control character. */
  ------------------
  |  Branch (336:3): [True: 2.17k, False: 36.8M]
  ------------------
  337|  2.17k|			if (nlsize != NULL)
  ------------------
  |  Branch (337:8): [True: 2.17k, False: 0]
  ------------------
  338|  2.17k|				*nlsize = 0;
  339|  2.17k|			return (-1);
  340|  33.5M|		case '\r':
  ------------------
  |  Branch (340:3): [True: 33.5M, False: 3.28M]
  ------------------
  341|  33.5M|			if (avail-len > 1 && b[1] == '\n') {
  ------------------
  |  Branch (341:8): [True: 33.5M, False: 10]
  |  Branch (341:25): [True: 718, False: 33.5M]
  ------------------
  342|    718|				if (nlsize != NULL)
  ------------------
  |  Branch (342:9): [True: 718, False: 0]
  ------------------
  343|    718|					*nlsize = 2;
  344|    718|				return (len+2);
  345|    718|			}
  346|       |			/* FALL THROUGH */
  347|  33.5M|		case '\n':
  ------------------
  |  Branch (347:3): [True: 1.34k, False: 36.8M]
  ------------------
  348|  33.5M|			if (nlsize != NULL)
  ------------------
  |  Branch (348:8): [True: 33.5M, False: 0]
  ------------------
  349|  33.5M|				*nlsize = 1;
  350|  33.5M|			return (len+1);
  351|  3.28M|		default:
  ------------------
  |  Branch (351:3): [True: 3.28M, False: 33.5M]
  ------------------
  352|  3.28M|			b++;
  353|  3.28M|			len++;
  354|  3.28M|			break;
  355|  36.8M|		}
  356|  36.8M|	}
  357|     46|	if (nlsize != NULL)
  ------------------
  |  Branch (357:6): [True: 46, False: 0]
  ------------------
  358|     46|		*nlsize = 0;
  359|     46|	return (avail);
  360|  33.5M|}
archive_read_support_format_mtree.c:bid_keyword_list:
  531|  1.92k|{
  532|  1.92k|	int l;
  533|  1.92k|	int keycnt = 0;
  534|       |
  535|  2.46k|	while (len > 0 && *p) {
  ------------------
  |  Branch (535:9): [True: 2.39k, False: 72]
  |  Branch (535:20): [True: 2.39k, False: 0]
  ------------------
  536|  2.39k|		int blank = 0;
  537|       |
  538|       |		/* Test whether there are blank characters in the line. */
  539|  3.93k|		while (len >0 && (*p == ' ' || *p == '\t')) {
  ------------------
  |  Branch (539:10): [True: 3.93k, False: 0]
  |  Branch (539:21): [True: 1.50k, False: 2.43k]
  |  Branch (539:34): [True: 34, False: 2.39k]
  ------------------
  540|  1.54k|			++p;
  541|  1.54k|			--len;
  542|  1.54k|			blank = 1;
  543|  1.54k|		}
  544|  2.39k|		if (*p == '\n' || *p == '\r')
  ------------------
  |  Branch (544:7): [True: 159, False: 2.23k]
  |  Branch (544:21): [True: 705, False: 1.53k]
  ------------------
  545|    864|			break;
  546|  1.53k|		if (p[0] == '\\' && (p[1] == '\n' || p[1] == '\r'))
  ------------------
  |  Branch (546:7): [True: 0, False: 1.53k]
  |  Branch (546:24): [True: 0, False: 0]
  |  Branch (546:40): [True: 0, False: 0]
  ------------------
  547|      0|			break;
  548|  1.53k|		if (!blank && !last_is_path) /* No blank character. */
  ------------------
  |  Branch (548:7): [True: 0, False: 1.53k]
  |  Branch (548:17): [True: 0, False: 0]
  ------------------
  549|      0|			return (-1);
  550|  1.53k|		if (last_is_path && len == 0)
  ------------------
  |  Branch (550:7): [True: 0, False: 1.53k]
  |  Branch (550:23): [True: 0, False: 0]
  ------------------
  551|      0|				return (keycnt);
  552|       |
  553|  1.53k|		if (unset) {
  ------------------
  |  Branch (553:7): [True: 1.00k, False: 528]
  ------------------
  554|  1.00k|			l = bid_keycmp(p, "all", len);
  555|  1.00k|			if (l > 0)
  ------------------
  |  Branch (555:8): [True: 968, False: 36]
  ------------------
  556|    968|				return (1);
  557|  1.00k|		}
  558|       |		/* Test whether there is a correct key in the line. */
  559|    564|		l = bid_keyword(p, len);
  560|    564|		if (l == 0)
  ------------------
  |  Branch (560:7): [True: 18, False: 546]
  ------------------
  561|     18|			return (-1);/* Unknown keyword was found. */
  562|    546|		p += l;
  563|    546|		len -= l;
  564|    546|		keycnt++;
  565|       |
  566|       |		/* Skip value */
  567|    546|		if (*p == '=') {
  ------------------
  |  Branch (567:7): [True: 80, False: 466]
  ------------------
  568|     80|			int value = 0;
  569|     80|			++p;
  570|     80|			--len;
  571|  32.7k|			while (len > 0 && *p != ' ' && *p != '\t') {
  ------------------
  |  Branch (571:11): [True: 32.6k, False: 72]
  |  Branch (571:22): [True: 32.6k, False: 2]
  |  Branch (571:35): [True: 32.6k, False: 6]
  ------------------
  572|  32.6k|				++p;
  573|  32.6k|				--len;
  574|  32.6k|				value = 1;
  575|  32.6k|			}
  576|       |			/* A keyword should have a value unless this is
  577|       |			 * an "/unset" operation. */ 
  578|     80|			if (!unset && value == 0)
  ------------------
  |  Branch (578:8): [True: 44, False: 36]
  |  Branch (578:18): [True: 0, False: 44]
  ------------------
  579|      0|				return (-1);
  580|     80|		}
  581|    546|	}
  582|    936|	return (keycnt);
  583|  1.92k|}
archive_read_support_format_mtree.c:bid_keycmp:
  431|  1.69k|{
  432|  1.69k|	int match_len = 0;
  433|       |
  434|  6.78k|	while (len > 0 && *p && *key) {
  ------------------
  |  Branch (434:9): [True: 6.78k, False: 0]
  |  Branch (434:20): [True: 6.78k, False: 0]
  |  Branch (434:26): [True: 5.25k, False: 1.52k]
  ------------------
  435|  5.25k|		if (*p == *key) {
  ------------------
  |  Branch (435:7): [True: 5.08k, False: 173]
  ------------------
  436|  5.08k|			--len;
  437|  5.08k|			++p;
  438|  5.08k|			++key;
  439|  5.08k|			++match_len;
  440|  5.08k|			continue;
  441|  5.08k|		}
  442|    173|		return (0);/* Not match */
  443|  5.25k|	}
  444|  1.52k|	if (*key != '\0')
  ------------------
  |  Branch (444:6): [True: 0, False: 1.52k]
  ------------------
  445|      0|		return (0);/* Not match */
  446|       |
  447|       |	/* A following character should be specified characters */
  448|  1.52k|	if (p[0] == '=' || p[0] == ' ' || p[0] == '\t' ||
  ------------------
  |  Branch (448:6): [True: 136, False: 1.39k]
  |  Branch (448:21): [True: 0, False: 1.39k]
  |  Branch (448:36): [True: 456, False: 934]
  ------------------
  449|    934|	    p[0] == '\n' || p[0] == '\r' ||
  ------------------
  |  Branch (449:6): [True: 2, False: 932]
  |  Branch (449:22): [True: 464, False: 468]
  ------------------
  450|    468|	   (p[0] == '\\' && (p[1] == '\n' || p[1] == '\r')))
  ------------------
  |  Branch (450:6): [True: 456, False: 12]
  |  Branch (450:23): [True: 456, False: 0]
  |  Branch (450:39): [True: 0, False: 0]
  ------------------
  451|  1.51k|		return (match_len);
  452|     12|	return (0);/* Not match */
  453|  1.52k|}
archive_read_support_format_mtree.c:bid_keyword:
  462|    564|{
  463|    564|	static const char * const keys_c[] = {
  464|    564|		"content", "contents", "cksum", NULL
  465|    564|	};
  466|    564|	static const char * const keys_df[] = {
  467|    564|		"device", "flags", NULL
  468|    564|	};
  469|    564|	static const char * const keys_g[] = {
  470|    564|		"gid", "gname", NULL
  471|    564|	};
  472|    564|	static const char * const keys_il[] = {
  473|    564|		"ignore", "inode", "link", NULL
  474|    564|	};
  475|    564|	static const char * const keys_m[] = {
  476|    564|		"md5", "md5digest", "mode", NULL
  477|    564|	};
  478|    564|	static const char * const keys_no[] = {
  479|    564|		"nlink", "nochange", "optional", NULL
  480|    564|	};
  481|    564|	static const char * const keys_r[] = {
  482|    564|		"resdevice", "rmd160", "rmd160digest", NULL
  483|    564|	};
  484|    564|	static const char * const keys_s[] = {
  485|    564|		"sha1", "sha1digest",
  486|    564|		"sha256", "sha256digest",
  487|    564|		"sha384", "sha384digest",
  488|    564|		"sha512", "sha512digest",
  489|    564|		"size", NULL
  490|    564|	};
  491|    564|	static const char * const keys_t[] = {
  492|    564|		"tags", "time", "type", NULL
  493|    564|	};
  494|    564|	static const char * const keys_u[] = {
  495|    564|		"uid", "uname",	NULL
  496|    564|	};
  497|    564|	const char * const *keys;
  498|    564|	int i;
  499|       |
  500|    564|	switch (*p) {
  501|      1|	case 'c': keys = keys_c; break;
  ------------------
  |  Branch (501:2): [True: 1, False: 563]
  ------------------
  502|      4|	case 'd': case 'f': keys = keys_df; break;
  ------------------
  |  Branch (502:2): [True: 4, False: 560]
  |  Branch (502:12): [True: 0, False: 564]
  ------------------
  503|    500|	case 'g': keys = keys_g; break;
  ------------------
  |  Branch (503:2): [True: 500, False: 64]
  ------------------
  504|      0|	case 'i': case 'l': keys = keys_il; break;
  ------------------
  |  Branch (504:2): [True: 0, False: 564]
  |  Branch (504:12): [True: 0, False: 564]
  ------------------
  505|      6|	case 'm': keys = keys_m; break;
  ------------------
  |  Branch (505:2): [True: 6, False: 558]
  ------------------
  506|      2|	case 'n': case 'o': keys = keys_no; break;
  ------------------
  |  Branch (506:2): [True: 2, False: 562]
  |  Branch (506:12): [True: 0, False: 564]
  ------------------
  507|      3|	case 'r': keys = keys_r; break;
  ------------------
  |  Branch (507:2): [True: 3, False: 561]
  ------------------
  508|     16|	case 's': keys = keys_s; break;
  ------------------
  |  Branch (508:2): [True: 16, False: 548]
  ------------------
  509|     19|	case 't': keys = keys_t; break;
  ------------------
  |  Branch (509:2): [True: 19, False: 545]
  ------------------
  510|      0|	case 'u': keys = keys_u; break;
  ------------------
  |  Branch (510:2): [True: 0, False: 564]
  ------------------
  511|     13|	default: return (0);/* Unknown key */
  ------------------
  |  Branch (511:2): [True: 13, False: 551]
  ------------------
  512|    564|	}
  513|       |
  514|    700|	for (i = 0; keys[i] != NULL; i++) {
  ------------------
  |  Branch (514:14): [True: 695, False: 5]
  ------------------
  515|    695|		int l = bid_keycmp(p, keys[i], len);
  516|    695|		if (l > 0)
  ------------------
  |  Branch (516:7): [True: 546, False: 149]
  ------------------
  517|    546|			return (l);
  518|    695|	}
  519|      5|	return (0);/* Unknown key */
  520|    551|}
archive_read_support_format_mtree.c:bid_entry:
  587|    585|{
  588|    585|	int f = 0;
  589|    585|	static const unsigned char safe_char[256] = {
  590|    585|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 00 - 0F */
  591|    585|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 10 - 1F */
  592|       |		/* !"$%&'()*+,-./  EXCLUSION:( )(#) */
  593|    585|		0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 20 - 2F */
  594|       |		/* 0123456789:;<>?  EXCLUSION:(=) */
  595|    585|		1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, /* 30 - 3F */
  596|       |		/* @ABCDEFGHIJKLMNO */
  597|    585|		1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 40 - 4F */
  598|       |		/* PQRSTUVWXYZ[\]^_  */
  599|    585|		1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 50 - 5F */
  600|       |		/* `abcdefghijklmno */
  601|    585|		1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 60 - 6F */
  602|       |		/* pqrstuvwxyz{|}~ */
  603|    585|		1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, /* 70 - 7F */
  604|    585|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 80 - 8F */
  605|    585|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 90 - 9F */
  606|    585|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* A0 - AF */
  607|    585|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* B0 - BF */
  608|    585|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* C0 - CF */
  609|    585|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* D0 - DF */
  610|    585|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* E0 - EF */
  611|    585|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* F0 - FF */
  612|    585|	};
  613|    585|	ssize_t ll;
  614|    585|	const char *pp = p;
  615|    585|	const char * const pp_end = pp + len;
  616|       |
  617|    585|	*last_is_path = 0;
  618|       |	/*
  619|       |	 * Skip the path-name which is quoted.
  620|       |	 */
  621|  38.0k|	for (;pp < pp_end; ++pp) {
  ------------------
  |  Branch (621:8): [True: 38.0k, False: 0]
  ------------------
  622|  38.0k|		if (!safe_char[*(const unsigned char *)pp]) {
  ------------------
  |  Branch (622:7): [True: 585, False: 37.4k]
  ------------------
  623|    585|			if (*pp != ' ' && *pp != '\t' && *pp != '\r'
  ------------------
  |  Branch (623:8): [True: 562, False: 23]
  |  Branch (623:22): [True: 543, False: 19]
  |  Branch (623:37): [True: 302, False: 241]
  ------------------
  624|    302|			    && *pp != '\n')
  ------------------
  |  Branch (624:11): [True: 149, False: 153]
  ------------------
  625|    149|				f = 0;
  626|    585|			break;
  627|    585|		}
  628|  37.4k|		f = 1;
  629|  37.4k|	}
  630|    585|	ll = pp_end - pp;
  631|       |
  632|       |	/* If a path-name was not found at the first, try to check
  633|       |	 * a mtree format(a.k.a form D) ``NetBSD's mtree -D'' creates,
  634|       |	 * which places the path-name at the last. */
  635|    585|	if (f == 0) {
  ------------------
  |  Branch (635:6): [True: 149, False: 436]
  ------------------
  636|    149|		const char *pb = p + len - nl;
  637|    149|		int name_len = 0;
  638|    149|		int slash;
  639|       |
  640|       |		/* The form D accepts only a single line for an entry. */
  641|    149|		if (pb-2 >= p &&
  ------------------
  |  Branch (641:7): [True: 147, False: 2]
  ------------------
  642|    147|		    pb[-1] == '\\' && (pb[-2] == ' ' || pb[-2] == '\t'))
  ------------------
  |  Branch (642:7): [True: 1, False: 146]
  |  Branch (642:26): [True: 0, False: 1]
  |  Branch (642:43): [True: 0, False: 1]
  ------------------
  643|      0|			return (-1);
  644|    149|		if (pb-1 >= p && pb[-1] == '\\')
  ------------------
  |  Branch (644:7): [True: 149, False: 0]
  |  Branch (644:20): [True: 1, False: 148]
  ------------------
  645|      1|			return (-1);
  646|       |
  647|    148|		slash = 0;
  648|  1.27k|		while (p <= --pb && *pb != ' ' && *pb != '\t') {
  ------------------
  |  Branch (648:10): [True: 1.27k, False: 0]
  |  Branch (648:23): [True: 1.27k, False: 1]
  |  Branch (648:37): [True: 1.27k, False: 2]
  ------------------
  649|  1.27k|			if (!safe_char[*(const unsigned char *)pb])
  ------------------
  |  Branch (649:8): [True: 145, False: 1.12k]
  ------------------
  650|    145|				return (-1);
  651|  1.12k|			name_len++;
  652|       |			/* The pathname should have a slash in this
  653|       |			 * format. */
  654|  1.12k|			if (*pb == '/')
  ------------------
  |  Branch (654:8): [True: 16, False: 1.11k]
  ------------------
  655|     16|				slash = 1;
  656|  1.12k|		}
  657|      3|		if (name_len == 0 || slash == 0)
  ------------------
  |  Branch (657:7): [True: 1, False: 2]
  |  Branch (657:24): [True: 2, False: 0]
  ------------------
  658|      3|			return (-1);
  659|       |		/* If '/' is placed at the first in this field, this is not
  660|       |		 * a valid filename. */
  661|      0|		if (pb[1] == '/')
  ------------------
  |  Branch (661:7): [True: 0, False: 0]
  ------------------
  662|      0|			return (-1);
  663|      0|		ll = len - nl - name_len;
  664|      0|		pp = p;
  665|      0|		*last_is_path = 1;
  666|      0|	}
  667|       |
  668|    436|	return (bid_keyword_list(pp, ll, 0, *last_is_path));
  669|    585|}
archive_read_support_format_mtree.c:read_header:
 1122|  7.71k|{
 1123|  7.71k|	struct mtree *mtree;
 1124|  7.71k|	char *p;
 1125|  7.71k|	int r, use_next;
 1126|       |
 1127|  7.71k|	mtree = (struct mtree *)(a->format->data);
 1128|       |
 1129|  7.71k|	if (mtree->fd >= 0) {
  ------------------
  |  Branch (1129:6): [True: 0, False: 7.71k]
  ------------------
 1130|      0|		close(mtree->fd);
 1131|      0|		mtree->fd = -1;
 1132|      0|	}
 1133|       |
 1134|  7.71k|	if (mtree->entries == NULL) {
  ------------------
  |  Branch (1134:6): [True: 33, False: 7.68k]
  ------------------
 1135|     33|		mtree->resolver = archive_entry_linkresolver_new();
 1136|     33|		if (mtree->resolver == NULL)
  ------------------
  |  Branch (1136:7): [True: 0, False: 33]
  ------------------
 1137|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1138|     33|		archive_entry_linkresolver_set_strategy(mtree->resolver,
 1139|     33|		    ARCHIVE_FORMAT_MTREE);
  ------------------
  |  |  379|     33|#define	ARCHIVE_FORMAT_MTREE			0x80000
  ------------------
 1140|     33|		r = read_mtree(a, mtree);
 1141|     33|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|     33|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1141:7): [True: 9, False: 24]
  ------------------
 1142|      9|			return (r);
 1143|     33|	}
 1144|       |
 1145|  7.70k|	a->archive.archive_format = mtree->archive_format;
 1146|  7.70k|	a->archive.archive_format_name = mtree->archive_format_name;
 1147|       |
 1148|  16.2k|	for (;;) {
 1149|  16.2k|		if (mtree->this_entry == NULL)
  ------------------
  |  Branch (1149:7): [True: 24, False: 16.2k]
  ------------------
 1150|     24|			return (ARCHIVE_EOF);
  ------------------
  |  |  232|     24|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1151|  16.2k|		if (strcmp(mtree->this_entry->name, "..") == 0) {
  ------------------
  |  Branch (1151:7): [True: 561, False: 15.6k]
  ------------------
 1152|    561|			mtree->this_entry->used = 1;
 1153|    561|			if (archive_strlen(&mtree->current_dir) > 0) {
  ------------------
  |  |  178|    561|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (1153:8): [True: 496, False: 65]
  ------------------
 1154|       |				/* Roll back current path. */
 1155|    496|				p = mtree->current_dir.s
 1156|    496|				    + mtree->current_dir.length - 1;
 1157|  1.99k|				while (p >= mtree->current_dir.s && *p != '/')
  ------------------
  |  Branch (1157:12): [True: 1.73k, False: 252]
  |  Branch (1157:41): [True: 1.49k, False: 244]
  ------------------
 1158|  1.49k|					--p;
 1159|    496|				if (p >= mtree->current_dir.s)
  ------------------
  |  Branch (1159:9): [True: 244, False: 252]
  ------------------
 1160|    244|					--p;
 1161|    496|				mtree->current_dir.length
 1162|    496|				    = p - mtree->current_dir.s + 1;
 1163|    496|			}
 1164|    561|		}
 1165|  16.2k|		if (!mtree->this_entry->used) {
  ------------------
  |  Branch (1165:7): [True: 7.68k, False: 8.52k]
  ------------------
 1166|  7.68k|			use_next = 0;
 1167|  7.68k|			r = parse_file(a, entry, mtree, mtree->this_entry,
 1168|  7.68k|				&use_next);
 1169|  7.68k|			if (use_next == 0)
  ------------------
  |  Branch (1169:8): [True: 7.68k, False: 0]
  ------------------
 1170|  7.68k|				return (r);
 1171|  7.68k|		}
 1172|  8.52k|		mtree->this_entry = mtree->this_entry->next;
 1173|  8.52k|	}
 1174|  7.70k|}
archive_read_support_format_mtree.c:read_mtree:
 1041|     33|{
 1042|     33|	ssize_t len;
 1043|     33|	uintmax_t counter;
 1044|     33|	char *p, *s;
 1045|     33|	struct mtree_option *global;
 1046|     33|	struct mtree_entry *last_entry;
 1047|     33|	int r, is_form_d;
 1048|       |
 1049|     33|	mtree->archive_format = ARCHIVE_FORMAT_MTREE;
  ------------------
  |  |  379|     33|#define	ARCHIVE_FORMAT_MTREE			0x80000
  ------------------
 1050|     33|	mtree->archive_format_name = "mtree";
 1051|       |
 1052|     33|	global = NULL;
 1053|     33|	last_entry = NULL;
 1054|       |
 1055|     33|	(void)detect_form(a, &is_form_d);
 1056|       |
 1057|  11.7k|	for (counter = 1; ; ++counter) {
 1058|  11.7k|		r = ARCHIVE_OK;
  ------------------
  |  |  233|  11.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1059|  11.7k|		len = readline(a, mtree, &p, 65536);
 1060|  11.7k|		if (len == 0) {
  ------------------
  |  Branch (1060:7): [True: 24, False: 11.7k]
  ------------------
 1061|     24|			mtree->this_entry = mtree->entries;
 1062|     24|			free_options(global);
 1063|     24|			return (ARCHIVE_OK);
  ------------------
  |  |  233|     24|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1064|     24|		}
 1065|  11.7k|		if (len < 0) {
  ------------------
  |  Branch (1065:7): [True: 8, False: 11.7k]
  ------------------
 1066|      8|			free_options(global);
 1067|      8|			return ((int)len);
 1068|      8|		}
 1069|       |		/* Leading whitespace is never significant, ignore it. */
 1070|  11.7k|		while (*p == ' ' || *p == '\t') {
  ------------------
  |  Branch (1070:10): [True: 3, False: 11.7k]
  |  Branch (1070:23): [True: 7, False: 11.7k]
  ------------------
 1071|     10|			++p;
 1072|     10|			--len;
 1073|     10|		}
 1074|       |		/* Skip content lines and blank lines. */
 1075|  11.7k|		if (*p == '#')
  ------------------
  |  Branch (1075:7): [True: 831, False: 10.9k]
  ------------------
 1076|    831|			continue;
 1077|  10.9k|		if (*p == '\r' || *p == '\n' || *p == '\0')
  ------------------
  |  Branch (1077:7): [True: 0, False: 10.9k]
  |  Branch (1077:21): [True: 411, False: 10.4k]
  |  Branch (1077:35): [True: 0, False: 10.4k]
  ------------------
 1078|    411|			continue;
 1079|       |		/* Non-printable characters are not allowed */
 1080|   166k|		for (s = p;s < p + len - 1; s++) {
  ------------------
  |  Branch (1080:14): [True: 156k, False: 10.4k]
  ------------------
 1081|   156k|			if (!isprint((unsigned char)*s) && *s != '\t') {
  ------------------
  |  Branch (1081:8): [True: 2.33k, False: 153k]
  |  Branch (1081:39): [True: 0, False: 2.33k]
  ------------------
 1082|      0|				archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1083|      0|					"Non-printable character 0x%02X", (unsigned char)(*s));
 1084|      0|				r = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1085|      0|				break;
 1086|      0|			}
 1087|   156k|		}
 1088|  10.4k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  10.4k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1088:7): [True: 0, False: 10.4k]
  ------------------
 1089|      0|			break;
 1090|  10.4k|		if (*p != '/') {
  ------------------
  |  Branch (1090:7): [True: 9.21k, False: 1.27k]
  ------------------
 1091|  9.21k|			r = process_add_entry(a, mtree, &global, p, len,
 1092|  9.21k|			    &last_entry, is_form_d);
 1093|  9.21k|		} else if (len > 4 && strncmp(p, "/set", 4) == 0) {
  ------------------
  |  Branch (1093:14): [True: 1.27k, False: 0]
  |  Branch (1093:25): [True: 660, False: 617]
  ------------------
 1094|    660|			if (p[4] != ' ' && p[4] != '\t')
  ------------------
  |  Branch (1094:8): [True: 488, False: 172]
  |  Branch (1094:23): [True: 0, False: 488]
  ------------------
 1095|      0|				break;
 1096|    660|			r = process_global_set(a, &global, p);
 1097|    660|		} else if (len > 6 && strncmp(p, "/unset", 6) == 0) {
  ------------------
  |  Branch (1097:14): [True: 617, False: 0]
  |  Branch (1097:25): [True: 616, False: 1]
  ------------------
 1098|    616|			if (p[6] != ' ' && p[6] != '\t')
  ------------------
  |  Branch (1098:8): [True: 0, False: 616]
  |  Branch (1098:23): [True: 0, False: 0]
  ------------------
 1099|      0|				break;
 1100|    616|			r = process_global_unset(a, &global, p);
 1101|    616|		} else
 1102|      1|			break;
 1103|       |
 1104|  10.4k|		if (r != ARCHIVE_OK) {
  ------------------
  |  |  233|  10.4k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1104:7): [True: 0, False: 10.4k]
  ------------------
 1105|      0|			free_options(global);
 1106|      0|			return r;
 1107|      0|		}
 1108|  10.4k|	}
 1109|       |
 1110|      1|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1111|      1|	    "Can't parse line %ju", counter);
 1112|      1|	free_options(global);
 1113|      1|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1114|     33|}
archive_read_support_format_mtree.c:readline:
 2103|  11.7k|{
 2104|  11.7k|	ssize_t bytes_read;
 2105|  11.7k|	ssize_t total_size = 0;
 2106|  11.7k|	ssize_t find_off = 0;
 2107|  11.7k|	const void *nl, *t;
 2108|  11.7k|	char *u;
 2109|       |
 2110|       |	/* Accumulate line in a line buffer. */
 2111|  16.9k|	for (;;) {
 2112|       |		/* Read some more. */
 2113|  16.9k|		t = __archive_read_ahead(a, 1, &bytes_read);
 2114|  16.9k|		if (t == NULL)
  ------------------
  |  Branch (2114:7): [True: 24, False: 16.8k]
  ------------------
 2115|     24|			return (0);
 2116|  16.8k|		if (bytes_read < 0)
  ------------------
  |  Branch (2116:7): [True: 0, False: 16.8k]
  ------------------
 2117|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2118|  16.8k|		nl = memchr(t, '\n', bytes_read);
 2119|       |		/* If we found '\n', trim the read to end exactly there. */
 2120|  16.8k|		if (nl != NULL) {
  ------------------
  |  Branch (2120:7): [True: 16.8k, False: 32]
  ------------------
 2121|  16.8k|			bytes_read = ((const char *)nl) - ((const char *)t) + 1;
 2122|  16.8k|		}
 2123|  16.8k|		if (total_size + bytes_read + 1 > limit) {
  ------------------
  |  Branch (2123:7): [True: 8, False: 16.8k]
  ------------------
 2124|      8|			archive_set_error(&a->archive,
 2125|      8|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      8|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2126|      8|			    "Line too long");
 2127|      8|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      8|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2128|      8|		}
 2129|  16.8k|		if (archive_string_ensure(&mtree->line,
  ------------------
  |  Branch (2129:7): [True: 0, False: 16.8k]
  ------------------
 2130|  16.8k|			total_size + bytes_read + 1) == NULL) {
 2131|      0|			archive_set_error(&a->archive, ENOMEM,
 2132|      0|			    "Can't allocate working buffer");
 2133|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2134|      0|		}
 2135|       |		/* Append new bytes to string. */
 2136|  16.8k|		memcpy(mtree->line.s + total_size, t, bytes_read);
 2137|  16.8k|		__archive_read_consume(a, bytes_read);
 2138|  16.8k|		total_size += bytes_read;
 2139|  16.8k|		mtree->line.s[total_size] = '\0';
 2140|       |
 2141|  1.17M|		for (u = mtree->line.s + find_off; *u; ++u) {
  ------------------
  |  Branch (2141:38): [True: 1.16M, False: 4.88k]
  ------------------
 2142|  1.16M|			if (u[0] == '\n') {
  ------------------
  |  Branch (2142:8): [True: 11.7k, False: 1.15M]
  ------------------
 2143|       |				/* Ends with unescaped newline. */
 2144|       |				/* Check if preceded by '\r' for CRLF handling */
 2145|  11.7k|				if (u > mtree->line.s && u[-1] == '\r') {
  ------------------
  |  Branch (2145:9): [True: 11.3k, False: 411]
  |  Branch (2145:30): [True: 217, False: 11.1k]
  ------------------
 2146|       |					/* CRLF ending - remove the '\r' */
 2147|    217|					u[-1] = '\n';
 2148|    217|					u[0] = '\0';
 2149|    217|					total_size--;
 2150|    217|				}
 2151|  11.7k|				*start = mtree->line.s;
 2152|  11.7k|				return total_size;
 2153|  1.15M|			} else if (u[0] == '#') {
  ------------------
  |  Branch (2153:15): [True: 989k, False: 167k]
  ------------------
 2154|       |				/* Ends with comment sequence #...\n */
 2155|   989k|				if (nl == NULL) {
  ------------------
  |  Branch (2155:9): [True: 14, False: 989k]
  ------------------
 2156|       |					/* But we've not found the \n yet */
 2157|     14|					break;
 2158|     14|				}
 2159|   989k|			} else if (u[0] == '\\') {
  ------------------
  |  Branch (2159:15): [True: 10.4k, False: 156k]
  ------------------
 2160|  10.4k|				if (u[1] == '\n') {
  ------------------
  |  Branch (2160:9): [True: 232, False: 10.2k]
  ------------------
 2161|       |					/* Trim escaped newline. */
 2162|    232|					total_size -= 2;
 2163|    232|					mtree->line.s[total_size] = '\0';
 2164|    232|					break;
 2165|  10.2k|				} else if (u[1] == '\r' && u[2] == '\n') {
  ------------------
  |  Branch (2165:16): [True: 0, False: 10.2k]
  |  Branch (2165:32): [True: 0, False: 0]
  ------------------
 2166|       |					/* Trim escaped CRLF. */
 2167|      0|					total_size -= 3;
 2168|      0|					mtree->line.s[total_size] = '\0';
 2169|      0|					break;
 2170|  10.2k|				} else if (u[1] != '\0') {
  ------------------
  |  Branch (2170:16): [True: 10.2k, False: 0]
  ------------------
 2171|       |					/* Skip the two-char escape sequence */
 2172|  10.2k|					++u;
 2173|  10.2k|				}
 2174|  10.4k|			}
 2175|  1.16M|		}
 2176|  5.13k|		find_off = u - mtree->line.s;
 2177|  5.13k|	}
 2178|  11.7k|}
archive_read_support_format_mtree.c:process_add_entry:
  927|  9.21k|{
  928|  9.21k|	struct mtree_entry *entry;
  929|  9.21k|	struct mtree_option *iter;
  930|  9.21k|	const char *next, *eq, *name, *end;
  931|  9.21k|	size_t name_len, len;
  932|  9.21k|	int r, i;
  933|       |
  934|  9.21k|	if ((entry = malloc(sizeof(*entry))) == NULL) {
  ------------------
  |  Branch (934:6): [True: 0, False: 9.21k]
  ------------------
  935|      0|		archive_set_error(&a->archive, errno, "Can't allocate memory");
  936|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  937|      0|	}
  938|  9.21k|	entry->next = NULL;
  939|  9.21k|	entry->options = NULL;
  940|  9.21k|	entry->name = NULL;
  941|  9.21k|	entry->used = 0;
  942|  9.21k|	entry->full = 0;
  943|       |
  944|       |	/* Add this entry to list. */
  945|  9.21k|	if (*last_entry == NULL)
  ------------------
  |  Branch (945:6): [True: 29, False: 9.18k]
  ------------------
  946|     29|		mtree->entries = entry;
  947|  9.18k|	else
  948|  9.18k|		(*last_entry)->next = entry;
  949|  9.21k|	*last_entry = entry;
  950|       |
  951|  9.21k|	if (is_form_d) {
  ------------------
  |  Branch (951:6): [True: 0, False: 9.21k]
  ------------------
  952|       |		/* Filename is last item on line. */
  953|       |		/* Adjust line_len to trim trailing whitespace */
  954|      0|		while (line_len > 0) {
  ------------------
  |  Branch (954:10): [True: 0, False: 0]
  ------------------
  955|      0|			char last_character = line[line_len - 1];
  956|      0|			if (last_character == '\r'
  ------------------
  |  Branch (956:8): [True: 0, False: 0]
  ------------------
  957|      0|			    || last_character == '\n'
  ------------------
  |  Branch (957:11): [True: 0, False: 0]
  ------------------
  958|      0|			    || last_character == '\t'
  ------------------
  |  Branch (958:11): [True: 0, False: 0]
  ------------------
  959|      0|			    || last_character == ' ') {
  ------------------
  |  Branch (959:11): [True: 0, False: 0]
  ------------------
  960|      0|				line_len--;
  961|      0|			} else {
  962|      0|				break;
  963|      0|			}
  964|      0|		}
  965|       |		/* Name starts after the last whitespace separator */
  966|      0|		name = line;
  967|      0|		for (i = 0; i < line_len; i++) {
  ------------------
  |  Branch (967:15): [True: 0, False: 0]
  ------------------
  968|      0|			if (line[i] == '\r'
  ------------------
  |  Branch (968:8): [True: 0, False: 0]
  ------------------
  969|      0|			    || line[i] == '\n'
  ------------------
  |  Branch (969:11): [True: 0, False: 0]
  ------------------
  970|      0|			    || line[i] == '\t'
  ------------------
  |  Branch (970:11): [True: 0, False: 0]
  ------------------
  971|      0|			    || line[i] == ' ') {
  ------------------
  |  Branch (971:11): [True: 0, False: 0]
  ------------------
  972|      0|				name = line + i + 1;
  973|      0|			}
  974|      0|		}
  975|      0|		name_len = line + line_len - name;
  976|      0|		end = name;
  977|  9.21k|	} else {
  978|       |		/* Filename is first item on line */
  979|  9.21k|		name_len = strcspn(line, " \t\r\n");
  980|  9.21k|		name = line;
  981|  9.21k|		line += name_len;
  982|  9.21k|		end = line + line_len;
  983|  9.21k|	}
  984|       |	/* name/name_len is the name within the line. */
  985|       |	/* line..end brackets the entire line except the name */
  986|       |
  987|  9.21k|	if ((entry->name = malloc(name_len + 1)) == NULL) {
  ------------------
  |  Branch (987:6): [True: 0, False: 9.21k]
  ------------------
  988|      0|		archive_set_error(&a->archive, errno, "Can't allocate memory");
  989|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  990|      0|	}
  991|       |
  992|  9.21k|	memcpy(entry->name, name, name_len);
  993|  9.21k|	entry->name[name_len] = '\0';
  994|  9.21k|	parse_escapes(entry->name, entry);
  995|       |
  996|  9.21k|	entry->next_dup = NULL;
  997|  9.21k|	if (entry->full) {
  ------------------
  |  Branch (997:6): [True: 438, False: 8.77k]
  ------------------
  998|    438|		if (!__archive_rb_tree_insert_node(&mtree->rbtree, &entry->rbnode)) {
  ------------------
  |  Branch (998:7): [True: 322, False: 116]
  ------------------
  999|    322|			struct mtree_entry *alt;
 1000|    322|			alt = (struct mtree_entry *)__archive_rb_tree_find_node(
 1001|    322|			    &mtree->rbtree, entry->name);
 1002|    322|			if (alt != NULL) {
  ------------------
  |  Branch (1002:8): [True: 322, False: 0]
  ------------------
 1003|  8.37k|				while (alt->next_dup)
  ------------------
  |  Branch (1003:12): [True: 8.05k, False: 322]
  ------------------
 1004|  8.05k|					alt = alt->next_dup;
 1005|    322|				alt->next_dup = entry;
 1006|    322|			}
 1007|    322|		}
 1008|    438|	}
 1009|       |
 1010|   101k|	for (iter = *global; iter != NULL; iter = iter->next) {
  ------------------
  |  Branch (1010:23): [True: 92.1k, False: 9.21k]
  ------------------
 1011|  92.1k|		r = add_option(a, &entry->options, iter->value,
 1012|  92.1k|		    strlen(iter->value));
 1013|  92.1k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  92.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1013:7): [True: 0, False: 92.1k]
  ------------------
 1014|      0|			return (r);
 1015|  92.1k|	}
 1016|       |
 1017|  12.5k|	for (;;) {
 1018|  12.5k|		next = line + strspn(line, " \t\r\n");
 1019|  12.5k|		if (*next == '\0')
  ------------------
  |  Branch (1019:7): [True: 9.21k, False: 3.28k]
  ------------------
 1020|  9.21k|			return (ARCHIVE_OK);
  ------------------
  |  |  233|  9.21k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1021|  3.28k|		if (next >= end)
  ------------------
  |  Branch (1021:7): [True: 0, False: 3.28k]
  ------------------
 1022|      0|			return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1023|  3.28k|		line = next;
 1024|  3.28k|		next = line + strcspn(line, " \t\r\n");
 1025|  3.28k|		eq = strchr(line, '=');
 1026|  3.28k|		if (eq == NULL || eq > next)
  ------------------
  |  Branch (1026:7): [True: 1.39k, False: 1.89k]
  |  Branch (1026:21): [True: 82, False: 1.81k]
  ------------------
 1027|  1.47k|			len = next - line;
 1028|  1.81k|		else
 1029|  1.81k|			len = eq - line;
 1030|       |
 1031|  3.28k|		remove_option(&entry->options, line, len);
 1032|  3.28k|		r = add_option(a, &entry->options, line, next - line);
 1033|  3.28k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  3.28k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1033:7): [True: 0, False: 3.28k]
  ------------------
 1034|      0|			return (r);
 1035|  3.28k|		line = next;
 1036|  3.28k|	}
 1037|  9.21k|}
archive_read_support_format_mtree.c:parse_escapes:
 1955|  9.21k|{
 1956|  9.21k|	char *dest = src;
 1957|  9.21k|	char c;
 1958|       |
 1959|  9.21k|	if (mentry != NULL && strcmp(src, ".") == 0)
  ------------------
  |  Branch (1959:6): [True: 9.21k, False: 0]
  |  Branch (1959:24): [True: 136, False: 9.08k]
  ------------------
 1960|    136|		mentry->full = 1;
 1961|       |
 1962|  60.4k|	while (*src != '\0') {
  ------------------
  |  Branch (1962:9): [True: 51.2k, False: 9.21k]
  ------------------
 1963|  51.2k|		c = *src++;
 1964|  51.2k|		if (c == '/' && mentry != NULL)
  ------------------
  |  Branch (1964:7): [True: 384, False: 50.8k]
  |  Branch (1964:19): [True: 384, False: 0]
  ------------------
 1965|    384|			mentry->full = 1;
 1966|  51.2k|		if (c == '\\') {
  ------------------
  |  Branch (1966:7): [True: 9.65k, False: 41.5k]
  ------------------
 1967|  9.65k|			switch (src[0]) {
  ------------------
  |  Branch (1967:12): [True: 9.38k, False: 273]
  ------------------
 1968|    128|			case '0':
  ------------------
  |  Branch (1968:4): [True: 128, False: 9.52k]
  ------------------
 1969|    128|				if (src[1] < '0' || src[1] > '7') {
  ------------------
  |  Branch (1969:9): [True: 0, False: 128]
  |  Branch (1969:25): [True: 128, False: 0]
  ------------------
 1970|    128|					c = 0;
 1971|    128|					++src;
 1972|    128|					break;
 1973|    128|				}
 1974|       |				/* FALLTHROUGH */
 1975|    644|			case '1':
  ------------------
  |  Branch (1975:4): [True: 644, False: 9.01k]
  ------------------
 1976|    779|			case '2':
  ------------------
  |  Branch (1976:4): [True: 135, False: 9.52k]
  ------------------
 1977|  9.12k|			case '3':
  ------------------
  |  Branch (1977:4): [True: 8.34k, False: 1.31k]
  ------------------
 1978|  9.12k|				if (src[1] >= '0' && src[1] <= '7' &&
  ------------------
  |  Branch (1978:9): [True: 6.38k, False: 2.73k]
  |  Branch (1978:26): [True: 905, False: 5.48k]
  ------------------
 1979|    905|				    src[2] >= '0' && src[2] <= '7') {
  ------------------
  |  Branch (1979:9): [True: 900, False: 5]
  |  Branch (1979:26): [True: 771, False: 129]
  ------------------
 1980|    771|					c = (src[0] - '0') << 6;
 1981|    771|					c |= (src[1] - '0') << 3;
 1982|    771|					c |= (src[2] - '0');
 1983|    771|					src += 3;
 1984|    771|				}
 1985|  9.12k|				break;
 1986|      0|			case 'a':
  ------------------
  |  Branch (1986:4): [True: 0, False: 9.65k]
  ------------------
 1987|      0|				c = '\a';
 1988|      0|				++src;
 1989|      0|				break;
 1990|      0|			case 'b':
  ------------------
  |  Branch (1990:4): [True: 0, False: 9.65k]
  ------------------
 1991|      0|				c = '\b';
 1992|      0|				++src;
 1993|      0|				break;
 1994|      0|			case 'f':
  ------------------
  |  Branch (1994:4): [True: 0, False: 9.65k]
  ------------------
 1995|      0|				c = '\f';
 1996|      0|				++src;
 1997|      0|				break;
 1998|      0|			case 'n':
  ------------------
  |  Branch (1998:4): [True: 0, False: 9.65k]
  ------------------
 1999|      0|				c = '\n';
 2000|      0|				++src;
 2001|      0|				break;
 2002|      0|			case 'r':
  ------------------
  |  Branch (2002:4): [True: 0, False: 9.65k]
  ------------------
 2003|      0|				c = '\r';
 2004|      0|				++src;
 2005|      0|				break;
 2006|      0|			case 's':
  ------------------
  |  Branch (2006:4): [True: 0, False: 9.65k]
  ------------------
 2007|      0|				c = ' ';
 2008|      0|				++src;
 2009|      0|				break;
 2010|      0|			case 't':
  ------------------
  |  Branch (2010:4): [True: 0, False: 9.65k]
  ------------------
 2011|      0|				c = '\t';
 2012|      0|				++src;
 2013|      0|				break;
 2014|      0|			case 'v':
  ------------------
  |  Branch (2014:4): [True: 0, False: 9.65k]
  ------------------
 2015|      0|				c = '\v';
 2016|      0|				++src;
 2017|      0|				break;
 2018|    131|			case '\\':
  ------------------
  |  Branch (2018:4): [True: 131, False: 9.52k]
  ------------------
 2019|    131|				c = '\\';
 2020|    131|				++src;
 2021|    131|				break;
 2022|  9.65k|			}
 2023|  9.65k|		}
 2024|  51.2k|		*dest++ = c;
 2025|  51.2k|	}
 2026|  9.21k|	*dest = '\0';
 2027|  9.21k|}
archive_read_support_format_mtree.c:add_option:
  820|  99.5k|{
  821|  99.5k|	struct mtree_option *opt;
  822|       |
  823|  99.5k|	if ((opt = malloc(sizeof(*opt))) == NULL) {
  ------------------
  |  Branch (823:6): [True: 0, False: 99.5k]
  ------------------
  824|      0|		archive_set_error(&a->archive, errno, "Can't allocate memory");
  825|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  826|      0|	}
  827|  99.5k|	if ((opt->value = malloc(len + 1)) == NULL) {
  ------------------
  |  Branch (827:6): [True: 0, False: 99.5k]
  ------------------
  828|      0|		free(opt);
  829|      0|		archive_set_error(&a->archive, errno, "Can't allocate memory");
  830|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  831|      0|	}
  832|  99.5k|	memcpy(opt->value, value, len);
  833|  99.5k|	opt->value[len] = '\0';
  834|  99.5k|	opt->next = *global;
  835|  99.5k|	*global = opt;
  836|  99.5k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  99.5k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  837|  99.5k|}
archive_read_support_format_mtree.c:remove_option:
  841|  10.2k|{
  842|  10.2k|	struct mtree_option *iter, *last;
  843|       |
  844|  10.2k|	last = NULL;
  845|  1.24M|	for (iter = *global; iter != NULL; last = iter, iter = iter->next) {
  ------------------
  |  Branch (845:23): [True: 1.24M, False: 8.03k]
  ------------------
  846|  1.24M|		if (strncmp(iter->value, value, len) == 0 &&
  ------------------
  |  Branch (846:7): [True: 10.5k, False: 1.23M]
  ------------------
  847|  10.5k|		    (iter->value[len] == '\0' ||
  ------------------
  |  Branch (847:8): [True: 2.07k, False: 8.44k]
  ------------------
  848|  8.44k|		     iter->value[len] == '='))
  ------------------
  |  Branch (848:8): [True: 137, False: 8.31k]
  ------------------
  849|  2.20k|			break;
  850|  1.24M|	}
  851|  10.2k|	if (iter == NULL)
  ------------------
  |  Branch (851:6): [True: 8.03k, False: 2.20k]
  ------------------
  852|  8.03k|		return;
  853|  2.20k|	if (last == NULL)
  ------------------
  |  Branch (853:6): [True: 240, False: 1.96k]
  ------------------
  854|    240|		*global = iter->next;
  855|  1.96k|	else
  856|  1.96k|		last->next = iter->next;
  857|       |
  858|  2.20k|	free(iter->value);
  859|  2.20k|	free(iter);
  860|  2.20k|}
archive_read_support_format_mtree.c:process_global_set:
  865|    660|{
  866|    660|	const char *next, *eq;
  867|    660|	size_t len;
  868|    660|	int r;
  869|       |
  870|    660|	line += 4;
  871|  4.82k|	for (;;) {
  872|  4.82k|		next = line + strspn(line, " \t\r\n");
  873|  4.82k|		if (*next == '\0')
  ------------------
  |  Branch (873:7): [True: 660, False: 4.16k]
  ------------------
  874|    660|			return (ARCHIVE_OK);
  ------------------
  |  |  233|    660|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  875|  4.16k|		line = next;
  876|  4.16k|		next = line + strcspn(line, " \t\r\n");
  877|  4.16k|		eq = strchr(line, '=');
  878|  4.16k|		if (eq > next)
  ------------------
  |  Branch (878:7): [True: 54, False: 4.11k]
  ------------------
  879|     54|			len = next - line;
  880|  4.11k|		else
  881|  4.11k|			len = eq - line;
  882|       |
  883|  4.16k|		remove_option(global, line, len);
  884|  4.16k|		r = add_option(a, global, line, next - line);
  885|  4.16k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  4.16k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (885:7): [True: 0, False: 4.16k]
  ------------------
  886|      0|			return (r);
  887|  4.16k|		line = next;
  888|  4.16k|	}
  889|    660|}
archive_read_support_format_mtree.c:process_global_unset:
  894|    616|{
  895|    616|	const char *next;
  896|    616|	size_t len;
  897|       |
  898|    616|	line += 6;
  899|    616|	if (strchr(line, '=') != NULL) {
  ------------------
  |  Branch (899:6): [True: 0, False: 616]
  ------------------
  900|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  901|      0|		    "/unset shall not contain `='");
  902|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  903|      0|	}
  904|       |
  905|  3.89k|	for (;;) {
  906|  3.89k|		next = line + strspn(line, " \t\r\n");
  907|  3.89k|		if (*next == '\0')
  ------------------
  |  Branch (907:7): [True: 616, False: 3.27k]
  ------------------
  908|    616|			return (ARCHIVE_OK);
  ------------------
  |  |  233|    616|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  909|  3.27k|		line = next;
  910|  3.27k|		len = strcspn(line, " \t\r\n");
  911|       |
  912|  3.27k|		if (len == 3 && strncmp(line, "all", 3) == 0) {
  ------------------
  |  Branch (912:7): [True: 724, False: 2.55k]
  |  Branch (912:19): [True: 483, False: 241]
  ------------------
  913|    483|			free_options(*global);
  914|    483|			*global = NULL;
  915|  2.79k|		} else {
  916|  2.79k|			remove_option(global, line, len);
  917|  2.79k|		}
  918|       |
  919|  3.27k|		line += len;
  920|  3.27k|	}
  921|    616|}
archive_read_support_format_mtree.c:parse_file:
 1184|  7.68k|{
 1185|  7.68k|	const char *path;
 1186|  7.68k|	la_seek_stat_t st_storage, *st;
 1187|  7.68k|	struct mtree_entry *mp;
 1188|  7.68k|	struct archive_entry *sparse_entry;
 1189|  7.68k|	int r = ARCHIVE_OK, r1, parsed_kws;
  ------------------
  |  |  233|  7.68k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1190|       |
 1191|  7.68k|	mentry->used = 1;
 1192|       |
 1193|       |	/* Initialize reasonable defaults. */
 1194|  7.68k|	archive_entry_set_filetype(entry, AE_IFREG);
  ------------------
  |  |  216|  7.68k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1195|  7.68k|	archive_entry_set_size(entry, 0);
 1196|  7.68k|	archive_string_empty(&mtree->contents_name);
  ------------------
  |  |  181|  7.68k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 1197|       |
 1198|       |	/* Parse options from this line. */
 1199|  7.68k|	parsed_kws = 0;
 1200|  7.68k|	r = parse_line(a, entry, mtree, mentry, &parsed_kws);
 1201|       |
 1202|  7.68k|	if (mentry->full) {
  ------------------
  |  Branch (1202:6): [True: 97, False: 7.58k]
  ------------------
 1203|     97|		archive_entry_copy_pathname(entry, mentry->name);
 1204|       |		/*
 1205|       |		 * "Full" entries are allowed to have multiple lines
 1206|       |		 * and those lines aren't required to be adjacent.  We
 1207|       |		 * don't support multiple lines for "relative" entries
 1208|       |		 * nor do we make any attempt to merge data from
 1209|       |		 * separate "relative" and "full" entries.  (Merging
 1210|       |		 * "relative" and "full" entries would require dealing
 1211|       |		 * with pathname canonicalization, which is a very
 1212|       |		 * tricky subject.)
 1213|       |		 */
 1214|     97|		mp = (struct mtree_entry *)__archive_rb_tree_find_node(
 1215|     97|		    &mtree->rbtree, mentry->name);
 1216|    476|		for (; mp; mp = mp->next_dup) {
  ------------------
  |  Branch (1216:10): [True: 379, False: 97]
  ------------------
 1217|    379|			if (mp->full && !mp->used) {
  ------------------
  |  Branch (1217:8): [True: 379, False: 0]
  |  Branch (1217:20): [True: 282, False: 97]
  ------------------
 1218|       |				/* Later lines override earlier ones. */
 1219|    282|				mp->used = 1;
 1220|    282|				r1 = parse_line(a, entry, mtree, mp, &parsed_kws);
 1221|    282|				if (r1 < r)
  ------------------
  |  Branch (1221:9): [True: 2, False: 280]
  ------------------
 1222|      2|					r = r1;
 1223|    282|			}
 1224|    379|		}
 1225|  7.58k|	} else {
 1226|       |		/*
 1227|       |		 * Relative entries require us to construct
 1228|       |		 * the full path and possibly update the
 1229|       |		 * current directory.
 1230|       |		 */
 1231|  7.58k|		size_t n = archive_strlen(&mtree->current_dir);
  ------------------
  |  |  178|  7.58k|#define	archive_strlen(a) ((a)->length)
  ------------------
 1232|  7.58k|		if (n > 0)
  ------------------
  |  Branch (1232:7): [True: 270, False: 7.31k]
  ------------------
 1233|    270|			archive_strcat(&mtree->current_dir, "/");
 1234|  7.58k|		archive_strcat(&mtree->current_dir, mentry->name);
 1235|  7.58k|		archive_entry_copy_pathname(entry, mtree->current_dir.s);
 1236|  7.58k|		if (archive_entry_filetype(entry) != AE_IFDIR)
  ------------------
  |  |  221|  7.58k|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (1236:7): [True: 7.08k, False: 498]
  ------------------
 1237|  7.08k|			mtree->current_dir.length = n;
 1238|  7.58k|	}
 1239|       |
 1240|  7.68k|	if (mtree->checkfs) {
  ------------------
  |  Branch (1240:6): [True: 0, False: 7.68k]
  ------------------
 1241|       |		/*
 1242|       |		 * Try to open and stat the file to get the real size
 1243|       |		 * and other file info.  It would be nice to avoid
 1244|       |		 * this here so that getting a listing of an mtree
 1245|       |		 * wouldn't require opening every referenced contents
 1246|       |		 * file.  But then we wouldn't know the actual
 1247|       |		 * contents size, so I don't see a really viable way
 1248|       |		 * around this.  (Also, we may want to someday pull
 1249|       |		 * other unspecified info from the contents file on
 1250|       |		 * disk.)
 1251|       |		 */
 1252|      0|		mtree->fd = -1;
 1253|      0|		if (archive_strlen(&mtree->contents_name) > 0)
  ------------------
  |  |  178|      0|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (1253:7): [True: 0, False: 0]
  ------------------
 1254|      0|			path = mtree->contents_name.s;
 1255|      0|		else
 1256|      0|			path = archive_entry_pathname(entry);
 1257|       |
 1258|      0|		if (archive_entry_filetype(entry) == AE_IFREG ||
  ------------------
  |  |  216|      0|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
  |  Branch (1258:7): [True: 0, False: 0]
  ------------------
 1259|      0|				archive_entry_filetype(entry) == AE_IFDIR) {
  ------------------
  |  |  221|      0|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (1259:5): [True: 0, False: 0]
  ------------------
 1260|      0|			mtree->fd = open(path, O_RDONLY | O_BINARY | O_CLOEXEC);
  ------------------
  |  |   62|      0|#define	O_BINARY 0
  ------------------
 1261|      0|			__archive_ensure_cloexec_flag(mtree->fd);
 1262|      0|			if (mtree->fd == -1 && (
  ------------------
  |  Branch (1262:8): [True: 0, False: 0]
  ------------------
 1263|       |#if defined(_WIN32) && !defined(__CYGWIN__)
 1264|       |        /*
 1265|       |         * On Windows, attempting to open a file with an
 1266|       |         * invalid name result in EINVAL (Error 22)
 1267|       |         */
 1268|       |				(errno != ENOENT && errno != EINVAL)
 1269|       |#else
 1270|      0|				errno != ENOENT
  ------------------
  |  Branch (1270:5): [True: 0, False: 0]
  ------------------
 1271|      0|#endif
 1272|      0|        || archive_strlen(&mtree->contents_name) > 0)) {
  ------------------
  |  |  178|      0|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (1272:12): [True: 0, False: 0]
  ------------------
 1273|      0|				archive_set_error(&a->archive, errno,
 1274|      0|						"Can't open %s", path);
 1275|      0|				r = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1276|      0|			}
 1277|      0|		}
 1278|       |
 1279|      0|		st = &st_storage;
 1280|      0|		if (mtree->fd >= 0) {
  ------------------
  |  Branch (1280:7): [True: 0, False: 0]
  ------------------
 1281|      0|			if (la_seek_fstat(mtree->fd, st) == -1) {
  ------------------
  |  |   41|      0|#define la_seek_fstat(fd, st)	fstat((fd), (st))
  ------------------
  |  Branch (1281:8): [True: 0, False: 0]
  ------------------
 1282|      0|				archive_set_error(&a->archive, errno,
 1283|      0|						"Could not fstat %s", path);
 1284|      0|				r = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1285|       |				/* If we can't stat it, don't keep it open. */
 1286|      0|				close(mtree->fd);
 1287|      0|				mtree->fd = -1;
 1288|      0|				st = NULL;
 1289|      0|			}
 1290|      0|		}
 1291|      0|#ifdef HAVE_LSTAT
 1292|      0|		else if (lstat(path, st) == -1)
  ------------------
  |  Branch (1292:12): [True: 0, False: 0]
  ------------------
 1293|       |#else
 1294|       |		else if (la_seek_stat(path, st) == -1)
 1295|       |#endif
 1296|      0|		{
 1297|      0|			st = NULL;
 1298|      0|		}
 1299|       |
 1300|       |		/*
 1301|       |		 * Check for a mismatch between the type in the specification
 1302|       |		 * and the type of the contents object on disk.
 1303|       |		 */
 1304|      0|		if (st != NULL) {
  ------------------
  |  Branch (1304:7): [True: 0, False: 0]
  ------------------
 1305|      0|			if (((st->st_mode & S_IFMT) == S_IFREG &&
  ------------------
  |  Branch (1305:9): [True: 0, False: 0]
  ------------------
 1306|      0|			      archive_entry_filetype(entry) == AE_IFREG)
  ------------------
  |  |  216|      0|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
  |  Branch (1306:10): [True: 0, False: 0]
  ------------------
 1307|      0|#ifdef S_IFLNK
 1308|      0|			  ||((st->st_mode & S_IFMT) == S_IFLNK &&
  ------------------
  |  Branch (1308:9): [True: 0, False: 0]
  ------------------
 1309|      0|			      archive_entry_filetype(entry) == AE_IFLNK)
  ------------------
  |  |  217|      0|#define AE_IFLNK	((__LA_MODE_T)0120000)
  ------------------
  |  Branch (1309:10): [True: 0, False: 0]
  ------------------
 1310|      0|#endif
 1311|      0|#ifdef S_IFSOCK
 1312|      0|			  ||((st->st_mode & S_IFSOCK) == S_IFSOCK &&
  ------------------
  |  Branch (1312:9): [True: 0, False: 0]
  ------------------
 1313|      0|			      archive_entry_filetype(entry) == AE_IFSOCK)
  ------------------
  |  |  218|      0|#define AE_IFSOCK	((__LA_MODE_T)0140000)
  ------------------
  |  Branch (1313:10): [True: 0, False: 0]
  ------------------
 1314|      0|#endif
 1315|      0|#ifdef S_IFCHR
 1316|      0|			  ||((st->st_mode & S_IFMT) == S_IFCHR &&
  ------------------
  |  Branch (1316:9): [True: 0, False: 0]
  ------------------
 1317|      0|			      archive_entry_filetype(entry) == AE_IFCHR)
  ------------------
  |  |  219|      0|#define AE_IFCHR	((__LA_MODE_T)0020000)
  ------------------
  |  Branch (1317:10): [True: 0, False: 0]
  ------------------
 1318|      0|#endif
 1319|      0|#ifdef S_IFBLK
 1320|      0|			  ||((st->st_mode & S_IFMT) == S_IFBLK &&
  ------------------
  |  Branch (1320:9): [True: 0, False: 0]
  ------------------
 1321|      0|			      archive_entry_filetype(entry) == AE_IFBLK)
  ------------------
  |  |  220|      0|#define AE_IFBLK	((__LA_MODE_T)0060000)
  ------------------
  |  Branch (1321:10): [True: 0, False: 0]
  ------------------
 1322|      0|#endif
 1323|      0|			  ||((st->st_mode & S_IFMT) == S_IFDIR &&
  ------------------
  |  Branch (1323:9): [True: 0, False: 0]
  ------------------
 1324|      0|			      archive_entry_filetype(entry) == AE_IFDIR)
  ------------------
  |  |  221|      0|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (1324:10): [True: 0, False: 0]
  ------------------
 1325|      0|#ifdef S_IFIFO
 1326|      0|			  ||((st->st_mode & S_IFMT) == S_IFIFO &&
  ------------------
  |  Branch (1326:9): [True: 0, False: 0]
  ------------------
 1327|      0|			      archive_entry_filetype(entry) == AE_IFIFO)
  ------------------
  |  |  222|      0|#define AE_IFIFO	((__LA_MODE_T)0010000)
  ------------------
  |  Branch (1327:10): [True: 0, False: 0]
  ------------------
 1328|      0|#endif
 1329|      0|			) {
 1330|       |				/* Types match. */
 1331|      0|			} else {
 1332|       |				/* Types don't match; bail out gracefully. */
 1333|      0|				if (mtree->fd >= 0)
  ------------------
  |  Branch (1333:9): [True: 0, False: 0]
  ------------------
 1334|      0|					close(mtree->fd);
 1335|      0|				mtree->fd = -1;
 1336|      0|				if (parsed_kws & MTREE_HAS_OPTIONAL) {
  ------------------
  |  |   80|      0|#define	MTREE_HAS_OPTIONAL	0x0800
  ------------------
  |  Branch (1336:9): [True: 0, False: 0]
  ------------------
 1337|       |					/* It's not an error for an optional
 1338|       |					 * entry to not match disk. */
 1339|      0|					*use_next = 1;
 1340|      0|				} else if (r == ARCHIVE_OK) {
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1340:16): [True: 0, False: 0]
  ------------------
 1341|      0|					archive_set_error(&a->archive,
 1342|      0|					    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1343|      0|					    "mtree specification has different"
 1344|      0|					    " type for %s",
 1345|      0|					    archive_entry_pathname(entry));
 1346|      0|					r = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1347|      0|				}
 1348|      0|				return (r);
 1349|      0|			}
 1350|      0|		}
 1351|       |
 1352|       |		/*
 1353|       |		 * If there is a contents file on disk, pick some of the
 1354|       |		 * metadata from that file.  For most of these, we only
 1355|       |		 * set it from the contents if it wasn't already parsed
 1356|       |		 * from the specification.
 1357|       |		 */
 1358|      0|		if (st != NULL) {
  ------------------
  |  Branch (1358:7): [True: 0, False: 0]
  ------------------
 1359|      0|			if (((parsed_kws & MTREE_HAS_DEVICE) == 0 ||
  ------------------
  |  |   68|      0|#define	MTREE_HAS_DEVICE	0x0001
  ------------------
  |  Branch (1359:9): [True: 0, False: 0]
  ------------------
 1360|      0|				(parsed_kws & MTREE_HAS_NOCHANGE) != 0) &&
  ------------------
  |  |   81|      0|#define	MTREE_HAS_NOCHANGE	0x1000 /* FreeBSD specific */
  ------------------
  |  Branch (1360:5): [True: 0, False: 0]
  ------------------
 1361|      0|				(archive_entry_filetype(entry) == AE_IFCHR ||
  ------------------
  |  |  219|      0|#define AE_IFCHR	((__LA_MODE_T)0020000)
  ------------------
  |  Branch (1361:6): [True: 0, False: 0]
  ------------------
 1362|      0|				 archive_entry_filetype(entry) == AE_IFBLK))
  ------------------
  |  |  220|      0|#define AE_IFBLK	((__LA_MODE_T)0060000)
  ------------------
  |  Branch (1362:6): [True: 0, False: 0]
  ------------------
 1363|      0|				archive_entry_set_rdev(entry, st->st_rdev);
 1364|      0|			if ((parsed_kws & (MTREE_HAS_GID | MTREE_HAS_GNAME))
  ------------------
  |  |   70|      0|#define	MTREE_HAS_GID		0x0004
  ------------------
              			if ((parsed_kws & (MTREE_HAS_GID | MTREE_HAS_GNAME))
  ------------------
  |  |   71|      0|#define	MTREE_HAS_GNAME		0x0008
  ------------------
  |  Branch (1364:8): [True: 0, False: 0]
  ------------------
 1365|      0|				== 0 ||
 1366|      0|			    (parsed_kws & MTREE_HAS_NOCHANGE) != 0)
  ------------------
  |  |   81|      0|#define	MTREE_HAS_NOCHANGE	0x1000 /* FreeBSD specific */
  ------------------
  |  Branch (1366:8): [True: 0, False: 0]
  ------------------
 1367|      0|				archive_entry_set_gid(entry, st->st_gid);
 1368|      0|			if ((parsed_kws & (MTREE_HAS_UID | MTREE_HAS_UNAME))
  ------------------
  |  |   77|      0|#define	MTREE_HAS_UID		0x0200
  ------------------
              			if ((parsed_kws & (MTREE_HAS_UID | MTREE_HAS_UNAME))
  ------------------
  |  |   78|      0|#define	MTREE_HAS_UNAME		0x0400
  ------------------
  |  Branch (1368:8): [True: 0, False: 0]
  ------------------
 1369|      0|				== 0 ||
 1370|      0|			    (parsed_kws & MTREE_HAS_NOCHANGE) != 0)
  ------------------
  |  |   81|      0|#define	MTREE_HAS_NOCHANGE	0x1000 /* FreeBSD specific */
  ------------------
  |  Branch (1370:8): [True: 0, False: 0]
  ------------------
 1371|      0|				archive_entry_set_uid(entry, st->st_uid);
 1372|      0|			if ((parsed_kws & MTREE_HAS_MTIME) == 0 ||
  ------------------
  |  |   72|      0|#define	MTREE_HAS_MTIME		0x0010
  ------------------
  |  Branch (1372:8): [True: 0, False: 0]
  ------------------
 1373|      0|			    (parsed_kws & MTREE_HAS_NOCHANGE) != 0) {
  ------------------
  |  |   81|      0|#define	MTREE_HAS_NOCHANGE	0x1000 /* FreeBSD specific */
  ------------------
  |  Branch (1373:8): [True: 0, False: 0]
  ------------------
 1374|       |#if HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC
 1375|       |				archive_entry_set_mtime(entry, st->st_mtime,
 1376|       |						st->st_mtimespec.tv_nsec);
 1377|       |#elif HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC
 1378|      0|				archive_entry_set_mtime(entry, st->st_mtime,
 1379|      0|						st->st_mtim.tv_nsec);
 1380|       |#elif HAVE_STRUCT_STAT_ST_MTIME_N
 1381|       |				archive_entry_set_mtime(entry, st->st_mtime,
 1382|       |						st->st_mtime_n);
 1383|       |#elif HAVE_STRUCT_STAT_ST_UMTIME
 1384|       |				archive_entry_set_mtime(entry, st->st_mtime,
 1385|       |						st->st_umtime*1000);
 1386|       |#elif HAVE_STRUCT_STAT_ST_MTIME_USEC
 1387|       |				archive_entry_set_mtime(entry, st->st_mtime,
 1388|       |						st->st_mtime_usec*1000);
 1389|       |#else
 1390|       |				archive_entry_set_mtime(entry, st->st_mtime, 0);
 1391|       |#endif
 1392|      0|			}
 1393|      0|			if ((parsed_kws & MTREE_HAS_NLINK) == 0 ||
  ------------------
  |  |   73|      0|#define	MTREE_HAS_NLINK		0x0020
  ------------------
  |  Branch (1393:8): [True: 0, False: 0]
  ------------------
 1394|      0|			    (parsed_kws & MTREE_HAS_NOCHANGE) != 0)
  ------------------
  |  |   81|      0|#define	MTREE_HAS_NOCHANGE	0x1000 /* FreeBSD specific */
  ------------------
  |  Branch (1394:8): [True: 0, False: 0]
  ------------------
 1395|      0|				archive_entry_set_nlink(entry, st->st_nlink);
 1396|      0|			if ((parsed_kws & MTREE_HAS_PERM) == 0 ||
  ------------------
  |  |   74|      0|#define	MTREE_HAS_PERM		0x0040
  ------------------
  |  Branch (1396:8): [True: 0, False: 0]
  ------------------
 1397|      0|			    (parsed_kws & MTREE_HAS_NOCHANGE) != 0)
  ------------------
  |  |   81|      0|#define	MTREE_HAS_NOCHANGE	0x1000 /* FreeBSD specific */
  ------------------
  |  Branch (1397:8): [True: 0, False: 0]
  ------------------
 1398|      0|				archive_entry_set_perm(entry, st->st_mode);
 1399|      0|			if ((parsed_kws & MTREE_HAS_SIZE) == 0 ||
  ------------------
  |  |   75|      0|#define	MTREE_HAS_SIZE		0x0080
  ------------------
  |  Branch (1399:8): [True: 0, False: 0]
  ------------------
 1400|      0|			    (parsed_kws & MTREE_HAS_NOCHANGE) != 0)
  ------------------
  |  |   81|      0|#define	MTREE_HAS_NOCHANGE	0x1000 /* FreeBSD specific */
  ------------------
  |  Branch (1400:8): [True: 0, False: 0]
  ------------------
 1401|      0|				archive_entry_set_size(entry, st->st_size);
 1402|      0|			archive_entry_set_ino(entry, st->st_ino);
 1403|      0|			archive_entry_set_dev(entry, st->st_dev);
 1404|       |
 1405|      0|			archive_entry_linkify(mtree->resolver, &entry,
 1406|      0|				&sparse_entry);
 1407|      0|		} else if (parsed_kws & MTREE_HAS_OPTIONAL) {
  ------------------
  |  |   80|      0|#define	MTREE_HAS_OPTIONAL	0x0800
  ------------------
  |  Branch (1407:14): [True: 0, False: 0]
  ------------------
 1408|       |			/*
 1409|       |			 * Couldn't open the entry, stat it or the on-disk type
 1410|       |			 * didn't match.  If this entry is optional, just
 1411|       |			 * ignore it and read the next header entry.
 1412|       |			 */
 1413|      0|			*use_next = 1;
 1414|      0|			return ARCHIVE_OK;
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1415|      0|		}
 1416|      0|	}
 1417|       |
 1418|  7.68k|	mtree->cur_size = archive_entry_size(entry);
 1419|  7.68k|	mtree->offset = 0;
 1420|       |
 1421|  7.68k|	return r;
 1422|  7.68k|}
archive_read_support_format_mtree.c:parse_line:
 1430|  7.96k|{
 1431|  7.96k|	struct mtree_option *iter;
 1432|  7.96k|	int r = ARCHIVE_OK, r1;
  ------------------
  |  |  233|  7.96k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1433|       |
 1434|  19.5k|	for (iter = mp->options; iter != NULL; iter = iter->next) {
  ------------------
  |  Branch (1434:27): [True: 11.5k, False: 7.96k]
  ------------------
 1435|  11.5k|		r1 = parse_keyword(a, mtree, entry, iter, parsed_kws);
 1436|  11.5k|		if (r1 < r)
  ------------------
  |  Branch (1436:7): [True: 2.90k, False: 8.65k]
  ------------------
 1437|  2.90k|			r = r1;
 1438|  11.5k|	}
 1439|  7.96k|	if (r == ARCHIVE_OK && (*parsed_kws & MTREE_HAS_TYPE) == 0) {
  ------------------
  |  |  233|  15.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
              	if (r == ARCHIVE_OK && (*parsed_kws & MTREE_HAS_TYPE) == 0) {
  ------------------
  |  |   76|  5.05k|#define	MTREE_HAS_TYPE		0x0100
  ------------------
  |  Branch (1439:6): [True: 5.05k, False: 2.90k]
  |  Branch (1439:25): [True: 4.54k, False: 508]
  ------------------
 1440|  4.54k|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  4.54k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1441|  4.54k|		    "Missing type keyword in mtree specification");
 1442|  4.54k|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|  4.54k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1443|  4.54k|	}
 1444|  3.41k|	return (r);
 1445|  7.96k|}
archive_read_support_format_mtree.c:parse_keyword:
 1611|  11.5k|{
 1612|  11.5k|	char *val, *key;
 1613|       |
 1614|  11.5k|	key = opt->value;
 1615|       |
 1616|  11.5k|	if (*key == '\0')
  ------------------
  |  Branch (1616:6): [True: 0, False: 11.5k]
  ------------------
 1617|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1618|       |
 1619|  11.5k|	if (strcmp(key, "nochange") == 0) {
  ------------------
  |  Branch (1619:6): [True: 0, False: 11.5k]
  ------------------
 1620|      0|		*parsed_kws |= MTREE_HAS_NOCHANGE;
  ------------------
  |  |   81|      0|#define	MTREE_HAS_NOCHANGE	0x1000 /* FreeBSD specific */
  ------------------
 1621|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1622|      0|	}
 1623|  11.5k|	if (strcmp(key, "optional") == 0) {
  ------------------
  |  Branch (1623:6): [True: 22, False: 11.5k]
  ------------------
 1624|     22|		*parsed_kws |= MTREE_HAS_OPTIONAL;
  ------------------
  |  |   80|     22|#define	MTREE_HAS_OPTIONAL	0x0800
  ------------------
 1625|     22|		return (ARCHIVE_OK);
  ------------------
  |  |  233|     22|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1626|     22|	}
 1627|  11.5k|	if (strcmp(key, "ignore") == 0) {
  ------------------
  |  Branch (1627:6): [True: 0, False: 11.5k]
  ------------------
 1628|       |		/*
 1629|       |		 * The mtree processing is not recursive, so
 1630|       |		 * recursion will only happen for explicitly listed
 1631|       |		 * entries.
 1632|       |		 */
 1633|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1634|      0|	}
 1635|       |
 1636|  11.5k|	val = strchr(key, '=');
 1637|  11.5k|	if (val == NULL) {
  ------------------
  |  Branch (1637:6): [True: 6.48k, False: 5.04k]
  ------------------
 1638|  6.48k|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  6.48k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1639|  6.48k|		    "Malformed attribute \"%s\" (%d)", key, key[0]);
 1640|  6.48k|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|  6.48k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1641|  6.48k|	}
 1642|       |
 1643|  5.04k|	*val = '\0';
 1644|  5.04k|	++val;
 1645|       |
 1646|  5.04k|	switch (key[0]) {
 1647|      0|	case 'c':
  ------------------
  |  Branch (1647:2): [True: 0, False: 5.04k]
  ------------------
 1648|      0|		if (strcmp(key, "content") == 0
  ------------------
  |  Branch (1648:7): [True: 0, False: 0]
  ------------------
 1649|      0|		    || strcmp(key, "contents") == 0) {
  ------------------
  |  Branch (1649:10): [True: 0, False: 0]
  ------------------
 1650|      0|			parse_escapes(val, NULL);
 1651|      0|			archive_strcpy(&mtree->contents_name, val);
  ------------------
  |  |  165|      0|	archive_strncpy((as), (p), ((p) == NULL ? 0 : strlen(p)))
  |  |  ------------------
  |  |  |  |  173|      0|	((as)->length=0, archive_strncat((as), (p), (l)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (173:47): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1652|      0|			return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1653|      0|		}
 1654|      0|		if (strcmp(key, "cksum") == 0)
  ------------------
  |  Branch (1654:7): [True: 0, False: 0]
  ------------------
 1655|      0|			return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1656|      0|		break;
 1657|  1.56k|	case 'd':
  ------------------
  |  Branch (1657:2): [True: 1.56k, False: 3.48k]
  ------------------
 1658|  1.56k|		if (strcmp(key, "device") == 0) {
  ------------------
  |  Branch (1658:7): [True: 856, False: 705]
  ------------------
 1659|       |			/* stat(2) st_rdev field, e.g. the major/minor IDs
 1660|       |			 * of a char/block special file */
 1661|    856|			int r;
 1662|    856|			dev_t dev;
 1663|       |
 1664|    856|			*parsed_kws |= MTREE_HAS_DEVICE;
  ------------------
  |  |   68|    856|#define	MTREE_HAS_DEVICE	0x0001
  ------------------
 1665|    856|			r = parse_device(&dev, &a->archive, val);
 1666|    856|			if (r == ARCHIVE_OK)
  ------------------
  |  |  233|    856|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1666:8): [True: 9, False: 847]
  ------------------
 1667|      9|				archive_entry_set_rdev(entry, dev);
 1668|    856|			return r;
 1669|    856|		}
 1670|    705|		break;
 1671|    705|	case 'f':
  ------------------
  |  Branch (1671:2): [True: 0, False: 5.04k]
  ------------------
 1672|      0|		if (strcmp(key, "flags") == 0) {
  ------------------
  |  Branch (1672:7): [True: 0, False: 0]
  ------------------
 1673|      0|			*parsed_kws |= MTREE_HAS_FFLAGS;
  ------------------
  |  |   69|      0|#define	MTREE_HAS_FFLAGS	0x0002
  ------------------
 1674|      0|			archive_entry_copy_fflags_text(entry, val);
 1675|      0|			return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1676|      0|		}
 1677|      0|		break;
 1678|      0|	case 'g':
  ------------------
  |  Branch (1678:2): [True: 0, False: 5.04k]
  ------------------
 1679|      0|		if (strcmp(key, "gid") == 0) {
  ------------------
  |  Branch (1679:7): [True: 0, False: 0]
  ------------------
 1680|      0|			*parsed_kws |= MTREE_HAS_GID;
  ------------------
  |  |   70|      0|#define	MTREE_HAS_GID		0x0004
  ------------------
 1681|      0|			archive_entry_set_gid(entry, mtree_atol(&val, 10));
 1682|      0|			return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1683|      0|		}
 1684|      0|		if (strcmp(key, "gname") == 0) {
  ------------------
  |  Branch (1684:7): [True: 0, False: 0]
  ------------------
 1685|      0|			*parsed_kws |= MTREE_HAS_GNAME;
  ------------------
  |  |   71|      0|#define	MTREE_HAS_GNAME		0x0008
  ------------------
 1686|      0|			archive_entry_copy_gname(entry, val);
 1687|      0|			return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1688|      0|		}
 1689|      0|		break;
 1690|    518|	case 'i':
  ------------------
  |  Branch (1690:2): [True: 518, False: 4.53k]
  ------------------
 1691|    518|		if (strcmp(key, "inode") == 0) {
  ------------------
  |  Branch (1691:7): [True: 0, False: 518]
  ------------------
 1692|      0|			archive_entry_set_ino(entry, mtree_atol(&val, 10));
 1693|      0|			return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1694|      0|		}
 1695|    518|		break;
 1696|    518|	case 'l':
  ------------------
  |  Branch (1696:2): [True: 0, False: 5.04k]
  ------------------
 1697|      0|		if (strcmp(key, "link") == 0) {
  ------------------
  |  Branch (1697:7): [True: 0, False: 0]
  ------------------
 1698|      0|			parse_escapes(val, NULL);
 1699|      0|			archive_entry_copy_symlink(entry, val);
 1700|      0|			return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1701|      0|		}
 1702|      0|		break;
 1703|      8|	case 'm':
  ------------------
  |  Branch (1703:2): [True: 8, False: 5.04k]
  ------------------
 1704|      8|		if (strcmp(key, "md5") == 0 || strcmp(key, "md5digest") == 0) {
  ------------------
  |  Branch (1704:7): [True: 0, False: 8]
  |  Branch (1704:34): [True: 0, False: 8]
  ------------------
 1705|      0|			return parse_digest(a, entry, val,
 1706|      0|			    ARCHIVE_ENTRY_DIGEST_MD5);
  ------------------
  |  |  444|      0|#define ARCHIVE_ENTRY_DIGEST_MD5              0x00000001
  ------------------
 1707|      0|		}
 1708|      8|		if (strcmp(key, "mode") == 0) {
  ------------------
  |  Branch (1708:7): [True: 4, False: 4]
  ------------------
 1709|      4|			if (val[0] < '0' || val[0] > '7') {
  ------------------
  |  Branch (1709:8): [True: 0, False: 4]
  |  Branch (1709:24): [True: 4, False: 0]
  ------------------
 1710|      4|				archive_set_error(&a->archive,
 1711|      4|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      4|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1712|      4|				    "Symbolic or non-octal mode \"%s\" unsupported", val);
 1713|      4|				return (ARCHIVE_WARN);
  ------------------
  |  |  235|      4|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1714|      4|			}
 1715|      0|			*parsed_kws |= MTREE_HAS_PERM;
  ------------------
  |  |   74|      0|#define	MTREE_HAS_PERM		0x0040
  ------------------
 1716|      0|			archive_entry_set_perm(entry, (mode_t)mtree_atol(&val, 8));
 1717|      0|			return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1718|      4|		}
 1719|      4|		break;
 1720|    413|	case 'n':
  ------------------
  |  Branch (1720:2): [True: 413, False: 4.63k]
  ------------------
 1721|    413|		if (strcmp(key, "nlink") == 0) {
  ------------------
  |  Branch (1721:7): [True: 0, False: 413]
  ------------------
 1722|      0|			*parsed_kws |= MTREE_HAS_NLINK;
  ------------------
  |  |   73|      0|#define	MTREE_HAS_NLINK		0x0020
  ------------------
 1723|      0|			archive_entry_set_nlink(entry,
 1724|      0|				(unsigned int)mtree_atol(&val, 10));
 1725|      0|			return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1726|      0|		}
 1727|    413|		break;
 1728|    413|	case 'r':
  ------------------
  |  Branch (1728:2): [True: 42, False: 5.00k]
  ------------------
 1729|     42|		if (strcmp(key, "resdevice") == 0) {
  ------------------
  |  Branch (1729:7): [True: 0, False: 42]
  ------------------
 1730|       |			/* stat(2) st_dev field, e.g. the device ID where the
 1731|       |			 * inode resides */
 1732|      0|			int r;
 1733|      0|			dev_t dev;
 1734|       |
 1735|      0|			r = parse_device(&dev, &a->archive, val);
 1736|      0|			if (r == ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1736:8): [True: 0, False: 0]
  ------------------
 1737|      0|				archive_entry_set_dev(entry, dev);
 1738|      0|			return r;
 1739|      0|		}
 1740|     42|		if (strcmp(key, "rmd160") == 0 ||
  ------------------
  |  Branch (1740:7): [True: 0, False: 42]
  ------------------
 1741|     42|		    strcmp(key, "rmd160digest") == 0) {
  ------------------
  |  Branch (1741:7): [True: 0, False: 42]
  ------------------
 1742|      0|			return parse_digest(a, entry, val,
 1743|      0|			    ARCHIVE_ENTRY_DIGEST_RMD160);
  ------------------
  |  |  445|      0|#define ARCHIVE_ENTRY_DIGEST_RMD160           0x00000002
  ------------------
 1744|      0|		}
 1745|     42|		break;
 1746|    528|	case 's':
  ------------------
  |  Branch (1746:2): [True: 528, False: 4.52k]
  ------------------
 1747|    528|		if (strcmp(key, "sha1") == 0 ||
  ------------------
  |  Branch (1747:7): [True: 0, False: 528]
  ------------------
 1748|    528|		    strcmp(key, "sha1digest") == 0) {
  ------------------
  |  Branch (1748:7): [True: 0, False: 528]
  ------------------
 1749|      0|			return parse_digest(a, entry, val,
 1750|      0|			    ARCHIVE_ENTRY_DIGEST_SHA1);
  ------------------
  |  |  446|      0|#define ARCHIVE_ENTRY_DIGEST_SHA1             0x00000003
  ------------------
 1751|      0|		}
 1752|    528|		if (strcmp(key, "sha256") == 0 ||
  ------------------
  |  Branch (1752:7): [True: 0, False: 528]
  ------------------
 1753|    528|		    strcmp(key, "sha256digest") == 0) {
  ------------------
  |  Branch (1753:7): [True: 0, False: 528]
  ------------------
 1754|      0|			return parse_digest(a, entry, val,
 1755|      0|			    ARCHIVE_ENTRY_DIGEST_SHA256);
  ------------------
  |  |  447|      0|#define ARCHIVE_ENTRY_DIGEST_SHA256           0x00000004
  ------------------
 1756|      0|		}
 1757|    528|		if (strcmp(key, "sha384") == 0 ||
  ------------------
  |  Branch (1757:7): [True: 2, False: 526]
  ------------------
 1758|    526|		    strcmp(key, "sha384digest") == 0) {
  ------------------
  |  Branch (1758:7): [True: 0, False: 526]
  ------------------
 1759|      2|			return parse_digest(a, entry, val,
 1760|      2|			    ARCHIVE_ENTRY_DIGEST_SHA384);
  ------------------
  |  |  448|      2|#define ARCHIVE_ENTRY_DIGEST_SHA384           0x00000005
  ------------------
 1761|      2|		}
 1762|    526|		if (strcmp(key, "sha512") == 0 ||
  ------------------
  |  Branch (1762:7): [True: 0, False: 526]
  ------------------
 1763|    526|		    strcmp(key, "sha512digest") == 0) {
  ------------------
  |  Branch (1763:7): [True: 521, False: 5]
  ------------------
 1764|    521|			return parse_digest(a, entry, val,
 1765|    521|			    ARCHIVE_ENTRY_DIGEST_SHA512);
  ------------------
  |  |  449|    521|#define ARCHIVE_ENTRY_DIGEST_SHA512           0x00000006
  ------------------
 1766|    521|		}
 1767|      5|		if (strcmp(key, "size") == 0) {
  ------------------
  |  Branch (1767:7): [True: 0, False: 5]
  ------------------
 1768|      0|			archive_entry_set_size(entry, mtree_atol(&val, 10));
 1769|      0|			return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1770|      0|		}
 1771|      5|		break;
 1772|  1.92k|	case 't':
  ------------------
  |  Branch (1772:2): [True: 1.92k, False: 3.12k]
  ------------------
 1773|  1.92k|		if (strcmp(key, "tags") == 0) {
  ------------------
  |  Branch (1773:7): [True: 0, False: 1.92k]
  ------------------
 1774|       |			/*
 1775|       |			 * Comma delimited list of tags.
 1776|       |			 * Ignore the tags for now, but the interface
 1777|       |			 * should be extended to allow inclusion/exclusion.
 1778|       |			 */
 1779|      0|			return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1780|      0|		}
 1781|  1.92k|		if (strcmp(key, "time") == 0) {
  ------------------
  |  Branch (1781:7): [True: 1.35k, False: 569]
  ------------------
 1782|  1.35k|			int64_t m;
 1783|  1.35k|			int64_t my_time_t_max = get_time_t_max();
 1784|  1.35k|			int64_t my_time_t_min = get_time_t_min();
 1785|  1.35k|			long ns = 0;
 1786|       |
 1787|  1.35k|			*parsed_kws |= MTREE_HAS_MTIME;
  ------------------
  |  |   72|  1.35k|#define	MTREE_HAS_MTIME		0x0010
  ------------------
 1788|  1.35k|			m = mtree_atol(&val, 10);
 1789|       |			/* Replicate an old mtree bug:
 1790|       |			 * 123456789.1 represents 123456789
 1791|       |			 * seconds and 1 nanosecond. */
 1792|  1.35k|			if (*val == '.') {
  ------------------
  |  Branch (1792:8): [True: 1.35k, False: 1]
  ------------------
 1793|  1.35k|				int64_t v;
 1794|       |
 1795|  1.35k|				++val;
 1796|  1.35k|				v = mtree_atol(&val, 10);
 1797|  1.35k|				if (v < 0)
  ------------------
  |  Branch (1797:9): [True: 1.35k, False: 1]
  ------------------
 1798|  1.35k|					ns = 0;
 1799|      1|				else if (v > 999999999)
  ------------------
  |  Branch (1799:14): [True: 0, False: 1]
  ------------------
 1800|      0|					ns = 999999999;
 1801|      1|				else
 1802|      1|					ns = (long)v;
 1803|  1.35k|			}
 1804|  1.35k|			if (m > my_time_t_max)
  ------------------
  |  Branch (1804:8): [True: 0, False: 1.35k]
  ------------------
 1805|      0|				m = my_time_t_max;
 1806|  1.35k|			else if (m < my_time_t_min)
  ------------------
  |  Branch (1806:13): [True: 0, False: 1.35k]
  ------------------
 1807|      0|				m = my_time_t_min;
 1808|  1.35k|			archive_entry_set_mtime(entry, (time_t)m, ns);
 1809|  1.35k|			return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.35k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1810|  1.35k|		}
 1811|    569|		if (strcmp(key, "type") == 0) {
  ------------------
  |  Branch (1811:7): [True: 565, False: 4]
  ------------------
 1812|    565|			switch (val[0]) {
 1813|      0|			case 'b':
  ------------------
  |  Branch (1813:4): [True: 0, False: 565]
  ------------------
 1814|      0|				if (strcmp(val, "block") == 0) {
  ------------------
  |  Branch (1814:9): [True: 0, False: 0]
  ------------------
 1815|      0|					*parsed_kws |= MTREE_HAS_TYPE;
  ------------------
  |  |   76|      0|#define	MTREE_HAS_TYPE		0x0100
  ------------------
 1816|      0|					archive_entry_set_filetype(entry,
 1817|      0|						AE_IFBLK);
  ------------------
  |  |  220|      0|#define AE_IFBLK	((__LA_MODE_T)0060000)
  ------------------
 1818|      0|					return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1819|      0|				}
 1820|      0|				break;
 1821|     30|			case 'c':
  ------------------
  |  Branch (1821:4): [True: 30, False: 535]
  ------------------
 1822|     30|				if (strcmp(val, "char") == 0) {
  ------------------
  |  Branch (1822:9): [True: 29, False: 1]
  ------------------
 1823|     29|					*parsed_kws |= MTREE_HAS_TYPE;
  ------------------
  |  |   76|     29|#define	MTREE_HAS_TYPE		0x0100
  ------------------
 1824|     29|					archive_entry_set_filetype(entry,
 1825|     29|						AE_IFCHR);
  ------------------
  |  |  219|     29|#define AE_IFCHR	((__LA_MODE_T)0020000)
  ------------------
 1826|     29|					return (ARCHIVE_OK);
  ------------------
  |  |  233|     29|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1827|     29|				}
 1828|      1|				break;
 1829|    500|			case 'd':
  ------------------
  |  Branch (1829:4): [True: 500, False: 65]
  ------------------
 1830|    500|				if (strcmp(val, "dir") == 0) {
  ------------------
  |  Branch (1830:9): [True: 498, False: 2]
  ------------------
 1831|    498|					*parsed_kws |= MTREE_HAS_TYPE;
  ------------------
  |  |   76|    498|#define	MTREE_HAS_TYPE		0x0100
  ------------------
 1832|    498|					archive_entry_set_filetype(entry,
 1833|    498|						AE_IFDIR);
  ------------------
  |  |  221|    498|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 1834|    498|					return (ARCHIVE_OK);
  ------------------
  |  |  233|    498|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1835|    498|				}
 1836|      2|				break;
 1837|     33|			case 'f':
  ------------------
  |  Branch (1837:4): [True: 33, False: 532]
  ------------------
 1838|     33|				if (strcmp(val, "fifo") == 0) {
  ------------------
  |  Branch (1838:9): [True: 33, False: 0]
  ------------------
 1839|     33|					*parsed_kws |= MTREE_HAS_TYPE;
  ------------------
  |  |   76|     33|#define	MTREE_HAS_TYPE		0x0100
  ------------------
 1840|     33|					archive_entry_set_filetype(entry,
 1841|     33|						AE_IFIFO);
  ------------------
  |  |  222|     33|#define AE_IFIFO	((__LA_MODE_T)0010000)
  ------------------
 1842|     33|					return (ARCHIVE_OK);
  ------------------
  |  |  233|     33|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1843|     33|				}
 1844|      0|				if (strcmp(val, "file") == 0) {
  ------------------
  |  Branch (1844:9): [True: 0, False: 0]
  ------------------
 1845|      0|					*parsed_kws |= MTREE_HAS_TYPE;
  ------------------
  |  |   76|      0|#define	MTREE_HAS_TYPE		0x0100
  ------------------
 1846|      0|					archive_entry_set_filetype(entry,
 1847|      0|						AE_IFREG);
  ------------------
  |  |  216|      0|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1848|      0|					return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1849|      0|				}
 1850|      0|				break;
 1851|      0|			case 'l':
  ------------------
  |  Branch (1851:4): [True: 0, False: 565]
  ------------------
 1852|      0|				if (strcmp(val, "link") == 0) {
  ------------------
  |  Branch (1852:9): [True: 0, False: 0]
  ------------------
 1853|      0|					*parsed_kws |= MTREE_HAS_TYPE;
  ------------------
  |  |   76|      0|#define	MTREE_HAS_TYPE		0x0100
  ------------------
 1854|      0|					archive_entry_set_filetype(entry,
 1855|      0|						AE_IFLNK);
  ------------------
  |  |  217|      0|#define AE_IFLNK	((__LA_MODE_T)0120000)
  ------------------
 1856|      0|					return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1857|      0|				}
 1858|      0|				break;
 1859|      2|			default:
  ------------------
  |  Branch (1859:4): [True: 2, False: 563]
  ------------------
 1860|      2|				break;
 1861|    565|			}
 1862|      5|			archive_set_error(&a->archive,
 1863|      5|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      5|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1864|      5|			    "Unrecognized file type \"%s\"; "
 1865|      5|			    "assuming \"file\"", val);
 1866|      5|			archive_entry_set_filetype(entry, AE_IFREG);
  ------------------
  |  |  216|      5|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1867|      5|			return (ARCHIVE_WARN);
  ------------------
  |  |  235|      5|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1868|    565|		}
 1869|      4|		break;
 1870|      4|	case 'u':
  ------------------
  |  Branch (1870:2): [True: 0, False: 5.04k]
  ------------------
 1871|      0|		if (strcmp(key, "uid") == 0) {
  ------------------
  |  Branch (1871:7): [True: 0, False: 0]
  ------------------
 1872|      0|			*parsed_kws |= MTREE_HAS_UID;
  ------------------
  |  |   77|      0|#define	MTREE_HAS_UID		0x0200
  ------------------
 1873|      0|			archive_entry_set_uid(entry, mtree_atol(&val, 10));
 1874|      0|			return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1875|      0|		}
 1876|      0|		if (strcmp(key, "uname") == 0) {
  ------------------
  |  Branch (1876:7): [True: 0, False: 0]
  ------------------
 1877|      0|			*parsed_kws |= MTREE_HAS_UNAME;
  ------------------
  |  |   78|      0|#define	MTREE_HAS_UNAME		0x0400
  ------------------
 1878|      0|			archive_entry_copy_uname(entry, val);
 1879|      0|			return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1880|      0|		}
 1881|      0|		break;
 1882|     57|	default:
  ------------------
  |  Branch (1882:2): [True: 57, False: 4.99k]
  ------------------
 1883|     57|		break;
 1884|  5.04k|	}
 1885|  1.74k|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  1.74k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1886|  1.74k|	    "Unrecognized key %s=%s", key, val);
 1887|  1.74k|	return (ARCHIVE_WARN);
  ------------------
  |  |  235|  1.74k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1888|  5.04k|}
archive_read_support_format_mtree.c:parse_device:
 1472|    856|{
 1473|    856|#define MAX_PACK_ARGS 3
 1474|    856|	unsigned long numbers[MAX_PACK_ARGS];
 1475|    856|	char *p, *dev;
 1476|    856|	int argc;
 1477|    856|	pack_t *pack;
 1478|    856|	dev_t result;
 1479|    856|	const char *error = NULL;
 1480|       |
 1481|    856|	memset(pdev, 0, sizeof(*pdev));
 1482|    856|	if ((dev = strchr(val, ',')) != NULL) {
  ------------------
  |  Branch (1482:6): [True: 854, False: 2]
  ------------------
 1483|       |		/*
 1484|       |		 * Device's major/minor are given in a specified format.
 1485|       |		 * Decode and pack it accordingly.
 1486|       |		 */
 1487|    854|		*dev++ = '\0';
 1488|    854|		if ((pack = pack_find(val)) == NULL) {
  ------------------
  |  Branch (1488:7): [True: 12, False: 842]
  ------------------
 1489|     12|			archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     12|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1490|     12|			    "Unknown format `%s'", val);
 1491|     12|			return ARCHIVE_WARN;
  ------------------
  |  |  235|     12|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1492|     12|		}
 1493|    842|		argc = 0;
 1494|  1.84k|		while ((p = la_strsep(&dev, ",")) != NULL) {
  ------------------
  |  Branch (1494:10): [True: 1.00k, False: 842]
  ------------------
 1495|  1.00k|			if (*p == '\0') {
  ------------------
  |  Branch (1495:8): [True: 0, False: 1.00k]
  ------------------
 1496|      0|				archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1497|      0|				    "Missing number");
 1498|      0|				return ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1499|      0|			}
 1500|  1.00k|			if (argc >= MAX_PACK_ARGS) {
  ------------------
  |  | 1473|  1.00k|#define MAX_PACK_ARGS 3
  ------------------
  |  Branch (1500:8): [True: 0, False: 1.00k]
  ------------------
 1501|      0|				archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1502|      0|				    "Too many arguments");
 1503|      0|				return ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1504|      0|			}
 1505|  1.00k|			numbers[argc++] = (unsigned long)mtree_atol(&p, 0);
 1506|  1.00k|		}
 1507|    842|		if (argc < 2) {
  ------------------
  |  Branch (1507:7): [True: 756, False: 86]
  ------------------
 1508|    756|			archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    756|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1509|    756|			    "Not enough arguments");
 1510|    756|			return ARCHIVE_WARN;
  ------------------
  |  |  235|    756|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1511|    756|		}
 1512|     86|		result = (*pack)(argc, numbers, &error);
 1513|     86|		if (error != NULL) {
  ------------------
  |  Branch (1513:7): [True: 79, False: 7]
  ------------------
 1514|     79|			archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     79|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1515|     79|			    "%s", error);
 1516|     79|			return ARCHIVE_WARN;
  ------------------
  |  |  235|     79|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1517|     79|		}
 1518|     86|	} else {
 1519|       |		/* file system raw value. */
 1520|      2|		result = (dev_t)mtree_atol(&val, 0);
 1521|      2|	}
 1522|      9|	*pdev = result;
 1523|      9|	return ARCHIVE_OK;
  ------------------
  |  |  233|      9|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1524|    856|#undef MAX_PACK_ARGS
 1525|    856|}
archive_read_support_format_mtree.c:la_strsep:
 1458|  1.84k|{
 1459|  1.84k|	char *p, *s;
 1460|  1.84k|	if (sp == NULL || *sp == NULL || **sp == '\0')
  ------------------
  |  Branch (1460:6): [True: 0, False: 1.84k]
  |  Branch (1460:20): [True: 0, False: 1.84k]
  |  Branch (1460:35): [True: 842, False: 1.00k]
  ------------------
 1461|    842|		return(NULL);
 1462|  1.00k|	s = *sp;
 1463|  1.00k|	p = s + strcspn(s, sep);
 1464|  1.00k|	if (*p != '\0')
  ------------------
  |  Branch (1464:6): [True: 165, False: 842]
  ------------------
 1465|    165|		*p++ = '\0';
 1466|  1.00k|	*sp = p;
 1467|  1.00k|	return(s);
 1468|  1.84k|}
archive_read_support_format_mtree.c:mtree_atol:
 2050|  3.71k|{
 2051|  3.71k|	int64_t l, limit;
 2052|  3.71k|	int digit, last_digit_limit;
 2053|       |
 2054|  3.71k|	if (base == 0) {
  ------------------
  |  Branch (2054:6): [True: 1.00k, False: 2.70k]
  ------------------
 2055|  1.00k|		if (**p != '0')
  ------------------
  |  Branch (2055:7): [True: 1.00k, False: 0]
  ------------------
 2056|  1.00k|			base = 10;
 2057|      0|		else if ((*p)[1] == 'x' || (*p)[1] == 'X') {
  ------------------
  |  Branch (2057:12): [True: 0, False: 0]
  |  Branch (2057:30): [True: 0, False: 0]
  ------------------
 2058|      0|			*p += 2;
 2059|      0|			base = 16;
 2060|      0|		} else {
 2061|      0|			base = 8;
 2062|      0|		}
 2063|  1.00k|	}
 2064|       |
 2065|  3.71k|	if (**p == '-') {
  ------------------
  |  Branch (2065:6): [True: 2.60k, False: 1.10k]
  ------------------
 2066|  2.60k|		limit = INT64_MIN / base;
 2067|  2.60k|		last_digit_limit = -(INT64_MIN % base);
 2068|  2.60k|		++(*p);
 2069|       |
 2070|  2.60k|		l = 0;
 2071|  2.60k|		digit = parsedigit(**p);
 2072|  26.8k|		while (digit >= 0 && digit < base) {
  ------------------
  |  Branch (2072:10): [True: 25.5k, False: 1.25k]
  |  Branch (2072:24): [True: 25.4k, False: 91]
  ------------------
 2073|  25.4k|			if (l < limit || (l == limit && digit >= last_digit_limit))
  ------------------
  |  Branch (2073:8): [True: 0, False: 25.4k]
  |  Branch (2073:22): [True: 1.25k, False: 24.1k]
  |  Branch (2073:36): [True: 1.25k, False: 0]
  ------------------
 2074|  1.25k|				return INT64_MIN;
 2075|  24.1k|			l = (l * base) - digit;
 2076|  24.1k|			digit = parsedigit(*++(*p));
 2077|  24.1k|		}
 2078|  1.35k|		return l;
 2079|  2.60k|	} else {
 2080|  1.10k|		limit = INT64_MAX / base;
 2081|  1.10k|		last_digit_limit = INT64_MAX % base;
 2082|       |
 2083|  1.10k|		l = 0;
 2084|  1.10k|		digit = parsedigit(**p);
 2085|  1.94k|		while (digit >= 0 && digit < base) {
  ------------------
  |  Branch (2085:10): [True: 1.85k, False: 95]
  |  Branch (2085:24): [True: 843, False: 1.00k]
  ------------------
 2086|    843|			if (l > limit || (l == limit && digit > last_digit_limit))
  ------------------
  |  Branch (2086:8): [True: 0, False: 843]
  |  Branch (2086:22): [True: 0, False: 843]
  |  Branch (2086:36): [True: 0, False: 0]
  ------------------
 2087|      0|				return INT64_MAX;
 2088|    843|			l = (l * base) + digit;
 2089|    843|			digit = parsedigit(*++(*p));
 2090|    843|		}
 2091|  1.10k|		return l;
 2092|  1.10k|	}
 2093|  3.71k|}
archive_read_support_format_mtree.c:parsedigit:
 2032|  28.7k|{
 2033|  28.7k|	if (c >= '0' && c <= '9')
  ------------------
  |  Branch (2033:6): [True: 27.3k, False: 1.35k]
  |  Branch (2033:18): [True: 26.2k, False: 1.09k]
  ------------------
 2034|  26.2k|		return c - '0';
 2035|  2.45k|	else if (c >= 'a' && c <= 'f')
  ------------------
  |  Branch (2035:11): [True: 0, False: 2.45k]
  |  Branch (2035:23): [True: 0, False: 0]
  ------------------
 2036|      0|		return 10 + c - 'a';
 2037|  2.45k|	else if (c >= 'A' && c <= 'F')
  ------------------
  |  Branch (2037:11): [True: 1.09k, False: 1.35k]
  |  Branch (2037:23): [True: 1.09k, False: 0]
  ------------------
 2038|  1.09k|		return 10 + c - 'A';
 2039|  1.35k|	else
 2040|  1.35k|		return -1;
 2041|  28.7k|}
archive_read_support_format_mtree.c:parse_digest:
 1546|    523|{
 1547|    523|	unsigned char digest_buf[64];
 1548|    523|	int high, low;
 1549|    523|	size_t i, j, len;
 1550|       |
 1551|    523|	switch (type) {
 1552|      0|	case ARCHIVE_ENTRY_DIGEST_MD5:
  ------------------
  |  |  444|      0|#define ARCHIVE_ENTRY_DIGEST_MD5              0x00000001
  ------------------
  |  Branch (1552:2): [True: 0, False: 523]
  ------------------
 1553|      0|		len = sizeof(entry->digest.md5);
 1554|      0|		break;
 1555|      0|	case ARCHIVE_ENTRY_DIGEST_RMD160:
  ------------------
  |  |  445|      0|#define ARCHIVE_ENTRY_DIGEST_RMD160           0x00000002
  ------------------
  |  Branch (1555:2): [True: 0, False: 523]
  ------------------
 1556|      0|		len = sizeof(entry->digest.rmd160);
 1557|      0|		break;
 1558|      0|	case ARCHIVE_ENTRY_DIGEST_SHA1:
  ------------------
  |  |  446|      0|#define ARCHIVE_ENTRY_DIGEST_SHA1             0x00000003
  ------------------
  |  Branch (1558:2): [True: 0, False: 523]
  ------------------
 1559|      0|		len = sizeof(entry->digest.sha1);
 1560|      0|		break;
 1561|      0|	case ARCHIVE_ENTRY_DIGEST_SHA256:
  ------------------
  |  |  447|      0|#define ARCHIVE_ENTRY_DIGEST_SHA256           0x00000004
  ------------------
  |  Branch (1561:2): [True: 0, False: 523]
  ------------------
 1562|      0|		len = sizeof(entry->digest.sha256);
 1563|      0|		break;
 1564|      2|	case ARCHIVE_ENTRY_DIGEST_SHA384:
  ------------------
  |  |  448|      2|#define ARCHIVE_ENTRY_DIGEST_SHA384           0x00000005
  ------------------
  |  Branch (1564:2): [True: 2, False: 521]
  ------------------
 1565|      2|		len = sizeof(entry->digest.sha384);
 1566|      2|		break;
 1567|    521|	case ARCHIVE_ENTRY_DIGEST_SHA512:
  ------------------
  |  |  449|    521|#define ARCHIVE_ENTRY_DIGEST_SHA512           0x00000006
  ------------------
  |  Branch (1567:2): [True: 521, False: 2]
  ------------------
 1568|    521|		len = sizeof(entry->digest.sha512);
 1569|    521|		break;
 1570|      0|	default:
  ------------------
  |  Branch (1570:2): [True: 0, False: 523]
  ------------------
 1571|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1572|      0|			"Internal error: Unknown digest type");
 1573|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1574|    523|	}
 1575|       |
 1576|    523|	if (len > sizeof(digest_buf)) {
  ------------------
  |  Branch (1576:6): [True: 0, False: 523]
  ------------------
 1577|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1578|      0|			"Internal error: Digest storage too large");
 1579|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1580|      0|	}
 1581|       |
 1582|    523|	len *= 2;
 1583|       |
 1584|    523|	if (mtree_strnlen(digest, len+1) != len) {
  ------------------
  |  |  194|    523|#define mtree_strnlen(a,b) strnlen(a,b)
  ------------------
  |  Branch (1584:6): [True: 523, False: 0]
  ------------------
 1585|    523|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    523|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1586|    523|				  "incorrect digest length, ignoring");
 1587|    523|		return ARCHIVE_WARN;
  ------------------
  |  |  235|    523|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1588|    523|	}
 1589|       |
 1590|      0|	for (i = 0, j = 0; i < len; i += 2, j++) {
  ------------------
  |  Branch (1590:21): [True: 0, False: 0]
  ------------------
 1591|      0|		high = parse_hex_nibble(digest[i]);
 1592|      0|		low = parse_hex_nibble(digest[i+1]);
 1593|      0|		if (high == -1 || low == -1) {
  ------------------
  |  Branch (1593:7): [True: 0, False: 0]
  |  Branch (1593:21): [True: 0, False: 0]
  ------------------
 1594|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1595|      0|					  "invalid digest data, ignoring");
 1596|      0|			return ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1597|      0|		}
 1598|       |
 1599|      0|		digest_buf[j] = high << 4 | low;
 1600|      0|	}
 1601|       |
 1602|      0|	return archive_entry_set_digest(entry, type, digest_buf);
 1603|      0|}
archive_read_support_format_mtree.c:get_time_t_max:
  150|  1.35k|{
  151|       |#if defined(TIME_T_MAX)
  152|       |	return TIME_T_MAX;
  153|       |#else
  154|       |	/* ISO C allows time_t to be a floating-point type,
  155|       |	   but POSIX requires an integer type.  The following
  156|       |	   should work on any system that follows the POSIX
  157|       |	   conventions. */
  158|  1.35k|	if (((time_t)0) < ((time_t)-1)) {
  ------------------
  |  Branch (158:6): [Folded, False: 1.35k]
  ------------------
  159|       |		/* Time_t is unsigned */
  160|      0|		return (~(time_t)0);
  161|  1.35k|	} else {
  162|       |		/* Time_t is signed. */
  163|       |		/* Assume it's the same as int64_t or int32_t */
  164|  1.35k|		if (sizeof(time_t) == sizeof(int64_t)) {
  ------------------
  |  Branch (164:7): [True: 1.35k, Folded]
  ------------------
  165|  1.35k|			return (time_t)INT64_MAX;
  166|  1.35k|		} else {
  167|       |			return (time_t)INT32_MAX;
  168|      0|		}
  169|  1.35k|	}
  170|  1.35k|#endif
  171|  1.35k|}
archive_read_support_format_mtree.c:get_time_t_min:
  175|  1.35k|{
  176|       |#if defined(TIME_T_MIN)
  177|       |	return TIME_T_MIN;
  178|       |#else
  179|  1.35k|	if (((time_t)0) < ((time_t)-1)) {
  ------------------
  |  Branch (179:6): [Folded, False: 1.35k]
  ------------------
  180|       |		/* Time_t is unsigned */
  181|      0|		return (time_t)0;
  182|  1.35k|	} else {
  183|       |		/* Time_t is signed. */
  184|  1.35k|		if (sizeof(time_t) == sizeof(int64_t)) {
  ------------------
  |  Branch (184:7): [True: 1.35k, Folded]
  ------------------
  185|  1.35k|			return (time_t)INT64_MIN;
  186|  1.35k|		} else {
  187|       |			return (time_t)INT32_MIN;
  188|      0|		}
  189|  1.35k|	}
  190|  1.35k|#endif
  191|  1.35k|}
archive_read_support_format_mtree.c:read_data:
 1893|  7.68k|{
 1894|  7.68k|	size_t bytes_to_read;
 1895|  7.68k|	ssize_t bytes_read;
 1896|  7.68k|	struct mtree *mtree;
 1897|       |
 1898|  7.68k|	mtree = (struct mtree *)(a->format->data);
 1899|  7.68k|	if (mtree->fd < 0) {
  ------------------
  |  Branch (1899:6): [True: 7.68k, False: 0]
  ------------------
 1900|  7.68k|		*buff = NULL;
 1901|  7.68k|		*offset = 0;
 1902|  7.68k|		*size = 0;
 1903|  7.68k|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|  7.68k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1904|  7.68k|	}
 1905|      0|	if (mtree->buff == NULL) {
  ------------------
  |  Branch (1905:6): [True: 0, False: 0]
  ------------------
 1906|      0|		mtree->buffsize = 64 * 1024;
 1907|      0|		mtree->buff = malloc(mtree->buffsize);
 1908|      0|		if (mtree->buff == NULL) {
  ------------------
  |  Branch (1908:7): [True: 0, False: 0]
  ------------------
 1909|      0|			archive_set_error(&a->archive, ENOMEM,
 1910|      0|			    "Can't allocate memory");
 1911|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1912|      0|		}
 1913|      0|	}
 1914|       |
 1915|      0|	*buff = mtree->buff;
 1916|      0|	*offset = mtree->offset;
 1917|      0|	if ((int64_t)mtree->buffsize > mtree->cur_size - mtree->offset)
  ------------------
  |  Branch (1917:6): [True: 0, False: 0]
  ------------------
 1918|      0|		bytes_to_read = (size_t)(mtree->cur_size - mtree->offset);
 1919|      0|	else
 1920|      0|		bytes_to_read = mtree->buffsize;
 1921|      0|	bytes_read = read(mtree->fd, mtree->buff, bytes_to_read);
 1922|      0|	if (bytes_read < 0) {
  ------------------
  |  Branch (1922:6): [True: 0, False: 0]
  ------------------
 1923|      0|		archive_set_error(&a->archive, errno, "Can't read");
 1924|      0|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1925|      0|	}
 1926|      0|	if (bytes_read == 0) {
  ------------------
  |  Branch (1926:6): [True: 0, False: 0]
  ------------------
 1927|      0|		*size = 0;
 1928|      0|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1929|      0|	}
 1930|      0|	mtree->offset += bytes_read;
 1931|      0|	*size = bytes_read;
 1932|      0|	return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1933|      0|}
archive_read_support_format_mtree.c:skip:
 1938|  7.68k|{
 1939|  7.68k|	struct mtree *mtree;
 1940|       |
 1941|  7.68k|	mtree = (struct mtree *)(a->format->data);
 1942|  7.68k|	if (mtree->fd >= 0) {
  ------------------
  |  Branch (1942:6): [True: 0, False: 7.68k]
  ------------------
 1943|      0|		close(mtree->fd);
 1944|      0|		mtree->fd = -1;
 1945|      0|	}
 1946|  7.68k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  7.68k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1947|  7.68k|}

archive_read_support_format_rar:
  730|  2.49k|{
  731|  2.49k|  struct archive_read *a = (struct archive_read *)_a;
  732|  2.49k|  struct rar *rar;
  733|  2.49k|  int r;
  734|       |
  735|  2.49k|  archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
  ------------------
  |  |  151|  2.49k|	do { \
  |  |  152|  2.49k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|  2.49k|			(allowed_states), (function_name)); \
  |  |  154|  2.49k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  2.49k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 2.49k]
  |  |  ------------------
  |  |  155|  2.49k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|  2.49k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 2.49k]
  |  |  ------------------
  ------------------
  736|  2.49k|                      "archive_read_support_format_rar");
  737|       |
  738|  2.49k|  rar = calloc(1, sizeof(*rar));
  739|  2.49k|  if (rar == NULL)
  ------------------
  |  Branch (739:7): [True: 0, False: 2.49k]
  ------------------
  740|      0|  {
  741|      0|    archive_set_error(&a->archive, ENOMEM, "Can't allocate rar data");
  742|      0|    return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  743|      0|  }
  744|       |
  745|       |  /*
  746|       |   * Until enough data has been read, we cannot tell about
  747|       |   * any encrypted entries yet.
  748|       |   */
  749|  2.49k|  rar->has_encrypted_entries = ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW;
  ------------------
  |  |  411|  2.49k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  750|       |
  751|  2.49k|  r = __archive_read_register_format(a,
  752|  2.49k|                                     rar,
  753|  2.49k|                                     "rar",
  754|  2.49k|                                     archive_read_format_rar_bid,
  755|  2.49k|                                     archive_read_format_rar_options,
  756|  2.49k|                                     archive_read_format_rar_read_header,
  757|  2.49k|                                     archive_read_format_rar_read_data,
  758|  2.49k|                                     archive_read_format_rar_read_data_skip,
  759|  2.49k|                                     archive_read_format_rar_seek_data,
  760|  2.49k|                                     archive_read_format_rar_cleanup,
  761|  2.49k|                                     archive_read_support_format_rar_capabilities,
  762|  2.49k|                                     archive_read_format_rar_has_encrypted_entries);
  763|       |
  764|  2.49k|  if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (764:7): [True: 0, False: 2.49k]
  ------------------
  765|      0|    free(rar);
  766|  2.49k|  return (r);
  767|  2.49k|}
archive_read_support_format_rar.c:archive_read_support_format_rar_capabilities:
  771|    296|{
  772|    296|  (void)a; /* UNUSED */
  773|    296|  return (ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA
  ------------------
  |  |  398|    296|#define ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA (1<<0)  /* reader can detect encrypted data */
  ------------------
  774|    296|    | ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA);
  ------------------
  |  |  399|    296|#define ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA (1<<1)  /* reader can detect encryptable metadata (pathname, mtime, etc.) */
  ------------------
  775|    296|}
archive_read_support_format_rar.c:archive_read_format_rar_has_encrypted_entries:
  779|    148|{
  780|    148|  if (_a && _a->format) {
  ------------------
  |  Branch (780:7): [True: 148, False: 0]
  |  Branch (780:13): [True: 148, False: 0]
  ------------------
  781|    148|    struct rar * rar = (struct rar *)_a->format->data;
  782|    148|    if (rar) {
  ------------------
  |  Branch (782:9): [True: 148, False: 0]
  ------------------
  783|    148|      return rar->has_encrypted_entries;
  784|    148|    }
  785|    148|  }
  786|      0|  return ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW;
  ------------------
  |  |  411|      0|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  787|    148|}
archive_read_support_format_rar.c:archive_read_format_rar_bid:
  792|  2.46k|{
  793|  2.46k|  const char *p;
  794|       |
  795|       |  /* If there's already a bid > 30, we'll never win. */
  796|  2.46k|  if (best_bid > 30)
  ------------------
  |  Branch (796:7): [True: 975, False: 1.48k]
  ------------------
  797|    975|    return (-1);
  798|       |
  799|  1.48k|  if ((p = __archive_read_ahead(a, 7, NULL)) == NULL)
  ------------------
  |  Branch (799:7): [True: 29, False: 1.45k]
  ------------------
  800|     29|    return (-1);
  801|       |
  802|  1.45k|  if (memcmp(p, RAR_SIGNATURE, 7) == 0)
  ------------------
  |  |   50|  1.45k|#define RAR_SIGNATURE "\x52\x61\x72\x21\x1A\x07\x00"
  ------------------
  |  Branch (802:7): [True: 145, False: 1.31k]
  ------------------
  803|    145|    return (30);
  804|       |
  805|  1.31k|  if ((p[0] == 'M' && p[1] == 'Z') || memcmp(p, "\x7F\x45LF", 4) == 0) {
  ------------------
  |  Branch (805:8): [True: 60, False: 1.25k]
  |  Branch (805:23): [True: 60, False: 0]
  |  Branch (805:39): [True: 15, False: 1.23k]
  ------------------
  806|       |    /* This is a PE file */
  807|     75|    ssize_t offset = 0x10000;
  808|     75|    ssize_t window = 4096;
  809|     75|    ssize_t bytes_avail;
  810|    449|    while (offset + window <= (1024 * 128)) {
  ------------------
  |  Branch (810:12): [True: 436, False: 13]
  ------------------
  811|    436|      const char *buff = __archive_read_ahead(a, offset + window, &bytes_avail);
  812|    436|      if (buff == NULL) {
  ------------------
  |  Branch (812:11): [True: 413, False: 23]
  ------------------
  813|       |        /* Remaining bytes are less than window. */
  814|    413|        window >>= 1;
  815|    413|        if (window < 0x40)
  ------------------
  |  Branch (815:13): [True: 58, False: 355]
  ------------------
  816|     58|          return (0);
  817|    355|        continue;
  818|    413|      }
  819|     23|      p = buff + offset;
  820|   401k|      while (p + 7 < buff + bytes_avail) {
  ------------------
  |  Branch (820:14): [True: 401k, False: 19]
  ------------------
  821|   401k|        if (memcmp(p, RAR_SIGNATURE, 7) == 0)
  ------------------
  |  |   50|   401k|#define RAR_SIGNATURE "\x52\x61\x72\x21\x1A\x07\x00"
  ------------------
  |  Branch (821:13): [True: 4, False: 401k]
  ------------------
  822|      4|          return (30);
  823|   401k|        p += 0x10;
  824|   401k|      }
  825|     19|      offset = p - buff;
  826|     19|    }
  827|     75|  }
  828|  1.24k|  return (0);
  829|  1.31k|}
archive_read_support_format_rar.c:archive_read_format_rar_read_header:
  910|  1.54k|{
  911|  1.54k|  const void *h;
  912|  1.54k|  const char *p;
  913|  1.54k|  struct rar *rar;
  914|  1.54k|  int64_t skip;
  915|  1.54k|  char head_type;
  916|  1.54k|  int ret;
  917|  1.54k|  unsigned flags;
  918|  1.54k|  unsigned long crc32_expected;
  919|       |
  920|  1.54k|  a->archive.archive_format = ARCHIVE_FORMAT_RAR;
  ------------------
  |  |  384|  1.54k|#define	ARCHIVE_FORMAT_RAR			0xD0000
  ------------------
  921|  1.54k|  if (a->archive.archive_format_name == NULL)
  ------------------
  |  Branch (921:7): [True: 148, False: 1.40k]
  ------------------
  922|    148|    a->archive.archive_format_name = "RAR";
  923|       |
  924|  1.54k|  rar = (struct rar *)(a->format->data);
  925|       |
  926|       |  /*
  927|       |   * It should be sufficient to call archive_read_next_header() for
  928|       |   * a reader to determine if an entry is encrypted or not. If the
  929|       |   * encryption of an entry is only detectable when calling
  930|       |   * archive_read_data(), so be it. We'll do the same check there
  931|       |   * as well.
  932|       |   */
  933|  1.54k|  if (rar->has_encrypted_entries == ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW) {
  ------------------
  |  |  411|  1.54k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  |  Branch (933:7): [True: 148, False: 1.40k]
  ------------------
  934|    148|    rar->has_encrypted_entries = 0;
  935|    148|  }
  936|       |
  937|       |  /* RAR files can be generated without EOF headers, so return ARCHIVE_EOF if
  938|       |  * this fails.
  939|       |  */
  940|  1.54k|  if ((h = __archive_read_ahead(a, 7, NULL)) == NULL)
  ------------------
  |  Branch (940:7): [True: 20, False: 1.52k]
  ------------------
  941|     20|    return (ARCHIVE_EOF);
  ------------------
  |  |  232|     20|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  942|       |
  943|  1.52k|  p = h;
  944|  1.52k|  if (rar->found_first_header == 0 &&
  ------------------
  |  Branch (944:7): [True: 148, False: 1.38k]
  ------------------
  945|    148|     ((p[0] == 'M' && p[1] == 'Z') || memcmp(p, "\x7F\x45LF", 4) == 0)) {
  ------------------
  |  Branch (945:8): [True: 1, False: 147]
  |  Branch (945:23): [True: 1, False: 0]
  |  Branch (945:39): [True: 2, False: 145]
  ------------------
  946|       |    /* This is an executable ? Must be self-extracting... */
  947|      3|    ret = skip_sfx(a);
  948|      3|    if (ret < ARCHIVE_WARN)
  ------------------
  |  |  235|      3|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (948:9): [True: 0, False: 3]
  ------------------
  949|      0|      return (ret);
  950|      3|  }
  951|  1.52k|  rar->found_first_header = 1;
  952|       |
  953|  2.81k|  while (1)
  ------------------
  |  Branch (953:10): [True: 2.81k, Folded]
  ------------------
  954|  2.81k|  {
  955|  2.81k|    unsigned long crc32_val;
  956|       |
  957|  2.81k|    if ((h = __archive_read_ahead(a, 7, NULL)) == NULL) {
  ------------------
  |  Branch (957:9): [True: 0, False: 2.81k]
  ------------------
  958|      0|      archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  959|      0|                        "Failed to read next header");
  960|      0|      return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  961|      0|    }
  962|  2.81k|    p = h;
  963|       |
  964|  2.81k|    head_type = p[2];
  965|  2.81k|    switch(head_type)
  966|  2.81k|    {
  967|    170|    case MARK_HEAD:
  ------------------
  |  |   53|    170|#define MARK_HEAD    0x72
  ------------------
  |  Branch (967:5): [True: 170, False: 2.64k]
  ------------------
  968|    170|      if (memcmp(p, RAR_SIGNATURE, 7) != 0) {
  ------------------
  |  |   50|    170|#define RAR_SIGNATURE "\x52\x61\x72\x21\x1A\x07\x00"
  ------------------
  |  Branch (968:11): [True: 0, False: 170]
  ------------------
  969|      0|        archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  970|      0|          "Invalid marker header");
  971|      0|        return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  972|      0|      }
  973|    170|      __archive_read_consume(a, 7);
  974|    170|      break;
  975|       |
  976|    963|    case MAIN_HEAD:
  ------------------
  |  |   54|    963|#define MAIN_HEAD    0x73
  ------------------
  |  Branch (976:5): [True: 963, False: 1.85k]
  ------------------
  977|    963|      rar->main_flags = archive_le16dec(p + 3);
  978|    963|      skip = archive_le16dec(p + 5);
  979|    963|      if ((size_t)skip < 7 + sizeof(rar->reserved1) + sizeof(rar->reserved2)) {
  ------------------
  |  Branch (979:11): [True: 0, False: 963]
  ------------------
  980|      0|        archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  981|      0|          "Invalid header size");
  982|      0|        return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  983|      0|      }
  984|    963|      if ((h = __archive_read_ahead(a, skip, NULL)) == NULL)
  ------------------
  |  Branch (984:11): [True: 4, False: 959]
  ------------------
  985|      4|        return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  986|    959|      p = h;
  987|    959|      memcpy(rar->reserved1, p + 7, sizeof(rar->reserved1));
  988|    959|      memcpy(rar->reserved2, p + 7 + sizeof(rar->reserved1),
  989|    959|             sizeof(rar->reserved2));
  990|    959|      if (rar->main_flags & MHD_ENCRYPTVER) {
  ------------------
  |  |   74|    959|#define MHD_ENCRYPTVER   0x0200
  ------------------
  |  Branch (990:11): [True: 0, False: 959]
  ------------------
  991|      0|        if ((size_t)skip <
  ------------------
  |  Branch (991:13): [True: 0, False: 0]
  ------------------
  992|      0|            7 + sizeof(rar->reserved1) + sizeof(rar->reserved2) + 1) {
  993|      0|          archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  994|      0|            "Invalid header size");
  995|      0|          return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  996|      0|        }
  997|      0|        rar->encryptver = *(p + 7 + sizeof(rar->reserved1) +
  998|      0|                            sizeof(rar->reserved2));
  999|      0|      }
 1000|       |
 1001|       |      /* Main header is password encrypted, so we cannot read any
 1002|       |         file names or any other info about files from the header. */
 1003|    959|      if (rar->main_flags & MHD_PASSWORD)
  ------------------
  |  |   72|    959|#define MHD_PASSWORD     0x0080
  ------------------
  |  Branch (1003:11): [True: 0, False: 959]
  ------------------
 1004|      0|      {
 1005|      0|        archive_entry_set_is_metadata_encrypted(entry, 1);
 1006|      0|        archive_entry_set_is_data_encrypted(entry, 1);
 1007|      0|        rar->has_encrypted_entries = 1;
 1008|      0|         archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1009|      0|                          "RAR encryption support unavailable");
 1010|      0|        return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1011|      0|      }
 1012|       |
 1013|    959|      crc32_val = crc32(0, (const unsigned char *)p + 2, (unsigned)skip - 2);
 1014|    959|      if ((crc32_val & 0xffff) != archive_le16dec(p)) {
  ------------------
  |  Branch (1014:11): [True: 903, False: 56]
  ------------------
 1015|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 1016|       |        archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
 1017|       |          "Header CRC error");
 1018|       |        return (ARCHIVE_FATAL);
 1019|       |#endif
 1020|    903|      }
 1021|    959|      __archive_read_consume(a, skip);
 1022|    959|      break;
 1023|       |
 1024|  1.50k|    case FILE_HEAD:
  ------------------
  |  |   55|  1.50k|#define FILE_HEAD    0x74
  ------------------
  |  Branch (1024:5): [True: 1.50k, False: 1.30k]
  ------------------
 1025|  1.50k|      return read_header(a, entry, head_type);
 1026|       |
 1027|      0|    case COMM_HEAD:
  ------------------
  |  |   56|      0|#define COMM_HEAD    0x75
  ------------------
  |  Branch (1027:5): [True: 0, False: 2.81k]
  ------------------
 1028|      0|    case AV_HEAD:
  ------------------
  |  |   57|      0|#define AV_HEAD      0x76
  ------------------
  |  Branch (1028:5): [True: 0, False: 2.81k]
  ------------------
 1029|      0|    case SUB_HEAD:
  ------------------
  |  |   58|      0|#define SUB_HEAD     0x77
  ------------------
  |  Branch (1029:5): [True: 0, False: 2.81k]
  ------------------
 1030|     86|    case PROTECT_HEAD:
  ------------------
  |  |   59|     86|#define PROTECT_HEAD 0x78
  ------------------
  |  Branch (1030:5): [True: 86, False: 2.73k]
  ------------------
 1031|     90|    case SIGN_HEAD:
  ------------------
  |  |   60|     90|#define SIGN_HEAD    0x79
  ------------------
  |  Branch (1031:5): [True: 4, False: 2.81k]
  ------------------
 1032|     90|    case ENDARC_HEAD:
  ------------------
  |  |   62|     90|#define ENDARC_HEAD  0x7b
  ------------------
  |  Branch (1032:5): [True: 0, False: 2.81k]
  ------------------
 1033|     90|      flags = archive_le16dec(p + 3);
 1034|     90|      skip = archive_le16dec(p + 5);
 1035|     90|      if (skip < 7) {
  ------------------
  |  Branch (1035:11): [True: 0, False: 90]
  ------------------
 1036|      0|        archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1037|      0|          "Invalid header size too small");
 1038|      0|        return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1039|      0|      }
 1040|     90|      if (flags & HD_ADD_SIZE_PRESENT)
  ------------------
  |  |   78|     90|#define HD_ADD_SIZE_PRESENT 0x8000
  ------------------
  |  Branch (1040:11): [True: 4, False: 86]
  ------------------
 1041|      4|      {
 1042|      4|        if (skip < 7 + 4) {
  ------------------
  |  Branch (1042:13): [True: 0, False: 4]
  ------------------
 1043|      0|          archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1044|      0|            "Invalid header size too small");
 1045|      0|          return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1046|      0|        }
 1047|      4|        if ((h = __archive_read_ahead(a, skip, NULL)) == NULL)
  ------------------
  |  Branch (1047:13): [True: 0, False: 4]
  ------------------
 1048|      0|          return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1049|      4|        p = h;
 1050|      4|        skip += archive_le32dec(p + 7);
 1051|      4|      }
 1052|       |
 1053|       |      /* Skip over the 2-byte CRC at the beginning of the header. */
 1054|     90|      crc32_expected = archive_le16dec(p);
 1055|     90|      __archive_read_consume(a, 2);
 1056|     90|      skip -= 2;
 1057|       |
 1058|       |      /* Skim the entire header and compute the CRC. */
 1059|     90|      crc32_val = 0;
 1060|    197|      while (skip > 0) {
  ------------------
  |  Branch (1060:14): [True: 111, False: 86]
  ------------------
 1061|    111|        unsigned to_read;
 1062|    111|        if (skip > 32 * 1024)
  ------------------
  |  Branch (1062:13): [True: 25, False: 86]
  ------------------
 1063|     25|          to_read = 32 * 1024;
 1064|     86|        else
 1065|     86|          to_read = (unsigned)skip;
 1066|    111|        if ((h = __archive_read_ahead(a, to_read, NULL)) == NULL) {
  ------------------
  |  Branch (1066:13): [True: 4, False: 107]
  ------------------
 1067|      4|          archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      4|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1068|      4|            "Bad RAR file");
 1069|      4|          return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1070|      4|        }
 1071|    107|        p = h;
 1072|    107|        crc32_val = crc32(crc32_val, (const unsigned char *)p, to_read);
 1073|    107|        __archive_read_consume(a, to_read);
 1074|    107|        skip -= to_read;
 1075|    107|      }
 1076|     86|      if ((crc32_val & 0xffff) != crc32_expected) {
  ------------------
  |  Branch (1076:11): [True: 86, False: 0]
  ------------------
 1077|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 1078|       |        archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
 1079|       |          "Header CRC error");
 1080|       |        return (ARCHIVE_FATAL);
 1081|       |#endif
 1082|     86|      }
 1083|     86|      if (head_type == ENDARC_HEAD)
  ------------------
  |  |   62|     86|#define ENDARC_HEAD  0x7b
  ------------------
  |  Branch (1083:11): [True: 0, False: 86]
  ------------------
 1084|      0|        return (ARCHIVE_EOF);
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1085|     86|      break;
 1086|       |
 1087|     86|    case NEWSUB_HEAD:
  ------------------
  |  |   61|     73|#define NEWSUB_HEAD  0x7a
  ------------------
  |  Branch (1087:5): [True: 73, False: 2.74k]
  ------------------
 1088|     73|      if ((ret = read_header(a, entry, head_type)) < ARCHIVE_WARN)
  ------------------
  |  |  235|     73|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (1088:11): [True: 0, False: 73]
  ------------------
 1089|      0|        return ret;
 1090|     73|      break;
 1091|       |
 1092|     73|    default:
  ------------------
  |  Branch (1092:5): [True: 12, False: 2.80k]
  ------------------
 1093|     12|      archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     12|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1094|     12|                        "Bad RAR file");
 1095|     12|      return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     12|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1096|  2.81k|    }
 1097|  2.81k|  }
 1098|  1.52k|}
archive_read_support_format_rar.c:skip_sfx:
  833|      3|{
  834|      3|  const void *h;
  835|      3|  const char *p, *q;
  836|      3|  size_t skip, total;
  837|      3|  ssize_t bytes, window;
  838|       |
  839|      3|  total = 0;
  840|      3|  window = 4096;
  841|      3|  while (total + window <= (1024 * 128)) {
  ------------------
  |  Branch (841:10): [True: 3, False: 0]
  ------------------
  842|      3|    h = __archive_read_ahead(a, window, &bytes);
  843|      3|    if (h == NULL) {
  ------------------
  |  Branch (843:9): [True: 0, False: 3]
  ------------------
  844|       |      /* Remaining bytes are less than window. */
  845|      0|      window >>= 1;
  846|      0|      if (window < 0x40)
  ------------------
  |  Branch (846:11): [True: 0, False: 0]
  ------------------
  847|      0|      	goto fatal;
  848|      0|      continue;
  849|      0|    }
  850|      3|    if (bytes < 0x40)
  ------------------
  |  Branch (850:9): [True: 0, False: 3]
  ------------------
  851|      0|      goto fatal;
  852|      3|    p = h;
  853|      3|    q = p + bytes;
  854|       |
  855|       |    /*
  856|       |     * Scan ahead until we find something that looks
  857|       |     * like the RAR header.
  858|       |     */
  859|  5.46k|    while (p + 7 < q) {
  ------------------
  |  Branch (859:12): [True: 5.46k, False: 0]
  ------------------
  860|  5.46k|      if (memcmp(p, RAR_SIGNATURE, 7) == 0) {
  ------------------
  |  |   50|  5.46k|#define RAR_SIGNATURE "\x52\x61\x72\x21\x1A\x07\x00"
  ------------------
  |  Branch (860:11): [True: 3, False: 5.45k]
  ------------------
  861|      3|      	skip = p - (const char *)h;
  862|      3|      	__archive_read_consume(a, skip);
  863|      3|      	return (ARCHIVE_OK);
  ------------------
  |  |  233|      3|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  864|      3|      }
  865|  5.45k|      p += 0x10;
  866|  5.45k|    }
  867|      0|    skip = p - (const char *)h;
  868|      0|    __archive_read_consume(a, skip);
  869|      0|    total += skip;
  870|      0|  }
  871|      0|fatal:
  872|      0|  archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  873|      0|      "Couldn't find out RAR header");
  874|      0|  return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  875|      3|}
archive_read_support_format_rar.c:read_header:
 1365|  1.58k|{
 1366|  1.58k|  const void *h;
 1367|  1.58k|  const char *p, *endp;
 1368|  1.58k|  struct rar *rar;
 1369|  1.58k|  struct rar_header rar_header;
 1370|  1.58k|  struct rar_file_header file_header;
 1371|  1.58k|  int64_t header_size;
 1372|  1.58k|  unsigned filename_size, end;
 1373|  1.58k|  char *filename;
 1374|  1.58k|  char *strp;
 1375|  1.58k|  char packed_size[8];
 1376|  1.58k|  char unp_size[8];
 1377|  1.58k|  int ttime;
 1378|  1.58k|  struct archive_string_conv *sconv, *fn_sconv;
 1379|  1.58k|  uint32_t crc32_computed, crc32_read;
 1380|  1.58k|  int ret = (ARCHIVE_OK), ret2;
  ------------------
  |  |  233|  1.58k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1381|  1.58k|  char *newptr;
 1382|  1.58k|  size_t newsize;
 1383|       |
 1384|  1.58k|  rar = (struct rar *)(a->format->data);
 1385|       |
 1386|       |  /* Setup a string conversion object for non-rar-unicode filenames. */
 1387|  1.58k|  sconv = rar->opt_sconv;
 1388|  1.58k|  if (sconv == NULL) {
  ------------------
  |  Branch (1388:7): [True: 1.58k, False: 0]
  ------------------
 1389|  1.58k|    if (!rar->init_default_conversion) {
  ------------------
  |  Branch (1389:9): [True: 142, False: 1.44k]
  ------------------
 1390|    142|      rar->sconv_default =
 1391|    142|          archive_string_default_conversion_for_read(
 1392|    142|            &(a->archive));
 1393|    142|      rar->init_default_conversion = 1;
 1394|    142|    }
 1395|  1.58k|    sconv = rar->sconv_default;
 1396|  1.58k|  }
 1397|       |
 1398|       |
 1399|  1.58k|  if ((h = __archive_read_ahead(a, 7, NULL)) == NULL)
  ------------------
  |  Branch (1399:7): [True: 0, False: 1.58k]
  ------------------
 1400|      0|    return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1401|  1.58k|  p = h;
 1402|  1.58k|  memcpy(&rar_header, p, sizeof(rar_header));
 1403|  1.58k|  rar->file_flags = archive_le16dec(rar_header.flags);
 1404|  1.58k|  header_size = archive_le16dec(rar_header.size);
 1405|  1.58k|  if (header_size < (int64_t)sizeof(file_header) + 7) {
  ------------------
  |  Branch (1405:7): [True: 3, False: 1.57k]
  ------------------
 1406|      3|    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      3|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1407|      3|      "Invalid header size");
 1408|      3|    return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      3|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1409|      3|  }
 1410|  1.57k|  crc32_computed = crc32(0, (const unsigned char *)p + 2, 7 - 2);
 1411|  1.57k|  __archive_read_consume(a, 7);
 1412|       |
 1413|  1.57k|  if (!(rar->file_flags & FHD_SOLID))
  ------------------
  |  |   85|  1.57k|#define FHD_SOLID        0x0010
  ------------------
  |  Branch (1413:7): [True: 1.57k, False: 0]
  ------------------
 1414|  1.57k|  {
 1415|  1.57k|    rar->compression_method = 0;
 1416|  1.57k|    rar->packed_size = 0;
 1417|  1.57k|    rar->unp_size = 0;
 1418|  1.57k|    rar->mtime = 0;
 1419|  1.57k|    rar->ctime = 0;
 1420|  1.57k|    rar->atime = 0;
 1421|  1.57k|    rar->arctime = 0;
 1422|  1.57k|    rar->mode = 0;
 1423|  1.57k|    memset(&rar->salt, 0, sizeof(rar->salt));
 1424|  1.57k|    rar->atime = 0;
 1425|  1.57k|    rar->ansec = 0;
 1426|  1.57k|    rar->ctime = 0;
 1427|  1.57k|    rar->cnsec = 0;
 1428|  1.57k|    rar->mtime = 0;
 1429|  1.57k|    rar->mnsec = 0;
 1430|  1.57k|    rar->arctime = 0;
 1431|  1.57k|    rar->arcnsec = 0;
 1432|  1.57k|  }
 1433|      0|  else
 1434|      0|  {
 1435|      0|    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1436|      0|                      "RAR solid archive support unavailable");
 1437|      0|    return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1438|      0|  }
 1439|       |
 1440|  1.57k|  if ((h = __archive_read_ahead(a, (size_t)header_size - 7, NULL)) == NULL)
  ------------------
  |  Branch (1440:7): [True: 0, False: 1.57k]
  ------------------
 1441|      0|  {
 1442|      0|    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1443|      0|                      "Failed to read full header content");
 1444|      0|    return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1445|      0|  }
 1446|       |
 1447|       |  /* File Header CRC check. */
 1448|  1.57k|  crc32_computed = crc32(crc32_computed, h, (unsigned)(header_size - 7));
 1449|  1.57k|  crc32_read = archive_le16dec(rar_header.crc);
 1450|  1.57k|  if ((crc32_computed & 0xffff) != crc32_read) {
  ------------------
  |  Branch (1450:7): [True: 1.57k, False: 3]
  ------------------
 1451|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 1452|       |    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
 1453|       |      "Header CRC error");
 1454|       |    return (ARCHIVE_FATAL);
 1455|       |#endif
 1456|  1.57k|  }
 1457|       |  /* If no CRC error, go on parsing File Header. */
 1458|  1.57k|  p = h;
 1459|  1.57k|  endp = p + header_size - 7;
 1460|  1.57k|  memcpy(&file_header, p, sizeof(file_header));
 1461|  1.57k|  p += sizeof(file_header);
 1462|       |
 1463|  1.57k|  rar->compression_method = file_header.method;
 1464|       |
 1465|  1.57k|  ttime = archive_le32dec(file_header.file_time);
 1466|  1.57k|  rar->mtime = get_time(ttime);
 1467|       |
 1468|  1.57k|  rar->file_crc = archive_le32dec(file_header.file_crc);
 1469|       |
 1470|  1.57k|  if (rar->file_flags & FHD_PASSWORD)
  ------------------
  |  |   83|  1.57k|#define FHD_PASSWORD     0x0004
  ------------------
  |  Branch (1470:7): [True: 1.14k, False: 431]
  ------------------
 1471|  1.14k|  {
 1472|  1.14k|    archive_entry_set_is_data_encrypted(entry, 1);
 1473|  1.14k|    rar->has_encrypted_entries = 1;
 1474|  1.14k|    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  1.14k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1475|  1.14k|                      "RAR encryption support unavailable");
 1476|       |    /* Since it is only the data part itself that is encrypted we can at least
 1477|       |       extract information about the currently processed entry and don't need
 1478|       |       to return ARCHIVE_FATAL here. */
 1479|       |    /*return (ARCHIVE_FATAL);*/
 1480|  1.14k|  }
 1481|       |
 1482|  1.57k|  if (rar->file_flags & FHD_LARGE)
  ------------------
  |  |   86|  1.57k|#define FHD_LARGE        0x0100
  ------------------
  |  Branch (1482:7): [True: 42, False: 1.53k]
  ------------------
 1483|     42|  {
 1484|     42|    if (p + 8 > endp) {
  ------------------
  |  Branch (1484:9): [True: 0, False: 42]
  ------------------
 1485|      0|      archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1486|      0|                        "Invalid header size");
 1487|      0|      return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1488|      0|    }
 1489|     42|    memcpy(packed_size, file_header.pack_size, 4);
 1490|     42|    memcpy(packed_size + 4, p, 4); /* High pack size */
 1491|     42|    p += 4;
 1492|     42|    memcpy(unp_size, file_header.unp_size, 4);
 1493|     42|    memcpy(unp_size + 4, p, 4); /* High unpack size */
 1494|     42|    p += 4;
 1495|     42|    rar->packed_size = archive_le64dec(&packed_size);
 1496|     42|    rar->unp_size = archive_le64dec(&unp_size);
 1497|     42|  }
 1498|  1.53k|  else
 1499|  1.53k|  {
 1500|  1.53k|    rar->packed_size = archive_le32dec(file_header.pack_size);
 1501|  1.53k|    rar->unp_size = archive_le32dec(file_header.unp_size);
 1502|  1.53k|  }
 1503|       |
 1504|  1.57k|  if (rar->packed_size < 0 || rar->unp_size < 0)
  ------------------
  |  Branch (1504:7): [True: 0, False: 1.57k]
  |  Branch (1504:31): [True: 0, False: 1.57k]
  ------------------
 1505|      0|  {
 1506|      0|    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1507|      0|                      "Invalid sizes specified");
 1508|      0|    return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1509|      0|  }
 1510|       |
 1511|  1.57k|  rar->bytes_remaining = rar->packed_size;
 1512|       |
 1513|       |  /* TODO: RARv3 subblocks contain comments. For now the complete block is
 1514|       |   * consumed at the end.
 1515|       |   */
 1516|  1.57k|  if (head_type == NEWSUB_HEAD) {
  ------------------
  |  |   61|  1.57k|#define NEWSUB_HEAD  0x7a
  ------------------
  |  Branch (1516:7): [True: 73, False: 1.50k]
  ------------------
 1517|     73|    if (rar->packed_size > RAR_MAX_NEWSUB_SIZE ||
  ------------------
  |  |  127|    146|#define RAR_MAX_NEWSUB_SIZE (1024 * 1024)
  ------------------
  |  Branch (1517:9): [True: 0, False: 73]
  ------------------
 1518|     73|        rar->packed_size > INT64_MAX - header_size) {
  ------------------
  |  Branch (1518:9): [True: 0, False: 73]
  ------------------
 1519|      0|      archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1520|      0|                        "Invalid RAR file: Overlarge extended header");
 1521|      0|      return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1522|      0|    }
 1523|     73|    if (__archive_read_consume(a, header_size + rar->packed_size - 7) < 0) {
  ------------------
  |  Branch (1523:9): [True: 0, False: 73]
  ------------------
 1524|      0|      archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1525|      0|                        "Invalid RAR file: Cannot read extended header data");
 1526|      0|      return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1527|      0|    }
 1528|       |
 1529|       |    /* NEWSUB blocks are metadata-only here; skip them without creating an entry. */
 1530|     73|    return ret;
 1531|     73|  }
 1532|       |
 1533|  1.50k|  filename_size = archive_le16dec(file_header.name_size);
 1534|  1.50k|  if (p + filename_size > endp) {
  ------------------
  |  Branch (1534:7): [True: 21, False: 1.48k]
  ------------------
 1535|     21|    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     21|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1536|     21|      "Invalid filename size");
 1537|     21|    return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     21|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1538|     21|  }
 1539|  1.48k|  if (rar->filename_allocated < filename_size * 2 + 2) {
  ------------------
  |  Branch (1539:7): [True: 142, False: 1.34k]
  ------------------
 1540|    142|    newsize = filename_size * 2 + 2;
 1541|    142|    newptr = realloc(rar->filename, newsize);
 1542|    142|    if (newptr == NULL) {
  ------------------
  |  Branch (1542:9): [True: 0, False: 142]
  ------------------
 1543|      0|      archive_set_error(&a->archive, ENOMEM,
 1544|      0|                        "Couldn't allocate memory");
 1545|      0|      return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1546|      0|    }
 1547|    142|    rar->filename = newptr;
 1548|    142|    rar->filename_allocated = newsize;
 1549|    142|  }
 1550|  1.48k|  filename = rar->filename;
 1551|  1.48k|  memcpy(filename, p, filename_size);
 1552|  1.48k|  filename[filename_size] = '\0';
 1553|  1.48k|  if (rar->file_flags & FHD_UNICODE)
  ------------------
  |  |   87|  1.48k|#define FHD_UNICODE      0x0200
  ------------------
  |  Branch (1553:7): [True: 1.18k, False: 299]
  ------------------
 1554|  1.18k|  {
 1555|  1.18k|    if (filename_size != strlen(filename))
  ------------------
  |  Branch (1555:9): [True: 1.13k, False: 48]
  ------------------
 1556|  1.13k|    {
 1557|  1.13k|      unsigned char highbyte, flagbits, flagbyte;
 1558|  1.13k|      unsigned fn_end, offset;
 1559|       |
 1560|  1.13k|      end = filename_size;
 1561|  1.13k|      fn_end = filename_size * 2;
 1562|  1.13k|      filename_size = 0;
 1563|  1.13k|      offset = (unsigned)strlen(filename) + 1;
 1564|  1.13k|      highbyte = offset >= end ? 0 : *(p + offset++);
  ------------------
  |  Branch (1564:18): [True: 66, False: 1.07k]
  ------------------
 1565|  1.13k|      flagbits = 0;
 1566|  1.13k|      flagbyte = 0;
 1567|  4.32k|      while (offset < end && filename_size < fn_end)
  ------------------
  |  Branch (1567:14): [True: 3.23k, False: 1.09k]
  |  Branch (1567:30): [True: 3.18k, False: 41]
  ------------------
 1568|  3.18k|      {
 1569|  3.18k|        if (!flagbits)
  ------------------
  |  Branch (1569:13): [True: 1.29k, False: 1.89k]
  ------------------
 1570|  1.29k|        {
 1571|  1.29k|          flagbyte = *(p + offset++);
 1572|  1.29k|          flagbits = 8;
 1573|  1.29k|        }
 1574|       |
 1575|  3.18k|        flagbits -= 2;
 1576|  3.18k|        switch((flagbyte >> flagbits) & 3)
  ------------------
  |  Branch (1576:16): [True: 3.18k, False: 0]
  ------------------
 1577|  3.18k|        {
 1578|  1.17k|          case 0:
  ------------------
  |  Branch (1578:11): [True: 1.17k, False: 2.01k]
  ------------------
 1579|  1.17k|            if (offset >= end)
  ------------------
  |  Branch (1579:17): [True: 0, False: 1.17k]
  ------------------
 1580|      0|              continue;
 1581|  1.17k|            filename[filename_size++] = '\0';
 1582|  1.17k|            filename[filename_size++] = *(p + offset++);
 1583|  1.17k|            break;
 1584|    314|          case 1:
  ------------------
  |  Branch (1584:11): [True: 314, False: 2.87k]
  ------------------
 1585|    314|            if (offset >= end)
  ------------------
  |  Branch (1585:17): [True: 85, False: 229]
  ------------------
 1586|     85|              continue;
 1587|    229|            filename[filename_size++] = highbyte;
 1588|    229|            filename[filename_size++] = *(p + offset++);
 1589|    229|            break;
 1590|    730|          case 2:
  ------------------
  |  Branch (1590:11): [True: 730, False: 2.45k]
  ------------------
 1591|    730|            if (offset >= end - 1) {
  ------------------
  |  Branch (1591:17): [True: 36, False: 694]
  ------------------
 1592|     36|              offset = end;
 1593|     36|              continue;
 1594|     36|            }
 1595|    694|            filename[filename_size++] = *(p + offset + 1);
 1596|    694|            filename[filename_size++] = *(p + offset);
 1597|    694|            offset += 2;
 1598|    694|            break;
 1599|    971|          case 3:
  ------------------
  |  Branch (1599:11): [True: 971, False: 2.21k]
  ------------------
 1600|    971|          {
 1601|    971|            char extra, high;
 1602|    971|            uint8_t length;
 1603|       |
 1604|    971|            if (offset >= end)
  ------------------
  |  Branch (1604:17): [True: 339, False: 632]
  ------------------
 1605|    339|              continue;
 1606|       |
 1607|    632|            length = *(p + offset++);
 1608|    632|            if (length & 0x80) {
  ------------------
  |  Branch (1608:17): [True: 570, False: 62]
  ------------------
 1609|    570|              if (offset >= end)
  ------------------
  |  Branch (1609:19): [True: 541, False: 29]
  ------------------
 1610|    541|                continue;
 1611|     29|              extra = *(p + offset++);
 1612|     29|              high = (char)highbyte;
 1613|     29|            } else
 1614|     62|              extra = high = 0;
 1615|     91|            length = (length & 0x7f) + 2;
 1616|    634|            while (length && filename_size < fn_end) {
  ------------------
  |  Branch (1616:20): [True: 590, False: 44]
  |  Branch (1616:30): [True: 543, False: 47]
  ------------------
 1617|    543|              unsigned cp = filename_size >> 1;
 1618|    543|              filename[filename_size++] = high;
 1619|    543|              filename[filename_size++] = p[cp] + extra;
 1620|    543|              length--;
 1621|    543|            }
 1622|     91|          }
 1623|      0|          break;
 1624|  3.18k|        }
 1625|  3.18k|      }
 1626|  1.13k|      if (filename_size > fn_end) {
  ------------------
  |  Branch (1626:11): [True: 0, False: 1.13k]
  ------------------
 1627|      0|        archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1628|      0|          "Invalid filename");
 1629|      0|        return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1630|      0|      }
 1631|  1.13k|      filename[filename_size++] = '\0';
 1632|       |      /*
 1633|       |       * Do not increment filename_size here as the computations below
 1634|       |       * add the space for the terminating NUL explicitly.
 1635|       |       */
 1636|  1.13k|      filename[filename_size] = '\0';
 1637|       |
 1638|       |      /* Decoded unicode form is UTF-16BE, so we have to update a string
 1639|       |       * conversion object for it. */
 1640|  1.13k|      if (rar->sconv_utf16be == NULL) {
  ------------------
  |  Branch (1640:11): [True: 23, False: 1.11k]
  ------------------
 1641|     23|        rar->sconv_utf16be = archive_string_conversion_from_charset(
 1642|     23|           &a->archive, "UTF-16BE", 1);
 1643|     23|        if (rar->sconv_utf16be == NULL)
  ------------------
  |  Branch (1643:13): [True: 0, False: 23]
  ------------------
 1644|      0|          return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1645|     23|      }
 1646|  1.13k|      fn_sconv = rar->sconv_utf16be;
 1647|       |
 1648|  1.13k|      strp = filename;
 1649|  2.79k|      while (memcmp(strp, "\x00\x00", 2))
  ------------------
  |  Branch (1649:14): [True: 1.66k, False: 1.13k]
  ------------------
 1650|  1.66k|      {
 1651|  1.66k|        if (!memcmp(strp, "\x00\\", 2))
  ------------------
  |  Branch (1651:13): [True: 0, False: 1.66k]
  ------------------
 1652|      0|          *(strp + 1) = '/';
 1653|  1.66k|        strp += 2;
 1654|  1.66k|      }
 1655|  1.13k|      p += offset;
 1656|  1.13k|    } else {
 1657|       |      /*
 1658|       |       * If FHD_UNICODE is set but no unicode data, this file name form
 1659|       |       * is UTF-8, so we have to update a string conversion object for
 1660|       |       * it accordingly.
 1661|       |       */
 1662|     48|      if (rar->sconv_utf8 == NULL) {
  ------------------
  |  Branch (1662:11): [True: 4, False: 44]
  ------------------
 1663|      4|        rar->sconv_utf8 = archive_string_conversion_from_charset(
 1664|      4|           &a->archive, "UTF-8", 1);
 1665|      4|        if (rar->sconv_utf8 == NULL)
  ------------------
  |  Branch (1665:13): [True: 0, False: 4]
  ------------------
 1666|      0|          return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1667|      4|      }
 1668|     48|      fn_sconv = rar->sconv_utf8;
 1669|     48|      while ((strp = strchr(filename, '\\')) != NULL)
  ------------------
  |  Branch (1669:14): [True: 0, False: 48]
  ------------------
 1670|      0|        *strp = '/';
 1671|     48|      p += filename_size;
 1672|     48|    }
 1673|  1.18k|  }
 1674|    299|  else
 1675|    299|  {
 1676|    299|    fn_sconv = sconv;
 1677|    299|    while ((strp = strchr(filename, '\\')) != NULL)
  ------------------
  |  Branch (1677:12): [True: 0, False: 299]
  ------------------
 1678|      0|      *strp = '/';
 1679|    299|    p += filename_size;
 1680|    299|  }
 1681|       |
 1682|       |  /* Split file in multivolume RAR. No more need to process header. */
 1683|  1.48k|  if (rar->filename_save &&
  ------------------
  |  Branch (1683:7): [True: 1.34k, False: 140]
  ------------------
 1684|  1.34k|    filename_size == rar->filename_save_size &&
  ------------------
  |  Branch (1684:5): [True: 1.07k, False: 267]
  ------------------
 1685|  1.07k|    !memcmp(rar->filename, rar->filename_save, filename_size + 1))
  ------------------
  |  Branch (1685:5): [True: 941, False: 137]
  ------------------
 1686|    941|  {
 1687|    941|    __archive_read_consume(a, header_size - 7);
 1688|    941|    rar->br.avail_in = 0;
 1689|    941|    rar->br.next_in = NULL;
 1690|    941|    rar->cursor++;
 1691|    941|    if (rar->cursor >= rar->nodes)
  ------------------
  |  Branch (1691:9): [True: 941, False: 0]
  ------------------
 1692|    941|    {
 1693|    941|      struct data_block_offsets *newdbo;
 1694|       |
 1695|    941|      newsize = sizeof(*rar->dbo) * (rar->nodes + 1);
 1696|    941|      if ((newdbo = realloc(rar->dbo, newsize)) == NULL)
  ------------------
  |  Branch (1696:11): [True: 0, False: 941]
  ------------------
 1697|      0|      {
 1698|      0|        archive_set_error(&a->archive, ENOMEM, "Couldn't allocate memory");
 1699|      0|        return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1700|      0|      }
 1701|    941|      rar->dbo = newdbo;
 1702|    941|      rar->nodes++;
 1703|    941|      rar->dbo[rar->cursor].header_size = header_size;
 1704|    941|      rar->dbo[rar->cursor].start_offset = -1;
 1705|    941|      rar->dbo[rar->cursor].end_offset = -1;
 1706|    941|    }
 1707|    941|    if (rar->dbo[rar->cursor].start_offset < 0)
  ------------------
  |  Branch (1707:9): [True: 941, False: 0]
  ------------------
 1708|    941|    {
 1709|    941|      if (rar->packed_size > INT64_MAX - a->filter->position)
  ------------------
  |  Branch (1709:11): [True: 0, False: 941]
  ------------------
 1710|      0|      {
 1711|      0|        archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1712|      0|                          "Unable to store offsets");
 1713|      0|        return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1714|      0|      }
 1715|    941|      rar->dbo[rar->cursor].start_offset = a->filter->position;
 1716|    941|      rar->dbo[rar->cursor].end_offset = rar->dbo[rar->cursor].start_offset +
 1717|    941|        rar->packed_size;
 1718|    941|    }
 1719|    941|    return ret;
 1720|    941|  }
 1721|    544|  else if (rar->filename_must_match)
  ------------------
  |  Branch (1721:12): [True: 7, False: 537]
  ------------------
 1722|      7|  {
 1723|      7|    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      7|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1724|      7|      "Mismatch of file parts split across multi-volume archive");
 1725|      7|    return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      7|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1726|      7|  }
 1727|       |
 1728|    537|  newsize = filename_size + 1;
 1729|    537|  if ((newptr = realloc(rar->filename_save, newsize)) == NULL)
  ------------------
  |  Branch (1729:7): [True: 0, False: 537]
  ------------------
 1730|      0|  {
 1731|      0|    archive_set_error(&a->archive, ENOMEM, "Couldn't allocate memory");
 1732|      0|    return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1733|      0|  }
 1734|    537|  rar->filename_save = newptr;
 1735|    537|  memcpy(rar->filename_save, rar->filename, newsize);
 1736|    537|  rar->filename_save_size = filename_size;
 1737|       |
 1738|       |  /* Set info for seeking */
 1739|    537|  free(rar->dbo);
 1740|    537|  if ((rar->dbo = calloc(1, sizeof(*rar->dbo))) == NULL)
  ------------------
  |  Branch (1740:7): [True: 0, False: 537]
  ------------------
 1741|      0|  {
 1742|      0|    archive_set_error(&a->archive, ENOMEM, "Couldn't allocate memory");
 1743|      0|    return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1744|      0|  }
 1745|    537|  rar->dbo[0].header_size = header_size;
 1746|    537|  rar->dbo[0].start_offset = -1;
 1747|    537|  rar->dbo[0].end_offset = -1;
 1748|    537|  rar->cursor = 0;
 1749|    537|  rar->nodes = 1;
 1750|       |
 1751|    537|  if (rar->file_flags & FHD_SALT)
  ------------------
  |  |   88|    537|#define FHD_SALT         0x0400
  ------------------
  |  Branch (1751:7): [True: 182, False: 355]
  ------------------
 1752|    182|  {
 1753|    182|    if (p + 8 > endp) {
  ------------------
  |  Branch (1753:9): [True: 0, False: 182]
  ------------------
 1754|      0|      archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1755|      0|        "Invalid header size");
 1756|      0|      return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1757|      0|    }
 1758|    182|    memcpy(rar->salt, p, 8);
 1759|    182|    p += 8;
 1760|    182|  }
 1761|       |
 1762|    537|  if (rar->file_flags & FHD_EXTTIME) {
  ------------------
  |  |   90|    537|#define FHD_EXTTIME      0x1000
  ------------------
  |  Branch (1762:7): [True: 179, False: 358]
  ------------------
 1763|    179|    if (read_exttime(p, rar, endp) < 0) {
  ------------------
  |  Branch (1763:9): [True: 0, False: 179]
  ------------------
 1764|      0|      archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1765|      0|        "Invalid header size");
 1766|      0|      return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1767|      0|    }
 1768|    179|  }
 1769|       |
 1770|    537|  __archive_read_consume(a, header_size - 7);
 1771|    537|  if (rar->packed_size > INT64_MAX - a->filter->position) {
  ------------------
  |  Branch (1771:7): [True: 0, False: 537]
  ------------------
 1772|      0|    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1773|      0|                      "Unable to store offsets");
 1774|      0|    return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1775|      0|  }
 1776|    537|  rar->dbo[0].start_offset = a->filter->position;
 1777|    537|  rar->dbo[0].end_offset = rar->dbo[0].start_offset + rar->packed_size;
 1778|       |
 1779|    537|  switch(file_header.host_os)
 1780|    537|  {
 1781|    411|  case OS_MSDOS:
  ------------------
  |  |  105|    411|#define OS_MSDOS  0
  ------------------
  |  Branch (1781:3): [True: 411, False: 126]
  ------------------
 1782|    430|  case OS_OS2:
  ------------------
  |  |  106|    430|#define OS_OS2    1
  ------------------
  |  Branch (1782:3): [True: 19, False: 518]
  ------------------
 1783|    460|  case OS_WIN32:
  ------------------
  |  |  107|    460|#define OS_WIN32  2
  ------------------
  |  Branch (1783:3): [True: 30, False: 507]
  ------------------
 1784|    460|    rar->mode = (__LA_MODE_T)archive_le32dec(file_header.file_attr);
 1785|    460|    if (rar->mode & FILE_ATTRIBUTE_DIRECTORY)
  ------------------
  |  |  159|    460|#define FILE_ATTRIBUTE_DIRECTORY 0x10
  ------------------
  |  Branch (1785:9): [True: 17, False: 443]
  ------------------
 1786|     17|      rar->mode = AE_IFDIR | S_IXUSR | S_IXGRP | S_IXOTH;
  ------------------
  |  |  221|     17|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 1787|    443|    else
 1788|    443|      rar->mode = AE_IFREG;
  ------------------
  |  |  216|    443|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1789|    460|    rar->mode |= S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH;
 1790|    460|    break;
 1791|       |
 1792|     68|  case OS_UNIX:
  ------------------
  |  |  108|     68|#define OS_UNIX   3
  ------------------
  |  Branch (1792:3): [True: 68, False: 469]
  ------------------
 1793|     77|  case OS_MAC_OS:
  ------------------
  |  |  109|     77|#define OS_MAC_OS 4
  ------------------
  |  Branch (1793:3): [True: 9, False: 528]
  ------------------
 1794|     77|  case OS_BEOS:
  ------------------
  |  |  110|     77|#define OS_BEOS   5
  ------------------
  |  Branch (1794:3): [True: 0, False: 537]
  ------------------
 1795|     77|    rar->mode = (__LA_MODE_T)archive_le32dec(file_header.file_attr);
 1796|     77|    break;
 1797|       |
 1798|      0|  default:
  ------------------
  |  Branch (1798:3): [True: 0, False: 537]
  ------------------
 1799|      0|    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1800|      0|                      "Unknown file attributes from RAR file's host OS");
 1801|      0|    return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1802|    537|  }
 1803|       |
 1804|    537|  rar->bytes_uncopied = rar->bytes_unconsumed = 0;
 1805|    537|  rar->lzss.position = rar->offset = 0;
 1806|    537|  rar->offset_seek = 0;
 1807|    537|  rar->dictionary_size = 0;
 1808|    537|  rar->offset_outgoing = 0;
 1809|    537|  rar->br.cache_avail = 0;
 1810|    537|  rar->br.avail_in = 0;
 1811|    537|  rar->br.next_in = NULL;
 1812|    537|  rar->crc_calculated = 0;
 1813|    537|  rar->entry_eof = 0;
 1814|    537|  rar->valid = 1;
 1815|    537|  rar->is_ppmd_block = 0;
 1816|    537|  rar->start_new_table = 1;
 1817|    537|  free(rar->unp_buffer);
 1818|    537|  rar->unp_buffer = NULL;
 1819|    537|  rar->unp_offset = 0;
 1820|    537|  rar->unp_buffer_size = UNP_BUFFER_SIZE;
  ------------------
  |  |  155|    537|#define UNP_BUFFER_SIZE   (128 * 1024)
  ------------------
 1821|    537|  memset(rar->lengthtable, 0, sizeof(rar->lengthtable));
 1822|    537|  __archive_ppmd7_functions.Ppmd7_Free(&rar->ppmd7_context);
 1823|    537|  rar->ppmd_valid = rar->ppmd_eod = 0;
 1824|    537|  rar->filters.filterstart = INT64_MAX;
 1825|       |
 1826|    537|  archive_entry_set_mtime(entry, rar->mtime, rar->mnsec);
 1827|    537|  archive_entry_set_ctime(entry, rar->ctime, rar->cnsec);
 1828|    537|  archive_entry_set_atime(entry, rar->atime, rar->ansec);
 1829|    537|  archive_entry_set_size(entry, rar->unp_size);
 1830|    537|  archive_entry_set_mode(entry, rar->mode);
 1831|       |
 1832|    537|  if (archive_entry_copy_pathname_l(entry, filename, filename_size, fn_sconv))
  ------------------
  |  |   80|    537|#define archive_entry_copy_pathname_l	_archive_entry_copy_pathname_l
  ------------------
  |  Branch (1832:7): [True: 150, False: 387]
  ------------------
 1833|    150|  {
 1834|    150|    if (errno == ENOMEM)
  ------------------
  |  Branch (1834:9): [True: 0, False: 150]
  ------------------
 1835|      0|    {
 1836|      0|      archive_set_error(&a->archive, ENOMEM,
 1837|      0|                        "Can't allocate memory for Pathname");
 1838|      0|      return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1839|      0|    }
 1840|    150|    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    150|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1841|    150|                      "Pathname cannot be converted from %s to current locale",
 1842|    150|                      archive_string_conversion_charset_name(fn_sconv));
 1843|    150|    ret = (ARCHIVE_WARN);
  ------------------
  |  |  235|    150|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1844|    150|  }
 1845|       |
 1846|    537|  if (((rar->mode) & AE_IFMT) == AE_IFLNK)
  ------------------
  |  |  215|    537|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
                if (((rar->mode) & AE_IFMT) == AE_IFLNK)
  ------------------
  |  |  217|    537|#define AE_IFLNK	((__LA_MODE_T)0120000)
  ------------------
  |  Branch (1846:7): [True: 0, False: 537]
  ------------------
 1847|      0|  {
 1848|       |    /* Make sure a symbolic-link file does not have its body. */
 1849|      0|    rar->bytes_remaining = 0;
 1850|      0|    archive_entry_set_size(entry, 0);
 1851|       |
 1852|       |    /* Read a symbolic-link name. */
 1853|      0|    if ((ret2 = read_symlink_stored(a, entry, sconv)) < (ARCHIVE_WARN))
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (1853:9): [True: 0, False: 0]
  ------------------
 1854|      0|      return ret2;
 1855|      0|    if (ret > ret2)
  ------------------
  |  Branch (1855:9): [True: 0, False: 0]
  ------------------
 1856|      0|      ret = ret2;
 1857|      0|  }
 1858|       |
 1859|    537|  if (rar->bytes_remaining == 0)
  ------------------
  |  Branch (1859:7): [True: 358, False: 179]
  ------------------
 1860|    358|    rar->entry_eof = 1;
 1861|       |
 1862|    537|  return ret;
 1863|    537|}
archive_read_support_format_rar.c:get_time:
 1867|  1.93k|{
 1868|  1.93k|  struct tm tm;
 1869|  1.93k|  tm.tm_sec = 2 * (ttime & 0x1f);
 1870|  1.93k|  tm.tm_min = (ttime >> 5) & 0x3f;
 1871|  1.93k|  tm.tm_hour = (ttime >> 11) & 0x1f;
 1872|  1.93k|  tm.tm_mday = (ttime >> 16) & 0x1f;
 1873|  1.93k|  tm.tm_mon = ((ttime >> 21) & 0x0f) - 1;
 1874|  1.93k|  tm.tm_year = ((ttime >> 25) & 0x7f) + 80;
 1875|  1.93k|  tm.tm_isdst = -1;
 1876|  1.93k|  return mktime(&tm);
 1877|  1.93k|}
archive_read_support_format_rar.c:read_exttime:
 1881|    179|{
 1882|    179|  unsigned rmode, flags, rem, j, count;
 1883|    179|  int ttime, i;
 1884|    179|  struct tm *tm;
 1885|    179|  time_t t;
 1886|    179|  long nsec;
 1887|    179|#if defined(HAVE_LOCALTIME_R) || defined(HAVE_LOCALTIME_S)
 1888|    179|  struct tm tmbuf;
 1889|    179|#endif
 1890|       |
 1891|    179|  if (p + 2 > endp)
  ------------------
  |  Branch (1891:7): [True: 0, False: 179]
  ------------------
 1892|      0|    return (-1);
 1893|    179|  flags = archive_le16dec(p);
 1894|    179|  p += 2;
 1895|       |
 1896|    895|  for (i = 3; i >= 0; i--)
  ------------------
  |  Branch (1896:15): [True: 716, False: 179]
  ------------------
 1897|    716|  {
 1898|    716|    t = 0;
 1899|    716|    if (i == 3)
  ------------------
  |  Branch (1899:9): [True: 179, False: 537]
  ------------------
 1900|    179|      t = rar->mtime;
 1901|    716|    rmode = flags >> i * 4;
 1902|    716|    if (rmode & 8)
  ------------------
  |  Branch (1902:9): [True: 492, False: 224]
  ------------------
 1903|    492|    {
 1904|    492|      if (!t)
  ------------------
  |  Branch (1904:11): [True: 359, False: 133]
  ------------------
 1905|    359|      {
 1906|    359|        if (p + 4 > endp)
  ------------------
  |  Branch (1906:13): [True: 0, False: 359]
  ------------------
 1907|      0|          return (-1);
 1908|    359|        ttime = archive_le32dec(p);
 1909|    359|        t = get_time(ttime);
 1910|    359|        p += 4;
 1911|    359|      }
 1912|    492|      rem = 0;
 1913|    492|      count = rmode & 3;
 1914|    492|      if (p + count > endp)
  ------------------
  |  Branch (1914:11): [True: 0, False: 492]
  ------------------
 1915|      0|        return (-1);
 1916|    868|      for (j = 0; j < count; j++)
  ------------------
  |  Branch (1916:19): [True: 376, False: 492]
  ------------------
 1917|    376|      {
 1918|    376|        rem = (((unsigned)(unsigned char)*p) << 16) | (rem >> 8);
 1919|    376|        p++;
 1920|    376|      }
 1921|       |#if defined(HAVE_LOCALTIME_S)
 1922|       |      tm = localtime_s(&tmbuf, &t) ? NULL : &tmbuf;
 1923|       |#elif defined(HAVE_LOCALTIME_R)
 1924|       |      tm = localtime_r(&t, &tmbuf);
 1925|       |#else
 1926|       |      tm = localtime(&t);
 1927|       |#endif
 1928|    492|      nsec = tm->tm_sec + rem / NS_UNIT;
  ------------------
  |  |  124|    492|#define NS_UNIT 10000000
  ------------------
 1929|    492|      if (rmode & 4)
  ------------------
  |  Branch (1929:11): [True: 15, False: 477]
  ------------------
 1930|     15|      {
 1931|     15|        tm->tm_sec++;
 1932|     15|        t = mktime(tm);
 1933|     15|      }
 1934|    492|      if (i == 3)
  ------------------
  |  Branch (1934:11): [True: 133, False: 359]
  ------------------
 1935|    133|      {
 1936|    133|        rar->mtime = t;
 1937|    133|        rar->mnsec = nsec;
 1938|    133|      }
 1939|    359|      else if (i == 2)
  ------------------
  |  Branch (1939:16): [True: 111, False: 248]
  ------------------
 1940|    111|      {
 1941|    111|        rar->ctime = t;
 1942|    111|        rar->cnsec = nsec;
 1943|    111|      }
 1944|    248|      else if (i == 1)
  ------------------
  |  Branch (1944:16): [True: 142, False: 106]
  ------------------
 1945|    142|      {
 1946|    142|        rar->atime = t;
 1947|    142|        rar->ansec = nsec;
 1948|    142|      }
 1949|    106|      else
 1950|    106|      {
 1951|    106|        rar->arctime = t;
 1952|    106|        rar->arcnsec = nsec;
 1953|    106|      }
 1954|    492|    }
 1955|    716|  }
 1956|    179|  return (0);
 1957|    179|}
archive_read_support_format_rar.c:rar_read_ahead:
 3226|  13.4k|{
 3227|  13.4k|  struct rar *rar = (struct rar *)(a->format->data);
 3228|  13.4k|  const void *h;
 3229|  13.4k|  int ret;
 3230|       |
 3231|  14.1k|again:
 3232|  14.1k|  h = __archive_read_ahead(a, min, avail);
 3233|       |
 3234|  14.1k|  if (avail)
  ------------------
  |  Branch (3234:7): [True: 14.1k, False: 0]
  ------------------
 3235|  14.1k|  {
 3236|  14.1k|    if (a->archive.read_data_is_posix_read && *avail > (ssize_t)a->archive.read_data_requested)
  ------------------
  |  Branch (3236:9): [True: 14.1k, False: 0]
  |  Branch (3236:47): [True: 13.3k, False: 801]
  ------------------
 3237|  13.3k|      *avail = a->archive.read_data_requested;
 3238|  14.1k|    if (*avail > rar->bytes_remaining)
  ------------------
  |  Branch (3238:9): [True: 1.44k, False: 12.6k]
  ------------------
 3239|  1.44k|      *avail = (ssize_t)rar->bytes_remaining;
 3240|  14.1k|    if (*avail < 0)
  ------------------
  |  Branch (3240:9): [True: 0, False: 14.1k]
  ------------------
 3241|      0|      return NULL;
 3242|  14.1k|    else if (*avail == 0 && rar->main_flags & MHD_VOLUME &&
  ------------------
  |  |   65|  14.9k|#define MHD_VOLUME       0x0001
  ------------------
  |  Branch (3242:14): [True: 835, False: 13.2k]
  |  Branch (3242:29): [True: 734, False: 101]
  ------------------
 3243|    734|      rar->file_flags & FHD_SPLIT_AFTER)
  ------------------
  |  |   82|    734|#define FHD_SPLIT_AFTER  0x0002
  ------------------
  |  Branch (3243:7): [True: 716, False: 18]
  ------------------
 3244|    716|    {
 3245|    716|      rar->filename_must_match = 1;
 3246|    716|      ret = archive_read_format_rar_read_header(a, a->entry);
 3247|    716|      if (ret == (ARCHIVE_EOF))
  ------------------
  |  |  232|    716|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (3247:11): [True: 10, False: 706]
  ------------------
 3248|     10|      {
 3249|     10|        rar->has_endarc_header = 1;
 3250|     10|        ret = archive_read_format_rar_read_header(a, a->entry);
 3251|     10|      }
 3252|    716|      rar->filename_must_match = 0;
 3253|    716|      if (ret != (ARCHIVE_OK))
  ------------------
  |  |  233|    716|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3253:11): [True: 39, False: 677]
  ------------------
 3254|     39|        return NULL;
 3255|    677|      goto again;
 3256|    716|    }
 3257|  14.1k|  }
 3258|  13.4k|  return h;
 3259|  14.1k|}
archive_read_support_format_rar.c:archive_read_format_rar_read_data:
 1103|  7.87k|{
 1104|  7.87k|  struct rar *rar = (struct rar *)(a->format->data);
 1105|  7.87k|  int ret;
 1106|       |
 1107|  7.87k|  if (rar->has_encrypted_entries == ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW) {
  ------------------
  |  |  411|  7.87k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  |  Branch (1107:7): [True: 0, False: 7.87k]
  ------------------
 1108|      0|    rar->has_encrypted_entries = 0;
 1109|      0|  }
 1110|       |
 1111|  7.87k|  if (rar->bytes_unconsumed > 0) {
  ------------------
  |  Branch (1111:7): [True: 3.24k, False: 4.62k]
  ------------------
 1112|       |      /* Consume as much as the decompressor actually used. */
 1113|  3.24k|      __archive_read_consume(a, rar->bytes_unconsumed);
 1114|  3.24k|      rar->bytes_unconsumed = 0;
 1115|  3.24k|  }
 1116|       |
 1117|  7.87k|  *buff = NULL;
 1118|  7.87k|  if (rar->entry_eof || rar->offset_seek >= rar->unp_size) {
  ------------------
  |  Branch (1118:7): [True: 619, False: 7.25k]
  |  Branch (1118:25): [True: 11, False: 7.24k]
  ------------------
 1119|    630|    *size = 0;
 1120|    630|    *offset = rar->offset;
 1121|    630|    return (ARCHIVE_EOF);
  ------------------
  |  |  232|    630|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1122|    630|  }
 1123|       |
 1124|  7.24k|  switch (rar->compression_method)
 1125|  7.24k|  {
 1126|    757|  case COMPRESS_METHOD_STORE:
  ------------------
  |  |  113|    757|#define COMPRESS_METHOD_STORE   0x30
  ------------------
  |  Branch (1126:3): [True: 757, False: 6.48k]
  ------------------
 1127|    757|    ret = read_data_stored(a, buff, size, offset);
 1128|    757|    break;
 1129|       |
 1130|  1.00k|  case COMPRESS_METHOD_FASTEST:
  ------------------
  |  |  115|  1.00k|#define COMPRESS_METHOD_FASTEST 0x31
  ------------------
  |  Branch (1130:3): [True: 1.00k, False: 6.24k]
  ------------------
 1131|  1.13k|  case COMPRESS_METHOD_FAST:
  ------------------
  |  |  116|  1.13k|#define COMPRESS_METHOD_FAST    0x32
  ------------------
  |  Branch (1131:3): [True: 139, False: 7.10k]
  ------------------
 1132|  2.46k|  case COMPRESS_METHOD_NORMAL:
  ------------------
  |  |  117|  2.46k|#define COMPRESS_METHOD_NORMAL  0x33
  ------------------
  |  Branch (1132:3): [True: 1.32k, False: 5.92k]
  ------------------
 1133|  3.40k|  case COMPRESS_METHOD_GOOD:
  ------------------
  |  |  119|  3.40k|#define COMPRESS_METHOD_GOOD    0x34
  ------------------
  |  Branch (1133:3): [True: 937, False: 6.30k]
  ------------------
 1134|  6.48k|  case COMPRESS_METHOD_BEST:
  ------------------
  |  |  120|  6.48k|#define COMPRESS_METHOD_BEST    0x35
  ------------------
  |  Branch (1134:3): [True: 3.08k, False: 4.15k]
  ------------------
 1135|  6.48k|    ret = read_data_compressed(a, buff, size, offset, 0);
 1136|  6.48k|    if (ret != ARCHIVE_OK && ret != ARCHIVE_WARN) {
  ------------------
  |  |  233|  12.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
                  if (ret != ARCHIVE_OK && ret != ARCHIVE_WARN) {
  ------------------
  |  |  235|    124|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (1136:9): [True: 124, False: 6.36k]
  |  Branch (1136:30): [True: 124, False: 0]
  ------------------
 1137|    124|      __archive_ppmd7_functions.Ppmd7_Free(&rar->ppmd7_context);
 1138|    124|      rar->start_new_table = 1;
 1139|    124|      rar->ppmd_valid = 0;
 1140|    124|    }
 1141|  6.48k|    break;
 1142|       |
 1143|      1|  default:
  ------------------
  |  Branch (1143:3): [True: 1, False: 7.24k]
  ------------------
 1144|      1|    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1145|      1|                      "Unsupported compression method for RAR file");
 1146|      1|    ret = ARCHIVE_FAILED;
  ------------------
  |  |  237|      1|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1147|      1|    break;
 1148|  7.24k|  }
 1149|  7.24k|  return (ret);
 1150|  7.24k|}
archive_read_support_format_rar.c:read_data_stored:
 2004|    757|{
 2005|    757|  struct rar *rar;
 2006|    757|  ssize_t bytes_avail;
 2007|       |
 2008|    757|  rar = (struct rar *)(a->format->data);
 2009|    757|  if (rar->bytes_remaining == 0 &&
  ------------------
  |  Branch (2009:7): [True: 715, False: 42]
  ------------------
 2010|    715|    !(rar->main_flags & MHD_VOLUME && rar->file_flags & FHD_SPLIT_AFTER))
  ------------------
  |  |   65|  1.43k|#define MHD_VOLUME       0x0001
  ------------------
                  !(rar->main_flags & MHD_VOLUME && rar->file_flags & FHD_SPLIT_AFTER))
  ------------------
  |  |   82|    684|#define FHD_SPLIT_AFTER  0x0002
  ------------------
  |  Branch (2010:7): [True: 684, False: 31]
  |  Branch (2010:39): [True: 683, False: 1]
  ------------------
 2011|     32|  {
 2012|     32|    *buff = NULL;
 2013|     32|    *size = 0;
 2014|     32|    *offset = rar->offset;
 2015|     32|    if (rar->file_crc != rar->crc_calculated) {
  ------------------
  |  Branch (2015:9): [True: 32, False: 0]
  ------------------
 2016|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 2017|       |      archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
 2018|       |                        "File CRC error");
 2019|       |      return (ARCHIVE_FAILED);
 2020|       |#endif
 2021|     32|    }
 2022|     32|    rar->entry_eof = 1;
 2023|     32|    return (ARCHIVE_EOF);
  ------------------
  |  |  232|     32|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2024|     32|  }
 2025|       |
 2026|    725|  *buff = rar_read_ahead(a, 1, &bytes_avail);
 2027|    725|  if (bytes_avail <= 0)
  ------------------
  |  Branch (2027:7): [True: 8, False: 717]
  ------------------
 2028|      8|  {
 2029|      8|    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      8|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2030|      8|                      "Truncated RAR file data");
 2031|      8|    return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      8|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2032|      8|  }
 2033|       |
 2034|    717|  *size = bytes_avail;
 2035|    717|  *offset = rar->offset;
 2036|    717|  rar->offset += bytes_avail;
 2037|    717|  rar->offset_seek += bytes_avail;
 2038|    717|  rar->bytes_remaining -= bytes_avail;
 2039|    717|  rar->bytes_unconsumed = bytes_avail;
 2040|       |  /* Calculate File CRC. */
 2041|    717|  rar->crc_calculated = crc32(rar->crc_calculated, *buff,
 2042|    717|    (unsigned)bytes_avail);
 2043|    717|  return (ARCHIVE_OK);
  ------------------
  |  |  233|    717|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2044|    725|}
archive_read_support_format_rar.c:read_data_compressed:
 2049|  9.79k|{
 2050|  9.79k|  if (looper++ > MAX_COMPRESS_DEPTH)
  ------------------
  |  |  166|  9.79k|#define MAX_COMPRESS_DEPTH 1024
  ------------------
  |  Branch (2050:7): [True: 1, False: 9.79k]
  ------------------
 2051|      1|    return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      1|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2052|       |
 2053|  9.79k|  struct rar *rar;
 2054|  9.79k|  int64_t start, end;
 2055|  9.79k|  size_t bs;
 2056|  9.79k|  int ret = (ARCHIVE_OK), sym, code, lzss_offset, length, i;
  ------------------
  |  |  233|  9.79k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2057|       |
 2058|  9.79k|  rar = (struct rar *)(a->format->data);
 2059|       |
 2060|  22.9k|  do {
 2061|  22.9k|    if (!rar->valid)
  ------------------
  |  Branch (2061:9): [True: 0, False: 22.9k]
  ------------------
 2062|      0|      return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2063|       |
 2064|  22.9k|    if (rar->filters.bytes_ready > 0)
  ------------------
  |  Branch (2064:9): [True: 4.86k, False: 18.0k]
  ------------------
 2065|  4.86k|    {
 2066|       |      /* Flush unp_buffer first */
 2067|  4.86k|      if (rar->unp_offset > 0)
  ------------------
  |  Branch (2067:11): [True: 2.40k, False: 2.46k]
  ------------------
 2068|  2.40k|      {
 2069|  2.40k|        *buff = rar->unp_buffer;
 2070|  2.40k|        *size = rar->unp_offset;
 2071|  2.40k|        rar->unp_offset = 0;
 2072|  2.40k|        *offset = rar->offset_outgoing;
 2073|  2.40k|        rar->offset_outgoing += *size;
 2074|  2.40k|      }
 2075|  2.46k|      else
 2076|  2.46k|      {
 2077|  2.46k|        *buff = rar->filters.bytes;
 2078|  2.46k|        *size = rar->filters.bytes_ready;
 2079|       |
 2080|  2.46k|        rar->offset += *size;
 2081|  2.46k|        *offset = rar->offset_outgoing;
 2082|  2.46k|        rar->offset_outgoing += *size;
 2083|       |
 2084|  2.46k|        rar->filters.bytes_ready -= *size;
 2085|  2.46k|        rar->filters.bytes += *size;
 2086|  2.46k|      }
 2087|  4.86k|      goto ending_block;
 2088|  4.86k|    }
 2089|       |
 2090|  18.0k|    if (rar->ppmd_eod ||
  ------------------
  |  Branch (2090:9): [True: 0, False: 18.0k]
  ------------------
 2091|  18.0k|       (rar->dictionary_size && rar->offset >= rar->unp_size))
  ------------------
  |  Branch (2091:9): [True: 17.9k, False: 125]
  |  Branch (2091:33): [True: 5, False: 17.9k]
  ------------------
 2092|      5|    {
 2093|      5|      if (rar->unp_offset > 0) {
  ------------------
  |  Branch (2093:11): [True: 2, False: 3]
  ------------------
 2094|       |        /*
 2095|       |         * We have unprocessed extracted data. write it out.
 2096|       |         */
 2097|      2|        *buff = rar->unp_buffer;
 2098|      2|        *size = rar->unp_offset;
 2099|      2|        *offset = rar->offset_outgoing;
 2100|      2|        rar->offset_outgoing += *size;
 2101|       |        /* Calculate File CRC. */
 2102|      2|        rar->crc_calculated = crc32(rar->crc_calculated, *buff,
 2103|      2|          (unsigned)*size);
 2104|      2|        rar->unp_offset = 0;
 2105|      2|        return (ARCHIVE_OK);
  ------------------
  |  |  233|      2|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2106|      2|      }
 2107|      3|      *buff = NULL;
 2108|      3|      *size = 0;
 2109|      3|      *offset = rar->offset;
 2110|      3|      if (rar->file_crc != rar->crc_calculated) {
  ------------------
  |  Branch (2110:11): [True: 3, False: 0]
  ------------------
 2111|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 2112|       |        archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
 2113|       |                          "File CRC error");
 2114|       |        return (ARCHIVE_FAILED);
 2115|       |#endif
 2116|      3|      }
 2117|      3|      rar->entry_eof = 1;
 2118|      3|      return (ARCHIVE_EOF);
  ------------------
  |  |  232|      3|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2119|      5|    }
 2120|       |
 2121|  18.0k|    if (!rar->is_ppmd_block && rar->dictionary_size && rar->bytes_uncopied > 0)
  ------------------
  |  Branch (2121:9): [True: 8.47k, False: 9.60k]
  |  Branch (2121:32): [True: 8.35k, False: 125]
  |  Branch (2121:56): [True: 1.49k, False: 6.86k]
  ------------------
 2122|  1.49k|    {
 2123|  1.49k|      if (rar->bytes_uncopied > (rar->unp_buffer_size - rar->unp_offset))
  ------------------
  |  Branch (2123:11): [True: 1.42k, False: 70]
  ------------------
 2124|  1.42k|        bs = rar->unp_buffer_size - rar->unp_offset;
 2125|     70|      else
 2126|     70|        bs = (size_t)rar->bytes_uncopied;
 2127|  1.49k|      ret = copy_from_lzss_window_to_unp(a, buff, rar->offset, bs);
 2128|  1.49k|      if (ret != ARCHIVE_OK)
  ------------------
  |  |  233|  1.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2128:11): [True: 0, False: 1.49k]
  ------------------
 2129|      0|        return (ret);
 2130|  1.49k|      rar->offset += bs;
 2131|  1.49k|      rar->bytes_uncopied -= bs;
 2132|  1.49k|      if (*buff != NULL) {
  ------------------
  |  Branch (2132:11): [True: 1.42k, False: 70]
  ------------------
 2133|  1.42k|        rar->unp_offset = 0;
 2134|  1.42k|        *size = rar->unp_buffer_size;
 2135|  1.42k|        *offset = rar->offset_outgoing;
 2136|  1.42k|        rar->offset_outgoing += *size;
 2137|       |        /* Calculate File CRC. */
 2138|  1.42k|        rar->crc_calculated = crc32(rar->crc_calculated, *buff,
 2139|  1.42k|          (unsigned)*size);
 2140|  1.42k|        return (ret);
 2141|  1.42k|      }
 2142|     70|      continue;
 2143|  1.49k|    }
 2144|       |
 2145|  16.5k|    if (rar->filters.lastend == rar->filters.filterstart)
  ------------------
  |  Branch (2145:9): [True: 2.48k, False: 14.0k]
  ------------------
 2146|  2.48k|    {
 2147|  2.48k|      if (!run_filters(a))
  ------------------
  |  Branch (2147:11): [True: 28, False: 2.46k]
  ------------------
 2148|     28|        return (ARCHIVE_FAILED);
  ------------------
  |  |  237|     28|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2149|  2.46k|      continue;
 2150|  2.48k|    }
 2151|       |
 2152|  14.0k|    if (!rar->br.next_in &&
  ------------------
  |  Branch (2152:9): [True: 128, False: 13.9k]
  ------------------
 2153|    128|      (ret = rar_br_preparation(a, &(rar->br))) < ARCHIVE_WARN)
  ------------------
  |  |  235|    128|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (2153:7): [True: 3, False: 125]
  ------------------
 2154|      3|      return (ret);
 2155|  14.0k|    if (rar->start_new_table && ((ret = parse_codes(a)) < (ARCHIVE_WARN)))
  ------------------
  |  |  235|  3.43k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (2155:9): [True: 3.43k, False: 10.6k]
  |  Branch (2155:33): [True: 7, False: 3.43k]
  ------------------
 2156|      7|      return (ret);
 2157|       |
 2158|  14.0k|    if (rar->is_ppmd_block)
  ------------------
  |  Branch (2158:9): [True: 9.60k, False: 4.48k]
  ------------------
 2159|  9.60k|    {
 2160|  9.60k|      if ((sym = __archive_ppmd7_functions.Ppmd7_DecodeSymbol(
  ------------------
  |  Branch (2160:11): [True: 0, False: 9.60k]
  ------------------
 2161|  9.60k|        &rar->ppmd7_context, &rar->range_dec.p)) < 0)
 2162|      0|      {
 2163|      0|        archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2164|      0|                          "Invalid symbol");
 2165|      0|        return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2166|      0|      }
 2167|  9.60k|      if(sym != rar->ppmd_escape)
  ------------------
  |  Branch (2167:10): [True: 6.29k, False: 3.30k]
  ------------------
 2168|  6.29k|      {
 2169|  6.29k|        lzss_emit_literal(rar, sym);
 2170|  6.29k|        rar->bytes_uncopied++;
 2171|  6.29k|      }
 2172|  3.30k|      else
 2173|  3.30k|      {
 2174|  3.30k|        if ((code = __archive_ppmd7_functions.Ppmd7_DecodeSymbol(
  ------------------
  |  Branch (2174:13): [True: 0, False: 3.30k]
  ------------------
 2175|  3.30k|          &rar->ppmd7_context, &rar->range_dec.p)) < 0)
 2176|      0|        {
 2177|      0|          archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2178|      0|                            "Invalid symbol");
 2179|      0|          return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2180|      0|        }
 2181|       |
 2182|  3.30k|        switch(code)
 2183|  3.30k|        {
 2184|  3.30k|          case 0:
  ------------------
  |  Branch (2184:11): [True: 3.30k, False: 0]
  ------------------
 2185|  3.30k|            rar->start_new_table = 1;
 2186|  3.30k|            return read_data_compressed(a, buff, size, offset, looper);
 2187|       |
 2188|      0|          case 2:
  ------------------
  |  Branch (2188:11): [True: 0, False: 3.30k]
  ------------------
 2189|      0|            rar->ppmd_eod = 1;/* End Of ppmd Data. */
 2190|      0|            continue;
 2191|       |
 2192|      0|          case 3:
  ------------------
  |  Branch (2192:11): [True: 0, False: 3.30k]
  ------------------
 2193|      0|            archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2194|      0|                              "Parsing filters is unsupported");
 2195|      0|            return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2196|       |
 2197|      0|          case 4:
  ------------------
  |  Branch (2197:11): [True: 0, False: 3.30k]
  ------------------
 2198|      0|            lzss_offset = 0;
 2199|      0|            for (i = 2; i >= 0; i--)
  ------------------
  |  Branch (2199:25): [True: 0, False: 0]
  ------------------
 2200|      0|            {
 2201|      0|              if ((code = __archive_ppmd7_functions.Ppmd7_DecodeSymbol(
  ------------------
  |  Branch (2201:19): [True: 0, False: 0]
  ------------------
 2202|      0|                &rar->ppmd7_context, &rar->range_dec.p)) < 0)
 2203|      0|              {
 2204|      0|                archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2205|      0|                                  "Invalid symbol");
 2206|      0|                return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2207|      0|              }
 2208|      0|              lzss_offset |= code << (i * 8);
 2209|      0|            }
 2210|      0|            if ((length = __archive_ppmd7_functions.Ppmd7_DecodeSymbol(
  ------------------
  |  Branch (2210:17): [True: 0, False: 0]
  ------------------
 2211|      0|              &rar->ppmd7_context, &rar->range_dec.p)) < 0)
 2212|      0|            {
 2213|      0|              archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2214|      0|                                "Invalid symbol");
 2215|      0|              return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2216|      0|            }
 2217|      0|            lzss_emit_match(rar, lzss_offset + 2, length + 32);
 2218|      0|            rar->bytes_uncopied += length + 32;
 2219|      0|            break;
 2220|       |
 2221|      0|          case 5:
  ------------------
  |  Branch (2221:11): [True: 0, False: 3.30k]
  ------------------
 2222|      0|            if ((length = __archive_ppmd7_functions.Ppmd7_DecodeSymbol(
  ------------------
  |  Branch (2222:17): [True: 0, False: 0]
  ------------------
 2223|      0|              &rar->ppmd7_context, &rar->range_dec.p)) < 0)
 2224|      0|            {
 2225|      0|              archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2226|      0|                                "Invalid symbol");
 2227|      0|              return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2228|      0|            }
 2229|      0|            lzss_emit_match(rar, 1, length + 4);
 2230|      0|            rar->bytes_uncopied += length + 4;
 2231|      0|            break;
 2232|       |
 2233|      0|         default:
  ------------------
  |  Branch (2233:10): [True: 0, False: 3.30k]
  ------------------
 2234|      0|           lzss_emit_literal(rar, sym);
 2235|      0|           rar->bytes_uncopied++;
 2236|  3.30k|        }
 2237|  3.30k|      }
 2238|  9.60k|    }
 2239|  4.48k|    else
 2240|  4.48k|    {
 2241|  4.48k|      start = rar->offset;
 2242|  4.48k|      end = start + rar->dictionary_size;
 2243|       |
 2244|       |      /* We don't want to overflow the window and overwrite data that we write
 2245|       |       * at 'start'. Therefore, reduce the end length by the maximum match size,
 2246|       |       * which is 260 bytes. You can compute this maximum by looking at the
 2247|       |       * definition of 'expand', in particular when 'symbol >= 271'. */
 2248|       |      /* NOTE: It's possible for 'dictionary_size' to be less than this 260
 2249|       |       * value, however that will only be the case when 'unp_size' is small,
 2250|       |       * which should only happen when the entry size is small and there's no
 2251|       |       * risk of overflowing the buffer */
 2252|  4.48k|      if (rar->dictionary_size > 260) {
  ------------------
  |  Branch (2252:11): [True: 4.48k, False: 0]
  ------------------
 2253|  4.48k|        end -= 260;
 2254|  4.48k|      }
 2255|       |
 2256|  4.48k|      if (rar->filters.filterstart < end) {
  ------------------
  |  Branch (2256:11): [True: 1.18k, False: 3.30k]
  ------------------
 2257|  1.18k|        end = rar->filters.filterstart;
 2258|  1.18k|      }
 2259|       |
 2260|  4.48k|      ret = expand(a, &end);
 2261|  4.48k|      if (ret != ARCHIVE_OK)
  ------------------
  |  |  233|  4.48k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2261:11): [True: 76, False: 4.40k]
  ------------------
 2262|     76|        return (ret);
 2263|       |
 2264|  4.40k|      rar->bytes_uncopied = end - start;
 2265|  4.40k|      rar->filters.lastend = end;
 2266|  4.40k|      if (rar->filters.lastend != rar->filters.filterstart && rar->bytes_uncopied == 0) {
  ------------------
  |  Branch (2266:11): [True: 1.91k, False: 2.49k]
  |  Branch (2266:63): [True: 1, False: 1.91k]
  ------------------
 2267|       |          /* Broken RAR files cause this case.
 2268|       |          * NOTE: If this case were possible on a normal RAR file
 2269|       |          * we would find out where it was actually bad and
 2270|       |          * what we would do to solve it. */
 2271|      1|          archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2272|      1|                            "Internal error extracting RAR file");
 2273|      1|          return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      1|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2274|      1|      }
 2275|  4.40k|    }
 2276|  10.7k|    if (rar->bytes_uncopied > (rar->unp_buffer_size - rar->unp_offset))
  ------------------
  |  Branch (2276:9): [True: 72, False: 10.6k]
  ------------------
 2277|     72|      bs = rar->unp_buffer_size - rar->unp_offset;
 2278|  10.6k|    else
 2279|  10.6k|      bs = (size_t)rar->bytes_uncopied;
 2280|  10.7k|    ret = copy_from_lzss_window_to_unp(a, buff, rar->offset, bs);
 2281|  10.7k|    if (ret != ARCHIVE_OK)
  ------------------
  |  |  233|  10.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2281:9): [True: 5, False: 10.7k]
  ------------------
 2282|      5|      return (ret);
 2283|  10.7k|    rar->offset += bs;
 2284|  10.7k|    rar->bytes_uncopied -= bs;
 2285|       |    /*
 2286|       |     * If *buff is NULL, it means unp_buffer is not full.
 2287|       |     * So we have to continue extracting a RAR file.
 2288|       |     */
 2289|  13.2k|  } while (*buff == NULL);
  ------------------
  |  Branch (2289:12): [True: 13.1k, False: 72]
  ------------------
 2290|       |
 2291|     72|  rar->unp_offset = 0;
 2292|     72|  *size = rar->unp_buffer_size;
 2293|     72|  *offset = rar->offset_outgoing;
 2294|     72|  rar->offset_outgoing += *size;
 2295|  4.93k|ending_block:
 2296|       |  /* Calculate File CRC. */
 2297|  4.93k|  rar->crc_calculated = crc32(rar->crc_calculated, *buff, (unsigned)*size);
 2298|  4.93k|  return ret;
 2299|     72|}
archive_read_support_format_rar.c:copy_from_lzss_window_to_unp:
 3169|  12.1k|{
 3170|  12.1k|  int windowoffs, firstpart;
 3171|  12.1k|  struct rar *rar = (struct rar *)(a->format->data);
 3172|       |
 3173|  12.1k|  if (length > rar->unp_buffer_size)
  ------------------
  |  Branch (3173:7): [True: 5, False: 12.1k]
  ------------------
 3174|      5|  {
 3175|      5|    goto fatal;
 3176|      5|  }
 3177|       |
 3178|  12.1k|  if (!rar->unp_buffer)
  ------------------
  |  Branch (3178:7): [True: 112, False: 12.0k]
  ------------------
 3179|    112|  {
 3180|    112|    if ((rar->unp_buffer = malloc(rar->unp_buffer_size)) == NULL)
  ------------------
  |  Branch (3180:9): [True: 0, False: 112]
  ------------------
 3181|      0|    {
 3182|      0|      archive_set_error(&a->archive, ENOMEM,
 3183|      0|                        "Unable to allocate memory for uncompressed data");
 3184|      0|      return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3185|      0|    }
 3186|    112|  }
 3187|       |
 3188|  12.1k|  windowoffs = lzss_offset_for_position(&rar->lzss, startpos);
 3189|  12.1k|  if(windowoffs + length <= (size_t)lzss_size(&rar->lzss)) {
  ------------------
  |  Branch (3189:6): [True: 11.6k, False: 570]
  ------------------
 3190|  11.6k|    memcpy(&rar->unp_buffer[rar->unp_offset], &rar->lzss.window[windowoffs],
 3191|  11.6k|           length);
 3192|  11.6k|  } else if (length <= (size_t)lzss_size(&rar->lzss)) {
  ------------------
  |  Branch (3192:14): [True: 570, False: 0]
  ------------------
 3193|    570|    firstpart = lzss_size(&rar->lzss) - windowoffs;
 3194|    570|    if (firstpart < 0) {
  ------------------
  |  Branch (3194:9): [True: 0, False: 570]
  ------------------
 3195|      0|      archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3196|      0|                        "Bad RAR file data");
 3197|      0|      return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3198|      0|    }
 3199|    570|    if ((size_t)firstpart < length) {
  ------------------
  |  Branch (3199:9): [True: 570, False: 0]
  ------------------
 3200|    570|      memcpy(&rar->unp_buffer[rar->unp_offset],
 3201|    570|             &rar->lzss.window[windowoffs], firstpart);
 3202|    570|      memcpy(&rar->unp_buffer[rar->unp_offset + firstpart],
 3203|    570|             &rar->lzss.window[0], length - firstpart);
 3204|    570|    } else {
 3205|      0|      memcpy(&rar->unp_buffer[rar->unp_offset],
 3206|      0|             &rar->lzss.window[windowoffs], length);
 3207|      0|    }
 3208|    570|  } else {
 3209|      0|      goto fatal;
 3210|      0|  }
 3211|  12.1k|  rar->unp_offset += (unsigned int) length;
 3212|  12.1k|  if (rar->unp_offset >= rar->unp_buffer_size)
  ------------------
  |  Branch (3212:7): [True: 1.49k, False: 10.6k]
  ------------------
 3213|  1.49k|    *buffer = rar->unp_buffer;
 3214|  10.6k|  else
 3215|  10.6k|    *buffer = NULL;
 3216|  12.1k|  return (ARCHIVE_OK);
  ------------------
  |  |  233|  12.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3217|       |
 3218|      5|fatal:
 3219|      5|  archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      5|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3220|      5|                    "Bad RAR file data");
 3221|      5|  return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      5|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3222|  12.1k|}
archive_read_support_format_rar.c:lzss_offset_for_position:
  647|  18.8M|{
  648|  18.8M|  return (int)(pos & lzss->mask);
  649|  18.8M|}
archive_read_support_format_rar.c:lzss_size:
  641|  1.45M|{
  642|  1.45M|  return lzss->mask + 1;
  643|  1.45M|}
archive_read_support_format_rar.c:run_filters:
 3431|  2.48k|{
 3432|  2.48k|  struct rar *rar = (struct rar *)(a->format->data);
 3433|  2.48k|  struct rar_filters *filters = &rar->filters;
 3434|  2.48k|  struct rar_filter *filter = filters->stack;
 3435|  2.48k|  struct rar_filter *f;
 3436|  2.48k|  size_t start, end;
 3437|  2.48k|  int64_t tend;
 3438|  2.48k|  uint32_t lastfilteraddress;
 3439|  2.48k|  uint32_t lastfilterlength;
 3440|  2.48k|  int ret;
 3441|       |
 3442|  2.48k|  if (filters == NULL || filter == NULL)
  ------------------
  |  Branch (3442:7): [True: 0, False: 2.48k]
  |  Branch (3442:26): [True: 0, False: 2.48k]
  ------------------
 3443|      0|    return (0);
 3444|       |
 3445|  2.48k|  start = (size_t)filters->filterstart;
 3446|  2.48k|  end = start + filter->blocklength;
 3447|       |
 3448|  2.48k|  filters->filterstart = INT64_MAX;
 3449|  2.48k|  tend = (int64_t)end;
 3450|  2.48k|  ret = expand(a, &tend);
 3451|  2.48k|  if (ret != ARCHIVE_OK)
  ------------------
  |  |  233|  2.48k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3451:7): [True: 15, False: 2.47k]
  ------------------
 3452|     15|    return 0;
 3453|       |
 3454|       |  /* Check if filter stack was modified in expand() */
 3455|  2.47k|  ret = ARCHIVE_FATAL;
  ------------------
  |  |  239|  2.47k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3456|  2.47k|  f = filters->stack;
 3457|  2.47k|  while (f)
  ------------------
  |  Branch (3457:10): [True: 2.47k, False: 0]
  ------------------
 3458|  2.47k|  {
 3459|  2.47k|    if (f == filter)
  ------------------
  |  Branch (3459:9): [True: 2.47k, False: 0]
  ------------------
 3460|  2.47k|    {
 3461|  2.47k|      ret = ARCHIVE_OK;
  ------------------
  |  |  233|  2.47k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3462|  2.47k|      break;
 3463|  2.47k|    }
 3464|      0|    f = f->next;
 3465|      0|  }
 3466|  2.47k|  if (ret != ARCHIVE_OK)
  ------------------
  |  |  233|  2.47k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3466:7): [True: 0, False: 2.47k]
  ------------------
 3467|      0|    return 0;
 3468|       |
 3469|  2.47k|  if (tend < 0)
  ------------------
  |  Branch (3469:7): [True: 0, False: 2.47k]
  ------------------
 3470|      0|    return 0;
 3471|  2.47k|  end = (size_t)tend;
 3472|  2.47k|  if (end != start + filter->blocklength)
  ------------------
  |  Branch (3472:7): [True: 1, False: 2.47k]
  ------------------
 3473|      1|    return 0;
 3474|       |
 3475|  2.47k|  if (!filters->vm)
  ------------------
  |  Branch (3475:7): [True: 65, False: 2.40k]
  ------------------
 3476|     65|  {
 3477|     65|    filters->vm = calloc(1, sizeof(*filters->vm));
 3478|     65|    if (!filters->vm)
  ------------------
  |  Branch (3478:9): [True: 0, False: 65]
  ------------------
 3479|      0|      return 0;
 3480|     65|  }
 3481|       |
 3482|  2.47k|  if (filter->blocklength > VM_MEMORY_SIZE)
  ------------------
  |  |  140|  2.47k|#define VM_MEMORY_SIZE 0x40000
  ------------------
  |  Branch (3482:7): [True: 1, False: 2.47k]
  ------------------
 3483|      1|  {
 3484|      1|    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, "Bad RAR file data");
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3485|      1|    return 0;
 3486|      1|  }
 3487|       |
 3488|  2.47k|  ret = copy_from_lzss_window(a, filters->vm->memory, start, filter->blocklength);
 3489|  2.47k|  if (ret != ARCHIVE_OK)
  ------------------
  |  |  233|  2.47k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3489:7): [True: 0, False: 2.47k]
  ------------------
 3490|      0|    return 0;
 3491|  2.47k|  if (!execute_filter(a, filter, filters->vm, (size_t)rar->offset))
  ------------------
  |  Branch (3491:7): [True: 9, False: 2.46k]
  ------------------
 3492|      9|    return 0;
 3493|       |
 3494|  2.46k|  lastfilteraddress = filter->filteredblockaddress;
 3495|  2.46k|  lastfilterlength = filter->filteredblocklength;
 3496|  2.46k|  filters->stack = filter->next;
 3497|  2.46k|  filter->next = NULL;
 3498|  2.46k|  delete_filter(filter);
 3499|       |
 3500|  2.46k|  while ((filter = filters->stack) != NULL && (int64_t)filter->blockstartpos == filters->filterstart && filter->blocklength == lastfilterlength)
  ------------------
  |  Branch (3500:10): [True: 957, False: 1.50k]
  |  Branch (3500:47): [True: 0, False: 957]
  |  Branch (3500:105): [True: 0, False: 0]
  ------------------
 3501|      0|  {
 3502|      0|    memmove(&filters->vm->memory[0], &filters->vm->memory[lastfilteraddress], lastfilterlength);
 3503|      0|    if (!execute_filter(a, filter, filters->vm, (size_t)rar->offset))
  ------------------
  |  Branch (3503:9): [True: 0, False: 0]
  ------------------
 3504|      0|      return 0;
 3505|       |
 3506|      0|    lastfilteraddress = filter->filteredblockaddress;
 3507|      0|    lastfilterlength = filter->filteredblocklength;
 3508|      0|    filters->stack = filter->next;
 3509|      0|    filter->next = NULL;
 3510|      0|    delete_filter(filter);
 3511|      0|  }
 3512|       |
 3513|  2.46k|  if (filters->stack)
  ------------------
  |  Branch (3513:7): [True: 957, False: 1.50k]
  ------------------
 3514|    957|  {
 3515|    957|    if (filters->stack->blockstartpos < end)
  ------------------
  |  Branch (3515:9): [True: 2, False: 955]
  ------------------
 3516|      2|      return 0;
 3517|    955|    filters->filterstart = filters->stack->blockstartpos;
 3518|    955|  }
 3519|       |
 3520|  2.46k|  filters->lastend = end;
 3521|  2.46k|  filters->bytes = &filters->vm->memory[lastfilteraddress];
 3522|  2.46k|  filters->bytes_ready = lastfilterlength;
 3523|       |
 3524|  2.46k|  return 1;
 3525|  2.46k|}
archive_read_support_format_rar.c:copy_from_lzss_window:
 3141|  2.47k|{
 3142|  2.47k|  int windowoffs, firstpart;
 3143|  2.47k|  struct rar *rar = (struct rar *)(a->format->data);
 3144|       |
 3145|  2.47k|  windowoffs = lzss_offset_for_position(&rar->lzss, startpos);
 3146|  2.47k|  firstpart = lzss_size(&rar->lzss) - windowoffs;
 3147|  2.47k|  if (length > lzss_size(&rar->lzss)) {
  ------------------
  |  Branch (3147:7): [True: 0, False: 2.47k]
  ------------------
 3148|      0|    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3149|      0|                      "Bad RAR file data");
 3150|      0|    return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3151|      0|  }
 3152|  2.47k|  if (firstpart < 0) {
  ------------------
  |  Branch (3152:7): [True: 0, False: 2.47k]
  ------------------
 3153|      0|    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3154|      0|                      "Bad RAR file data");
 3155|      0|    return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3156|      0|  }
 3157|  2.47k|  if (firstpart < length) {
  ------------------
  |  Branch (3157:7): [True: 1, False: 2.47k]
  ------------------
 3158|      1|    memcpy(buffer, &rar->lzss.window[windowoffs], firstpart);
 3159|      1|    memcpy(buffer + firstpart, &rar->lzss.window[0], length - firstpart);
 3160|  2.47k|  } else {
 3161|  2.47k|    memcpy(buffer, &rar->lzss.window[windowoffs], length);
 3162|  2.47k|  }
 3163|  2.47k|  return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.47k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3164|  2.47k|}
archive_read_support_format_rar.c:execute_filter:
 3881|  2.47k|{
 3882|  2.47k|  if (filter->prog->fingerprint == 0x1D0E06077D)
  ------------------
  |  Branch (3882:7): [True: 962, False: 1.51k]
  ------------------
 3883|    962|    return execute_filter_delta(filter, vm);
 3884|  1.51k|  if (filter->prog->fingerprint == 0x35AD576887)
  ------------------
  |  Branch (3884:7): [True: 878, False: 632]
  ------------------
 3885|    878|    return execute_filter_e8(filter, vm, pos, 0);
 3886|    632|  if (filter->prog->fingerprint == 0x393CD7E57E)
  ------------------
  |  Branch (3886:7): [True: 0, False: 632]
  ------------------
 3887|      0|    return execute_filter_e8(filter, vm, pos, 1);
 3888|    632|  if (filter->prog->fingerprint == 0x951C2C5DC8)
  ------------------
  |  Branch (3888:7): [True: 632, False: 0]
  ------------------
 3889|    632|    return execute_filter_rgb(filter, vm);
 3890|      0|  if (filter->prog->fingerprint == 0xD8BC85E701)
  ------------------
  |  Branch (3890:7): [True: 0, False: 0]
  ------------------
 3891|      0|    return execute_filter_audio(filter, vm);
 3892|       |
 3893|      0|  archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, "No support for RAR VM program filter");
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3894|      0|  return 0;
 3895|      0|}
archive_read_support_format_rar.c:execute_filter_delta:
 3696|    962|{
 3697|    962|  uint32_t length = filter->initialregisters[4];
 3698|    962|  uint32_t numchannels = filter->initialregisters[0];
 3699|    962|  uint8_t *src, *dst;
 3700|    962|  uint32_t i, idx;
 3701|       |
 3702|    962|  if (length > PROGRAM_WORK_SIZE / 2)
  ------------------
  |  |  142|    962|#define PROGRAM_WORK_SIZE 0x3C000
  ------------------
  |  Branch (3702:7): [True: 0, False: 962]
  ------------------
 3703|      0|    return 0;
 3704|       |
 3705|    962|  src = &vm->memory[0];
 3706|    962|  dst = &vm->memory[length];
 3707|   245M|  for (i = 0; i < numchannels; i++)
  ------------------
  |  Branch (3707:15): [True: 245M, False: 961]
  ------------------
 3708|   245M|  {
 3709|   245M|    uint8_t lastbyte = 0;
 3710|   245M|    for (idx = i; idx < length; idx += numchannels)
  ------------------
  |  Branch (3710:19): [True: 69.6k, False: 245M]
  ------------------
 3711|  69.6k|    {
 3712|       |      /*
 3713|       |       * The src block should not overlap with the dst block.
 3714|       |       * If so it would be better to consider this archive is broken.
 3715|       |       */
 3716|  69.6k|      if (src >= dst)
  ------------------
  |  Branch (3716:11): [True: 1, False: 69.6k]
  ------------------
 3717|      1|        return 0;
 3718|  69.6k|      lastbyte = dst[idx] = lastbyte - *src++;
 3719|  69.6k|    }
 3720|   245M|  }
 3721|       |
 3722|    961|  filter->filteredblockaddress = length;
 3723|    961|  filter->filteredblocklength = length;
 3724|       |
 3725|    961|  return 1;
 3726|    962|}
archive_read_support_format_rar.c:execute_filter_e8:
 3730|    878|{
 3731|    878|  uint32_t length = filter->initialregisters[4];
 3732|    878|  uint32_t filesize = 0x1000000;
 3733|    878|  uint32_t i;
 3734|       |
 3735|    878|  if (length > PROGRAM_WORK_SIZE || length <= 4)
  ------------------
  |  |  142|  1.75k|#define PROGRAM_WORK_SIZE 0x3C000
  ------------------
  |  Branch (3735:7): [True: 8, False: 870]
  |  Branch (3735:37): [True: 0, False: 870]
  ------------------
 3736|      8|    return 0;
 3737|       |
 3738|   244k|  for (i = 0; i <= length - 5; i++)
  ------------------
  |  Branch (3738:15): [True: 243k, False: 870]
  ------------------
 3739|   243k|  {
 3740|   243k|    if (vm->memory[i] == 0xE8 || (e9also && vm->memory[i] == 0xE9))
  ------------------
  |  Branch (3740:9): [True: 1.65k, False: 242k]
  |  Branch (3740:35): [True: 0, False: 242k]
  |  Branch (3740:45): [True: 0, False: 0]
  ------------------
 3741|  1.65k|    {
 3742|  1.65k|      uint32_t currpos = (uint32_t)pos + i + 1;
 3743|  1.65k|      int32_t address = (int32_t)vm_read_32(vm, i + 1);
 3744|  1.65k|      if (address < 0 && currpos >= (~(uint32_t)address + 1))
  ------------------
  |  Branch (3744:11): [True: 559, False: 1.09k]
  |  Branch (3744:26): [True: 9, False: 550]
  ------------------
 3745|      9|        vm_write_32(vm, i + 1, address + filesize);
 3746|  1.64k|      else if (address >= 0 && (uint32_t)address < filesize)
  ------------------
  |  Branch (3746:16): [True: 1.09k, False: 550]
  |  Branch (3746:32): [True: 287, False: 807]
  ------------------
 3747|    287|        vm_write_32(vm, i + 1, address - currpos);
 3748|  1.65k|      i += 4;
 3749|  1.65k|    }
 3750|   243k|  }
 3751|       |
 3752|    870|  filter->filteredblockaddress = 0;
 3753|    870|  filter->filteredblocklength = length;
 3754|       |
 3755|    870|  return 1;
 3756|    878|}
archive_read_support_format_rar.c:vm_read_32:
 3917|  1.65k|{
 3918|  1.65k|  return archive_le32dec(vm->memory + offset);
 3919|  1.65k|}
archive_read_support_format_rar.c:vm_write_32:
 3911|    296|{
 3912|    296|  archive_le32enc(vm->memory + offset, u32);
 3913|    296|}
archive_read_support_format_rar.c:execute_filter_rgb:
 3760|    632|{
 3761|    632|  uint32_t stride = filter->initialregisters[0];
 3762|    632|  uint32_t byteoffset = filter->initialregisters[1];
 3763|    632|  uint32_t blocklength = filter->initialregisters[4];
 3764|    632|  uint8_t *src, *dst;
 3765|    632|  uint32_t i, j;
 3766|       |
 3767|    632|  if (blocklength > PROGRAM_WORK_SIZE / 2 || stride > blocklength || blocklength < 3 || byteoffset > 2)
  ------------------
  |  |  142|    632|#define PROGRAM_WORK_SIZE 0x3C000
  ------------------
  |  Branch (3767:7): [True: 0, False: 632]
  |  Branch (3767:46): [True: 0, False: 632]
  |  Branch (3767:70): [True: 0, False: 632]
  |  Branch (3767:89): [True: 0, False: 632]
  ------------------
 3768|      0|    return 0;
 3769|       |
 3770|    632|  src = &vm->memory[0];
 3771|    632|  dst = &vm->memory[blocklength];
 3772|  2.52k|  for (i = 0; i < 3; i++) {
  ------------------
  |  Branch (3772:15): [True: 1.89k, False: 632]
  ------------------
 3773|  1.89k|    uint8_t byte = 0;
 3774|  1.89k|    uint8_t *prev = dst + i - stride;
 3775|  21.2k|    for (j = i; j < blocklength; j += 3)
  ------------------
  |  Branch (3775:17): [True: 19.3k, False: 1.89k]
  ------------------
 3776|  19.3k|    {
 3777|       |      /*
 3778|       |       * The src block should not overlap with the dst block.
 3779|       |       * If so it would be better to consider this archive is broken.
 3780|       |       */
 3781|  19.3k|      if (src >= dst)
  ------------------
  |  Branch (3781:11): [True: 0, False: 19.3k]
  ------------------
 3782|      0|        return 0;
 3783|       |
 3784|  19.3k|      if (prev >= dst)
  ------------------
  |  Branch (3784:11): [True: 19.2k, False: 98]
  ------------------
 3785|  19.2k|      {
 3786|  19.2k|        uint32_t delta1 = abs(prev[3] - prev[0]);
 3787|  19.2k|        uint32_t delta2 = abs(byte - prev[0]);
 3788|  19.2k|        uint32_t delta3 = abs(prev[3] - prev[0] + byte - prev[0]);
 3789|  19.2k|        if (delta1 > delta2 || delta1 > delta3)
  ------------------
  |  Branch (3789:13): [True: 8.58k, False: 10.6k]
  |  Branch (3789:32): [True: 495, False: 10.1k]
  ------------------
 3790|  9.08k|          byte = delta2 <= delta3 ? prev[3] : prev[0];
  ------------------
  |  Branch (3790:18): [True: 8.30k, False: 775]
  ------------------
 3791|  19.2k|      }
 3792|  19.3k|      byte -= *src++;
 3793|  19.3k|      dst[j] = byte;
 3794|  19.3k|      prev += 3;
 3795|  19.3k|    }
 3796|  1.89k|  }
 3797|  6.72k|  for (i = byteoffset; i < blocklength - 2; i += 3)
  ------------------
  |  Branch (3797:24): [True: 6.09k, False: 632]
  ------------------
 3798|  6.09k|  {
 3799|  6.09k|    dst[i] += dst[i + 1];
 3800|  6.09k|    dst[i + 2] += dst[i + 1];
 3801|  6.09k|  }
 3802|       |
 3803|    632|  filter->filteredblockaddress = blocklength;
 3804|    632|  filter->filteredblocklength = blocklength;
 3805|       |
 3806|    632|  return 1;
 3807|    632|}
archive_read_support_format_rar.c:delete_filter:
 3569|  6.01k|{
 3570|  17.4k|  while (filter)
  ------------------
  |  Branch (3570:10): [True: 11.4k, False: 6.01k]
  ------------------
 3571|  11.4k|  {
 3572|  11.4k|    struct rar_filter *next = filter->next;
 3573|  11.4k|    free(filter->globaldata);
 3574|  11.4k|    free(filter);
 3575|  11.4k|    filter = next;
 3576|  11.4k|  }
 3577|  6.01k|}
archive_read_support_format_rar.c:rar_br_preparation:
  597|    128|{
  598|    128|  struct rar *rar = (struct rar *)(a->format->data);
  599|       |
  600|    128|  if (rar->bytes_remaining > 0) {
  ------------------
  |  Branch (600:7): [True: 128, False: 0]
  ------------------
  601|    128|    br->next_in = rar_read_ahead(a, 1, &(br->avail_in));
  602|    128|    if (br->next_in == NULL) {
  ------------------
  |  Branch (602:9): [True: 3, False: 125]
  ------------------
  603|      3|      archive_set_error(&a->archive,
  604|      3|          ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      3|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  605|      3|          "Truncated RAR file data");
  606|      3|      return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      3|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  607|      3|    }
  608|    125|    if (br->cache_avail == 0)
  ------------------
  |  Branch (608:9): [True: 125, False: 0]
  ------------------
  609|    125|      (void)rar_br_fillup(a, br);
  610|    125|  }
  611|    125|  return (ARCHIVE_OK);
  ------------------
  |  |  233|    125|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  612|    128|}
archive_read_support_format_rar.c:rar_br_fillup:
  502|   650k|{
  503|   650k|  struct rar *rar = (struct rar *)(a->format->data);
  504|   650k|  int n = CACHE_BITS - br->cache_avail;
  ------------------
  |  |  383|   650k|#define CACHE_BITS	(8 * sizeof(CACHE_TYPE))
  ------------------
  505|       |
  506|   717k|  for (;;) {
  507|   717k|    switch (n >> 3) {
  508|  41.6k|    case 8:
  ------------------
  |  Branch (508:5): [True: 41.6k, False: 676k]
  ------------------
  509|  41.6k|      if (br->avail_in >= 8) {
  ------------------
  |  Branch (509:11): [True: 41.2k, False: 409]
  ------------------
  510|  41.2k|        br->cache_buffer =
  511|  41.2k|            ((uint64_t)br->next_in[0]) << 56 |
  512|  41.2k|            ((uint64_t)br->next_in[1]) << 48 |
  513|  41.2k|            ((uint64_t)br->next_in[2]) << 40 |
  514|  41.2k|            ((uint64_t)br->next_in[3]) << 32 |
  515|  41.2k|            ((uint32_t)br->next_in[4]) << 24 |
  516|  41.2k|            ((uint32_t)br->next_in[5]) << 16 |
  517|  41.2k|            ((uint32_t)br->next_in[6]) << 8 |
  518|  41.2k|             (uint32_t)br->next_in[7];
  519|  41.2k|        br->next_in += 8;
  520|  41.2k|        br->avail_in -= 8;
  521|  41.2k|        br->cache_avail += 8 * 8;
  522|  41.2k|        rar->bytes_unconsumed += 8;
  523|  41.2k|        rar->bytes_remaining -= 8;
  524|  41.2k|        return (1);
  525|  41.2k|      }
  526|    409|      break;
  527|   554k|    case 7:
  ------------------
  |  Branch (527:5): [True: 554k, False: 162k]
  ------------------
  528|   554k|      if (br->avail_in >= 7) {
  ------------------
  |  Branch (528:11): [True: 545k, False: 9.37k]
  ------------------
  529|   545k|        br->cache_buffer =
  530|   545k|           (br->cache_buffer << 56) |
  531|   545k|            ((uint64_t)br->next_in[0]) << 48 |
  532|   545k|            ((uint64_t)br->next_in[1]) << 40 |
  533|   545k|            ((uint64_t)br->next_in[2]) << 32 |
  534|   545k|            ((uint32_t)br->next_in[3]) << 24 |
  535|   545k|            ((uint32_t)br->next_in[4]) << 16 |
  536|   545k|            ((uint32_t)br->next_in[5]) << 8 |
  537|   545k|             (uint32_t)br->next_in[6];
  538|   545k|        br->next_in += 7;
  539|   545k|        br->avail_in -= 7;
  540|   545k|        br->cache_avail += 7 * 8;
  541|   545k|        rar->bytes_unconsumed += 7;
  542|   545k|        rar->bytes_remaining -= 7;
  543|   545k|        return (1);
  544|   545k|      }
  545|  9.37k|      break;
  546|  63.6k|    case 6:
  ------------------
  |  Branch (546:5): [True: 63.6k, False: 654k]
  ------------------
  547|  63.6k|      if (br->avail_in >= 6) {
  ------------------
  |  Branch (547:11): [True: 53.9k, False: 9.64k]
  ------------------
  548|  53.9k|        br->cache_buffer =
  549|  53.9k|           (br->cache_buffer << 48) |
  550|  53.9k|            ((uint64_t)br->next_in[0]) << 40 |
  551|  53.9k|            ((uint64_t)br->next_in[1]) << 32 |
  552|  53.9k|            ((uint32_t)br->next_in[2]) << 24 |
  553|  53.9k|            ((uint32_t)br->next_in[3]) << 16 |
  554|  53.9k|            ((uint32_t)br->next_in[4]) << 8 |
  555|  53.9k|             (uint32_t)br->next_in[5];
  556|  53.9k|        br->next_in += 6;
  557|  53.9k|        br->avail_in -= 6;
  558|  53.9k|        br->cache_avail += 6 * 8;
  559|  53.9k|        rar->bytes_unconsumed += 6;
  560|  53.9k|        rar->bytes_remaining -= 6;
  561|  53.9k|        return (1);
  562|  53.9k|      }
  563|  9.64k|      break;
  564|  9.64k|    case 0:
  ------------------
  |  Branch (564:5): [True: 9.57k, False: 708k]
  ------------------
  565|       |      /* We have enough compressed data in
  566|       |       * the cache buffer.*/
  567|  9.57k|      return (1);
  568|  48.0k|    default:
  ------------------
  |  Branch (568:5): [True: 48.0k, False: 669k]
  ------------------
  569|  48.0k|      break;
  570|   717k|    }
  571|  67.4k|    if (br->avail_in <= 0) {
  ------------------
  |  Branch (571:9): [True: 12.5k, False: 54.8k]
  ------------------
  572|       |
  573|  12.5k|      if (rar->bytes_unconsumed > 0) {
  ------------------
  |  Branch (573:11): [True: 12.5k, False: 82]
  ------------------
  574|       |        /* Consume as much as the decompressor
  575|       |         * actually used. */
  576|  12.5k|        __archive_read_consume(a, rar->bytes_unconsumed);
  577|  12.5k|        rar->bytes_unconsumed = 0;
  578|  12.5k|      }
  579|  12.5k|      br->next_in = rar_read_ahead(a, 1, &(br->avail_in));
  580|  12.5k|      if (br->next_in == NULL)
  ------------------
  |  Branch (580:11): [True: 147, False: 12.4k]
  ------------------
  581|    147|        return (0);
  582|  12.4k|      if (br->avail_in == 0)
  ------------------
  |  Branch (582:11): [True: 0, False: 12.4k]
  ------------------
  583|      0|        return (0);
  584|  12.4k|    }
  585|  67.3k|    br->cache_buffer =
  586|  67.3k|       (br->cache_buffer << 8) | *br->next_in++;
  587|  67.3k|    br->avail_in--;
  588|  67.3k|    br->cache_avail += 8;
  589|  67.3k|    n -= 8;
  590|  67.3k|    rar->bytes_unconsumed++;
  591|  67.3k|    rar->bytes_remaining--;
  592|  67.3k|  }
  593|   650k|}
archive_read_support_format_rar.c:parse_codes:
 2303|  4.10k|{
 2304|  4.10k|  int i, j, val, n, r;
 2305|  4.10k|  unsigned char bitlengths[MAX_SYMBOLS], zerocount, ppmd_flags;
 2306|  4.10k|  unsigned int maxorder;
 2307|  4.10k|  struct huffman_code precode;
 2308|  4.10k|  struct rar *rar = (struct rar *)(a->format->data);
 2309|  4.10k|  struct rar_br *br = &(rar->br);
 2310|       |
 2311|  4.10k|  free_codes(a);
 2312|       |
 2313|       |  /* Skip to the next byte */
 2314|  4.10k|  rar_br_consume_unaligned_bits(br);
  ------------------
  |  |  479|  4.10k|#define rar_br_consume_unaligned_bits(br) ((br)->cache_avail &= ~7)
  ------------------
 2315|       |
 2316|       |  /* PPMd block flag */
 2317|  4.10k|  if (!rar_br_read_ahead(a, br, 1))
  ------------------
  |  |  476|  4.10k|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  463|  8.21k|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (463:27): [True: 3.68k, False: 425]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  463|      2|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (463:27): [True: 1, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (476:28): [True: 423, False: 2]
  |  |  ------------------
  ------------------
 2318|      1|    goto truncated_data;
 2319|  4.10k|  if ((rar->is_ppmd_block = rar_br_bits(br, 1)) != 0)
  ------------------
  |  |  466|  4.10k|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  467|  4.10k|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
  |  Branch (2319:7): [True: 3.31k, False: 792]
  ------------------
 2320|  3.31k|  {
 2321|  3.31k|    rar_br_consume(br, 1);
  ------------------
  |  |  478|  3.31k|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 2322|  3.31k|    if (!rar_br_read_ahead(a, br, 7))
  ------------------
  |  |  476|  3.31k|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  463|  6.62k|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (463:27): [True: 3.31k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  463|      0|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (463:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (476:28): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2323|      0|      goto truncated_data;
 2324|  3.31k|    ppmd_flags = rar_br_bits(br, 7);
  ------------------
  |  |  466|  3.31k|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  467|  3.31k|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2325|  3.31k|    rar_br_consume(br, 7);
  ------------------
  |  |  478|  3.31k|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 2326|       |
 2327|       |    /* Memory is allocated in MB */
 2328|  3.31k|    if (ppmd_flags & 0x20)
  ------------------
  |  Branch (2328:9): [True: 8, False: 3.30k]
  ------------------
 2329|      8|    {
 2330|      8|      if (!rar_br_read_ahead(a, br, 8))
  ------------------
  |  |  476|      8|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  463|     16|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (463:27): [True: 5, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  463|      0|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (463:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (476:28): [True: 3, False: 0]
  |  |  ------------------
  ------------------
 2331|      0|        goto truncated_data;
 2332|      8|      rar->dictionary_size = (rar_br_bits(br, 8) + 1) << 20;
  ------------------
  |  |  466|      8|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  467|      8|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2333|      8|      rar_br_consume(br, 8);
  ------------------
  |  |  478|      8|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 2334|      8|    }
 2335|       |
 2336|  3.31k|    if (ppmd_flags & 0x40)
  ------------------
  |  Branch (2336:9): [True: 4, False: 3.30k]
  ------------------
 2337|      4|    {
 2338|      4|      if (!rar_br_read_ahead(a, br, 8))
  ------------------
  |  |  476|      4|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  463|      8|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (463:27): [True: 4, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  463|      0|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (463:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (476:28): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2339|      0|        goto truncated_data;
 2340|      4|      rar->ppmd_escape = rar->ppmd7_context.InitEsc = rar_br_bits(br, 8);
  ------------------
  |  |  466|      4|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  467|      4|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2341|      4|      rar_br_consume(br, 8);
  ------------------
  |  |  478|      4|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 2342|      4|    }
 2343|  3.30k|    else
 2344|  3.30k|      rar->ppmd_escape = 2;
 2345|       |
 2346|  3.31k|    if (ppmd_flags & 0x20)
  ------------------
  |  Branch (2346:9): [True: 8, False: 3.30k]
  ------------------
 2347|      8|    {
 2348|      8|      maxorder = (ppmd_flags & 0x1F) + 1;
 2349|      8|      if(maxorder > 16)
  ------------------
  |  Branch (2349:10): [True: 5, False: 3]
  ------------------
 2350|      5|        maxorder = 16 + (maxorder - 16) * 3;
 2351|       |
 2352|      8|      if (maxorder == 1)
  ------------------
  |  Branch (2352:11): [True: 0, False: 8]
  ------------------
 2353|      0|      {
 2354|      0|        archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2355|      0|                          "Truncated RAR file data");
 2356|      0|        return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2357|      0|      }
 2358|       |
 2359|       |      /* Make sure ppmd7_context is freed before Ppmd7_Construct
 2360|       |       * because reading a broken file causes this abnormal sequence. */
 2361|      8|      __archive_ppmd7_functions.Ppmd7_Free(&rar->ppmd7_context);
 2362|       |
 2363|      8|      rar->bytein.a = a;
 2364|      8|      rar->bytein.Read = &ppmd_read;
 2365|      8|      __archive_ppmd7_functions.PpmdRAR_RangeDec_CreateVTable(&rar->range_dec);
 2366|      8|      rar->range_dec.Stream = &rar->bytein;
 2367|      8|      __archive_ppmd7_functions.Ppmd7_Construct(&rar->ppmd7_context);
 2368|       |
 2369|      8|      if (rar->dictionary_size == 0) {
  ------------------
  |  Branch (2369:11): [True: 0, False: 8]
  ------------------
 2370|      0|        archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2371|      0|                          "Invalid zero dictionary size");
 2372|      0|        return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2373|      0|      }
 2374|       |
 2375|      8|      if (!__archive_ppmd7_functions.Ppmd7_Alloc(&rar->ppmd7_context,
  ------------------
  |  Branch (2375:11): [True: 0, False: 8]
  ------------------
 2376|      8|        rar->dictionary_size))
 2377|      0|      {
 2378|      0|        archive_set_error(&a->archive, ENOMEM,
 2379|      0|                          "Out of memory");
 2380|      0|        return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2381|      0|      }
 2382|      8|      if (!__archive_ppmd7_functions.PpmdRAR_RangeDec_Init(&rar->range_dec))
  ------------------
  |  Branch (2382:11): [True: 4, False: 4]
  ------------------
 2383|      4|      {
 2384|      4|        archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      4|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2385|      4|                          "Unable to initialize PPMd range decoder");
 2386|      4|        return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      4|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2387|      4|      }
 2388|      4|      __archive_ppmd7_functions.Ppmd7_Init(&rar->ppmd7_context, maxorder);
 2389|      4|      rar->ppmd_valid = 1;
 2390|      4|    }
 2391|  3.30k|    else
 2392|  3.30k|    {
 2393|  3.30k|      if (!rar->ppmd_valid) {
  ------------------
  |  Branch (2393:11): [True: 0, False: 3.30k]
  ------------------
 2394|      0|        archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2395|      0|                          "Invalid PPMd sequence");
 2396|      0|        return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2397|      0|      }
 2398|  3.30k|      if (!__archive_ppmd7_functions.PpmdRAR_RangeDec_Init(&rar->range_dec))
  ------------------
  |  Branch (2398:11): [True: 0, False: 3.30k]
  ------------------
 2399|      0|      {
 2400|      0|        archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2401|      0|                          "Unable to initialize PPMd range decoder");
 2402|      0|        return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2403|      0|      }
 2404|  3.30k|    }
 2405|  3.31k|  }
 2406|    792|  else
 2407|    792|  {
 2408|    792|    rar_br_consume(br, 1);
  ------------------
  |  |  478|    792|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 2409|       |
 2410|       |    /* Keep existing table flag */
 2411|    792|    if (!rar_br_read_ahead(a, br, 1))
  ------------------
  |  |  476|    792|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  463|  1.58k|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (463:27): [True: 792, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  463|      0|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (463:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (476:28): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2412|      0|      goto truncated_data;
 2413|    792|    if (!rar_br_bits(br, 1))
  ------------------
  |  |  466|    792|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  467|    792|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
  |  Branch (2413:9): [True: 773, False: 19]
  ------------------
 2414|    773|      memset(rar->lengthtable, 0, sizeof(rar->lengthtable));
 2415|    792|    rar_br_consume(br, 1);
  ------------------
  |  |  478|    792|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 2416|       |
 2417|    792|    memset(&bitlengths, 0, sizeof(bitlengths));
 2418|  15.9k|    for (i = 0; i < MAX_SYMBOLS;)
  ------------------
  |  |  137|  15.9k|#define MAX_SYMBOLS       20
  ------------------
  |  Branch (2418:17): [True: 15.2k, False: 792]
  ------------------
 2419|  15.2k|    {
 2420|  15.2k|      if (!rar_br_read_ahead(a, br, 4))
  ------------------
  |  |  476|  15.2k|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  463|  30.4k|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (463:27): [True: 13.9k, False: 1.22k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  463|      0|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (463:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (476:28): [True: 1.22k, False: 0]
  |  |  ------------------
  ------------------
 2421|      0|        goto truncated_data;
 2422|  15.2k|      bitlengths[i++] = rar_br_bits(br, 4);
  ------------------
  |  |  466|  15.2k|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  467|  15.2k|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2423|  15.2k|      rar_br_consume(br, 4);
  ------------------
  |  |  478|  15.2k|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 2424|  15.2k|      if (bitlengths[i-1] == 0xF)
  ------------------
  |  Branch (2424:11): [True: 49, False: 15.1k]
  ------------------
 2425|     49|      {
 2426|     49|        if (!rar_br_read_ahead(a, br, 4))
  ------------------
  |  |  476|     49|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  463|     98|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (463:27): [True: 49, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  463|      0|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (463:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (476:28): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2427|      0|          goto truncated_data;
 2428|     49|        zerocount = rar_br_bits(br, 4);
  ------------------
  |  |  466|     49|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  467|     49|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2429|     49|        rar_br_consume(br, 4);
  ------------------
  |  |  478|     49|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 2430|     49|        if (zerocount)
  ------------------
  |  Branch (2430:13): [True: 49, False: 0]
  ------------------
 2431|     49|        {
 2432|     49|          i--;
 2433|    738|          for (j = 0; j < zerocount + 2 && i < MAX_SYMBOLS; j++)
  ------------------
  |  |  137|    690|#define MAX_SYMBOLS       20
  ------------------
  |  Branch (2433:23): [True: 690, False: 48]
  |  Branch (2433:44): [True: 689, False: 1]
  ------------------
 2434|    689|            bitlengths[i++] = 0;
 2435|     49|        }
 2436|     49|      }
 2437|  15.2k|    }
 2438|       |
 2439|    792|    memset(&precode, 0, sizeof(precode));
 2440|    792|    r = create_code(a, &precode, bitlengths, MAX_SYMBOLS, MAX_SYMBOL_LENGTH);
  ------------------
  |  |  137|    792|#define MAX_SYMBOLS       20
  ------------------
                  r = create_code(a, &precode, bitlengths, MAX_SYMBOLS, MAX_SYMBOL_LENGTH);
  ------------------
  |  |  136|    792|#define MAX_SYMBOL_LENGTH 0xF
  ------------------
 2441|    792|    if (r != ARCHIVE_OK) {
  ------------------
  |  |  233|    792|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2441:9): [True: 0, False: 792]
  ------------------
 2442|      0|      free(precode.tree);
 2443|      0|      free(precode.table);
 2444|      0|      return (r);
 2445|      0|    }
 2446|       |
 2447|   196k|    for (i = 0; i < HUFFMAN_TABLE_SIZE;)
  ------------------
  |  |  134|   196k|  MAINCODE_SIZE + OFFSETCODE_SIZE + LOWOFFSETCODE_SIZE + LENGTHCODE_SIZE
  |  |  ------------------
  |  |  |  |  129|   196k|#define MAINCODE_SIZE      299
  |  |  ------------------
  |  |                 MAINCODE_SIZE + OFFSETCODE_SIZE + LOWOFFSETCODE_SIZE + LENGTHCODE_SIZE
  |  |  ------------------
  |  |  |  |  130|   196k|#define OFFSETCODE_SIZE    60
  |  |  ------------------
  |  |                 MAINCODE_SIZE + OFFSETCODE_SIZE + LOWOFFSETCODE_SIZE + LENGTHCODE_SIZE
  |  |  ------------------
  |  |  |  |  131|   196k|#define LOWOFFSETCODE_SIZE 17
  |  |  ------------------
  |  |                 MAINCODE_SIZE + OFFSETCODE_SIZE + LOWOFFSETCODE_SIZE + LENGTHCODE_SIZE
  |  |  ------------------
  |  |  |  |  132|   196k|#define LENGTHCODE_SIZE    28
  |  |  ------------------
  ------------------
  |  Branch (2447:17): [True: 195k, False: 786]
  ------------------
 2448|   195k|    {
 2449|   195k|      if ((val = read_next_symbol(a, &precode)) < 0) {
  ------------------
  |  Branch (2449:11): [True: 6, False: 195k]
  ------------------
 2450|      6|        free(precode.tree);
 2451|      6|        free(precode.table);
 2452|      6|        return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      6|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2453|      6|      }
 2454|   195k|      if (val < 16)
  ------------------
  |  Branch (2454:11): [True: 180k, False: 15.5k]
  ------------------
 2455|   180k|      {
 2456|   180k|        rar->lengthtable[i] = (rar->lengthtable[i] + val) & 0xF;
 2457|   180k|        i++;
 2458|   180k|      }
 2459|  15.5k|      else if (val < 18)
  ------------------
  |  Branch (2459:16): [True: 4.87k, False: 10.6k]
  ------------------
 2460|  4.87k|      {
 2461|  4.87k|        if (i == 0)
  ------------------
  |  Branch (2461:13): [True: 0, False: 4.87k]
  ------------------
 2462|      0|        {
 2463|      0|          free(precode.tree);
 2464|      0|          free(precode.table);
 2465|      0|          archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2466|      0|                            "Internal error extracting RAR file");
 2467|      0|          return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2468|      0|        }
 2469|       |
 2470|  4.87k|        if(val == 16) {
  ------------------
  |  Branch (2470:12): [True: 4.40k, False: 468]
  ------------------
 2471|  4.40k|          if (!rar_br_read_ahead(a, br, 3)) {
  ------------------
  |  |  476|  4.40k|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  463|  8.80k|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (463:27): [True: 4.40k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  463|      0|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (463:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (476:28): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2472|      0|            free(precode.tree);
 2473|      0|            free(precode.table);
 2474|      0|            goto truncated_data;
 2475|      0|          }
 2476|  4.40k|          n = rar_br_bits(br, 3) + 3;
  ------------------
  |  |  466|  4.40k|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  467|  4.40k|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2477|  4.40k|          rar_br_consume(br, 3);
  ------------------
  |  |  478|  4.40k|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 2478|  4.40k|        } else {
 2479|    468|          if (!rar_br_read_ahead(a, br, 7)) {
  ------------------
  |  |  476|    468|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  463|    936|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (463:27): [True: 425, False: 43]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  463|      0|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (463:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (476:28): [True: 43, False: 0]
  |  |  ------------------
  ------------------
 2480|      0|            free(precode.tree);
 2481|      0|            free(precode.table);
 2482|      0|            goto truncated_data;
 2483|      0|          }
 2484|    468|          n = rar_br_bits(br, 7) + 11;
  ------------------
  |  |  466|    468|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  467|    468|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2485|    468|          rar_br_consume(br, 7);
  ------------------
  |  |  478|    468|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 2486|    468|        }
 2487|       |
 2488|  26.3k|        for (j = 0; j < n && i < HUFFMAN_TABLE_SIZE; j++)
  ------------------
  |  |  134|  21.5k|  MAINCODE_SIZE + OFFSETCODE_SIZE + LOWOFFSETCODE_SIZE + LENGTHCODE_SIZE
  |  |  ------------------
  |  |  |  |  129|  21.5k|#define MAINCODE_SIZE      299
  |  |  ------------------
  |  |                 MAINCODE_SIZE + OFFSETCODE_SIZE + LOWOFFSETCODE_SIZE + LENGTHCODE_SIZE
  |  |  ------------------
  |  |  |  |  130|  21.5k|#define OFFSETCODE_SIZE    60
  |  |  ------------------
  |  |                 MAINCODE_SIZE + OFFSETCODE_SIZE + LOWOFFSETCODE_SIZE + LENGTHCODE_SIZE
  |  |  ------------------
  |  |  |  |  131|  21.5k|#define LOWOFFSETCODE_SIZE 17
  |  |  ------------------
  |  |                 MAINCODE_SIZE + OFFSETCODE_SIZE + LOWOFFSETCODE_SIZE + LENGTHCODE_SIZE
  |  |  ------------------
  |  |  |  |  132|  21.5k|#define LENGTHCODE_SIZE    28
  |  |  ------------------
  ------------------
  |  Branch (2488:21): [True: 21.5k, False: 4.86k]
  |  Branch (2488:30): [True: 21.5k, False: 10]
  ------------------
 2489|  21.5k|        {
 2490|  21.5k|          rar->lengthtable[i] = rar->lengthtable[i-1];
 2491|  21.5k|          i++;
 2492|  21.5k|        }
 2493|  4.87k|      }
 2494|  10.6k|      else
 2495|  10.6k|      {
 2496|  10.6k|        if(val == 18) {
  ------------------
  |  Branch (2496:12): [True: 9.16k, False: 1.50k]
  ------------------
 2497|  9.16k|          if (!rar_br_read_ahead(a, br, 3)) {
  ------------------
  |  |  476|  9.16k|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  463|  18.3k|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (463:27): [True: 9.11k, False: 49]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  463|      0|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (463:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (476:28): [True: 49, False: 0]
  |  |  ------------------
  ------------------
 2498|      0|            free(precode.tree);
 2499|      0|            free(precode.table);
 2500|      0|            goto truncated_data;
 2501|      0|          }
 2502|  9.16k|          n = rar_br_bits(br, 3) + 3;
  ------------------
  |  |  466|  9.16k|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  467|  9.16k|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2503|  9.16k|          rar_br_consume(br, 3);
  ------------------
  |  |  478|  9.16k|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 2504|  9.16k|        } else {
 2505|  1.50k|          if (!rar_br_read_ahead(a, br, 7)) {
  ------------------
  |  |  476|  1.50k|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  463|  3.00k|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (463:27): [True: 1.43k, False: 73]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  463|      0|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (463:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (476:28): [True: 73, False: 0]
  |  |  ------------------
  ------------------
 2506|      0|            free(precode.tree);
 2507|      0|            free(precode.table);
 2508|      0|            goto truncated_data;
 2509|      0|          }
 2510|  1.50k|          n = rar_br_bits(br, 7) + 11;
  ------------------
  |  |  466|  1.50k|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  467|  1.50k|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2511|  1.50k|          rar_br_consume(br, 7);
  ------------------
  |  |  478|  1.50k|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 2512|  1.50k|        }
 2513|       |
 2514|   126k|        for(j = 0; j < n && i < HUFFMAN_TABLE_SIZE; j++)
  ------------------
  |  |  134|   116k|  MAINCODE_SIZE + OFFSETCODE_SIZE + LOWOFFSETCODE_SIZE + LENGTHCODE_SIZE
  |  |  ------------------
  |  |  |  |  129|   116k|#define MAINCODE_SIZE      299
  |  |  ------------------
  |  |                 MAINCODE_SIZE + OFFSETCODE_SIZE + LOWOFFSETCODE_SIZE + LENGTHCODE_SIZE
  |  |  ------------------
  |  |  |  |  130|   116k|#define OFFSETCODE_SIZE    60
  |  |  ------------------
  |  |                 MAINCODE_SIZE + OFFSETCODE_SIZE + LOWOFFSETCODE_SIZE + LENGTHCODE_SIZE
  |  |  ------------------
  |  |  |  |  131|   116k|#define LOWOFFSETCODE_SIZE 17
  |  |  ------------------
  |  |                 MAINCODE_SIZE + OFFSETCODE_SIZE + LOWOFFSETCODE_SIZE + LENGTHCODE_SIZE
  |  |  ------------------
  |  |  |  |  132|   116k|#define LENGTHCODE_SIZE    28
  |  |  ------------------
  ------------------
  |  Branch (2514:20): [True: 116k, False: 10.3k]
  |  Branch (2514:29): [True: 115k, False: 317]
  ------------------
 2515|   115k|          rar->lengthtable[i++] = 0;
 2516|  10.6k|      }
 2517|   195k|    }
 2518|    786|    free(precode.tree);
 2519|    786|    free(precode.table);
 2520|       |
 2521|    786|    r = create_code(a, &rar->maincode, &rar->lengthtable[0], MAINCODE_SIZE,
  ------------------
  |  |  129|    786|#define MAINCODE_SIZE      299
  ------------------
 2522|    786|                MAX_SYMBOL_LENGTH);
  ------------------
  |  |  136|    786|#define MAX_SYMBOL_LENGTH 0xF
  ------------------
 2523|    786|    if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    786|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2523:9): [True: 4, False: 782]
  ------------------
 2524|      4|      return (r);
 2525|    782|    r = create_code(a, &rar->offsetcode, &rar->lengthtable[MAINCODE_SIZE],
  ------------------
  |  |  129|    782|#define MAINCODE_SIZE      299
  ------------------
 2526|    782|                OFFSETCODE_SIZE, MAX_SYMBOL_LENGTH);
  ------------------
  |  |  130|    782|#define OFFSETCODE_SIZE    60
  ------------------
                              OFFSETCODE_SIZE, MAX_SYMBOL_LENGTH);
  ------------------
  |  |  136|    782|#define MAX_SYMBOL_LENGTH 0xF
  ------------------
 2527|    782|    if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    782|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2527:9): [True: 0, False: 782]
  ------------------
 2528|      0|      return (r);
 2529|    782|    r = create_code(a, &rar->lowoffsetcode,
 2530|    782|                &rar->lengthtable[MAINCODE_SIZE + OFFSETCODE_SIZE],
  ------------------
  |  |  129|    782|#define MAINCODE_SIZE      299
  ------------------
                              &rar->lengthtable[MAINCODE_SIZE + OFFSETCODE_SIZE],
  ------------------
  |  |  130|    782|#define OFFSETCODE_SIZE    60
  ------------------
 2531|    782|                LOWOFFSETCODE_SIZE, MAX_SYMBOL_LENGTH);
  ------------------
  |  |  131|    782|#define LOWOFFSETCODE_SIZE 17
  ------------------
                              LOWOFFSETCODE_SIZE, MAX_SYMBOL_LENGTH);
  ------------------
  |  |  136|    782|#define MAX_SYMBOL_LENGTH 0xF
  ------------------
 2532|    782|    if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    782|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2532:9): [True: 0, False: 782]
  ------------------
 2533|      0|      return (r);
 2534|    782|    r = create_code(a, &rar->lengthcode,
 2535|    782|                &rar->lengthtable[MAINCODE_SIZE + OFFSETCODE_SIZE +
  ------------------
  |  |  129|    782|#define MAINCODE_SIZE      299
  ------------------
                              &rar->lengthtable[MAINCODE_SIZE + OFFSETCODE_SIZE +
  ------------------
  |  |  130|    782|#define OFFSETCODE_SIZE    60
  ------------------
 2536|    782|                LOWOFFSETCODE_SIZE], LENGTHCODE_SIZE, MAX_SYMBOL_LENGTH);
  ------------------
  |  |  131|    782|#define LOWOFFSETCODE_SIZE 17
  ------------------
                              LOWOFFSETCODE_SIZE], LENGTHCODE_SIZE, MAX_SYMBOL_LENGTH);
  ------------------
  |  |  132|    782|#define LENGTHCODE_SIZE    28
  ------------------
                              LOWOFFSETCODE_SIZE], LENGTHCODE_SIZE, MAX_SYMBOL_LENGTH);
  ------------------
  |  |  136|    782|#define MAX_SYMBOL_LENGTH 0xF
  ------------------
 2537|    782|    if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    782|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2537:9): [True: 0, False: 782]
  ------------------
 2538|      0|      return (r);
 2539|    782|  }
 2540|       |
 2541|  4.09k|  if (!rar->dictionary_size || !rar->lzss.window ||
  ------------------
  |  Branch (2541:7): [True: 121, False: 3.97k]
  |  Branch (2541:32): [True: 4, False: 3.96k]
  ------------------
 2542|  3.96k|      (unsigned int)(rar->lzss.mask + 1) < rar->dictionary_size)
  ------------------
  |  Branch (2542:7): [True: 0, False: 3.96k]
  ------------------
 2543|    125|  {
 2544|       |    /* Seems as though dictionary sizes are not used. Even so, minimize
 2545|       |     * memory usage as much as possible.
 2546|       |     */
 2547|    125|    void *new_window;
 2548|    125|    unsigned int new_size;
 2549|       |
 2550|    125|    if (rar->unp_size >= DICTIONARY_MAX_SIZE)
  ------------------
  |  |  126|    125|#define DICTIONARY_MAX_SIZE 0x400000
  ------------------
  |  Branch (2550:9): [True: 65, False: 60]
  ------------------
 2551|     65|      new_size = DICTIONARY_MAX_SIZE;
  ------------------
  |  |  126|     65|#define DICTIONARY_MAX_SIZE 0x400000
  ------------------
 2552|     60|    else
 2553|     60|      new_size = rar_fls((unsigned int)rar->unp_size) << 1;
 2554|    125|    if (new_size == 0) {
  ------------------
  |  Branch (2554:9): [True: 0, False: 125]
  ------------------
 2555|      0|      archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2556|      0|                        "Zero window size is invalid");
 2557|      0|      return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2558|      0|    }
 2559|    125|    new_window = realloc(rar->lzss.window, new_size);
 2560|    125|    if (new_window == NULL) {
  ------------------
  |  Branch (2560:9): [True: 0, False: 125]
  ------------------
 2561|      0|      archive_set_error(&a->archive, ENOMEM,
 2562|      0|                        "Unable to allocate memory for uncompressed data");
 2563|      0|      return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2564|      0|    }
 2565|    125|    rar->lzss.window = (unsigned char *)new_window;
 2566|    125|    rar->dictionary_size = new_size;
 2567|    125|    memset(rar->lzss.window, 0, rar->dictionary_size);
 2568|    125|    rar->lzss.mask = rar->dictionary_size - 1;
 2569|    125|  }
 2570|       |
 2571|  4.09k|  rar->start_new_table = 0;
 2572|  4.09k|  return (ARCHIVE_OK);
  ------------------
  |  |  233|  4.09k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2573|      1|truncated_data:
 2574|      1|  archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2575|      1|                    "Truncated RAR file data");
 2576|      1|  rar->valid = 0;
 2577|      1|  return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      1|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2578|  4.09k|}
archive_read_support_format_rar.c:free_codes:
 2582|  6.60k|{
 2583|  6.60k|  struct rar *rar = (struct rar *)(a->format->data);
 2584|  6.60k|  free(rar->maincode.tree);
 2585|  6.60k|  free(rar->offsetcode.tree);
 2586|  6.60k|  free(rar->lowoffsetcode.tree);
 2587|  6.60k|  free(rar->lengthcode.tree);
 2588|  6.60k|  free(rar->maincode.table);
 2589|  6.60k|  free(rar->offsetcode.table);
 2590|  6.60k|  free(rar->lowoffsetcode.table);
 2591|  6.60k|  free(rar->lengthcode.table);
 2592|  6.60k|  memset(&rar->maincode, 0, sizeof(rar->maincode));
 2593|  6.60k|  memset(&rar->offsetcode, 0, sizeof(rar->offsetcode));
 2594|  6.60k|  memset(&rar->lowoffsetcode, 0, sizeof(rar->lowoffsetcode));
 2595|  6.60k|  memset(&rar->lengthcode, 0, sizeof(rar->lengthcode));
 2596|  6.60k|}
archive_read_support_format_rar.c:ppmd_read:
  711|  13.2k|{
  712|  13.2k|  struct archive_read *a = ((IByteIn*)p)->a;
  713|  13.2k|  struct rar *rar = (struct rar *)(a->format->data);
  714|  13.2k|  struct rar_br *br = &(rar->br);
  715|  13.2k|  Byte b;
  716|  13.2k|  if (!rar_br_read_ahead(a, br, 8))
  ------------------
  |  |  476|  13.2k|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  463|  26.5k|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (463:27): [True: 11.6k, False: 1.65k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  463|      1|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (463:27): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (476:28): [True: 1.65k, False: 1]
  |  |  ------------------
  ------------------
  717|      0|  {
  718|      0|    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  719|      0|                      "Truncated RAR file data");
  720|      0|    rar->valid = 0;
  721|      0|    return 0;
  722|      0|  }
  723|  13.2k|  b = rar_br_bits(br, 8);
  ------------------
  |  |  466|  13.2k|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  467|  13.2k|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
  724|  13.2k|  rar_br_consume(br, 8);
  ------------------
  |  |  478|  13.2k|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
  725|  13.2k|  return b;
  726|  13.2k|}
archive_read_support_format_rar.c:create_code:
 2673|  3.92k|{
 2674|  3.92k|  int i, j, codebits = 0, symbolsleft = numsymbols;
 2675|       |
 2676|  3.92k|  code->numentries = 0;
 2677|  3.92k|  code->numallocatedentries = 0;
 2678|  3.92k|  if (new_node(code) < 0) {
  ------------------
  |  Branch (2678:7): [True: 0, False: 3.92k]
  ------------------
 2679|      0|    archive_set_error(&a->archive, ENOMEM,
 2680|      0|                      "Unable to allocate memory for node data");
 2681|      0|    return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2682|      0|  }
 2683|  3.92k|  code->numentries = 1;
 2684|  3.92k|  code->minlength = INT_MAX;
 2685|  3.92k|  code->maxlength = INT_MIN;
 2686|  3.92k|  codebits = 0;
 2687|  57.8k|  for(i = 1; i <= maxlength; i++)
  ------------------
  |  Branch (2687:14): [True: 54.3k, False: 3.47k]
  ------------------
 2688|  54.3k|  {
 2689|  4.95M|    for(j = 0; j < numsymbols; j++)
  ------------------
  |  Branch (2689:16): [True: 4.90M, False: 53.9k]
  ------------------
 2690|  4.90M|    {
 2691|  4.90M|      if (lengths[j] != i) continue;
  ------------------
  |  Branch (2691:11): [True: 4.69M, False: 211k]
  ------------------
 2692|   211k|      if (add_value(a, code, j, codebits, i) != ARCHIVE_OK)
  ------------------
  |  |  233|   211k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2692:11): [True: 4, False: 211k]
  ------------------
 2693|      4|        return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      4|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2694|   211k|      codebits++;
 2695|   211k|      if (--symbolsleft <= 0)
  ------------------
  |  Branch (2695:11): [True: 448, False: 210k]
  ------------------
 2696|    448|        break;
 2697|   211k|    }
 2698|  54.3k|    if (symbolsleft <= 0)
  ------------------
  |  Branch (2698:9): [True: 448, False: 53.9k]
  ------------------
 2699|    448|      break;
 2700|  53.9k|    codebits <<= 1;
 2701|  53.9k|  }
 2702|  3.92k|  return (ARCHIVE_OK);
  ------------------
  |  |  233|  3.92k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2703|  3.92k|}
archive_read_support_format_rar.c:new_node:
 2816|   426k|{
 2817|   426k|  void *new_tree;
 2818|   426k|  if (code->numallocatedentries == code->numentries) {
  ------------------
  |  Branch (2818:7): [True: 4.81k, False: 421k]
  ------------------
 2819|  4.81k|    int new_num_entries = 256;
 2820|  4.81k|    if (code->numentries > 0) {
  ------------------
  |  Branch (2820:9): [True: 891, False: 3.92k]
  ------------------
 2821|    891|        new_num_entries = code->numentries * 2;
 2822|    891|    }
 2823|  4.81k|    new_tree = realloc(code->tree, new_num_entries * sizeof(*code->tree));
 2824|  4.81k|    if (new_tree == NULL)
  ------------------
  |  Branch (2824:9): [True: 0, False: 4.81k]
  ------------------
 2825|      0|        return (-1);
 2826|  4.81k|    code->tree = (struct huffman_tree_node *)new_tree;
 2827|  4.81k|    code->numallocatedentries = new_num_entries;
 2828|  4.81k|  }
 2829|   426k|  code->tree[code->numentries].branches[0] = -1;
 2830|   426k|  code->tree[code->numentries].branches[1] = -2;
 2831|   426k|  return 1;
 2832|   426k|}
archive_read_support_format_rar.c:add_value:
 2708|   211k|{
 2709|   211k|  int lastnode, bitpos, bit;
 2710|       |  /* int repeatpos, repeatnode, nextnode; */
 2711|       |
 2712|   211k|  free(code->table);
 2713|   211k|  code->table = NULL;
 2714|       |
 2715|   211k|  if(length > code->maxlength)
  ------------------
  |  Branch (2715:6): [True: 21.5k, False: 189k]
  ------------------
 2716|  21.5k|    code->maxlength = length;
 2717|   211k|  if(length < code->minlength)
  ------------------
  |  Branch (2717:6): [True: 3.80k, False: 207k]
  ------------------
 2718|  3.80k|    code->minlength = length;
 2719|       |
 2720|       |  /*
 2721|       |   * Dead code, repeatpos was is -1
 2722|       |   *
 2723|       |  repeatpos = -1;
 2724|       |  if (repeatpos == 0 || (repeatpos >= 0
 2725|       |    && (((codebits >> (repeatpos - 1)) & 3) == 0
 2726|       |    || ((codebits >> (repeatpos - 1)) & 3) == 3)))
 2727|       |  {
 2728|       |    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
 2729|       |                      "Invalid repeat position");
 2730|       |    return (ARCHIVE_FATAL);
 2731|       |  }
 2732|       |  */
 2733|       |
 2734|   211k|  lastnode = 0;
 2735|  1.86M|  for (bitpos = length - 1; bitpos >= 0; bitpos--)
  ------------------
  |  Branch (2735:29): [True: 1.65M, False: 211k]
  ------------------
 2736|  1.65M|  {
 2737|  1.65M|    bit = (codebits >> bitpos) & 1;
 2738|       |
 2739|       |    /* Leaf node check */
 2740|  1.65M|    if (code->tree[lastnode].branches[0] ==
  ------------------
  |  Branch (2740:9): [True: 4, False: 1.65M]
  ------------------
 2741|  1.65M|      code->tree[lastnode].branches[1])
 2742|      4|    {
 2743|      4|      archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      4|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2744|      4|                        "Prefix found");
 2745|      4|      return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      4|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2746|      4|    }
 2747|       |
 2748|       |    /*
 2749|       |     * Dead code, repeatpos was -1, bitpos >=0
 2750|       |     *
 2751|       |    if (bitpos == repeatpos)
 2752|       |    {
 2753|       |      * Open branch check *
 2754|       |      if (!(code->tree[lastnode].branches[bit] < 0))
 2755|       |      {
 2756|       |        archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
 2757|       |                          "Invalid repeating code");
 2758|       |        return (ARCHIVE_FATAL);
 2759|       |      }
 2760|       |
 2761|       |      if ((repeatnode = new_node(code)) < 0) {
 2762|       |        archive_set_error(&a->archive, ENOMEM,
 2763|       |                          "Unable to allocate memory for node data");
 2764|       |        return (ARCHIVE_FATAL);
 2765|       |      }
 2766|       |      if ((nextnode = new_node(code)) < 0) {
 2767|       |        archive_set_error(&a->archive, ENOMEM,
 2768|       |                          "Unable to allocate memory for node data");
 2769|       |        return (ARCHIVE_FATAL);
 2770|       |      }
 2771|       |
 2772|       |      * Set branches *
 2773|       |      code->tree[lastnode].branches[bit] = repeatnode;
 2774|       |      code->tree[repeatnode].branches[bit] = repeatnode;
 2775|       |      code->tree[repeatnode].branches[bit^1] = nextnode;
 2776|       |      lastnode = nextnode;
 2777|       |
 2778|       |      bitpos++; * terminating bit already handled, skip it *
 2779|       |    }
 2780|       |    else
 2781|       |    {
 2782|       |    */
 2783|       |      /* Open branch check */
 2784|  1.65M|      if (code->tree[lastnode].branches[bit] < 0)
  ------------------
  |  Branch (2784:11): [True: 422k, False: 1.23M]
  ------------------
 2785|   422k|      {
 2786|   422k|        if (new_node(code) < 0) {
  ------------------
  |  Branch (2786:13): [True: 0, False: 422k]
  ------------------
 2787|      0|          archive_set_error(&a->archive, ENOMEM,
 2788|      0|                            "Unable to allocate memory for node data");
 2789|      0|          return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2790|      0|        }
 2791|   422k|        code->tree[lastnode].branches[bit] = code->numentries++;
 2792|   422k|      }
 2793|       |
 2794|       |      /* set to branch */
 2795|  1.65M|      lastnode = code->tree[lastnode].branches[bit];
 2796|       | /* } */
 2797|  1.65M|  }
 2798|       |
 2799|   211k|  if (!(code->tree[lastnode].branches[0] == -1
  ------------------
  |  Branch (2799:9): [True: 211k, False: 0]
  ------------------
 2800|   211k|    && code->tree[lastnode].branches[1] == -2))
  ------------------
  |  Branch (2800:8): [True: 211k, False: 0]
  ------------------
 2801|      0|  {
 2802|      0|    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2803|      0|                      "Prefix found");
 2804|      0|    return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2805|      0|  }
 2806|       |
 2807|       |  /* Set leaf value */
 2808|   211k|  code->tree[lastnode].branches[0] = value;
 2809|   211k|  code->tree[lastnode].branches[1] = value;
 2810|       |
 2811|   211k|  return (ARCHIVE_OK);
  ------------------
  |  |  233|   211k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2812|   211k|}
archive_read_support_format_rar.c:read_next_symbol:
 2601|  19.6M|{
 2602|  19.6M|  unsigned char bit;
 2603|  19.6M|  unsigned int bits;
 2604|  19.6M|  int length, value, node;
 2605|  19.6M|  struct rar *rar;
 2606|  19.6M|  struct rar_br *br;
 2607|       |
 2608|  19.6M|  if (!code->table)
  ------------------
  |  Branch (2608:7): [True: 2.88k, False: 19.6M]
  ------------------
 2609|  2.88k|  {
 2610|  2.88k|    if (make_table(a, code) != (ARCHIVE_OK))
  ------------------
  |  |  233|  2.88k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2610:9): [True: 8, False: 2.87k]
  ------------------
 2611|      8|      return -1;
 2612|  2.88k|  }
 2613|       |
 2614|  19.6M|  rar = (struct rar *)(a->format->data);
 2615|  19.6M|  br = &(rar->br);
 2616|       |
 2617|       |  /* Look ahead (peek) at bits */
 2618|  19.6M|  if (!rar_br_read_ahead(a, br, code->tablesize)) {
  ------------------
  |  |  476|  19.6M|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  463|  39.3M|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (463:27): [True: 19.0M, False: 596k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  463|     91|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (463:27): [True: 56, False: 35]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (476:28): [True: 595k, False: 91]
  |  |  ------------------
  ------------------
 2619|     35|    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     35|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2620|     35|                      "Truncated RAR file data");
 2621|     35|    rar->valid = 0;
 2622|     35|    return -1;
 2623|     35|  }
 2624|  19.6M|  bits = rar_br_bits(br, code->tablesize);
  ------------------
  |  |  466|  19.6M|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  467|  19.6M|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2625|       |
 2626|  19.6M|  length = code->table[bits].length;
 2627|  19.6M|  value = code->table[bits].value;
 2628|       |
 2629|  19.6M|  if (length < 0)
  ------------------
  |  Branch (2629:7): [True: 0, False: 19.6M]
  ------------------
 2630|      0|  {
 2631|      0|    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2632|      0|                      "Invalid prefix code in bitstream");
 2633|      0|    return -1;
 2634|      0|  }
 2635|       |
 2636|  19.6M|  if (length <= code->tablesize)
  ------------------
  |  Branch (2636:7): [True: 19.3M, False: 339k]
  ------------------
 2637|  19.3M|  {
 2638|       |    /* Skip length bits */
 2639|  19.3M|    rar_br_consume(br, length);
  ------------------
  |  |  478|  19.3M|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 2640|  19.3M|    return value;
 2641|  19.3M|  }
 2642|       |
 2643|       |  /* Skip tablesize bits */
 2644|   339k|  rar_br_consume(br, code->tablesize);
  ------------------
  |  |  478|   339k|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 2645|       |
 2646|   339k|  node = value;
 2647|  2.02M|  while (code->tree[node].branches[0] != code->tree[node].branches[1])
  ------------------
  |  Branch (2647:10): [True: 1.68M, False: 339k]
  ------------------
 2648|  1.68M|  {
 2649|  1.68M|    if (!rar_br_read_ahead(a, br, 1)) {
  ------------------
  |  |  476|  1.68M|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  463|  3.37M|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (463:27): [True: 1.68M, False: 3.15k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  463|      5|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (463:27): [True: 0, False: 5]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (476:28): [True: 3.15k, False: 5]
  |  |  ------------------
  ------------------
 2650|      5|      archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      5|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2651|      5|                        "Truncated RAR file data");
 2652|      5|      rar->valid = 0;
 2653|      5|      return -1;
 2654|      5|    }
 2655|  1.68M|    bit = rar_br_bits(br, 1);
  ------------------
  |  |  466|  1.68M|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  467|  1.68M|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2656|  1.68M|    rar_br_consume(br, 1);
  ------------------
  |  |  478|  1.68M|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 2657|       |
 2658|  1.68M|    if (code->tree[node].branches[bit] < 0)
  ------------------
  |  Branch (2658:9): [True: 1, False: 1.68M]
  ------------------
 2659|      1|    {
 2660|      1|      archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2661|      1|                        "Invalid prefix code in bitstream");
 2662|      1|      return -1;
 2663|      1|    }
 2664|  1.68M|    node = code->tree[node].branches[bit];
 2665|  1.68M|  }
 2666|       |
 2667|   339k|  return code->tree[node].branches[0];
 2668|   339k|}
archive_read_support_format_rar.c:make_table:
 2836|  2.88k|{
 2837|  2.88k|  if (code->maxlength < code->minlength || code->maxlength > 10)
  ------------------
  |  Branch (2837:7): [True: 0, False: 2.88k]
  |  Branch (2837:44): [True: 749, False: 2.13k]
  ------------------
 2838|    749|    code->tablesize = 10;
 2839|  2.13k|  else
 2840|  2.13k|    code->tablesize = code->maxlength;
 2841|       |
 2842|  2.88k|  code->table = calloc(((size_t)1U) << code->tablesize, sizeof(*code->table));
 2843|  2.88k|  if (code->table == NULL) {
  ------------------
  |  Branch (2843:7): [True: 0, False: 2.88k]
  ------------------
 2844|      0|    archive_set_error(&a->archive, ENOMEM, "Can't allocate memory");
 2845|      0|    return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2846|      0|  }
 2847|       |
 2848|  2.88k|  return make_table_recurse(a, code, 0, code->table, 0, code->tablesize);
 2849|  2.88k|}
archive_read_support_format_rar.c:make_table_recurse:
 2855|   374k|{
 2856|   374k|  int currtablesize, i, ret = (ARCHIVE_OK);
  ------------------
  |  |  233|   374k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2857|       |
 2858|   374k|  if (!code->tree)
  ------------------
  |  Branch (2858:7): [True: 0, False: 374k]
  ------------------
 2859|      0|  {
 2860|      0|    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2861|      0|                      "Huffman tree was not created");
 2862|      0|    return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2863|      0|  }
 2864|   374k|  if (node < 0 || node >= code->numentries)
  ------------------
  |  Branch (2864:7): [True: 44, False: 374k]
  |  Branch (2864:19): [True: 0, False: 374k]
  ------------------
 2865|     44|  {
 2866|     44|    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     44|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2867|     44|                      "Invalid location to Huffman tree specified");
 2868|     44|    return (ARCHIVE_FAILED);
  ------------------
  |  |  237|     44|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2869|     44|  }
 2870|       |
 2871|   374k|  currtablesize = 1 << (maxdepth - depth);
 2872|       |
 2873|   374k|  if (code->tree[node].branches[0] ==
  ------------------
  |  Branch (2873:7): [True: 187k, False: 187k]
  ------------------
 2874|   374k|    code->tree[node].branches[1])
 2875|   187k|  {
 2876|  1.89M|    for(i = 0; i < currtablesize; i++)
  ------------------
  |  Branch (2876:16): [True: 1.71M, False: 187k]
  ------------------
 2877|  1.71M|    {
 2878|  1.71M|      table[i].length = depth;
 2879|  1.71M|      table[i].value = code->tree[node].branches[0];
 2880|  1.71M|    }
 2881|   187k|  }
 2882|       |  /*
 2883|       |   * Dead code, node >= 0
 2884|       |   *
 2885|       |  else if (node < 0)
 2886|       |  {
 2887|       |    for(i = 0; i < currtablesize; i++)
 2888|       |      table[i].length = -1;
 2889|       |  }
 2890|       |   */
 2891|   187k|  else
 2892|   187k|  {
 2893|   187k|    if(depth == maxdepth)
  ------------------
  |  Branch (2893:8): [True: 1.79k, False: 186k]
  ------------------
 2894|  1.79k|    {
 2895|  1.79k|      table[0].length = maxdepth + 1;
 2896|  1.79k|      table[0].value = node;
 2897|  1.79k|    }
 2898|   186k|    else
 2899|   186k|    {
 2900|   186k|      ret |= make_table_recurse(a, code, code->tree[node].branches[0], table,
 2901|   186k|                                depth + 1, maxdepth);
 2902|   186k|      ret |= make_table_recurse(a, code, code->tree[node].branches[1],
 2903|   186k|                         table + currtablesize / 2, depth + 1, maxdepth);
 2904|   186k|    }
 2905|   187k|  }
 2906|   374k|  return ret;
 2907|   374k|}
archive_read_support_format_rar.c:rar_fls:
  617|     60|{
  618|     60|  word |= (word >>  1);
  619|     60|  word |= (word >>  2);
  620|     60|  word |= (word >>  4);
  621|     60|  word |= (word >>  8);
  622|     60|  word |= (word >> 16);
  623|     60|  return word - (word >> 1);
  624|     60|}
archive_read_support_format_rar.c:lzss_emit_literal:
  671|  17.4M|{
  672|  17.4M|  *lzss_current_pointer(&rar->lzss) = literal;
  673|  17.4M|  rar->lzss.position++;
  674|  17.4M|}
archive_read_support_format_rar.c:lzss_current_pointer:
  665|  17.4M|{
  666|  17.4M|  return lzss_pointer_for_position(lzss, lzss->position);
  667|  17.4M|}
archive_read_support_format_rar.c:lzss_pointer_for_position:
  653|  17.4M|{
  654|  17.4M|  return &lzss->window[lzss_offset_for_position(lzss, pos)];
  655|  17.4M|}
archive_read_support_format_rar.c:lzss_emit_match:
  678|  1.43M|{
  679|  1.43M|  int dstoffs = lzss_current_offset(&rar->lzss);
  680|  1.43M|  int srcoffs = (dstoffs - offset) & lzss_mask(&rar->lzss);
  681|  1.43M|  int l, li, remaining;
  682|  1.43M|  unsigned char *d, *s;
  683|       |
  684|  1.43M|  remaining = length;
  685|  2.87M|  while (remaining > 0) {
  ------------------
  |  Branch (685:10): [True: 1.43M, False: 1.43M]
  ------------------
  686|  1.43M|    l = remaining;
  687|  1.43M|    if (dstoffs > srcoffs) {
  ------------------
  |  Branch (687:9): [True: 652k, False: 786k]
  ------------------
  688|   652k|      if (l > lzss_size(&rar->lzss) - dstoffs)
  ------------------
  |  Branch (688:11): [True: 191, False: 652k]
  ------------------
  689|    191|        l = lzss_size(&rar->lzss) - dstoffs;
  690|   786k|    } else {
  691|   786k|      if (l > lzss_size(&rar->lzss) - srcoffs)
  ------------------
  |  Branch (691:11): [True: 456, False: 786k]
  ------------------
  692|    456|        l = lzss_size(&rar->lzss) - srcoffs;
  693|   786k|    }
  694|  1.43M|    d = &(rar->lzss.window[dstoffs]);
  695|  1.43M|    s = &(rar->lzss.window[srcoffs]);
  696|  1.43M|    if ((dstoffs + l < srcoffs) || (srcoffs + l < dstoffs))
  ------------------
  |  Branch (696:9): [True: 13.7k, False: 1.42M]
  |  Branch (696:36): [True: 308k, False: 1.11M]
  ------------------
  697|   322k|      memcpy(d, s, l);
  698|  1.11M|    else {
  699|   202M|      for (li = 0; li < l; li++)
  ------------------
  |  Branch (699:20): [True: 201M, False: 1.11M]
  ------------------
  700|   201M|        d[li] = s[li];
  701|  1.11M|    }
  702|  1.43M|    remaining -= l;
  703|  1.43M|    dstoffs = (dstoffs + l) & lzss_mask(&(rar->lzss));
  704|  1.43M|    srcoffs = (srcoffs + l) & lzss_mask(&(rar->lzss));
  705|  1.43M|  }
  706|  1.43M|  rar->lzss.position += length;
  707|  1.43M|}
archive_read_support_format_rar.c:lzss_current_offset:
  659|  1.43M|{
  660|  1.43M|  return lzss_offset_for_position(lzss, lzss->position);
  661|  1.43M|}
archive_read_support_format_rar.c:lzss_mask:
  635|  4.31M|{
  636|  4.31M|  return lzss->mask;
  637|  4.31M|}
archive_read_support_format_rar.c:expand:
 2911|  6.97k|{
 2912|  6.97k|  static const unsigned char lengthbases[] =
 2913|  6.97k|    {   0,   1,   2,   3,   4,   5,   6,
 2914|  6.97k|        7,   8,  10,  12,  14,  16,  20,
 2915|  6.97k|       24,  28,  32,  40,  48,  56,  64,
 2916|  6.97k|       80,  96, 112, 128, 160, 192, 224 };
 2917|  6.97k|  static const unsigned char lengthbits[] =
 2918|  6.97k|    { 0, 0, 0, 0, 0, 0, 0,
 2919|  6.97k|      0, 1, 1, 1, 1, 2, 2,
 2920|  6.97k|      2, 2, 3, 3, 3, 3, 4,
 2921|  6.97k|      4, 4, 4, 5, 5, 5, 5 };
 2922|  6.97k|  static const int lengthb_min = minimum(
  ------------------
  |  |  163|  6.97k|#define minimum(a, b)	((a)<(b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (163:24): [Folded, False: 6.97k]
  |  |  ------------------
  ------------------
 2923|  6.97k|    (int)(sizeof(lengthbases)/sizeof(lengthbases[0])),
 2924|  6.97k|    (int)(sizeof(lengthbits)/sizeof(lengthbits[0]))
 2925|  6.97k|  );
 2926|  6.97k|  static const unsigned int offsetbases[] =
 2927|  6.97k|    {       0,       1,       2,       3,       4,       6,
 2928|  6.97k|            8,      12,      16,      24,      32,      48,
 2929|  6.97k|           64,      96,     128,     192,     256,     384,
 2930|  6.97k|          512,     768,    1024,    1536,    2048,    3072,
 2931|  6.97k|         4096,    6144,    8192,   12288,   16384,   24576,
 2932|  6.97k|        32768,   49152,   65536,   98304,  131072,  196608,
 2933|  6.97k|       262144,  327680,  393216,  458752,  524288,  589824,
 2934|  6.97k|       655360,  720896,  786432,  851968,  917504,  983040,
 2935|  6.97k|      1048576, 1310720, 1572864, 1835008, 2097152, 2359296,
 2936|  6.97k|      2621440, 2883584, 3145728, 3407872, 3670016, 3932160 };
 2937|  6.97k|  static const unsigned char offsetbits[] =
 2938|  6.97k|    {  0,  0,  0,  0,  1,  1,  2,  2,  3,  3,  4,  4,
 2939|  6.97k|       5,  5,  6,  6,  7,  7,  8,  8,  9,  9, 10, 10,
 2940|  6.97k|      11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16,
 2941|  6.97k|      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 2942|  6.97k|      18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18 };
 2943|  6.97k|  static const int offsetb_min = minimum(
  ------------------
  |  |  163|  6.97k|#define minimum(a, b)	((a)<(b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (163:24): [Folded, False: 6.97k]
  |  |  ------------------
  ------------------
 2944|  6.97k|    (int)(sizeof(offsetbases)/sizeof(offsetbases[0])),
 2945|  6.97k|    (int)(sizeof(offsetbits)/sizeof(offsetbits[0]))
 2946|  6.97k|  );
 2947|  6.97k|  static const unsigned char shortbases[] =
 2948|  6.97k|    { 0, 4, 8, 16, 32, 64, 128, 192 };
 2949|  6.97k|  static const unsigned char shortbits[] =
 2950|  6.97k|    { 2, 2, 3, 4, 5, 6, 6, 6 };
 2951|       |
 2952|  6.97k|  int symbol, offs, len, offsindex, lensymbol, i, offssymbol, lowoffsetsymbol;
 2953|  6.97k|  unsigned char newfile;
 2954|  6.97k|  struct rar *rar = (struct rar *)(a->format->data);
 2955|  6.97k|  struct rar_br *br = &(rar->br);
 2956|       |
 2957|  6.97k|  if (rar->filters.filterstart < *end)
  ------------------
  |  Branch (2957:7): [True: 0, False: 6.97k]
  ------------------
 2958|      0|    *end = rar->filters.filterstart;
 2959|       |
 2960|  18.8M|  while (1)
  ------------------
  |  Branch (2960:10): [True: 18.8M, Folded]
  ------------------
 2961|  18.8M|  {
 2962|  18.8M|    if(lzss_position(&rar->lzss) >= *end) {
  ------------------
  |  Branch (2962:8): [True: 6.28k, False: 18.8M]
  ------------------
 2963|  6.28k|      return (ARCHIVE_OK);
  ------------------
  |  |  233|  6.28k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2964|  6.28k|    }
 2965|       |
 2966|  18.8M|    if(rar->is_ppmd_block) {
  ------------------
  |  Branch (2966:8): [True: 0, False: 18.8M]
  ------------------
 2967|      0|      *end = lzss_position(&rar->lzss);
 2968|      0|      return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2969|      0|    }
 2970|       |
 2971|  18.8M|    if ((symbol = read_next_symbol(a, &rar->maincode)) < 0)
  ------------------
  |  Branch (2971:9): [True: 42, False: 18.8M]
  ------------------
 2972|     42|      goto bad_data;
 2973|       |
 2974|  18.8M|    if (symbol < 256)
  ------------------
  |  Branch (2974:9): [True: 17.4M, False: 1.45M]
  ------------------
 2975|  17.4M|    {
 2976|  17.4M|      lzss_emit_literal(rar, (uint8_t)symbol);
 2977|  17.4M|      continue;
 2978|  17.4M|    }
 2979|  1.45M|    else if (symbol == 256)
  ------------------
  |  Branch (2979:14): [True: 1.26k, False: 1.45M]
  ------------------
 2980|  1.26k|    {
 2981|  1.26k|      if (!rar_br_read_ahead(a, br, 1))
  ------------------
  |  |  476|  1.26k|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  463|  2.52k|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (463:27): [True: 1.26k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  463|      0|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (463:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (476:28): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2982|      0|        goto truncated_data;
 2983|  1.26k|      newfile = !rar_br_bits(br, 1);
  ------------------
  |  |  466|  1.26k|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  467|  1.26k|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2984|  1.26k|      rar_br_consume(br, 1);
  ------------------
  |  |  478|  1.26k|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 2985|       |
 2986|  1.26k|      if(newfile)
  ------------------
  |  Branch (2986:10): [True: 595, False: 669]
  ------------------
 2987|    595|      {
 2988|    595|        rar->start_new_block = 1;
 2989|    595|        if (!rar_br_read_ahead(a, br, 1))
  ------------------
  |  |  476|    595|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  463|  1.19k|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (463:27): [True: 595, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  463|      0|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (463:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (476:28): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2990|      0|          goto truncated_data;
 2991|    595|        rar->start_new_table = rar_br_bits(br, 1);
  ------------------
  |  |  466|    595|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  467|    595|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2992|    595|        rar_br_consume(br, 1);
  ------------------
  |  |  478|    595|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 2993|    595|        *end = lzss_position(&rar->lzss);
 2994|    595|        return (ARCHIVE_OK);
  ------------------
  |  |  233|    595|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2995|    595|      }
 2996|    669|      else
 2997|    669|      {
 2998|    669|        if (parse_codes(a) != ARCHIVE_OK)
  ------------------
  |  |  233|    669|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2998:13): [True: 8, False: 661]
  ------------------
 2999|      8|          goto bad_data;
 3000|    661|        continue;
 3001|    669|      }
 3002|  1.26k|    }
 3003|  1.45M|    else if(symbol==257)
  ------------------
  |  Branch (3003:13): [True: 11.4k, False: 1.44M]
  ------------------
 3004|  11.4k|    {
 3005|  11.4k|      if (!read_filter(a, end))
  ------------------
  |  Branch (3005:11): [True: 35, False: 11.4k]
  ------------------
 3006|     35|          goto bad_data;
 3007|  11.4k|      continue;
 3008|  11.4k|    }
 3009|  1.44M|    else if(symbol==258)
  ------------------
  |  Branch (3009:13): [True: 778k, False: 661k]
  ------------------
 3010|   778k|    {
 3011|   778k|      if(rar->lastlength == 0)
  ------------------
  |  Branch (3011:10): [True: 1.12k, False: 777k]
  ------------------
 3012|  1.12k|        continue;
 3013|       |
 3014|   777k|      offs = rar->lastoffset;
 3015|   777k|      len = rar->lastlength;
 3016|   777k|    }
 3017|   661k|    else if (symbol <= 262)
  ------------------
  |  Branch (3017:14): [True: 22.7k, False: 638k]
  ------------------
 3018|  22.7k|    {
 3019|  22.7k|      offsindex = symbol - 259;
 3020|  22.7k|      offs = rar->oldoffset[offsindex];
 3021|       |
 3022|  22.7k|      if ((lensymbol = read_next_symbol(a, &rar->lengthcode)) < 0)
  ------------------
  |  Branch (3022:11): [True: 1, False: 22.7k]
  ------------------
 3023|      1|        goto bad_data;
 3024|  22.7k|      if (lensymbol >= lengthb_min)
  ------------------
  |  Branch (3024:11): [True: 0, False: 22.7k]
  ------------------
 3025|      0|        goto bad_data;
 3026|  22.7k|      len = lengthbases[lensymbol] + 2;
 3027|  22.7k|      if (lengthbits[lensymbol] > 0) {
  ------------------
  |  Branch (3027:11): [True: 3.65k, False: 19.1k]
  ------------------
 3028|  3.65k|        if (!rar_br_read_ahead(a, br, lengthbits[lensymbol]))
  ------------------
  |  |  476|  3.65k|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  463|  7.30k|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (463:27): [True: 3.53k, False: 116]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  463|      0|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (463:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (476:28): [True: 116, False: 0]
  |  |  ------------------
  ------------------
 3029|      0|          goto truncated_data;
 3030|  3.65k|        len += rar_br_bits(br, lengthbits[lensymbol]);
  ------------------
  |  |  466|  3.65k|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  467|  3.65k|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 3031|  3.65k|        rar_br_consume(br, lengthbits[lensymbol]);
  ------------------
  |  |  478|  3.65k|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 3032|  3.65k|      }
 3033|       |
 3034|  34.4k|      for (i = offsindex; i > 0; i--)
  ------------------
  |  Branch (3034:27): [True: 11.6k, False: 22.7k]
  ------------------
 3035|  11.6k|        rar->oldoffset[i] = rar->oldoffset[i-1];
 3036|  22.7k|      rar->oldoffset[0] = offs;
 3037|  22.7k|    }
 3038|   638k|    else if(symbol<=270)
  ------------------
  |  Branch (3038:13): [True: 164k, False: 474k]
  ------------------
 3039|   164k|    {
 3040|   164k|      offs = shortbases[symbol-263] + 1;
 3041|   164k|      if(shortbits[symbol-263] > 0) {
  ------------------
  |  Branch (3041:10): [True: 164k, False: 0]
  ------------------
 3042|   164k|        if (!rar_br_read_ahead(a, br, shortbits[symbol-263]))
  ------------------
  |  |  476|   164k|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  463|   328k|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (463:27): [True: 157k, False: 7.29k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  463|     13|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (463:27): [True: 10, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (476:28): [True: 7.28k, False: 13]
  |  |  ------------------
  ------------------
 3043|      3|          goto truncated_data;
 3044|   164k|        offs += rar_br_bits(br, shortbits[symbol-263]);
  ------------------
  |  |  466|   164k|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  467|   164k|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 3045|   164k|        rar_br_consume(br, shortbits[symbol-263]);
  ------------------
  |  |  478|   164k|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 3046|   164k|      }
 3047|       |
 3048|   164k|      len = 2;
 3049|       |
 3050|   657k|      for(i = 3; i > 0; i--)
  ------------------
  |  Branch (3050:18): [True: 492k, False: 164k]
  ------------------
 3051|   492k|        rar->oldoffset[i] = rar->oldoffset[i-1];
 3052|   164k|      rar->oldoffset[0] = offs;
 3053|   164k|    }
 3054|   474k|    else
 3055|   474k|    {
 3056|   474k|      if (symbol-271 >= lengthb_min)
  ------------------
  |  Branch (3056:11): [True: 0, False: 474k]
  ------------------
 3057|      0|        goto bad_data;
 3058|   474k|      len = lengthbases[symbol-271]+3;
 3059|   474k|      if(lengthbits[symbol-271] > 0) {
  ------------------
  |  Branch (3059:10): [True: 350k, False: 124k]
  ------------------
 3060|   350k|        if (!rar_br_read_ahead(a, br, lengthbits[symbol-271]))
  ------------------
  |  |  476|   350k|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  463|   700k|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (463:27): [True: 349k, False: 1.00k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  463|      2|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (463:27): [True: 0, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (476:28): [True: 1.00k, False: 2]
  |  |  ------------------
  ------------------
 3061|      2|          goto truncated_data;
 3062|   350k|        len += rar_br_bits(br, lengthbits[symbol-271]);
  ------------------
  |  |  466|   350k|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  467|   350k|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 3063|   350k|        rar_br_consume(br, lengthbits[symbol-271]);
  ------------------
  |  |  478|   350k|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 3064|   350k|      }
 3065|       |
 3066|   474k|      if ((offssymbol = read_next_symbol(a, &rar->offsetcode)) < 0)
  ------------------
  |  Branch (3066:11): [True: 0, False: 474k]
  ------------------
 3067|      0|        goto bad_data;
 3068|   474k|      if (offssymbol >= offsetb_min)
  ------------------
  |  Branch (3068:11): [True: 0, False: 474k]
  ------------------
 3069|      0|        goto bad_data;
 3070|   474k|      offs = offsetbases[offssymbol]+1;
 3071|   474k|      if(offsetbits[offssymbol] > 0)
  ------------------
  |  Branch (3071:10): [True: 143k, False: 330k]
  ------------------
 3072|   143k|      {
 3073|   143k|        if(offssymbol > 9)
  ------------------
  |  Branch (3073:12): [True: 127k, False: 15.9k]
  ------------------
 3074|   127k|        {
 3075|   127k|          if(offsetbits[offssymbol] > 4) {
  ------------------
  |  Branch (3075:14): [True: 122k, False: 4.58k]
  ------------------
 3076|   122k|            if (!rar_br_read_ahead(a, br, offsetbits[offssymbol] - 4))
  ------------------
  |  |  476|   122k|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  463|   245k|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (463:27): [True: 121k, False: 1.92k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  463|      0|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (463:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (476:28): [True: 1.92k, False: 0]
  |  |  ------------------
  ------------------
 3077|      0|              goto truncated_data;
 3078|   122k|            offs += rar_br_bits(br, offsetbits[offssymbol] - 4) << 4;
  ------------------
  |  |  466|   122k|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  467|   122k|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 3079|   122k|            rar_br_consume(br, offsetbits[offssymbol] - 4);
  ------------------
  |  |  478|   122k|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 3080|   122k|          }
 3081|       |
 3082|   127k|          if(rar->numlowoffsetrepeats > 0)
  ------------------
  |  Branch (3082:14): [True: 25.2k, False: 102k]
  ------------------
 3083|  25.2k|          {
 3084|  25.2k|            rar->numlowoffsetrepeats--;
 3085|  25.2k|            offs += rar->lastlowoffset;
 3086|  25.2k|          }
 3087|   102k|          else
 3088|   102k|          {
 3089|   102k|            if ((lowoffsetsymbol =
  ------------------
  |  Branch (3089:17): [True: 0, False: 102k]
  ------------------
 3090|   102k|              read_next_symbol(a, &rar->lowoffsetcode)) < 0)
 3091|      0|              goto bad_data;
 3092|   102k|            if(lowoffsetsymbol == 16)
  ------------------
  |  Branch (3092:16): [True: 1.70k, False: 100k]
  ------------------
 3093|  1.70k|            {
 3094|  1.70k|              rar->numlowoffsetrepeats = 15;
 3095|  1.70k|              offs += rar->lastlowoffset;
 3096|  1.70k|            }
 3097|   100k|            else
 3098|   100k|            {
 3099|   100k|              offs += lowoffsetsymbol;
 3100|   100k|              rar->lastlowoffset = lowoffsetsymbol;
 3101|   100k|            }
 3102|   102k|          }
 3103|   127k|        }
 3104|  15.9k|        else {
 3105|  15.9k|          if (!rar_br_read_ahead(a, br, offsetbits[offssymbol]))
  ------------------
  |  |  476|  15.9k|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  463|  31.8k|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (463:27): [True: 15.0k, False: 939]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  463|      1|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (463:27): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (476:28): [True: 938, False: 1]
  |  |  ------------------
  ------------------
 3106|      0|            goto truncated_data;
 3107|  15.9k|          offs += rar_br_bits(br, offsetbits[offssymbol]);
  ------------------
  |  |  466|  15.9k|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  467|  15.9k|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 3108|  15.9k|          rar_br_consume(br, offsetbits[offssymbol]);
  ------------------
  |  |  478|  15.9k|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 3109|  15.9k|        }
 3110|   143k|      }
 3111|       |
 3112|   474k|      if (offs >= 0x40000)
  ------------------
  |  Branch (3112:11): [True: 1.09k, False: 473k]
  ------------------
 3113|  1.09k|        len++;
 3114|   474k|      if (offs >= 0x2000)
  ------------------
  |  Branch (3114:11): [True: 5.09k, False: 469k]
  ------------------
 3115|  5.09k|        len++;
 3116|       |
 3117|  1.89M|      for(i = 3; i > 0; i--)
  ------------------
  |  Branch (3117:18): [True: 1.42M, False: 474k]
  ------------------
 3118|  1.42M|        rar->oldoffset[i] = rar->oldoffset[i-1];
 3119|   474k|      rar->oldoffset[0] = offs;
 3120|   474k|    }
 3121|       |
 3122|  1.43M|    rar->lastoffset = offs;
 3123|  1.43M|    rar->lastlength = len;
 3124|       |
 3125|  1.43M|    lzss_emit_match(rar, rar->lastoffset, rar->lastlength);
 3126|  1.43M|  }
 3127|      5|truncated_data:
 3128|      5|  archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      5|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3129|      5|                    "Truncated RAR file data");
 3130|      5|  rar->valid = 0;
 3131|      5|  return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      5|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3132|     86|bad_data:
 3133|     86|  archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     86|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3134|     86|                    "Bad RAR file data");
 3135|     86|  return (ARCHIVE_FAILED);
  ------------------
  |  |  237|     86|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3136|  6.97k|}
archive_read_support_format_rar.c:lzss_position:
  629|  18.9M|{
  630|  18.9M|  return lzss->position;
  631|  18.9M|}
archive_read_support_format_rar.c:read_filter:
 3646|  11.4k|{
 3647|  11.4k|  struct rar *rar = (struct rar *)(a->format->data);
 3648|  11.4k|  uint8_t flags, val, *code;
 3649|  11.4k|  uint16_t length, i;
 3650|       |
 3651|  11.4k|  if (!rar_decode_byte(a, &flags))
  ------------------
  |  Branch (3651:7): [True: 1, False: 11.4k]
  ------------------
 3652|      1|    return 0;
 3653|  11.4k|  length = (flags & 0x07) + 1;
 3654|  11.4k|  if (length == 7)
  ------------------
  |  Branch (3654:7): [True: 4.19k, False: 7.28k]
  ------------------
 3655|  4.19k|  {
 3656|  4.19k|    if (!rar_decode_byte(a, &val))
  ------------------
  |  Branch (3656:9): [True: 0, False: 4.19k]
  ------------------
 3657|      0|      return 0;
 3658|  4.19k|    length = val + 7;
 3659|  4.19k|  }
 3660|  7.28k|  else if (length == 8)
  ------------------
  |  Branch (3660:12): [True: 1.60k, False: 5.67k]
  ------------------
 3661|  1.60k|  {
 3662|  1.60k|    if (!rar_decode_byte(a, &val))
  ------------------
  |  Branch (3662:9): [True: 0, False: 1.60k]
  ------------------
 3663|      0|      return 0;
 3664|  1.60k|    length = val << 8;
 3665|  1.60k|    if (!rar_decode_byte(a, &val))
  ------------------
  |  Branch (3665:9): [True: 0, False: 1.60k]
  ------------------
 3666|      0|      return 0;
 3667|  1.60k|    length |= val;
 3668|  1.60k|  }
 3669|       |
 3670|  11.4k|  code = malloc(length);
 3671|  11.4k|  if (!code)
  ------------------
  |  Branch (3671:7): [True: 0, False: 11.4k]
  ------------------
 3672|      0|    return 0;
 3673|   261k|  for (i = 0; i < length; i++)
  ------------------
  |  Branch (3673:15): [True: 250k, False: 11.4k]
  ------------------
 3674|   250k|  {
 3675|   250k|    if (!rar_decode_byte(a, &code[i]))
  ------------------
  |  Branch (3675:9): [True: 16, False: 250k]
  ------------------
 3676|     16|    {
 3677|     16|      free(code);
 3678|     16|      return 0;
 3679|     16|    }
 3680|   250k|  }
 3681|  11.4k|  if (!parse_filter(a, code, length, flags))
  ------------------
  |  Branch (3681:7): [True: 18, False: 11.4k]
  ------------------
 3682|     18|  {
 3683|     18|    free(code);
 3684|     18|    return 0;
 3685|     18|  }
 3686|  11.4k|  free(code);
 3687|       |
 3688|  11.4k|  if (rar->filters.filterstart < *end)
  ------------------
  |  Branch (3688:7): [True: 1.74k, False: 9.69k]
  ------------------
 3689|  1.74k|    *end = rar->filters.filterstart;
 3690|       |
 3691|  11.4k|  return 1;
 3692|  11.4k|}
archive_read_support_format_rar.c:rar_decode_byte:
 3899|   269k|{
 3900|   269k|  struct rar *rar = (struct rar *)(a->format->data);
 3901|   269k|  struct rar_br *br = &(rar->br);
 3902|   269k|  if (!rar_br_read_ahead(a, br, 8))
  ------------------
  |  |  476|   269k|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  463|   538k|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (463:27): [True: 233k, False: 36.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  463|     32|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (463:27): [True: 15, False: 17]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (476:28): [True: 36.1k, False: 32]
  |  |  ------------------
  ------------------
 3903|     17|    return 0;
 3904|   269k|  *byte = (uint8_t)rar_br_bits(br, 8);
  ------------------
  |  |  466|   269k|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  467|   269k|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 3905|   269k|  rar_br_consume(br, 8);
  ------------------
  |  |  478|   269k|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 3906|   269k|  return 1;
 3907|   269k|}
archive_read_support_format_rar.c:parse_filter:
 3263|  11.4k|{
 3264|  11.4k|  struct rar *rar = (struct rar *)(a->format->data);
 3265|  11.4k|  struct rar_filters *filters = &rar->filters;
 3266|       |
 3267|  11.4k|  struct memory_bit_reader br = { 0 };
 3268|  11.4k|  struct rar_program_code *prog;
 3269|  11.4k|  struct rar_filter *filter, **nextfilter;
 3270|       |
 3271|  11.4k|  uint32_t numprogs, num, blocklength, globaldatalen;
 3272|  11.4k|  uint8_t *globaldata;
 3273|  11.4k|  size_t blockstartpos;
 3274|  11.4k|  uint32_t registers[8] = { 0 };
 3275|  11.4k|  uint32_t i;
 3276|       |
 3277|  11.4k|  br.bytes = bytes;
 3278|  11.4k|  br.length = length;
 3279|       |
 3280|  11.4k|  numprogs = 0;
 3281|  26.4k|  for (prog = filters->progs; prog; prog = prog->next)
  ------------------
  |  Branch (3281:31): [True: 14.9k, False: 11.4k]
  ------------------
 3282|  14.9k|    numprogs++;
 3283|       |
 3284|  11.4k|  if ((flags & 0x80))
  ------------------
  |  Branch (3284:7): [True: 2.98k, False: 8.47k]
  ------------------
 3285|  2.98k|  {
 3286|  2.98k|    num = membr_next_rarvm_number(&br);
 3287|  2.98k|    if (num == 0)
  ------------------
  |  Branch (3287:9): [True: 1.04k, False: 1.93k]
  ------------------
 3288|  1.04k|    {
 3289|  1.04k|      delete_filter(filters->stack);
 3290|  1.04k|      filters->stack = NULL;
 3291|  1.04k|      delete_program_code(filters->progs);
 3292|  1.04k|      filters->progs = NULL;
 3293|  1.04k|    }
 3294|  1.93k|    else
 3295|  1.93k|      num--;
 3296|  2.98k|    if (num > numprogs) {
  ------------------
  |  Branch (3296:9): [True: 4, False: 2.98k]
  ------------------
 3297|      4|      return 0;
 3298|      4|    }
 3299|  2.98k|    filters->lastfilternum = num;
 3300|  2.98k|  }
 3301|  8.47k|  else
 3302|  8.47k|    num = filters->lastfilternum;
 3303|       |
 3304|  11.4k|  prog = filters->progs;
 3305|  14.4k|  for (i = 0; i < num; i++)
  ------------------
  |  Branch (3305:15): [True: 3.01k, False: 11.4k]
  ------------------
 3306|  3.01k|    prog = prog->next;
 3307|  11.4k|  if (prog)
  ------------------
  |  Branch (3307:7): [True: 9.85k, False: 1.59k]
  ------------------
 3308|  9.85k|    prog->usagecount++;
 3309|       |
 3310|  11.4k|  blockstartpos = membr_next_rarvm_number(&br) + (size_t)lzss_position(&rar->lzss);
 3311|  11.4k|  if ((flags & 0x40))
  ------------------
  |  Branch (3311:7): [True: 4.14k, False: 7.31k]
  ------------------
 3312|  4.14k|    blockstartpos += 258;
 3313|  11.4k|  if ((flags & 0x20))
  ------------------
  |  Branch (3313:7): [True: 2.42k, False: 9.03k]
  ------------------
 3314|  2.42k|    blocklength = membr_next_rarvm_number(&br);
 3315|  9.03k|  else
 3316|  9.03k|    blocklength = prog ? prog->oldfilterlength : 0;
  ------------------
  |  Branch (3316:19): [True: 8.56k, False: 468]
  ------------------
 3317|       |
 3318|  11.4k|  if (blocklength > rar->dictionary_size ||
  ------------------
  |  Branch (3318:7): [True: 3, False: 11.4k]
  ------------------
 3319|  11.4k|      blocklength > (uint32_t)(rar->lzss.mask + 1))
  ------------------
  |  Branch (3319:7): [True: 0, False: 11.4k]
  ------------------
 3320|      3|    return 0;
 3321|       |
 3322|  11.4k|  registers[3] = PROGRAM_SYSTEM_GLOBAL_ADDRESS;
  ------------------
  |  |  144|  11.4k|#define PROGRAM_SYSTEM_GLOBAL_ADDRESS PROGRAM_WORK_SIZE
  |  |  ------------------
  |  |  |  |  142|  11.4k|#define PROGRAM_WORK_SIZE 0x3C000
  |  |  ------------------
  ------------------
 3323|  11.4k|  registers[4] = blocklength;
 3324|  11.4k|  registers[5] = prog ? prog->usagecount : 0;
  ------------------
  |  Branch (3324:18): [True: 9.85k, False: 1.59k]
  ------------------
 3325|  11.4k|  registers[7] = VM_MEMORY_SIZE;
  ------------------
  |  |  140|  11.4k|#define VM_MEMORY_SIZE 0x40000
  ------------------
 3326|       |
 3327|  11.4k|  if ((flags & 0x10))
  ------------------
  |  Branch (3327:7): [True: 2.32k, False: 9.12k]
  ------------------
 3328|  2.32k|  {
 3329|  2.32k|    uint8_t mask = (uint8_t)membr_bits(&br, 7);
 3330|  18.6k|    for (i = 0; i < 7; i++)
  ------------------
  |  Branch (3330:17): [True: 16.2k, False: 2.32k]
  ------------------
 3331|  16.2k|      if ((mask & (1 << i)))
  ------------------
  |  Branch (3331:11): [True: 6.60k, False: 9.68k]
  ------------------
 3332|  6.60k|        registers[i] = membr_next_rarvm_number(&br);
 3333|  2.32k|  }
 3334|       |
 3335|  11.4k|  if (!prog)
  ------------------
  |  Branch (3335:7): [True: 1.59k, False: 9.85k]
  ------------------
 3336|  1.59k|  {
 3337|  1.59k|    uint32_t len = membr_next_rarvm_number(&br);
 3338|  1.59k|    uint8_t *bytecode;
 3339|  1.59k|    struct rar_program_code **next;
 3340|       |
 3341|  1.59k|    if (len == 0 || len > 0x10000)
  ------------------
  |  Branch (3341:9): [True: 0, False: 1.59k]
  |  Branch (3341:21): [True: 3, False: 1.59k]
  ------------------
 3342|      3|      return 0;
 3343|  1.59k|    bytecode = malloc(len);
 3344|  1.59k|    if (!bytecode)
  ------------------
  |  Branch (3344:9): [True: 0, False: 1.59k]
  ------------------
 3345|      0|      return 0;
 3346|  49.4k|    for (i = 0; i < len; i++)
  ------------------
  |  Branch (3346:17): [True: 47.8k, False: 1.59k]
  ------------------
 3347|  47.8k|      bytecode[i] = (uint8_t)membr_bits(&br, 8);
 3348|  1.59k|    prog = compile_program(bytecode, len);
 3349|  1.59k|    if (!prog) {
  ------------------
  |  Branch (3349:9): [True: 4, False: 1.59k]
  ------------------
 3350|      4|      free(bytecode);
 3351|      4|      return 0;
 3352|      4|    }
 3353|  1.59k|    free(bytecode);
 3354|  1.59k|    next = &filters->progs;
 3355|  2.16k|    while (*next)
  ------------------
  |  Branch (3355:12): [True: 570, False: 1.59k]
  ------------------
 3356|    570|      next = &(*next)->next;
 3357|  1.59k|    *next = prog;
 3358|  1.59k|  }
 3359|  11.4k|  prog->oldfilterlength = blocklength;
 3360|       |
 3361|  11.4k|  globaldata = NULL;
 3362|  11.4k|  globaldatalen = 0;
 3363|  11.4k|  if ((flags & 0x08))
  ------------------
  |  Branch (3363:7): [True: 494, False: 10.9k]
  ------------------
 3364|    494|  {
 3365|    494|    globaldatalen = membr_next_rarvm_number(&br);
 3366|    494|    if (globaldatalen > PROGRAM_USER_GLOBAL_SIZE)
  ------------------
  |  |  147|    494|#define PROGRAM_USER_GLOBAL_SIZE (PROGRAM_GLOBAL_SIZE - PROGRAM_SYSTEM_GLOBAL_SIZE)
  |  |  ------------------
  |  |  |  |  143|    494|#define PROGRAM_GLOBAL_SIZE 0x2000
  |  |  ------------------
  |  |               #define PROGRAM_USER_GLOBAL_SIZE (PROGRAM_GLOBAL_SIZE - PROGRAM_SYSTEM_GLOBAL_SIZE)
  |  |  ------------------
  |  |  |  |  145|    494|#define PROGRAM_SYSTEM_GLOBAL_SIZE 0x40
  |  |  ------------------
  ------------------
  |  Branch (3366:9): [True: 2, False: 492]
  ------------------
 3367|      2|      return 0;
 3368|    492|    globaldata = malloc(globaldatalen + PROGRAM_SYSTEM_GLOBAL_SIZE);
  ------------------
  |  |  145|    492|#define PROGRAM_SYSTEM_GLOBAL_SIZE 0x40
  ------------------
 3369|    492|    if (!globaldata)
  ------------------
  |  Branch (3369:9): [True: 0, False: 492]
  ------------------
 3370|      0|      return 0;
 3371|  1.30k|    for (i = 0; i < globaldatalen; i++)
  ------------------
  |  Branch (3371:17): [True: 808, False: 492]
  ------------------
 3372|    808|      globaldata[i + PROGRAM_SYSTEM_GLOBAL_SIZE] = (uint8_t)membr_bits(&br, 8);
  ------------------
  |  |  145|    808|#define PROGRAM_SYSTEM_GLOBAL_SIZE 0x40
  ------------------
 3373|    492|  }
 3374|       |
 3375|  11.4k|  if (br.at_eof)
  ------------------
  |  Branch (3375:7): [True: 2, False: 11.4k]
  ------------------
 3376|      2|  {
 3377|      2|      free(globaldata);
 3378|      2|      return 0;
 3379|      2|  }
 3380|       |
 3381|  11.4k|  filter = create_filter(prog, globaldata, globaldatalen, registers, blockstartpos, blocklength);
 3382|  11.4k|  free(globaldata);
 3383|  11.4k|  if (!filter)
  ------------------
  |  Branch (3383:7): [True: 0, False: 11.4k]
  ------------------
 3384|      0|    return 0;
 3385|       |
 3386|  91.5k|  for (i = 0; i < 7; i++)
  ------------------
  |  Branch (3386:15): [True: 80.0k, False: 11.4k]
  ------------------
 3387|  80.0k|    archive_le32enc(&filter->globaldata[i * 4], registers[i]);
 3388|  11.4k|  archive_le32enc(&filter->globaldata[0x1C], blocklength);
 3389|  11.4k|  archive_le32enc(&filter->globaldata[0x20], 0);
 3390|  11.4k|  archive_le32enc(&filter->globaldata[0x2C], prog->usagecount);
 3391|       |
 3392|  11.4k|  nextfilter = &filters->stack;
 3393|   814k|  while (*nextfilter)
  ------------------
  |  Branch (3393:10): [True: 803k, False: 11.4k]
  ------------------
 3394|   803k|    nextfilter = &(*nextfilter)->next;
 3395|  11.4k|  *nextfilter = filter;
 3396|       |
 3397|  11.4k|  if (!filters->stack->next)
  ------------------
  |  Branch (3397:7): [True: 2.20k, False: 9.24k]
  ------------------
 3398|  2.20k|    filters->filterstart = blockstartpos;
 3399|       |
 3400|  11.4k|  return 1;
 3401|  11.4k|}
archive_read_support_format_rar.c:membr_next_rarvm_number:
 3602|  26.0k|{
 3603|  26.0k|  uint32_t val;
 3604|  26.0k|  switch (membr_bits(br, 2))
 3605|  26.0k|  {
 3606|  15.4k|    case 0:
  ------------------
  |  Branch (3606:5): [True: 15.4k, False: 10.6k]
  ------------------
 3607|  15.4k|      return membr_bits(br, 4);
 3608|  5.58k|    case 1:
  ------------------
  |  Branch (3608:5): [True: 5.58k, False: 20.4k]
  ------------------
 3609|  5.58k|      val = membr_bits(br, 8);
 3610|  5.58k|      if (val >= 16)
  ------------------
  |  Branch (3610:11): [True: 3.66k, False: 1.91k]
  ------------------
 3611|  3.66k|        return val;
 3612|  1.91k|      return 0xFFFFFF00 | (val << 4) | membr_bits(br, 4);
 3613|  2.36k|    case 2:
  ------------------
  |  Branch (3613:5): [True: 2.36k, False: 23.6k]
  ------------------
 3614|  2.36k|      return membr_bits(br, 16);
 3615|  2.65k|    default:
  ------------------
  |  Branch (3615:5): [True: 2.65k, False: 23.3k]
  ------------------
 3616|  2.65k|      return membr_bits(br, 32);
 3617|  26.0k|  }
 3618|  26.0k|}
archive_read_support_format_rar.c:delete_program_code:
 3589|  3.54k|{
 3590|  5.13k|  while (prog)
  ------------------
  |  Branch (3590:10): [True: 1.59k, False: 3.54k]
  ------------------
 3591|  1.59k|  {
 3592|  1.59k|    struct rar_program_code *next = prog->next;
 3593|  1.59k|    free(prog->staticdata);
 3594|  1.59k|    free(prog->globalbackup);
 3595|  1.59k|    free(prog);
 3596|  1.59k|    prog = next;
 3597|  1.59k|  }
 3598|  3.54k|}
archive_read_support_format_rar.c:membr_bits:
 3622|   218k|{
 3623|   218k|  if (bits > br->available && (br->at_eof || !membr_fill(br, bits)))
  ------------------
  |  Branch (3623:7): [True: 193k, False: 25.3k]
  |  Branch (3623:32): [True: 111k, False: 81.6k]
  |  Branch (3623:46): [True: 479, False: 81.2k]
  ------------------
 3624|   111k|    return 0;
 3625|   106k|  return (uint32_t)((br->bits >> (br->available -= bits)) & (((uint64_t)1 << bits) - 1));
 3626|   218k|}
archive_read_support_format_rar.c:membr_fill:
 3630|  81.6k|{
 3631|   173k|  while (br->available < bits && br->offset < br->length)
  ------------------
  |  Branch (3631:10): [True: 92.0k, False: 81.2k]
  |  Branch (3631:34): [True: 91.5k, False: 479]
  ------------------
 3632|  91.5k|  {
 3633|  91.5k|    br->bits = (br->bits << 8) | br->bytes[br->offset++];
 3634|  91.5k|    br->available += 8;
 3635|  91.5k|  }
 3636|  81.6k|  if (bits > br->available)
  ------------------
  |  Branch (3636:7): [True: 479, False: 81.2k]
  ------------------
 3637|    479|  {
 3638|    479|    br->at_eof = 1;
 3639|    479|    return 0;
 3640|    479|  }
 3641|  81.2k|  return 1;
 3642|  81.6k|}
archive_read_support_format_rar.c:compile_program:
 3529|  1.59k|{
 3530|  1.59k|  struct memory_bit_reader br = { 0 };
 3531|  1.59k|  struct rar_program_code *prog;
 3532|       |  // uint32_t instrcount = 0;
 3533|  1.59k|  uint8_t xor;
 3534|  1.59k|  size_t i;
 3535|       |
 3536|  1.59k|  xor = 0;
 3537|  47.8k|  for (i = 1; i < length; i++)
  ------------------
  |  Branch (3537:15): [True: 46.2k, False: 1.59k]
  ------------------
 3538|  46.2k|    xor ^= bytes[i];
 3539|  1.59k|  if (!length || xor != bytes[0])
  ------------------
  |  Branch (3539:7): [True: 0, False: 1.59k]
  |  Branch (3539:18): [True: 4, False: 1.59k]
  ------------------
 3540|      4|    return NULL;
 3541|       |
 3542|  1.59k|  br.bytes = bytes;
 3543|  1.59k|  br.length = length;
 3544|  1.59k|  br.offset = 1;
 3545|       |
 3546|  1.59k|  prog = calloc(1, sizeof(*prog));
 3547|  1.59k|  if (!prog)
  ------------------
  |  Branch (3547:7): [True: 0, False: 1.59k]
  ------------------
 3548|      0|    return NULL;
 3549|  1.59k|  prog->fingerprint = crc32(0, bytes, (unsigned int)length) | ((uint64_t)length << 32);
 3550|       |
 3551|  1.59k|  if (membr_bits(&br, 1))
  ------------------
  |  Branch (3551:7): [True: 472, False: 1.11k]
  ------------------
 3552|    472|  {
 3553|    472|    prog->staticdatalen = membr_next_rarvm_number(&br) + 1;
 3554|    472|    prog->staticdata = malloc(prog->staticdatalen);
 3555|    472|    if (!prog->staticdata)
  ------------------
  |  Branch (3555:9): [True: 0, False: 472]
  ------------------
 3556|      0|    {
 3557|      0|      delete_program_code(prog);
 3558|      0|      return NULL;
 3559|      0|    }
 3560|   112k|    for (i = 0; i < prog->staticdatalen; i++)
  ------------------
  |  Branch (3560:17): [True: 111k, False: 472]
  ------------------
 3561|   111k|      prog->staticdata[i] = (uint8_t)membr_bits(&br, 8);
 3562|    472|  }
 3563|       |
 3564|  1.59k|  return prog;
 3565|  1.59k|}
archive_read_support_format_rar.c:create_filter:
 3405|  11.4k|{
 3406|  11.4k|  struct rar_filter *filter;
 3407|       |
 3408|  11.4k|  filter = calloc(1, sizeof(*filter));
 3409|  11.4k|  if (!filter)
  ------------------
  |  Branch (3409:7): [True: 0, False: 11.4k]
  ------------------
 3410|      0|    return NULL;
 3411|  11.4k|  filter->prog = prog;
 3412|  11.4k|  filter->globaldatalen = globaldatalen > PROGRAM_SYSTEM_GLOBAL_SIZE ? globaldatalen : PROGRAM_SYSTEM_GLOBAL_SIZE;
  ------------------
  |  |  145|  11.4k|#define PROGRAM_SYSTEM_GLOBAL_SIZE 0x40
  ------------------
                filter->globaldatalen = globaldatalen > PROGRAM_SYSTEM_GLOBAL_SIZE ? globaldatalen : PROGRAM_SYSTEM_GLOBAL_SIZE;
  ------------------
  |  |  145|  22.8k|#define PROGRAM_SYSTEM_GLOBAL_SIZE 0x40
  ------------------
  |  Branch (3412:27): [True: 0, False: 11.4k]
  ------------------
 3413|  11.4k|  filter->globaldata = calloc(1, filter->globaldatalen);
 3414|  11.4k|  if (!filter->globaldata)
  ------------------
  |  Branch (3414:7): [True: 0, False: 11.4k]
  ------------------
 3415|      0|  {
 3416|      0|    free(filter);
 3417|      0|    return NULL;
 3418|      0|  }
 3419|  11.4k|  if (globaldata)
  ------------------
  |  Branch (3419:7): [True: 491, False: 10.9k]
  ------------------
 3420|    491|    memcpy(filter->globaldata, globaldata, globaldatalen);
 3421|  11.4k|  if (registers)
  ------------------
  |  Branch (3421:7): [True: 11.4k, False: 0]
  ------------------
 3422|  11.4k|    memcpy(filter->initialregisters, registers, sizeof(filter->initialregisters));
 3423|  11.4k|  filter->blockstartpos = startpos;
 3424|  11.4k|  filter->blocklength = length;
 3425|       |
 3426|  11.4k|  return filter;
 3427|  11.4k|}
archive_read_support_format_rar.c:archive_read_format_rar_read_data_skip:
 1154|    760|{
 1155|    760|  struct rar *rar;
 1156|    760|  int64_t bytes_skipped;
 1157|    760|  int ret;
 1158|       |
 1159|    760|  rar = (struct rar *)(a->format->data);
 1160|       |
 1161|    760|  if (rar->bytes_unconsumed > 0) {
  ------------------
  |  Branch (1161:7): [True: 54, False: 706]
  ------------------
 1162|       |      /* Consume as much as the decompressor actually used. */
 1163|     54|      __archive_read_consume(a, rar->bytes_unconsumed);
 1164|     54|      rar->bytes_unconsumed = 0;
 1165|     54|  }
 1166|       |
 1167|    760|  if (rar->bytes_remaining > 0) {
  ------------------
  |  Branch (1167:7): [True: 396, False: 364]
  ------------------
 1168|    396|    bytes_skipped = __archive_read_consume(a, rar->bytes_remaining);
 1169|    396|    if (bytes_skipped < 0)
  ------------------
  |  Branch (1169:9): [True: 123, False: 273]
  ------------------
 1170|    123|      return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    123|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1171|    396|  }
 1172|       |
 1173|       |  /* Compressed data to skip must be read from each header in a multivolume
 1174|       |   * archive.
 1175|       |   */
 1176|    637|  if (rar->main_flags & MHD_VOLUME && rar->file_flags & FHD_SPLIT_AFTER)
  ------------------
  |  |   65|  1.27k|#define MHD_VOLUME       0x0001
  ------------------
                if (rar->main_flags & MHD_VOLUME && rar->file_flags & FHD_SPLIT_AFTER)
  ------------------
  |  |   82|    464|#define FHD_SPLIT_AFTER  0x0002
  ------------------
  |  Branch (1176:7): [True: 464, False: 173]
  |  Branch (1176:39): [True: 310, False: 154]
  ------------------
 1177|    310|  {
 1178|    310|    ret = archive_read_format_rar_read_header(a, a->entry);
 1179|    310|    if (ret == (ARCHIVE_EOF))
  ------------------
  |  |  232|    310|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (1179:9): [True: 0, False: 310]
  ------------------
 1180|      0|      ret = archive_read_format_rar_read_header(a, a->entry);
 1181|    310|    if (ret != (ARCHIVE_OK))
  ------------------
  |  |  233|    310|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1181:9): [True: 46, False: 264]
  ------------------
 1182|     46|      return ret;
 1183|    264|    return archive_read_format_rar_read_data_skip(a);
 1184|    310|  }
 1185|       |
 1186|    327|  return (ARCHIVE_OK);
  ------------------
  |  |  233|    327|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1187|    637|}
archive_read_support_format_rar.c:archive_read_format_rar_cleanup:
 1345|  2.49k|{
 1346|  2.49k|  struct rar *rar;
 1347|       |
 1348|  2.49k|  rar = (struct rar *)(a->format->data);
 1349|  2.49k|  free_codes(a);
 1350|  2.49k|  clear_filters(&rar->filters);
 1351|  2.49k|  free(rar->filename);
 1352|  2.49k|  free(rar->filename_save);
 1353|  2.49k|  free(rar->dbo);
 1354|  2.49k|  free(rar->unp_buffer);
 1355|  2.49k|  free(rar->lzss.window);
 1356|  2.49k|  __archive_ppmd7_functions.Ppmd7_Free(&rar->ppmd7_context);
 1357|  2.49k|  free(rar);
 1358|  2.49k|  (a->format->data) = NULL;
 1359|  2.49k|  return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1360|  2.49k|}
archive_read_support_format_rar.c:clear_filters:
 3581|  2.49k|{
 3582|  2.49k|  delete_filter(filters->stack);
 3583|  2.49k|  delete_program_code(filters->progs);
 3584|  2.49k|  free(filters->vm);
 3585|  2.49k|}

archive_read_support_format_rar5:
 4405|  2.49k|int archive_read_support_format_rar5(struct archive *_a) {
 4406|  2.49k|	struct archive_read* ar;
 4407|  2.49k|	int ret;
 4408|  2.49k|	struct rar5* rar;
 4409|       |
 4410|  2.49k|	if(ARCHIVE_OK != (ret = get_archive_read(_a, &ar)))
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4410:5): [True: 0, False: 2.49k]
  ------------------
 4411|      0|		return ret;
 4412|       |
 4413|  2.49k|	rar = malloc(sizeof(*rar));
 4414|  2.49k|	if(rar == NULL) {
  ------------------
  |  Branch (4414:5): [True: 0, False: 2.49k]
  ------------------
 4415|      0|		archive_set_error(&ar->archive, ENOMEM,
 4416|      0|		    "Can't allocate rar5 data");
 4417|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4418|      0|	}
 4419|       |
 4420|  2.49k|	if(ARCHIVE_OK != rar5_init(rar)) {
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4420:5): [True: 0, False: 2.49k]
  ------------------
 4421|      0|		archive_set_error(&ar->archive, ENOMEM,
 4422|      0|		    "Can't allocate rar5 filter buffer");
 4423|      0|		free(rar);
 4424|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4425|      0|	}
 4426|       |
 4427|  2.49k|	ret = __archive_read_register_format(ar,
 4428|  2.49k|	    rar,
 4429|  2.49k|	    "rar5",
 4430|  2.49k|	    rar5_bid,
 4431|  2.49k|	    rar5_options,
 4432|  2.49k|	    rar5_read_header,
 4433|  2.49k|	    rar5_read_data,
 4434|  2.49k|	    rar5_read_data_skip,
 4435|  2.49k|	    rar5_seek_data,
 4436|  2.49k|	    rar5_cleanup,
 4437|  2.49k|	    rar5_capabilities,
 4438|  2.49k|	    rar5_has_encrypted_entries);
 4439|       |
 4440|  2.49k|	if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4440:5): [True: 0, False: 2.49k]
  ------------------
 4441|      0|		rar5_deinit(rar);
 4442|      0|		free(rar);
 4443|      0|	}
 4444|       |
 4445|  2.49k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4446|  2.49k|}
archive_read_support_format_rar5.c:get_archive_read:
  897|  2.49k|{
  898|  2.49k|	*ar = (struct archive_read*) a;
  899|  2.49k|	archive_check_magic(a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
  ------------------
  |  |  151|  2.49k|	do { \
  |  |  152|  2.49k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|  2.49k|			(allowed_states), (function_name)); \
  |  |  154|  2.49k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  2.49k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 2.49k]
  |  |  ------------------
  |  |  155|  2.49k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|  2.49k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 2.49k]
  |  |  ------------------
  ------------------
  900|  2.49k|	    "archive_read_support_format_rar5");
  901|       |
  902|  2.49k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  903|  2.49k|}
archive_read_support_format_rar5.c:rar5_init:
 4385|  2.49k|static int rar5_init(struct rar5* rar) {
 4386|  2.49k|	memset(rar, 0, sizeof(struct rar5));
 4387|       |
 4388|  2.49k|	if(CDE_OK != cdeque_init(&rar->cstate.filters, 8192))
  ------------------
  |  Branch (4388:5): [True: 0, False: 2.49k]
  ------------------
 4389|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4390|       |
 4391|       |	/*
 4392|       |	 * Until enough data has been read, we cannot tell about
 4393|       |	 * any encrypted entries yet.
 4394|       |	 */
 4395|  2.49k|	rar->has_encrypted_entries = ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW;
  ------------------
  |  |  411|  2.49k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
 4396|       |
 4397|  2.49k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4398|  2.49k|}
archive_read_support_format_rar5.c:cdeque_init:
  395|  2.49k|static int cdeque_init(struct cdeque* d, int max_capacity_power_of_2) {
  396|  2.49k|	if(d == NULL || max_capacity_power_of_2 == 0)
  ------------------
  |  Branch (396:5): [True: 0, False: 2.49k]
  |  Branch (396:18): [True: 0, False: 2.49k]
  ------------------
  397|      0|		return CDE_PARAM;
  398|       |
  399|  2.49k|	d->cap_mask = max_capacity_power_of_2 - 1;
  400|  2.49k|	d->arr = NULL;
  401|       |
  402|  2.49k|	if((max_capacity_power_of_2 & d->cap_mask) != 0)
  ------------------
  |  Branch (402:5): [True: 0, False: 2.49k]
  ------------------
  403|      0|		return CDE_PARAM;
  404|       |
  405|  2.49k|	cdeque_clear(d);
  406|  2.49k|	d->arr = malloc(sizeof(void*) * max_capacity_power_of_2);
  407|       |
  408|  2.49k|	return d->arr ? CDE_OK : CDE_ALLOC;
  ------------------
  |  Branch (408:9): [True: 2.49k, False: 0]
  ------------------
  409|  2.49k|}
archive_read_support_format_rar5.c:cdeque_clear:
  386|  17.8k|static void cdeque_clear(struct cdeque* d) {
  387|  17.8k|	d->size = 0;
  388|  17.8k|	d->beg_pos = 0;
  389|  17.8k|	d->end_pos = 0;
  390|  17.8k|}
archive_read_support_format_rar5.c:rar5_bid:
 1182|  2.46k|static int rar5_bid(struct archive_read* a, int best_bid) {
 1183|  2.46k|	int my_bid;
 1184|       |
 1185|  2.46k|	if(best_bid > 30)
  ------------------
  |  Branch (1185:5): [True: 975, False: 1.48k]
  ------------------
 1186|    975|		return -1;
 1187|       |
 1188|  1.48k|	my_bid = bid_standard(a);
 1189|  1.48k|	if(my_bid > -1) {
  ------------------
  |  Branch (1189:5): [True: 359, False: 1.12k]
  ------------------
 1190|    359|		return my_bid;
 1191|    359|	}
 1192|  1.12k|	my_bid = bid_sfx(a);
 1193|  1.12k|	if (my_bid > -1) {
  ------------------
  |  Branch (1193:6): [True: 1.09k, False: 29]
  ------------------
 1194|  1.09k|		return my_bid;
 1195|  1.09k|	}
 1196|       |
 1197|     29|	return -1;
 1198|  1.12k|}
archive_read_support_format_rar5.c:bid_standard:
 1129|  1.48k|static int bid_standard(struct archive_read* a) {
 1130|  1.48k|	const uint8_t* p;
 1131|  1.48k|	char signature[sizeof(rar5_signature_xor)];
 1132|       |
 1133|  1.48k|	rar5_signature(signature);
 1134|       |
 1135|  1.48k|	if(!read_ahead(a, sizeof(rar5_signature_xor), &p))
  ------------------
  |  Branch (1135:5): [True: 29, False: 1.45k]
  ------------------
 1136|     29|		return -1;
 1137|       |
 1138|  1.45k|	if(!memcmp(signature, p, sizeof(rar5_signature_xor)))
  ------------------
  |  Branch (1138:5): [True: 359, False: 1.09k]
  ------------------
 1139|    359|		return 30;
 1140|       |
 1141|  1.09k|	return -1;
 1142|  1.45k|}
archive_read_support_format_rar5.c:rar5_signature:
 4209|  18.9k|static void rar5_signature(char *buf) {
 4210|  18.9k|		size_t i;
 4211|       |
 4212|   170k|		for(i = 0; i < sizeof(rar5_signature_xor); i++) {
  ------------------
  |  Branch (4212:14): [True: 151k, False: 18.9k]
  ------------------
 4213|   151k|			buf[i] = rar5_signature_xor[i] ^ 0xA1;
 4214|   151k|		}
 4215|  18.9k|}
archive_read_support_format_rar5.c:read_ahead:
  907|   586k|{
  908|   586k|	ssize_t avail = -1;
  909|   586k|	if(!ptr)
  ------------------
  |  Branch (909:5): [True: 0, False: 586k]
  ------------------
  910|      0|		return 0;
  911|       |
  912|   586k|	*ptr = __archive_read_ahead(a, how_many, &avail);
  913|   586k|	if(*ptr == NULL) {
  ------------------
  |  Branch (913:5): [True: 1.61k, False: 584k]
  ------------------
  914|  1.61k|		return 0;
  915|  1.61k|	}
  916|       |
  917|   584k|	return 1;
  918|   586k|}
archive_read_support_format_rar5.c:bid_sfx:
 1145|  1.12k|{
 1146|  1.12k|	const char *p;
 1147|       |
 1148|  1.12k|	if ((p = __archive_read_ahead(a, 7, NULL)) == NULL)
  ------------------
  |  Branch (1148:6): [True: 29, False: 1.09k]
  ------------------
 1149|     29|		return -1;
 1150|       |
 1151|  1.09k|	if ((p[0] == 'M' && p[1] == 'Z') || memcmp(p, "\x7F\x45LF", 4) == 0) {
  ------------------
  |  Branch (1151:7): [True: 60, False: 1.03k]
  |  Branch (1151:22): [True: 60, False: 0]
  |  Branch (1151:38): [True: 15, False: 1.02k]
  ------------------
 1152|       |		/* This is a PE file */
 1153|     75|		char signature[sizeof(rar5_signature_xor)];
 1154|     75|		ssize_t offset = 0x10000;
 1155|     75|		ssize_t window = 4096;
 1156|     75|		ssize_t bytes_avail;
 1157|       |
 1158|     75|		rar5_signature(signature);
 1159|       |
 1160|    571|		while (offset + window <= (1024 * 512)) {
  ------------------
  |  Branch (1160:10): [True: 563, False: 8]
  ------------------
 1161|    563|			const char *buff = __archive_read_ahead(a, offset + window, &bytes_avail);
 1162|    563|			if (buff == NULL) {
  ------------------
  |  Branch (1162:8): [True: 438, False: 125]
  ------------------
 1163|       |				/* Remaining bytes are less than window. */
 1164|    438|				window >>= 1;
 1165|    438|				if (window < 0x40)
  ------------------
  |  Branch (1165:9): [True: 62, False: 376]
  ------------------
 1166|     62|					return 0;
 1167|    376|				continue;
 1168|    438|			}
 1169|    125|			p = buff + offset;
 1170|   427k|			while (p + 8 < buff + bytes_avail) {
  ------------------
  |  Branch (1170:11): [True: 427k, False: 120]
  ------------------
 1171|   427k|				if (memcmp(p, signature, sizeof(signature)) == 0)
  ------------------
  |  Branch (1171:9): [True: 5, False: 427k]
  ------------------
 1172|      5|					return 30;
 1173|   427k|				p += 0x10;
 1174|   427k|			}
 1175|    120|			offset = p - buff;
 1176|    120|		}
 1177|     75|	}
 1178|       |
 1179|  1.03k|	return 0;
 1180|  1.09k|}
archive_read_support_format_rar5.c:rar5_read_header:
 2529|  3.31k|{
 2530|  3.31k|	struct rar5* rar = get_context(a);
 2531|  3.31k|	int ret;
 2532|       |
 2533|       |	/*
 2534|       |	 * It should be sufficient to call archive_read_next_header() for
 2535|       |	 * a reader to determine if an entry is encrypted or not.
 2536|       |	 */
 2537|  3.31k|	if (rar->has_encrypted_entries == ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW) {
  ------------------
  |  |  411|  3.31k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  |  Branch (2537:6): [True: 262, False: 3.04k]
  ------------------
 2538|    262|		rar->has_encrypted_entries = 0;
 2539|    262|	}
 2540|       |
 2541|  3.31k|	if(rar->header_initialized == 0) {
  ------------------
  |  Branch (2541:5): [True: 262, False: 3.04k]
  ------------------
 2542|    262|		init_header(a);
 2543|    262|		if ((ret = try_skip_sfx(a)) < ARCHIVE_WARN)
  ------------------
  |  |  235|    262|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (2543:7): [True: 0, False: 262]
  ------------------
 2544|      0|			return ret;
 2545|    262|		rar->header_initialized = 1;
 2546|    262|	}
 2547|       |
 2548|  3.31k|	if(rar->skipped_magic == 0) {
  ------------------
  |  Branch (2548:5): [True: 262, False: 3.04k]
  ------------------
 2549|    262|		if(ARCHIVE_OK != consume(a, sizeof(rar5_signature_xor))) {
  ------------------
  |  |  233|    262|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2549:6): [True: 0, False: 262]
  ------------------
 2550|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2551|      0|		}
 2552|       |
 2553|    262|		rar->skipped_magic = 1;
 2554|    262|	}
 2555|       |
 2556|  6.63k|	do {
 2557|  6.63k|		ret = process_base_block(a, entry);
 2558|  6.63k|	} while(ret == ARCHIVE_RETRY ||
  ------------------
  |  |  234|  13.2k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  |  Branch (2558:10): [True: 2.14k, False: 4.48k]
  ------------------
 2559|  4.48k|			(rar->main.endarc > 0 && ret == ARCHIVE_OK));
  ------------------
  |  |  233|  1.18k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2559:5): [True: 1.18k, False: 3.30k]
  |  Branch (2559:29): [True: 1.17k, False: 9]
  ------------------
 2560|       |
 2561|  3.31k|	return ret;
 2562|  3.31k|}
archive_read_support_format_rar5.c:get_context:
  517|   660k|static inline struct rar5* get_context(struct archive_read* a) {
  518|   660k|	return (struct rar5*) a->format->data;
  519|   660k|}
archive_read_support_format_rar5.c:init_header:
 1213|    262|static void init_header(struct archive_read* a) {
 1214|    262|	a->archive.archive_format = ARCHIVE_FORMAT_RAR_V5;
  ------------------
  |  |  387|    262|#define	ARCHIVE_FORMAT_RAR_V5			0x100000
  ------------------
 1215|    262|	a->archive.archive_format_name = "RAR5";
 1216|    262|}
archive_read_support_format_rar5.c:try_skip_sfx:
 2472|    262|{
 2473|    262|	const char *p;
 2474|       |
 2475|    262|	if ((p = __archive_read_ahead(a, 7, NULL)) == NULL)
  ------------------
  |  Branch (2475:6): [True: 0, False: 262]
  ------------------
 2476|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2477|       |
 2478|    262|	if ((p[0] == 'M' && p[1] == 'Z') || memcmp(p, "\x7F\x45LF", 4) == 0)
  ------------------
  |  Branch (2478:7): [True: 0, False: 262]
  |  Branch (2478:22): [True: 0, False: 0]
  |  Branch (2478:38): [True: 4, False: 258]
  ------------------
 2479|      4|	{
 2480|      4|		char signature[sizeof(rar5_signature_xor)];
 2481|      4|		const void *h;
 2482|      4|		const char *q;
 2483|      4|		size_t skip, total = 0;
 2484|      4|		ssize_t bytes, window = 4096;
 2485|       |
 2486|      4|		rar5_signature(signature);
 2487|       |
 2488|      4|		while (total + window <= (1024 * 512)) {
  ------------------
  |  Branch (2488:10): [True: 4, False: 0]
  ------------------
 2489|      4|			h = __archive_read_ahead(a, window, &bytes);
 2490|      4|			if (h == NULL) {
  ------------------
  |  Branch (2490:8): [True: 0, False: 4]
  ------------------
 2491|       |				/* Remaining bytes are less than window. */
 2492|      0|				window >>= 1;
 2493|      0|				if (window < 0x40)
  ------------------
  |  Branch (2493:9): [True: 0, False: 0]
  ------------------
 2494|      0|					goto fatal;
 2495|      0|				continue;
 2496|      0|			}
 2497|      4|			if (bytes < 0x40)
  ------------------
  |  Branch (2497:8): [True: 0, False: 4]
  ------------------
 2498|      0|				goto fatal;
 2499|      4|			p = h;
 2500|      4|			q = p + bytes;
 2501|       |
 2502|       |			/*
 2503|       |			 * Scan ahead until we find something that looks
 2504|       |			 * like the RAR header.
 2505|       |			 */
 2506|  1.69k|			while (p + 8 < q) {
  ------------------
  |  Branch (2506:11): [True: 1.69k, False: 0]
  ------------------
 2507|  1.69k|				if (memcmp(p, signature, sizeof(signature)) == 0) {
  ------------------
  |  Branch (2507:9): [True: 4, False: 1.68k]
  ------------------
 2508|      4|					skip = p - (const char *)h;
 2509|      4|					__archive_read_consume(a, skip);
 2510|      4|					return (ARCHIVE_OK);
  ------------------
  |  |  233|      4|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2511|      4|				}
 2512|  1.68k|				p += 0x10;
 2513|  1.68k|			}
 2514|      0|			skip = p - (const char *)h;
 2515|      0|			__archive_read_consume(a, skip);
 2516|      0|			total += skip;
 2517|      0|		}
 2518|      4|	}
 2519|       |
 2520|    258|	return ARCHIVE_OK;
  ------------------
  |  |  233|    258|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2521|      0|fatal:
 2522|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2523|      0|			"Couldn't find out RAR header");
 2524|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2525|    262|}
archive_read_support_format_rar5.c:consume:
  920|   517k|static int consume(struct archive_read* a, int64_t how_many) {
  921|   517k|	int ret;
  922|       |
  923|   517k|	ret = how_many == __archive_read_consume(a, how_many)
  ------------------
  |  Branch (923:8): [True: 515k, False: 1.78k]
  ------------------
  924|   517k|		? ARCHIVE_OK
  ------------------
  |  |  233|   515k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  925|   517k|		: ARCHIVE_FATAL;
  ------------------
  |  |  239|   519k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  926|       |
  927|   517k|	return ret;
  928|   517k|}
archive_read_support_format_rar5.c:process_base_block:
 2279|  55.5k|{
 2280|  55.5k|	const size_t SMALLEST_RAR5_BLOCK_SIZE = 3;
 2281|       |
 2282|  55.5k|	struct rar5* rar = get_context(a);
 2283|  55.5k|	uint32_t hdr_crc, computed_crc;
 2284|  55.5k|	size_t raw_hdr_size = 0, hdr_size_len, hdr_size;
 2285|  55.5k|	size_t header_id = 0;
 2286|  55.5k|	size_t header_flags = 0;
 2287|  55.5k|	const uint8_t* p;
 2288|  55.5k|	int ret;
 2289|       |
 2290|  55.5k|	enum HEADER_TYPE {
 2291|  55.5k|		HEAD_MARK    = 0x00, HEAD_MAIN  = 0x01, HEAD_FILE   = 0x02,
 2292|  55.5k|		HEAD_SERVICE = 0x03, HEAD_CRYPT = 0x04, HEAD_ENDARC = 0x05,
 2293|  55.5k|		HEAD_UNKNOWN = 0xff,
 2294|  55.5k|	};
 2295|       |
 2296|       |	/* Skip any unprocessed data for this file. */
 2297|  55.5k|	ret = skip_unprocessed_bytes(a);
 2298|  55.5k|	if(ret != ARCHIVE_OK)
  ------------------
  |  |  233|  55.5k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2298:5): [True: 8.72k, False: 46.7k]
  ------------------
 2299|  8.72k|		return ret;
 2300|       |
 2301|       |	/* Read the expected CRC32 checksum. */
 2302|  46.7k|	if(!read_u32(a, &hdr_crc)) {
  ------------------
  |  Branch (2302:5): [True: 9, False: 46.7k]
  ------------------
 2303|      9|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      9|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2304|      9|	}
 2305|       |
 2306|       |	/* Read header size. */
 2307|  46.7k|	if(!read_var_sized(a, &raw_hdr_size, &hdr_size_len)) {
  ------------------
  |  Branch (2307:5): [True: 4, False: 46.7k]
  ------------------
 2308|      4|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      4|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2309|      4|	}
 2310|       |
 2311|  46.7k|	hdr_size = raw_hdr_size + hdr_size_len;
 2312|       |
 2313|       |	/* Sanity check, maximum header size for RAR5 is 2MB. */
 2314|  46.7k|	if(hdr_size > (2 * 1024 * 1024)) {
  ------------------
  |  Branch (2314:5): [True: 14, False: 46.7k]
  ------------------
 2315|     14|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     14|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2316|     14|		    "Base block header is too large");
 2317|       |
 2318|     14|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|     14|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2319|     14|	}
 2320|       |
 2321|       |	/* Additional sanity checks to weed out invalid files. */
 2322|  46.7k|	if(raw_hdr_size == 0 || hdr_size_len == 0 ||
  ------------------
  |  Branch (2322:5): [True: 50, False: 46.7k]
  |  Branch (2322:26): [True: 0, False: 46.7k]
  ------------------
 2323|  46.7k|		hdr_size < SMALLEST_RAR5_BLOCK_SIZE)
  ------------------
  |  Branch (2323:3): [True: 5, False: 46.6k]
  ------------------
 2324|     55|	{
 2325|     55|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     55|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2326|     55|		    "Too small block encountered (%zu bytes)",
 2327|     55|		    raw_hdr_size);
 2328|       |
 2329|     55|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|     55|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2330|     55|	}
 2331|       |
 2332|       |	/* Read the whole header data into memory, maximum memory use here is
 2333|       |	 * 2MB. */
 2334|  46.6k|	if(!read_ahead(a, hdr_size, &p)) {
  ------------------
  |  Branch (2334:5): [True: 220, False: 46.4k]
  ------------------
 2335|    220|		return ARCHIVE_EOF;
  ------------------
  |  |  232|    220|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2336|    220|	}
 2337|       |
 2338|       |	/* Verify the CRC32 of the header data. */
 2339|  46.4k|	computed_crc = (uint32_t) crc32(0, p, (int) hdr_size);
 2340|  46.4k|	if(computed_crc != hdr_crc) {
  ------------------
  |  Branch (2340:5): [True: 44.5k, False: 1.90k]
  ------------------
 2341|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 2342|       |		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
 2343|       |		    "Header CRC error");
 2344|       |
 2345|       |		return ARCHIVE_FATAL;
 2346|       |#endif
 2347|  44.5k|	}
 2348|       |
 2349|       |	/* If the checksum is OK, we proceed with parsing. */
 2350|  46.4k|	if(ARCHIVE_OK != consume(a, hdr_size_len)) {
  ------------------
  |  |  233|  46.4k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2350:5): [True: 0, False: 46.4k]
  ------------------
 2351|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2352|      0|	}
 2353|       |
 2354|  46.4k|	if(!read_var_sized(a, &header_id, NULL))
  ------------------
  |  Branch (2354:5): [True: 0, False: 46.4k]
  ------------------
 2355|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2356|       |
 2357|  46.4k|	if(!read_var_sized(a, &header_flags, NULL))
  ------------------
  |  Branch (2357:5): [True: 0, False: 46.4k]
  ------------------
 2358|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2359|       |
 2360|  46.4k|	rar->generic.split_after = (header_flags & HFL_SPLIT_AFTER) > 0;
 2361|  46.4k|	rar->generic.split_before = (header_flags & HFL_SPLIT_BEFORE) > 0;
 2362|  46.4k|	rar->generic.size = (int)hdr_size;
 2363|  46.4k|	rar->generic.last_header_id = (int)header_id;
 2364|  46.4k|	rar->main.endarc = 0;
 2365|       |
 2366|       |	/* Those are possible header ids in RARv5. */
 2367|  46.4k|	switch(header_id) {
 2368|  3.08k|		case HEAD_MAIN:
  ------------------
  |  Branch (2368:3): [True: 3.08k, False: 43.3k]
  ------------------
 2369|  3.08k|			ret = process_head_main(a, rar, entry, header_flags);
 2370|       |
 2371|       |			/* Main header doesn't have any files in it, so it's
 2372|       |			 * pointless to return to the caller. Retry to next
 2373|       |			 * header, which should be HEAD_FILE/HEAD_SERVICE. */
 2374|  3.08k|			if(ret == ARCHIVE_OK)
  ------------------
  |  |  233|  3.08k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2374:7): [True: 541, False: 2.54k]
  ------------------
 2375|    541|				return ARCHIVE_RETRY;
  ------------------
  |  |  234|    541|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
 2376|       |
 2377|  2.54k|			return ret;
 2378|    846|		case HEAD_SERVICE:
  ------------------
  |  Branch (2378:3): [True: 846, False: 45.6k]
  ------------------
 2379|    846|			ret = process_head_service(a, rar, entry, header_flags);
 2380|    846|			return ret;
 2381|  17.2k|		case HEAD_FILE:
  ------------------
  |  Branch (2381:3): [True: 17.2k, False: 29.2k]
  ------------------
 2382|  17.2k|			ret = process_head_file(a, rar, entry, header_flags);
 2383|  17.2k|			return ret;
 2384|      4|		case HEAD_CRYPT:
  ------------------
  |  Branch (2384:3): [True: 4, False: 46.4k]
  ------------------
 2385|      4|			archive_entry_set_is_metadata_encrypted(entry, 1);
 2386|      4|			archive_entry_set_is_data_encrypted(entry, 1);
 2387|      4|			rar->has_encrypted_entries = 1;
 2388|      4|			rar->headers_are_encrypted = 1;
 2389|      4|			archive_set_error(&a->archive,
 2390|      4|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      4|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2391|      4|			    "Encryption is not supported");
 2392|      4|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2393|  17.4k|		case HEAD_ENDARC:
  ------------------
  |  Branch (2393:3): [True: 17.4k, False: 28.9k]
  ------------------
 2394|  17.4k|			rar->main.endarc = 1;
 2395|       |
 2396|       |			/* After encountering an end of file marker, we need
 2397|       |			 * to take into consideration if this archive is
 2398|       |			 * continued in another file (i.e. is it part01.rar:
 2399|       |			 * is there a part02.rar?) */
 2400|  17.4k|			if(rar->main.volume) {
  ------------------
  |  Branch (2400:7): [True: 17.4k, False: 52]
  ------------------
 2401|       |				/* In case there is part02.rar, position the
 2402|       |				 * read pointer in a proper place, so we can
 2403|       |				 * resume parsing. */
 2404|  17.4k|				ret = scan_for_signature(a);
 2405|  17.4k|				if(ret == ARCHIVE_FATAL) {
  ------------------
  |  |  239|  17.4k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (2405:8): [True: 0, False: 17.4k]
  ------------------
 2406|      0|					return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2407|  17.4k|				} else {
 2408|  17.4k|					if(rar->vol.expected_vol_no ==
  ------------------
  |  Branch (2408:9): [True: 0, False: 17.4k]
  ------------------
 2409|  17.4k|					    UINT_MAX) {
 2410|      0|						archive_set_error(&a->archive,
 2411|      0|						    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2412|      0|						    "Header error");
 2413|      0|							return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2414|      0|					}
 2415|       |
 2416|  17.4k|					rar->vol.expected_vol_no =
 2417|  17.4k|					    rar->main.vol_no + 1;
 2418|  17.4k|					return ARCHIVE_OK;
  ------------------
  |  |  233|  17.4k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2419|  17.4k|				}
 2420|  17.4k|			} else {
 2421|     52|				return ARCHIVE_EOF;
  ------------------
  |  |  232|     52|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2422|     52|			}
 2423|    104|		case HEAD_MARK:
  ------------------
  |  Branch (2423:3): [True: 104, False: 46.3k]
  ------------------
 2424|    104|			return ARCHIVE_EOF;
  ------------------
  |  |  232|    104|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2425|  7.73k|		default:
  ------------------
  |  Branch (2425:3): [True: 7.73k, False: 38.7k]
  ------------------
 2426|  7.73k|			if((header_flags & HFL_SKIP_IF_UNKNOWN) == 0) {
  ------------------
  |  Branch (2426:7): [True: 25, False: 7.71k]
  ------------------
 2427|     25|				archive_set_error(&a->archive,
 2428|     25|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     25|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2429|     25|				    "Header type error");
 2430|     25|				return ARCHIVE_FATAL;
  ------------------
  |  |  239|     25|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2431|  7.71k|			} else {
 2432|       |				/* If the block is marked as 'skip if unknown',
 2433|       |				 * do as the flag says: skip the block
 2434|       |				 * instead on failing on it. */
 2435|  7.71k|				return ARCHIVE_RETRY;
  ------------------
  |  |  234|  7.71k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
 2436|  7.71k|			}
 2437|  46.4k|	}
 2438|       |
 2439|      0|#if !defined WIN32
 2440|       |	// Not reached.
 2441|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 2442|      0|	    "Internal unpacker error");
 2443|      0|	return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2444|  46.4k|#endif
 2445|  46.4k|}
archive_read_support_format_rar5.c:skip_unprocessed_bytes:
 2196|  55.5k|static int skip_unprocessed_bytes(struct archive_read* a) {
 2197|  55.5k|	struct rar5* rar = get_context(a);
 2198|  55.5k|	int ret;
 2199|       |
 2200|  55.5k|	if(rar->file.bytes_remaining) {
  ------------------
  |  Branch (2200:5): [True: 11.7k, False: 43.7k]
  ------------------
 2201|       |		/* Use different skipping method in block merging mode than in
 2202|       |		 * normal mode. If merge mode is active, rar5_read_data_skip
 2203|       |		 * can't be used, because it could allow recursive use of
 2204|       |		 * merge_block() * function, and this function doesn't support
 2205|       |		 * recursive use. */
 2206|  11.7k|		if(rar->merge_mode) {
  ------------------
  |  Branch (2206:6): [True: 531, False: 11.2k]
  ------------------
 2207|       |			/* Discard whole merged block. This is valid in solid
 2208|       |			 * mode as well, because the code will discard blocks
 2209|       |			 * only if those blocks are safe to discard (i.e.
 2210|       |			 * they're not FILE blocks).  */
 2211|    531|			ret = consume(a, rar->file.bytes_remaining);
 2212|    531|			if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|    531|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2212:7): [True: 0, False: 531]
  ------------------
 2213|      0|				return ret;
 2214|      0|			}
 2215|    531|			rar->file.bytes_remaining = 0;
 2216|  11.2k|		} else {
 2217|       |			/* If we're not in merge mode, use safe skipping code.
 2218|       |			 * This will ensure we'll handle solid archives
 2219|       |			 * properly. */
 2220|  11.2k|			ret = rar5_read_data_skip(a);
 2221|  11.2k|			if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  11.2k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2221:7): [True: 8.72k, False: 2.53k]
  ------------------
 2222|  8.72k|				return ret;
 2223|  8.72k|			}
 2224|  11.2k|		}
 2225|  11.7k|	}
 2226|       |
 2227|  46.7k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  46.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2228|  55.5k|}
archive_read_support_format_rar5.c:read_u32:
 1111|  67.4k|static char read_u32(struct archive_read* a, uint32_t* pvalue) {
 1112|  67.4k|	const uint8_t* p;
 1113|  67.4k|	if(!read_ahead(a, 4, &p))
  ------------------
  |  Branch (1113:5): [True: 10, False: 67.4k]
  ------------------
 1114|     10|		return 0;
 1115|       |
 1116|  67.4k|	*pvalue = archive_le32dec(p);
 1117|  67.4k|	return ARCHIVE_OK == consume(a, 4);
  ------------------
  |  |  233|  67.4k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1118|  67.4k|}
archive_read_support_format_rar5.c:read_var_sized:
 1020|   274k|{
 1021|   274k|	uint64_t v;
 1022|   274k|	uint64_t v_size = 0;
 1023|       |
 1024|   274k|	const int ret = pvalue_len ? read_var(a, &v, &v_size)
  ------------------
  |  Branch (1024:18): [True: 61.2k, False: 213k]
  ------------------
 1025|   274k|				   : read_var(a, &v, NULL);
 1026|       |
 1027|   274k|	if(ret == 1 && pvalue) {
  ------------------
  |  Branch (1027:5): [True: 274k, False: 5]
  |  Branch (1027:17): [True: 274k, False: 0]
  ------------------
 1028|   274k|		*pvalue = (size_t) v;
 1029|   274k|	}
 1030|       |
 1031|   274k|	if(pvalue_len) {
  ------------------
  |  Branch (1031:5): [True: 61.2k, False: 213k]
  ------------------
 1032|       |		/* Possible data truncation should be safe. */
 1033|  61.2k|		*pvalue_len = (size_t) v_size;
 1034|  61.2k|	}
 1035|       |
 1036|   274k|	return ret;
 1037|   274k|}
archive_read_support_format_rar5.c:read_var:
  949|   346k|{
  950|   346k|	uint64_t result = 0;
  951|   346k|	size_t shift, i;
  952|   346k|	const uint8_t* p;
  953|   346k|	uint8_t b;
  954|       |
  955|       |	/* We will read maximum of 8 bytes. We don't have to handle the
  956|       |	 * situation to read the RAR5 variable-sized value stored at the end of
  957|       |	 * the file, because such situation will never happen. */
  958|   346k|	if(!read_ahead(a, 8, &p))
  ------------------
  |  Branch (958:5): [True: 12, False: 346k]
  ------------------
  959|     12|		return 0;
  960|       |
  961|   486k|	for(shift = 0, i = 0; i < 8; i++, shift += 7) {
  ------------------
  |  Branch (961:24): [True: 480k, False: 5.80k]
  ------------------
  962|   480k|		b = p[i];
  963|       |
  964|       |		/* Strip the MSB from the input byte and add the resulting
  965|       |		 * number to the `result`. */
  966|   480k|		result += (b & (uint64_t)0x7F) << shift;
  967|       |
  968|       |		/* MSB set to 1 means we need to continue decoding process.
  969|       |		 * MSB set to 0 means we're done.
  970|       |		 *
  971|       |		 * This conditional checks for the second case. */
  972|   480k|		if((b & 0x80) == 0) {
  ------------------
  |  Branch (972:6): [True: 340k, False: 140k]
  ------------------
  973|   340k|			if(pvalue) {
  ------------------
  |  Branch (973:7): [True: 340k, False: 0]
  ------------------
  974|   340k|				*pvalue = result;
  975|   340k|			}
  976|       |
  977|       |			/* If the caller has passed the `pvalue_len` pointer,
  978|       |			 * store the number of consumed bytes in it and do NOT
  979|       |			 * consume those bytes, since the caller has all the
  980|       |			 * information it needs to perform */
  981|   340k|			if(pvalue_len) {
  ------------------
  |  Branch (981:7): [True: 102k, False: 237k]
  ------------------
  982|   102k|				*pvalue_len = 1 + i;
  983|   237k|			} else {
  984|       |				/* If the caller did not provide the
  985|       |				 * `pvalue_len` pointer, it will not have the
  986|       |				 * possibility to advance the file pointer,
  987|       |				 * because it will not know how many bytes it
  988|       |				 * needs to consume. This is why we handle
  989|       |				 * such situation here automatically. */
  990|   237k|				if(ARCHIVE_OK != consume(a, 1 + i)) {
  ------------------
  |  |  233|   237k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (990:8): [True: 0, False: 237k]
  ------------------
  991|      0|					return 0;
  992|      0|				}
  993|   237k|			}
  994|       |
  995|       |			/* End of decoding process, return success. */
  996|   340k|			return 1;
  997|   340k|		}
  998|   480k|	}
  999|       |
 1000|       |	/* The decoded value takes the maximum number of 8 bytes.
 1001|       |	 * It's a maximum number of bytes, so end decoding process here
 1002|       |	 * even if the first bit of last byte is 1. */
 1003|  5.80k|	if(pvalue) {
  ------------------
  |  Branch (1003:5): [True: 5.80k, False: 0]
  ------------------
 1004|  5.80k|		*pvalue = result;
 1005|  5.80k|	}
 1006|       |
 1007|  5.80k|	if(pvalue_len) {
  ------------------
  |  Branch (1007:5): [True: 5.18k, False: 614]
  ------------------
 1008|  5.18k|		*pvalue_len = 9;
 1009|  5.18k|	} else {
 1010|    614|		if(ARCHIVE_OK != consume(a, 9)) {
  ------------------
  |  |  233|    614|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1010:6): [True: 0, False: 614]
  ------------------
 1011|      0|			return 0;
 1012|      0|		}
 1013|    614|	}
 1014|       |
 1015|  5.80k|	return 1;
 1016|  5.80k|}
archive_read_support_format_rar5.c:process_head_main:
 2090|  3.08k|{
 2091|  3.08k|	int ret;
 2092|  3.08k|	uint64_t extra_data_size = 0;
 2093|  3.08k|	size_t extra_field_size = 0;
 2094|  3.08k|	size_t extra_field_id = 0;
 2095|  3.08k|	size_t archive_flags = 0;
 2096|       |
 2097|  3.08k|	enum MAIN_FLAGS {
 2098|  3.08k|		VOLUME = 0x0001,         /* multi-volume archive */
 2099|  3.08k|		VOLUME_NUMBER = 0x0002,  /* volume number, first vol doesn't
 2100|       |					  * have it */
 2101|  3.08k|		SOLID = 0x0004,          /* solid archive */
 2102|  3.08k|		PROTECT = 0x0008,        /* contains Recovery info */
 2103|  3.08k|		LOCK = 0x0010,           /* readonly flag, not used */
 2104|  3.08k|	};
 2105|       |
 2106|  3.08k|	enum MAIN_EXTRA {
 2107|       |		// Just one attribute here.
 2108|  3.08k|		LOCATOR = 0x01,
 2109|  3.08k|	};
 2110|       |
 2111|  3.08k|	(void) entry;
 2112|       |
 2113|  3.08k|	if(block_flags & HFL_EXTRA_DATA) {
  ------------------
  |  Branch (2113:5): [True: 338, False: 2.74k]
  ------------------
 2114|    338|		if(!read_var(a, &extra_data_size, NULL))
  ------------------
  |  Branch (2114:6): [True: 0, False: 338]
  ------------------
 2115|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2116|  2.74k|	} else {
 2117|  2.74k|		extra_data_size = 0;
 2118|  2.74k|	}
 2119|       |
 2120|  3.08k|	if(!read_var_sized(a, &archive_flags, NULL)) {
  ------------------
  |  Branch (2120:5): [True: 0, False: 3.08k]
  ------------------
 2121|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2122|      0|	}
 2123|       |
 2124|  3.08k|	rar->main.volume = (archive_flags & VOLUME) > 0;
 2125|  3.08k|	rar->main.solid = (archive_flags & SOLID) > 0;
 2126|       |
 2127|  3.08k|	if(archive_flags & VOLUME_NUMBER) {
  ------------------
  |  Branch (2127:5): [True: 2.70k, False: 378]
  ------------------
 2128|  2.70k|		size_t v = 0;
 2129|  2.70k|		if(!read_var_sized(a, &v, NULL)) {
  ------------------
  |  Branch (2129:6): [True: 0, False: 2.70k]
  ------------------
 2130|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2131|      0|		}
 2132|       |
 2133|  2.70k|		if (v > UINT_MAX) {
  ------------------
  |  Branch (2133:7): [True: 0, False: 2.70k]
  ------------------
 2134|      0|			archive_set_error(&a->archive,
 2135|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2136|      0|			    "Invalid volume number");
 2137|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2138|      0|		}
 2139|       |
 2140|  2.70k|		rar->main.vol_no = (unsigned int) v;
 2141|  2.70k|	} else {
 2142|    378|		rar->main.vol_no = 0;
 2143|    378|	}
 2144|       |
 2145|  3.08k|	if(rar->vol.expected_vol_no > 0 &&
  ------------------
  |  Branch (2145:5): [True: 2.56k, False: 517]
  ------------------
 2146|  2.56k|		rar->main.vol_no != rar->vol.expected_vol_no)
  ------------------
  |  Branch (2146:3): [True: 2.54k, False: 25]
  ------------------
 2147|  2.54k|	{
 2148|       |		/* Returning EOF instead of FATAL because of strange
 2149|       |		 * libarchive behavior. When opening multiple files via
 2150|       |		 * archive_read_open_filenames(), after reading up the whole
 2151|       |		 * last file, the __archive_read_ahead function wraps up to
 2152|       |		 * the first archive instead of returning EOF. */
 2153|  2.54k|		return ARCHIVE_EOF;
  ------------------
  |  |  232|  2.54k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2154|  2.54k|	}
 2155|       |
 2156|    542|	if(extra_data_size == 0) {
  ------------------
  |  Branch (2156:5): [True: 206, False: 336]
  ------------------
 2157|       |		/* Early return. */
 2158|    206|		return ARCHIVE_OK;
  ------------------
  |  |  233|    206|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2159|    206|	}
 2160|       |
 2161|    336|	if(!read_var_sized(a, &extra_field_size, NULL)) {
  ------------------
  |  Branch (2161:5): [True: 0, False: 336]
  ------------------
 2162|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2163|      0|	}
 2164|       |
 2165|    336|	if(!read_var_sized(a, &extra_field_id, NULL)) {
  ------------------
  |  Branch (2165:5): [True: 0, False: 336]
  ------------------
 2166|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2167|      0|	}
 2168|       |
 2169|    336|	if(extra_field_size == 0) {
  ------------------
  |  Branch (2169:5): [True: 0, False: 336]
  ------------------
 2170|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2171|      0|		    "Invalid extra field size");
 2172|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2173|      0|	}
 2174|       |
 2175|    336|	switch(extra_field_id) {
 2176|    335|		case LOCATOR:
  ------------------
  |  Branch (2176:3): [True: 335, False: 1]
  ------------------
 2177|    335|			ret = process_main_locator_extra_block(a, rar);
 2178|    335|			if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|    335|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2178:7): [True: 0, False: 335]
  ------------------
 2179|       |				/* Error while parsing main locator extra
 2180|       |				 * block. */
 2181|      0|				return ret;
 2182|      0|			}
 2183|       |
 2184|    335|			break;
 2185|    335|		default:
  ------------------
  |  Branch (2185:3): [True: 1, False: 335]
  ------------------
 2186|      1|			archive_set_error(&a->archive,
 2187|      1|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2188|      1|			    "Unsupported extra type (0x%jx)",
 2189|      1|			    (uintmax_t)extra_field_id);
 2190|      1|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2191|    336|	}
 2192|       |
 2193|    335|	return ARCHIVE_OK;
  ------------------
  |  |  233|    335|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2194|    336|}
archive_read_support_format_rar5.c:process_main_locator_extra_block:
 1237|    335|{
 1238|    335|	uint64_t locator_flags;
 1239|       |
 1240|    335|	enum LOCATOR_FLAGS {
 1241|    335|		QLIST = 0x01, RECOVERY = 0x02,
 1242|    335|	};
 1243|       |
 1244|    335|	if(!read_var(a, &locator_flags, NULL)) {
  ------------------
  |  Branch (1244:5): [True: 0, False: 335]
  ------------------
 1245|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1246|      0|	}
 1247|       |
 1248|    335|	if(locator_flags & QLIST) {
  ------------------
  |  Branch (1248:5): [True: 235, False: 100]
  ------------------
 1249|    235|		if(!read_var(a, &rar->qlist_offset, NULL)) {
  ------------------
  |  Branch (1249:6): [True: 0, False: 235]
  ------------------
 1250|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1251|      0|		}
 1252|       |
 1253|       |		/* qlist is not used */
 1254|    235|	}
 1255|       |
 1256|    335|	if(locator_flags & RECOVERY) {
  ------------------
  |  Branch (1256:5): [True: 209, False: 126]
  ------------------
 1257|    209|		if(!read_var(a, &rar->rr_offset, NULL)) {
  ------------------
  |  Branch (1257:6): [True: 0, False: 209]
  ------------------
 1258|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1259|      0|		}
 1260|       |
 1261|       |		/* rr is not used */
 1262|    209|	}
 1263|       |
 1264|    335|	return ARCHIVE_OK;
  ------------------
  |  |  233|    335|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1265|    335|}
archive_read_support_format_rar5.c:process_head_service:
 2069|    846|{
 2070|       |	/* Process this SERVICE block the same way as FILE blocks. */
 2071|    846|	int ret = process_head_file(a, rar, entry, block_flags);
 2072|    846|	if(ret != ARCHIVE_OK)
  ------------------
  |  |  233|    846|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2072:5): [True: 372, False: 474]
  ------------------
 2073|    372|		return ret;
 2074|       |
 2075|    474|	rar->file.service = 1;
 2076|       |
 2077|       |	/* But skip the data part automatically. It's no use for the user
 2078|       |	 * anyway.  It contains only service data, not even needed to
 2079|       |	 * properly unpack the file. */
 2080|    474|	ret = rar5_read_data_skip(a);
 2081|    474|	if(ret != ARCHIVE_OK)
  ------------------
  |  |  233|    474|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2081:5): [True: 0, False: 474]
  ------------------
 2082|      0|		return ret;
 2083|       |
 2084|       |	/* After skipping, try parsing another block automatically. */
 2085|    474|	return ARCHIVE_RETRY;
  ------------------
  |  |  234|    474|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
 2086|    474|}
archive_read_support_format_rar5.c:process_head_file:
 1739|  18.0k|{
 1740|  18.0k|	int64_t extra_data_size = 0;
 1741|  18.0k|	size_t data_size = 0;
 1742|  18.0k|	size_t file_flags = 0;
 1743|  18.0k|	size_t file_attr = 0;
 1744|  18.0k|	size_t compression_info = 0;
 1745|  18.0k|	size_t host_os = 0;
 1746|  18.0k|	size_t name_size = 0;
 1747|  18.0k|	uint64_t unpacked_size, window_size;
 1748|  18.0k|	uint32_t mtime = 0, crc = 0;
 1749|  18.0k|	int c_method = 0, c_version = 0;
 1750|  18.0k|	char name_utf8_buf[MAX_NAME_IN_BYTES];
 1751|  18.0k|	const uint8_t* p;
 1752|  18.0k|	int sanity_ret;
 1753|       |
 1754|  18.0k|	enum FILE_FLAGS {
 1755|  18.0k|		DIRECTORY = 0x0001, UTIME = 0x0002, CRC32 = 0x0004,
 1756|  18.0k|		UNKNOWN_UNPACKED_SIZE = 0x0008,
 1757|  18.0k|	};
 1758|       |
 1759|  18.0k|	enum FILE_ATTRS {
 1760|  18.0k|		ATTR_READONLY = 0x1, ATTR_HIDDEN = 0x2, ATTR_SYSTEM = 0x4,
 1761|  18.0k|		ATTR_DIRECTORY = 0x10,
 1762|  18.0k|	};
 1763|       |
 1764|  18.0k|	enum COMP_INFO_FLAGS {
 1765|  18.0k|		SOLID = 0x0040,
 1766|  18.0k|	};
 1767|       |
 1768|  18.0k|	enum HOST_OS {
 1769|  18.0k|		HOST_WINDOWS = 0,
 1770|  18.0k|		HOST_UNIX = 1,
 1771|  18.0k|	};
 1772|       |
 1773|  18.0k|	archive_entry_clear(entry);
 1774|       |
 1775|       |	/* Do not reset file context if we're switching archives. */
 1776|  18.0k|	if(!rar->cstate.switch_multivolume) {
  ------------------
  |  Branch (1776:5): [True: 12.8k, False: 5.26k]
  ------------------
 1777|  12.8k|		reset_file_context(rar);
 1778|  12.8k|	}
 1779|       |
 1780|  18.0k|	if(block_flags & HFL_EXTRA_DATA) {
  ------------------
  |  Branch (1780:5): [True: 5.80k, False: 12.2k]
  ------------------
 1781|  5.80k|		uint64_t edata_size = 0;
 1782|  5.80k|		if(!read_var(a, &edata_size, NULL))
  ------------------
  |  Branch (1782:6): [True: 0, False: 5.80k]
  ------------------
 1783|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1784|       |
 1785|       |		/* Intentional type cast from unsigned to signed. */
 1786|  5.80k|		extra_data_size = (int64_t) edata_size;
 1787|  5.80k|	}
 1788|       |
 1789|  18.0k|	if(block_flags & HFL_DATA) {
  ------------------
  |  Branch (1789:5): [True: 18.0k, False: 2]
  ------------------
 1790|  18.0k|		if(!read_var_sized(a, &data_size, NULL))
  ------------------
  |  Branch (1790:6): [True: 0, False: 18.0k]
  ------------------
 1791|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1792|       |
 1793|  18.0k|		rar->file.bytes_remaining = data_size;
 1794|  18.0k|	} else {
 1795|      2|		rar->file.bytes_remaining = 0;
 1796|      2|	}
 1797|       |
 1798|  18.0k|	if(!read_var_sized(a, &file_flags, NULL))
  ------------------
  |  Branch (1798:5): [True: 0, False: 18.0k]
  ------------------
 1799|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1800|       |
 1801|  18.0k|	if(!read_var(a, &unpacked_size, NULL))
  ------------------
  |  Branch (1801:5): [True: 0, False: 18.0k]
  ------------------
 1802|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1803|       |
 1804|  18.0k|	if(file_flags & UNKNOWN_UNPACKED_SIZE) {
  ------------------
  |  Branch (1804:5): [True: 1, False: 18.0k]
  ------------------
 1805|      1|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      1|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1806|      1|		    "Files with unknown unpacked size are not supported");
 1807|      1|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1808|      1|	}
 1809|       |
 1810|  18.0k|	rar->file.dir = (uint8_t) ((file_flags & DIRECTORY) > 0);
 1811|       |
 1812|  18.0k|	sanity_ret = file_entry_sanity_checks(a, block_flags, rar->file.dir,
 1813|  18.0k|		unpacked_size, data_size);
 1814|       |
 1815|  18.0k|	if (sanity_ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  18.0k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1815:6): [True: 3, False: 18.0k]
  ------------------
 1816|      3|		return sanity_ret;
 1817|      3|	}
 1818|       |
 1819|  18.0k|	if(!read_var_sized(a, &file_attr, NULL))
  ------------------
  |  Branch (1819:5): [True: 0, False: 18.0k]
  ------------------
 1820|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1821|       |
 1822|  18.0k|	if(file_flags & UTIME) {
  ------------------
  |  Branch (1822:5): [True: 14.5k, False: 3.52k]
  ------------------
 1823|  14.5k|		if(!read_u32(a, &mtime))
  ------------------
  |  Branch (1823:6): [True: 0, False: 14.5k]
  ------------------
 1824|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1825|  14.5k|	}
 1826|       |
 1827|  18.0k|	if(file_flags & CRC32) {
  ------------------
  |  Branch (1827:5): [True: 5.13k, False: 12.9k]
  ------------------
 1828|  5.13k|		if(!read_u32(a, &crc))
  ------------------
  |  Branch (1828:6): [True: 0, False: 5.13k]
  ------------------
 1829|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1830|  5.13k|	}
 1831|       |
 1832|  18.0k|	if(!read_var_sized(a, &compression_info, NULL))
  ------------------
  |  Branch (1832:5): [True: 0, False: 18.0k]
  ------------------
 1833|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1834|       |
 1835|  18.0k|	c_method = (int) (compression_info >> 7) & 0x7;
 1836|  18.0k|	c_version = (int) (compression_info & 0x3f);
 1837|       |
 1838|       |	/* RAR5 seems to limit the dictionary size to 64MB. */
 1839|  18.0k|	window_size = (rar->file.dir > 0) ?
  ------------------
  |  Branch (1839:16): [True: 1, False: 18.0k]
  ------------------
 1840|      1|		0 :
 1841|  18.0k|		g_unpack_window_size << ((compression_info >> 10) & 15);
 1842|  18.0k|	rar->cstate.method = c_method;
 1843|  18.0k|	rar->cstate.version = c_version + 50;
 1844|  18.0k|	rar->file.solid = (compression_info & SOLID) > 0;
 1845|       |
 1846|       |	/* Archives which declare solid files without initializing the window
 1847|       |	 * buffer first are invalid, unless previous data was encrypted, in
 1848|       |	 * which case we may never have had the chance */
 1849|       |
 1850|  18.0k|	if(rar->file.solid > 0 && rar->cstate.data_encrypted == 0 &&
  ------------------
  |  Branch (1850:5): [True: 1.14k, False: 16.9k]
  |  Branch (1850:28): [True: 984, False: 156]
  ------------------
 1851|    984|	    rar->cstate.window_buf == NULL) {
  ------------------
  |  Branch (1851:6): [True: 1, False: 983]
  ------------------
 1852|      1|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1853|      1|				  "Declared solid file, but no window buffer "
 1854|      1|				  "initialized yet");
 1855|      1|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1856|      1|	}
 1857|       |
 1858|       |	/* Check if window_size is a sane value. Also, if the file is not
 1859|       |	 * declared as a directory, disallow window_size == 0. */
 1860|  18.0k|	if(window_size > (64 * 1024 * 1024) ||
  ------------------
  |  Branch (1860:5): [True: 3, False: 18.0k]
  ------------------
 1861|  18.0k|	    (rar->file.dir == 0 && window_size == 0))
  ------------------
  |  Branch (1861:7): [True: 18.0k, False: 1]
  |  Branch (1861:29): [True: 0, False: 18.0k]
  ------------------
 1862|      3|	{
 1863|      3|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      3|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1864|      3|		    "Declared dictionary size is not supported");
 1865|      3|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      3|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1866|      3|	}
 1867|       |
 1868|  18.0k|	if(rar->file.solid > 0) {
  ------------------
  |  Branch (1868:5): [True: 1.13k, False: 16.9k]
  ------------------
 1869|       |		/* Re-check if current window size is the same as previous
 1870|       |		 * window size (for solid files only). */
 1871|  1.13k|		if(rar->file.solid_window_size > 0 &&
  ------------------
  |  Branch (1871:6): [True: 342, False: 796]
  ------------------
 1872|    342|		    rar->file.solid_window_size != (ssize_t) window_size)
  ------------------
  |  Branch (1872:7): [True: 0, False: 342]
  ------------------
 1873|      0|		{
 1874|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1875|      0|			    "Window size for this solid file doesn't match "
 1876|      0|			    "the window size used in previous solid file");
 1877|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1878|      0|		}
 1879|  1.13k|	}
 1880|  16.9k|	else
 1881|  16.9k|		rar->cstate.data_encrypted = 0; /* Reset for new buffer */
 1882|       |
 1883|  18.0k|	if(rar->cstate.window_size < (ssize_t) window_size &&
  ------------------
  |  Branch (1883:5): [True: 1.15k, False: 16.9k]
  ------------------
 1884|  1.15k|	    rar->cstate.window_buf)
  ------------------
  |  Branch (1884:6): [True: 794, False: 360]
  ------------------
 1885|    794|	{
 1886|       |		/* The `data_ready` stack contains pointers to the `window_buf` or
 1887|       |		 * `filtered_buf` buffers.  Since we're about to reallocate the first
 1888|       |		 * buffer, some of those pointers could become invalid. Therefore, we
 1889|       |		 * need to dispose of all entries from the stack before attempting the
 1890|       |		 * realloc. */
 1891|    794|		clear_data_ready_stack(rar);
 1892|       |
 1893|       |		/* If window_buf has been allocated before, reallocate it, so
 1894|       |		 * that its size will match new window_size. */
 1895|       |
 1896|    794|		uint8_t* new_window_buf =
 1897|    794|			realloc(rar->cstate.window_buf, (size_t) window_size);
 1898|       |
 1899|    794|		if(!new_window_buf) {
  ------------------
  |  Branch (1899:6): [True: 0, False: 794]
  ------------------
 1900|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1901|      0|				"Not enough memory when trying to realloc the window "
 1902|      0|				"buffer");
 1903|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1904|      0|		}
 1905|       |
 1906|    794|		rar->cstate.window_buf = new_window_buf;
 1907|    794|	}
 1908|       |
 1909|       |	/* Values up to 64M should fit into ssize_t on every
 1910|       |	 * architecture. */
 1911|  18.0k|	rar->cstate.window_size = (ssize_t) window_size;
 1912|       |
 1913|  18.0k|	if(rar->file.solid > 0 && rar->file.solid_window_size == 0) {
  ------------------
  |  Branch (1913:5): [True: 1.13k, False: 16.9k]
  |  Branch (1913:28): [True: 796, False: 342]
  ------------------
 1914|       |		/* Solid files have to have the same window_size across
 1915|       |		   whole archive. Remember the window_size parameter
 1916|       |		   for first solid file found. */
 1917|    796|		rar->file.solid_window_size = rar->cstate.window_size;
 1918|    796|	}
 1919|       |
 1920|  18.0k|	init_window_mask(rar);
 1921|       |
 1922|  18.0k|	rar->file.service = 0;
 1923|       |
 1924|  18.0k|	if(!read_var_sized(a, &host_os, NULL))
  ------------------
  |  Branch (1924:5): [True: 0, False: 18.0k]
  ------------------
 1925|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1926|       |
 1927|  18.0k|	if(host_os == HOST_WINDOWS) {
  ------------------
  |  Branch (1927:5): [True: 17.8k, False: 168]
  ------------------
 1928|       |		/* Host OS is Windows */
 1929|       |
 1930|  17.8k|		__LA_MODE_T mode;
  ------------------
  |  |  102|  17.8k|# define	__LA_MODE_T	mode_t
  ------------------
 1931|       |
 1932|  17.8k|		if(file_attr & ATTR_DIRECTORY) {
  ------------------
  |  Branch (1932:6): [True: 12.4k, False: 5.44k]
  ------------------
 1933|  12.4k|			if (file_attr & ATTR_READONLY) {
  ------------------
  |  Branch (1933:8): [True: 8.86k, False: 3.57k]
  ------------------
 1934|  8.86k|				mode = 0555 | AE_IFDIR;
  ------------------
  |  |  221|  8.86k|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 1935|  8.86k|			} else {
 1936|  3.57k|				mode = 0755 | AE_IFDIR;
  ------------------
  |  |  221|  3.57k|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 1937|  3.57k|			}
 1938|  12.4k|		} else {
 1939|  5.44k|			if (file_attr & ATTR_READONLY) {
  ------------------
  |  Branch (1939:8): [True: 3.47k, False: 1.97k]
  ------------------
 1940|  3.47k|				mode = 0444 | AE_IFREG;
  ------------------
  |  |  216|  3.47k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1941|  3.47k|			} else {
 1942|  1.97k|				mode = 0644 | AE_IFREG;
  ------------------
  |  |  216|  1.97k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1943|  1.97k|			}
 1944|  5.44k|		}
 1945|       |
 1946|  17.8k|		archive_entry_set_mode(entry, mode);
 1947|       |
 1948|  17.8k|		if (file_attr & (ATTR_READONLY | ATTR_HIDDEN | ATTR_SYSTEM)) {
  ------------------
  |  Branch (1948:7): [True: 16.1k, False: 1.76k]
  ------------------
 1949|  16.1k|			char *fflags_text, *ptr;
 1950|       |			/* allocate for ",rdonly,hidden,system" */
 1951|  16.1k|			fflags_text = malloc(22 * sizeof(*fflags_text));
 1952|  16.1k|			if (fflags_text != NULL) {
  ------------------
  |  Branch (1952:8): [True: 16.1k, False: 0]
  ------------------
 1953|  16.1k|				ptr = fflags_text;
 1954|  16.1k|				if (file_attr & ATTR_READONLY) {
  ------------------
  |  Branch (1954:9): [True: 12.3k, False: 3.78k]
  ------------------
 1955|  12.3k|					strcpy(ptr, ",rdonly");
 1956|  12.3k|					ptr = ptr + 7;
 1957|  12.3k|				}
 1958|  16.1k|				if (file_attr & ATTR_HIDDEN) {
  ------------------
  |  Branch (1958:9): [True: 12.4k, False: 3.67k]
  ------------------
 1959|  12.4k|					strcpy(ptr, ",hidden");
 1960|  12.4k|					ptr = ptr + 7;
 1961|  12.4k|				}
 1962|  16.1k|				if (file_attr & ATTR_SYSTEM) {
  ------------------
  |  Branch (1962:9): [True: 9.14k, False: 6.97k]
  ------------------
 1963|  9.14k|					strcpy(ptr, ",system");
 1964|  9.14k|					ptr = ptr + 7;
 1965|  9.14k|				}
 1966|  16.1k|				if (ptr > fflags_text) {
  ------------------
  |  Branch (1966:9): [True: 16.1k, False: 0]
  ------------------
 1967|  16.1k|					archive_entry_copy_fflags_text(entry,
 1968|  16.1k|					    fflags_text + 1);
 1969|  16.1k|				}
 1970|  16.1k|				free(fflags_text);
 1971|  16.1k|			}
 1972|  16.1k|		}
 1973|  17.8k|	} else if(host_os == HOST_UNIX) {
  ------------------
  |  Branch (1973:12): [True: 166, False: 2]
  ------------------
 1974|       |		/* Host OS is Unix */
 1975|    166|		archive_entry_set_mode(entry, (__LA_MODE_T) file_attr);
 1976|    166|	} else {
 1977|       |		/* Unknown host OS */
 1978|      2|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      2|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1979|      2|				"Unsupported Host OS: 0x%jx",
 1980|      2|				(uintmax_t)host_os);
 1981|       |
 1982|      2|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1983|      2|	}
 1984|       |
 1985|  18.0k|	if(!read_var_sized(a, &name_size, NULL))
  ------------------
  |  Branch (1985:5): [True: 0, False: 18.0k]
  ------------------
 1986|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1987|       |
 1988|  18.0k|	if(name_size > (MAX_NAME_IN_CHARS - 1)) {
  ------------------
  |  |   89|  18.0k|#define MAX_NAME_IN_CHARS 2048
  ------------------
  |  Branch (1988:5): [True: 0, False: 18.0k]
  ------------------
 1989|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1990|      0|				"Filename is too long");
 1991|       |
 1992|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1993|      0|	}
 1994|       |
 1995|  18.0k|	if(name_size == 0) {
  ------------------
  |  Branch (1995:5): [True: 1, False: 18.0k]
  ------------------
 1996|      1|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1997|      1|				"No filename specified");
 1998|       |
 1999|      1|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2000|      1|	}
 2001|       |
 2002|  18.0k|	if(!read_ahead(a, name_size, &p))
  ------------------
  |  Branch (2002:5): [True: 2, False: 18.0k]
  ------------------
 2003|      2|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      2|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2004|       |
 2005|  18.0k|	memcpy(name_utf8_buf, p, name_size);
 2006|  18.0k|	name_utf8_buf[name_size] = 0;
 2007|  18.0k|	if(ARCHIVE_OK != consume(a, name_size)) {
  ------------------
  |  |  233|  18.0k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2007:5): [True: 0, False: 18.0k]
  ------------------
 2008|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2009|      0|	}
 2010|       |
 2011|  18.0k|	archive_entry_update_pathname_utf8(entry, name_utf8_buf);
 2012|       |
 2013|  18.0k|	if(extra_data_size > 0) {
  ------------------
  |  Branch (2013:5): [True: 2.38k, False: 15.6k]
  ------------------
 2014|  2.38k|		int ret = process_head_file_extra(a, entry, rar,
 2015|  2.38k|		    extra_data_size);
 2016|       |
 2017|       |		/*
 2018|       |		 * TODO: rewrite or remove useless sanity check
 2019|       |		 *       as extra_data_size is not passed as a pointer
 2020|       |		 *
 2021|       |		if(extra_data_size < 0) {
 2022|       |			archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
 2023|       |			    "File extra data size is not zero");
 2024|       |			return ARCHIVE_FATAL;
 2025|       |		}
 2026|       |		 */
 2027|       |
 2028|  2.38k|		if(ret != ARCHIVE_OK)
  ------------------
  |  |  233|  2.38k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2028:6): [True: 1.75k, False: 631]
  ------------------
 2029|  1.75k|			return ret;
 2030|  2.38k|	}
 2031|       |
 2032|  16.3k|	if((file_flags & UNKNOWN_UNPACKED_SIZE) == 0) {
  ------------------
  |  Branch (2032:5): [True: 16.3k, False: 0]
  ------------------
 2033|  16.3k|		rar->file.unpacked_size = (ssize_t) unpacked_size;
 2034|  16.3k|		if(rar->file.redir_type == REDIR_TYPE_NONE)
  ------------------
  |  Branch (2034:6): [True: 14.3k, False: 1.95k]
  ------------------
 2035|  14.3k|			archive_entry_set_size(entry, unpacked_size);
 2036|  16.3k|	}
 2037|       |
 2038|  16.3k|	if(file_flags & UTIME) {
  ------------------
  |  Branch (2038:5): [True: 13.1k, False: 3.14k]
  ------------------
 2039|  13.1k|		archive_entry_set_mtime(entry, (time_t) mtime, 0);
 2040|  13.1k|	}
 2041|       |
 2042|  16.3k|	if(file_flags & CRC32) {
  ------------------
  |  Branch (2042:5): [True: 3.75k, False: 12.5k]
  ------------------
 2043|  3.75k|		rar->file.stored_crc32 = crc;
 2044|  3.75k|	}
 2045|       |
 2046|  16.3k|	if(!rar->cstate.switch_multivolume) {
  ------------------
  |  Branch (2046:5): [True: 12.7k, False: 3.56k]
  ------------------
 2047|       |		/* Do not reinitialize unpacking state if we're switching
 2048|       |		 * archives. */
 2049|  12.7k|		rar->cstate.block_parsing_finished = 1;
 2050|  12.7k|		rar->cstate.all_filters_applied = 1;
 2051|  12.7k|		rar->cstate.initialized = 0;
 2052|  12.7k|	}
 2053|       |
 2054|  16.3k|	if(rar->generic.split_before > 0) {
  ------------------
  |  Branch (2054:5): [True: 2.00k, False: 14.2k]
  ------------------
 2055|       |		/* If now we're standing on a header that has a 'split before'
 2056|       |		 * mark, it means we're standing on a 'continuation' file
 2057|       |		 * header. Signal the caller that if it wants to move to
 2058|       |		 * another file, it must call rar5_read_header() function
 2059|       |		 * again. */
 2060|       |
 2061|  2.00k|		return ARCHIVE_RETRY;
  ------------------
  |  |  234|  2.00k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
 2062|  14.2k|	} else {
 2063|  14.2k|		return ARCHIVE_OK;
  ------------------
  |  |  233|  14.2k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2064|  14.2k|	}
 2065|  16.3k|}
archive_read_support_format_rar5.c:reset_file_context:
  875|  12.8k|static void reset_file_context(struct rar5* rar) {
  876|  12.8k|	memset(&rar->file, 0, sizeof(rar->file));
  877|  12.8k|	blake2sp_init(&rar->file.b2state, 32);
  878|       |
  879|  12.8k|	if(rar->main.solid) {
  ------------------
  |  Branch (879:5): [True: 11.2k, False: 1.58k]
  ------------------
  880|  11.2k|		rar->cstate.solid_offset += rar->cstate.write_ptr;
  881|  11.2k|	} else {
  882|  1.58k|		rar->cstate.solid_offset = 0;
  883|  1.58k|	}
  884|       |
  885|  12.8k|	rar->cstate.write_ptr = 0;
  886|  12.8k|	rar->cstate.last_write_ptr = 0;
  887|  12.8k|	rar->cstate.last_unstore_ptr = 0;
  888|       |
  889|  12.8k|	rar->file.redir_type = REDIR_TYPE_NONE;
  890|  12.8k|	rar->file.redir_flags = 0;
  891|       |
  892|  12.8k|	free_filters(rar);
  893|  12.8k|}
archive_read_support_format_rar5.c:free_filters:
  850|  15.3k|static void free_filters(struct rar5* rar) {
  851|  15.3k|	struct cdeque* d = &rar->cstate.filters;
  852|       |
  853|       |	/* Free any remaining filters. All filters should be naturally
  854|       |	 * consumed by the unpacking function, so remaining filters after
  855|       |	 * unpacking normally mean that unpacking wasn't successful.
  856|       |	 * But still of course we shouldn't leak memory in such case. */
  857|       |
  858|       |	/* cdeque_size() is a fast operation, so we can use it as a loop
  859|       |	 * expression. */
  860|  15.3k|	while(cdeque_size(d) > 0) {
  ------------------
  |  Branch (860:8): [True: 0, False: 15.3k]
  ------------------
  861|      0|		struct filter_info* f = NULL;
  862|       |
  863|       |		/* Pop_front will also decrease the collection's size. */
  864|      0|		if (CDE_OK == cdeque_pop_front(d, cdeque_filter_p(&f)))
  ------------------
  |  Branch (864:7): [True: 0, False: 0]
  ------------------
  865|      0|			free(f);
  866|      0|	}
  867|       |
  868|  15.3k|	cdeque_clear(d);
  869|       |
  870|       |	/* Also clear out the variables needed for sanity checking. */
  871|  15.3k|	rar->cstate.last_block_start = 0;
  872|  15.3k|	rar->cstate.last_block_length = 0;
  873|  15.3k|}
archive_read_support_format_rar5.c:cdeque_size:
  412|  25.1k|static size_t cdeque_size(struct cdeque* d) {
  413|  25.1k|	return d->size;
  414|  25.1k|}
archive_read_support_format_rar5.c:cdeque_filter_p:
  470|  9.85k|static void** cdeque_filter_p(struct filter_info** f) {
  471|  9.85k|	return (void**) (size_t) f;
  472|  9.85k|}
archive_read_support_format_rar5.c:file_entry_sanity_checks:
 1713|  18.0k|{
 1714|  18.0k|	if (is_dir) {
  ------------------
  |  Branch (1714:6): [True: 3, False: 18.0k]
  ------------------
 1715|      3|		const int declares_data_size =
 1716|      3|			(int) (unpacked_size != 0 || packed_size != 0);
  ------------------
  |  Branch (1716:11): [True: 2, False: 1]
  |  Branch (1716:33): [True: 0, False: 1]
  ------------------
 1717|       |
 1718|       |		/* FILE entries for directories still declare HFL_DATA in block flags,
 1719|       |		   even though attaching data to such blocks doesn't make much sense. */
 1720|      3|		if (declares_data_size) {
  ------------------
  |  Branch (1720:7): [True: 2, False: 1]
  ------------------
 1721|      2|			archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      2|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1722|      2|				"directory entries cannot have any data");
 1723|      2|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1724|      2|		}
 1725|  18.0k|	} else {
 1726|  18.0k|		const int declares_hfl_data = (int) ((block_flags & HFL_DATA) != 0);
 1727|  18.0k|		if (!declares_hfl_data) {
  ------------------
  |  Branch (1727:7): [True: 1, False: 18.0k]
  ------------------
 1728|      1|			archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1729|      1|					"no data found in file/service block");
 1730|      1|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1731|      1|		}
 1732|  18.0k|	}
 1733|       |
 1734|  18.0k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  18.0k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1735|  18.0k|}
archive_read_support_format_rar5.c:clear_data_ready_stack:
 3780|  3.67k|static void clear_data_ready_stack(struct rar5* rar) {
 3781|  3.67k|	memset(&rar->cstate.dready, 0, sizeof(rar->cstate.dready));
 3782|  3.67k|}
archive_read_support_format_rar5.c:init_window_mask:
 1218|  18.4k|static void init_window_mask(struct rar5* rar) {
 1219|  18.4k|	if (rar->cstate.window_size)
  ------------------
  |  Branch (1219:6): [True: 18.4k, False: 1]
  ------------------
 1220|  18.4k|		rar->cstate.window_mask = rar->cstate.window_size - 1;
 1221|      1|	else
 1222|      1|		rar->cstate.window_mask = 0;
 1223|  18.4k|}
archive_read_support_format_rar5.c:process_head_file_extra:
 1623|  2.38k|{
 1624|  2.38k|	uint64_t extra_field_size;
 1625|  2.38k|	uint64_t extra_field_id = 0;
 1626|  2.38k|	uint64_t var_size;
 1627|       |
 1628|  18.1k|	while(extra_data_size > 0) {
  ------------------
  |  Branch (1628:8): [True: 17.5k, False: 640]
  ------------------
 1629|       |		/* Make sure we won't fail if the file declares only unsupported
 1630|       |		attributes. */
 1631|  17.5k|		int ret = ARCHIVE_OK;
  ------------------
  |  |  233|  17.5k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1632|       |
 1633|  17.5k|		if(!read_var(a, &extra_field_size, &var_size))
  ------------------
  |  Branch (1633:6): [True: 1, False: 17.5k]
  ------------------
 1634|      1|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      1|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1635|       |
 1636|  17.5k|		extra_data_size -= var_size;
 1637|  17.5k|		if(ARCHIVE_OK != consume(a, var_size)) {
  ------------------
  |  |  233|  17.5k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1637:6): [True: 0, False: 17.5k]
  ------------------
 1638|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1639|      0|		}
 1640|       |
 1641|  17.5k|		if(!read_var(a, &extra_field_id, &var_size))
  ------------------
  |  Branch (1641:6): [True: 5, False: 17.5k]
  ------------------
 1642|      5|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      5|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1643|       |
 1644|  17.5k|		extra_field_size -= var_size;
 1645|  17.5k|		extra_data_size -= var_size;
 1646|  17.5k|		if(ARCHIVE_OK != consume(a, var_size)) {
  ------------------
  |  |  233|  17.5k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1646:6): [True: 0, False: 17.5k]
  ------------------
 1647|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1648|      0|		}
 1649|       |
 1650|  17.5k|		switch(extra_field_id) {
 1651|    290|			case EX_HASH:
  ------------------
  |  Branch (1651:4): [True: 290, False: 17.2k]
  ------------------
 1652|    290|				ret = parse_file_extra_hash(a, rar,
 1653|    290|				    &extra_data_size);
 1654|    290|				break;
 1655|    610|			case EX_HTIME:
  ------------------
  |  Branch (1655:4): [True: 610, False: 16.9k]
  ------------------
 1656|    610|				ret = parse_file_extra_htime(a, e, rar,
 1657|    610|				    &extra_data_size);
 1658|    610|				break;
 1659|  4.74k|			case EX_REDIR:
  ------------------
  |  Branch (1659:4): [True: 4.74k, False: 12.8k]
  ------------------
 1660|  4.74k|				ret = parse_file_extra_redir(a, e, rar,
 1661|  4.74k|				    &extra_data_size);
 1662|  4.74k|				break;
 1663|    924|			case EX_UOWNER:
  ------------------
  |  Branch (1663:4): [True: 924, False: 16.6k]
  ------------------
 1664|    924|				ret = parse_file_extra_owner(a, e,
 1665|    924|				    &extra_data_size);
 1666|    924|				break;
 1667|  6.77k|			case EX_VERSION:
  ------------------
  |  Branch (1667:4): [True: 6.77k, False: 10.7k]
  ------------------
 1668|  6.77k|				ret = parse_file_extra_version(a, e,
 1669|  6.77k|				    &extra_data_size);
 1670|  6.77k|				break;
 1671|    477|			case EX_CRYPT:
  ------------------
  |  Branch (1671:4): [True: 477, False: 17.0k]
  ------------------
 1672|       |				/* Mark the entry as encrypted */
 1673|    477|				archive_entry_set_is_data_encrypted(e, 1);
 1674|    477|				rar->has_encrypted_entries = 1;
 1675|    477|				rar->cstate.data_encrypted = 1;
 1676|       |				/* fallthrough */
 1677|    479|			case EX_SUBDATA:
  ------------------
  |  Branch (1677:4): [True: 2, False: 17.5k]
  ------------------
 1678|       |				/* fallthrough */
 1679|  4.21k|			default:
  ------------------
  |  Branch (1679:4): [True: 3.73k, False: 13.8k]
  ------------------
 1680|       |				/* Skip unsupported entry. */
 1681|  4.21k|				extra_data_size -= extra_field_size;
 1682|  4.21k|				if (ARCHIVE_OK != consume(a, extra_field_size)) {
  ------------------
  |  |  233|  4.21k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1682:9): [True: 1.72k, False: 2.48k]
  ------------------
 1683|  1.72k|					return ARCHIVE_EOF;
  ------------------
  |  |  232|  1.72k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1684|  1.72k|				}
 1685|       |
 1686|       |				/* Don't fail on unsupported attribute -- we've handled it
 1687|       |				   by skipping over it. */
 1688|  2.48k|				ret = ARCHIVE_OK;
  ------------------
  |  |  233|  2.48k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1689|  17.5k|		}
 1690|       |
 1691|  15.8k|		if (ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  15.8k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1691:7): [True: 8, False: 15.8k]
  ------------------
 1692|       |			/* Forward any errors signalled by the attribute parsing
 1693|       |			   functions. */
 1694|      8|			return ret;
 1695|      8|		}
 1696|  15.8k|	}
 1697|       |
 1698|    640|	if (extra_data_size != 0) {
  ------------------
  |  Branch (1698:6): [True: 9, False: 631]
  ------------------
 1699|       |		/* We didn't skip everything, or we skipped too much; either way,
 1700|       |		   there's an error in this parsing function. */
 1701|       |
 1702|      9|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      9|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1703|      9|				"unsupported structure of file header extra data");
 1704|      9|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      9|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1705|      9|	}
 1706|       |
 1707|    631|	return ARCHIVE_OK;
  ------------------
  |  |  233|    631|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1708|    640|}
archive_read_support_format_rar5.c:parse_file_extra_hash:
 1269|    290|{
 1270|    290|	size_t hash_type = 0;
 1271|    290|	size_t value_len;
 1272|       |
 1273|    290|	enum HASH_TYPE {
 1274|    290|		BLAKE2sp = 0x00
 1275|    290|	};
 1276|       |
 1277|    290|	if(!read_var_sized(a, &hash_type, &value_len))
  ------------------
  |  Branch (1277:5): [True: 0, False: 290]
  ------------------
 1278|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1279|       |
 1280|    290|	*extra_data_size -= value_len;
 1281|    290|	if(ARCHIVE_OK != consume(a, value_len)) {
  ------------------
  |  |  233|    290|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1281:5): [True: 0, False: 290]
  ------------------
 1282|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1283|      0|	}
 1284|       |
 1285|       |	/* The file uses BLAKE2sp checksum algorithm instead of plain old
 1286|       |	 * CRC32. */
 1287|    290|	if(hash_type == BLAKE2sp) {
  ------------------
  |  Branch (1287:5): [True: 290, False: 0]
  ------------------
 1288|    290|		const uint8_t* p;
 1289|    290|		const int hash_size = sizeof(rar->file.blake2sp);
 1290|       |
 1291|    290|		if(!read_ahead(a, hash_size, &p))
  ------------------
  |  Branch (1291:6): [True: 0, False: 290]
  ------------------
 1292|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1293|       |
 1294|    290|		rar->file.has_blake2 = 1;
 1295|    290|		memcpy(&rar->file.blake2sp, p, hash_size);
 1296|       |
 1297|    290|		if(ARCHIVE_OK != consume(a, hash_size)) {
  ------------------
  |  |  233|    290|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1297:6): [True: 0, False: 290]
  ------------------
 1298|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1299|      0|		}
 1300|       |
 1301|    290|		*extra_data_size -= hash_size;
 1302|    290|	} else {
 1303|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1304|      0|		    "Unsupported hash type (0x%jx)", (uintmax_t)hash_type);
 1305|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1306|      0|	}
 1307|       |
 1308|    290|	return ARCHIVE_OK;
  ------------------
  |  |  233|    290|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1309|    290|}
archive_read_support_format_rar5.c:parse_file_extra_htime:
 1389|    610|{
 1390|    610|	char unix_time, has_unix_ns, has_mtime, has_ctime, has_atime;
 1391|    610|	size_t flags = 0;
 1392|    610|	size_t value_len;
 1393|       |
 1394|    610|	enum HTIME_FLAGS {
 1395|    610|		IS_UNIX       = 0x01,
 1396|    610|		HAS_MTIME     = 0x02,
 1397|    610|		HAS_CTIME     = 0x04,
 1398|    610|		HAS_ATIME     = 0x08,
 1399|    610|		HAS_UNIX_NS   = 0x10,
 1400|    610|	};
 1401|       |
 1402|    610|	if(!read_var_sized(a, &flags, &value_len))
  ------------------
  |  Branch (1402:5): [True: 0, False: 610]
  ------------------
 1403|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1404|       |
 1405|    610|	*extra_data_size -= value_len;
 1406|    610|	if(ARCHIVE_OK != consume(a, value_len)) {
  ------------------
  |  |  233|    610|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1406:5): [True: 0, False: 610]
  ------------------
 1407|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1408|      0|	}
 1409|       |
 1410|    610|	unix_time = flags & IS_UNIX;
 1411|    610|	has_unix_ns = unix_time && (flags & HAS_UNIX_NS);
  ------------------
  |  Branch (1411:16): [True: 455, False: 155]
  |  Branch (1411:29): [True: 237, False: 218]
  ------------------
 1412|    610|	has_mtime = flags & HAS_MTIME;
 1413|    610|	has_atime = flags & HAS_ATIME;
 1414|    610|	has_ctime = flags & HAS_CTIME;
 1415|    610|	rar->file.e_atime_ns = rar->file.e_ctime_ns = rar->file.e_mtime_ns = 0;
 1416|       |
 1417|    610|	if(has_mtime) {
  ------------------
  |  Branch (1417:5): [True: 380, False: 230]
  ------------------
 1418|    380|		parse_htime_item(a, unix_time, &rar->file.e_mtime,
 1419|    380|		    &rar->file.e_mtime_ns, extra_data_size);
 1420|    380|	}
 1421|       |
 1422|    610|	if(has_ctime) {
  ------------------
  |  Branch (1422:5): [True: 222, False: 388]
  ------------------
 1423|    222|		parse_htime_item(a, unix_time, &rar->file.e_ctime,
 1424|    222|		    &rar->file.e_ctime_ns, extra_data_size);
 1425|    222|	}
 1426|       |
 1427|    610|	if(has_atime) {
  ------------------
  |  Branch (1427:5): [True: 320, False: 290]
  ------------------
 1428|    320|		parse_htime_item(a, unix_time, &rar->file.e_atime,
 1429|    320|		    &rar->file.e_atime_ns, extra_data_size);
 1430|    320|	}
 1431|       |
 1432|    610|	if(has_mtime && has_unix_ns) {
  ------------------
  |  Branch (1432:5): [True: 380, False: 230]
  |  Branch (1432:18): [True: 106, False: 274]
  ------------------
 1433|    106|		if(!read_u32(a, &rar->file.e_mtime_ns))
  ------------------
  |  Branch (1433:6): [True: 0, False: 106]
  ------------------
 1434|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1435|       |
 1436|    106|		*extra_data_size -= 4;
 1437|    106|	}
 1438|       |
 1439|    610|	if(has_ctime && has_unix_ns) {
  ------------------
  |  Branch (1439:5): [True: 222, False: 388]
  |  Branch (1439:18): [True: 133, False: 89]
  ------------------
 1440|    133|		if(!read_u32(a, &rar->file.e_ctime_ns))
  ------------------
  |  Branch (1440:6): [True: 1, False: 132]
  ------------------
 1441|      1|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      1|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1442|       |
 1443|    132|		*extra_data_size -= 4;
 1444|    132|	}
 1445|       |
 1446|    609|	if(has_atime && has_unix_ns) {
  ------------------
  |  Branch (1446:5): [True: 319, False: 290]
  |  Branch (1446:18): [True: 132, False: 187]
  ------------------
 1447|    132|		if(!read_u32(a, &rar->file.e_atime_ns))
  ------------------
  |  Branch (1447:6): [True: 0, False: 132]
  ------------------
 1448|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1449|       |
 1450|    132|		*extra_data_size -= 4;
 1451|    132|	}
 1452|       |
 1453|       |	/* The seconds and nanoseconds are either together, or separated in two
 1454|       |	 * fields so we parse them, then set the archive_entry's times. */
 1455|    609|	if(has_mtime) {
  ------------------
  |  Branch (1455:5): [True: 380, False: 229]
  ------------------
 1456|    380|		archive_entry_set_mtime(e, rar->file.e_mtime, rar->file.e_mtime_ns);
 1457|    380|	}
 1458|       |
 1459|    609|	if(has_ctime) {
  ------------------
  |  Branch (1459:5): [True: 221, False: 388]
  ------------------
 1460|    221|		archive_entry_set_ctime(e, rar->file.e_ctime, rar->file.e_ctime_ns);
 1461|    221|	}
 1462|       |
 1463|    609|	if(has_atime) {
  ------------------
  |  Branch (1463:5): [True: 319, False: 290]
  ------------------
 1464|    319|		archive_entry_set_atime(e, rar->file.e_atime, rar->file.e_atime_ns);
 1465|    319|	}
 1466|       |
 1467|    609|	return ARCHIVE_OK;
  ------------------
  |  |  233|    609|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1468|    609|}
archive_read_support_format_rar5.c:parse_htime_item:
 1313|    922|{
 1314|    922|	if(unix_time) {
  ------------------
  |  Branch (1314:5): [True: 658, False: 264]
  ------------------
 1315|    658|		uint32_t time_val;
 1316|    658|		if(!read_u32(a, &time_val))
  ------------------
  |  Branch (1316:6): [True: 0, False: 658]
  ------------------
 1317|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1318|       |
 1319|    658|		*extra_data_size -= 4;
 1320|    658|		*sec = (int64_t) time_val;
 1321|    658|	} else {
 1322|    264|		uint64_t windows_time;
 1323|    264|		if(!read_u64(a, &windows_time))
  ------------------
  |  Branch (1323:6): [True: 0, False: 264]
  ------------------
 1324|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1325|       |
 1326|    264|		ntfs_to_unix(windows_time, sec, nsec);
 1327|    264|		*extra_data_size -= 8;
 1328|    264|	}
 1329|       |
 1330|    922|	return ARCHIVE_OK;
  ------------------
  |  |  233|    922|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1331|    922|}
archive_read_support_format_rar5.c:read_u64:
 1120|    264|static char read_u64(struct archive_read* a, uint64_t* pvalue) {
 1121|    264|	const uint8_t* p;
 1122|    264|	if(!read_ahead(a, 8, &p))
  ------------------
  |  Branch (1122:5): [True: 0, False: 264]
  ------------------
 1123|      0|		return 0;
 1124|       |
 1125|    264|	*pvalue = archive_le64dec(p);
 1126|    264|	return ARCHIVE_OK == consume(a, 8);
  ------------------
  |  |  233|    264|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1127|    264|}
archive_read_support_format_rar5.c:parse_file_extra_redir:
 1472|  4.74k|{
 1473|  4.74k|	uint64_t value_size = 0;
 1474|  4.74k|	size_t target_size = 0;
 1475|  4.74k|	char target_utf8_buf[MAX_NAME_IN_BYTES];
 1476|  4.74k|	const uint8_t* p;
 1477|       |
 1478|  4.74k|	if(!read_var(a, &rar->file.redir_type, &value_size))
  ------------------
  |  Branch (1478:5): [True: 0, False: 4.74k]
  ------------------
 1479|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1480|  4.74k|	if(ARCHIVE_OK != consume(a, (int64_t)value_size))
  ------------------
  |  |  233|  4.74k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1480:5): [True: 0, False: 4.74k]
  ------------------
 1481|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1482|  4.74k|	*extra_data_size -= value_size;
 1483|       |
 1484|  4.74k|	if(!read_var(a, &rar->file.redir_flags, &value_size))
  ------------------
  |  Branch (1484:5): [True: 0, False: 4.74k]
  ------------------
 1485|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1486|  4.74k|	if(ARCHIVE_OK != consume(a, (int64_t)value_size))
  ------------------
  |  |  233|  4.74k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1486:5): [True: 0, False: 4.74k]
  ------------------
 1487|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1488|  4.74k|	*extra_data_size -= value_size;
 1489|       |
 1490|  4.74k|	if(!read_var_sized(a, &target_size, NULL))
  ------------------
  |  Branch (1490:5): [True: 0, False: 4.74k]
  ------------------
 1491|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1492|  4.74k|	*extra_data_size -= target_size + 1;
 1493|       |
 1494|  4.74k|	if(target_size > (MAX_NAME_IN_CHARS - 1)) {
  ------------------
  |  |   89|  4.74k|#define MAX_NAME_IN_CHARS 2048
  ------------------
  |  Branch (1494:5): [True: 1, False: 4.74k]
  ------------------
 1495|      1|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1496|      1|		    "Link target is too long");
 1497|      1|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1498|      1|	}
 1499|       |
 1500|  4.74k|	if(target_size == 0) {
  ------------------
  |  Branch (1500:5): [True: 0, False: 4.74k]
  ------------------
 1501|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1502|      0|		    "No link target specified");
 1503|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1504|      0|	}
 1505|       |
 1506|  4.74k|	if(!read_ahead(a, target_size, &p))
  ------------------
  |  Branch (1506:5): [True: 0, False: 4.74k]
  ------------------
 1507|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1508|       |
 1509|  4.74k|	memcpy(target_utf8_buf, p, target_size);
 1510|  4.74k|	target_utf8_buf[target_size] = 0;
 1511|       |
 1512|  4.74k|	if(ARCHIVE_OK != consume(a, (int64_t)target_size))
  ------------------
  |  |  233|  4.74k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1512:5): [True: 0, False: 4.74k]
  ------------------
 1513|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1514|       |
 1515|  4.74k|	switch(rar->file.redir_type) {
 1516|      0|		case REDIR_TYPE_UNIXSYMLINK:
  ------------------
  |  Branch (1516:3): [True: 0, False: 4.74k]
  ------------------
 1517|      0|		case REDIR_TYPE_WINSYMLINK:
  ------------------
  |  Branch (1517:3): [True: 0, False: 4.74k]
  ------------------
 1518|      0|			archive_entry_set_filetype(e, AE_IFLNK);
  ------------------
  |  |  217|      0|#define AE_IFLNK	((__LA_MODE_T)0120000)
  ------------------
 1519|      0|			archive_entry_update_symlink_utf8(e, target_utf8_buf);
 1520|      0|			if (rar->file.redir_flags & REDIR_SYMLINK_IS_DIR) {
  ------------------
  |  |  135|      0|#define REDIR_SYMLINK_IS_DIR	1
  ------------------
  |  Branch (1520:8): [True: 0, False: 0]
  ------------------
 1521|      0|				archive_entry_set_symlink_type(e,
 1522|      0|					AE_SYMLINK_TYPE_DIRECTORY);
  ------------------
  |  |  229|      0|#define AE_SYMLINK_TYPE_DIRECTORY	2
  ------------------
 1523|      0|			} else {
 1524|      0|				archive_entry_set_symlink_type(e,
 1525|      0|				AE_SYMLINK_TYPE_FILE);
  ------------------
  |  |  228|      0|#define AE_SYMLINK_TYPE_FILE		1
  ------------------
 1526|      0|			}
 1527|      0|			break;
 1528|       |
 1529|    164|		case REDIR_TYPE_HARDLINK:
  ------------------
  |  Branch (1529:3): [True: 164, False: 4.57k]
  ------------------
 1530|    164|			archive_entry_set_filetype(e, AE_IFREG);
  ------------------
  |  |  216|    164|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1531|    164|			archive_entry_update_hardlink_utf8(e, target_utf8_buf);
 1532|    164|			break;
 1533|       |
 1534|  4.57k|		default:
  ------------------
  |  Branch (1534:3): [True: 4.57k, False: 164]
  ------------------
 1535|       |			/* Unknown redir type, skip it. */
 1536|  4.57k|			break;
 1537|  4.74k|	}
 1538|  4.74k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  4.74k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1539|  4.74k|}
archive_read_support_format_rar5.c:parse_file_extra_owner:
 1543|    924|{
 1544|    924|	uint64_t flags = 0;
 1545|    924|	uint64_t value_size = 0;
 1546|    924|	uint64_t id = 0;
 1547|    924|	size_t name_len = 0;
 1548|    924|	size_t name_size = 0;
 1549|    924|	char namebuf[OWNER_MAXNAMELEN];
 1550|    924|	const uint8_t* p;
 1551|       |
 1552|    924|	if(!read_var(a, &flags, &value_size))
  ------------------
  |  Branch (1552:5): [True: 0, False: 924]
  ------------------
 1553|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1554|    924|	if(ARCHIVE_OK != consume(a, (int64_t)value_size))
  ------------------
  |  |  233|    924|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1554:5): [True: 0, False: 924]
  ------------------
 1555|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1556|    924|	*extra_data_size -= value_size;
 1557|       |
 1558|    924|	if ((flags & OWNER_USER_NAME) != 0) {
  ------------------
  |  |  146|    924|#define	OWNER_USER_NAME		0x01
  ------------------
  |  Branch (1558:6): [True: 224, False: 700]
  ------------------
 1559|    224|		if(!read_var_sized(a, &name_size, NULL))
  ------------------
  |  Branch (1559:6): [True: 0, False: 224]
  ------------------
 1560|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1561|    224|		*extra_data_size -= name_size + 1;
 1562|       |
 1563|    224|		if(!read_ahead(a, name_size, &p))
  ------------------
  |  Branch (1563:6): [True: 4, False: 220]
  ------------------
 1564|      4|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      4|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1565|       |
 1566|    220|		if (name_size >= OWNER_MAXNAMELEN) {
  ------------------
  |  |  150|    220|#define	OWNER_MAXNAMELEN	256
  ------------------
  |  Branch (1566:7): [True: 3, False: 217]
  ------------------
 1567|      3|			name_len = OWNER_MAXNAMELEN - 1;
  ------------------
  |  |  150|      3|#define	OWNER_MAXNAMELEN	256
  ------------------
 1568|    217|		} else {
 1569|    217|			name_len = name_size;
 1570|    217|		}
 1571|       |
 1572|    220|		memcpy(namebuf, p, name_len);
 1573|    220|		namebuf[name_len] = 0;
 1574|    220|		if(ARCHIVE_OK != consume(a, (int64_t)name_size))
  ------------------
  |  |  233|    220|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1574:6): [True: 0, False: 220]
  ------------------
 1575|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1576|       |
 1577|    220|		archive_entry_set_uname(e, namebuf);
 1578|    220|	}
 1579|    920|	if ((flags & OWNER_GROUP_NAME) != 0) {
  ------------------
  |  |  147|    920|#define	OWNER_GROUP_NAME	0x02
  ------------------
  |  Branch (1579:6): [True: 784, False: 136]
  ------------------
 1580|    784|		if(!read_var_sized(a, &name_size, NULL))
  ------------------
  |  Branch (1580:6): [True: 0, False: 784]
  ------------------
 1581|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1582|    784|		*extra_data_size -= name_size + 1;
 1583|       |
 1584|    784|		if(!read_ahead(a, name_size, &p))
  ------------------
  |  Branch (1584:6): [True: 0, False: 784]
  ------------------
 1585|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1586|       |
 1587|    784|		if (name_size >= OWNER_MAXNAMELEN) {
  ------------------
  |  |  150|    784|#define	OWNER_MAXNAMELEN	256
  ------------------
  |  Branch (1587:7): [True: 7, False: 777]
  ------------------
 1588|      7|			name_len = OWNER_MAXNAMELEN - 1;
  ------------------
  |  |  150|      7|#define	OWNER_MAXNAMELEN	256
  ------------------
 1589|    777|		} else {
 1590|    777|			name_len = name_size;
 1591|    777|		}
 1592|       |
 1593|    784|		memcpy(namebuf, p, name_len);
 1594|    784|		namebuf[name_len] = 0;
 1595|    784|		if(ARCHIVE_OK != consume(a, (int64_t)name_size))
  ------------------
  |  |  233|    784|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1595:6): [True: 0, False: 784]
  ------------------
 1596|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1597|       |
 1598|    784|		archive_entry_set_gname(e, namebuf);
 1599|    784|	}
 1600|    920|	if ((flags & OWNER_USER_UID) != 0) {
  ------------------
  |  |  148|    920|#define	OWNER_USER_UID		0x04
  ------------------
  |  Branch (1600:6): [True: 907, False: 13]
  ------------------
 1601|    907|		if(!read_var(a, &id, &value_size))
  ------------------
  |  Branch (1601:6): [True: 1, False: 906]
  ------------------
 1602|      1|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      1|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1603|    906|		if(ARCHIVE_OK != consume(a, (int64_t)value_size))
  ------------------
  |  |  233|    906|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1603:6): [True: 0, False: 906]
  ------------------
 1604|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1605|    906|		*extra_data_size -= value_size;
 1606|       |
 1607|    906|		archive_entry_set_uid(e, (la_int64_t)id);
 1608|    906|	}
 1609|    919|	if ((flags & OWNER_GROUP_GID) != 0) {
  ------------------
  |  |  149|    919|#define	OWNER_GROUP_GID		0x08
  ------------------
  |  Branch (1609:6): [True: 224, False: 695]
  ------------------
 1610|    224|		if(!read_var(a, &id, &value_size))
  ------------------
  |  Branch (1610:6): [True: 0, False: 224]
  ------------------
 1611|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1612|    224|		if(ARCHIVE_OK != consume(a, (int64_t)value_size))
  ------------------
  |  |  233|    224|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1612:6): [True: 0, False: 224]
  ------------------
 1613|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1614|    224|		*extra_data_size -= value_size;
 1615|       |
 1616|    224|		archive_entry_set_gid(e, (la_int64_t)id);
 1617|    224|	}
 1618|    919|	return ARCHIVE_OK;
  ------------------
  |  |  233|    919|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1619|    919|}
archive_read_support_format_rar5.c:parse_file_extra_version:
 1335|  6.77k|{
 1336|  6.77k|	size_t flags = 0;
 1337|  6.77k|	size_t version = 0;
 1338|  6.77k|	size_t value_len = 0;
 1339|  6.77k|	struct archive_string version_string;
 1340|  6.77k|	struct archive_string name_utf8_string;
 1341|  6.77k|	const char* cur_filename;
 1342|       |
 1343|       |	/* Flags are ignored. */
 1344|  6.77k|	if(!read_var_sized(a, &flags, &value_len))
  ------------------
  |  Branch (1344:5): [True: 1, False: 6.76k]
  ------------------
 1345|      1|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      1|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1346|       |
 1347|  6.76k|	*extra_data_size -= value_len;
 1348|  6.76k|	if(ARCHIVE_OK != consume(a, value_len))
  ------------------
  |  |  233|  6.76k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1348:5): [True: 0, False: 6.76k]
  ------------------
 1349|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1350|       |
 1351|  6.76k|	if(!read_var_sized(a, &version, &value_len))
  ------------------
  |  Branch (1351:5): [True: 0, False: 6.76k]
  ------------------
 1352|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1353|       |
 1354|  6.76k|	*extra_data_size -= value_len;
 1355|  6.76k|	if(ARCHIVE_OK != consume(a, value_len))
  ------------------
  |  |  233|  6.76k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1355:5): [True: 0, False: 6.76k]
  ------------------
 1356|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1357|       |
 1358|       |	/* extra_data_size should be zero here. */
 1359|       |
 1360|  6.76k|	cur_filename = archive_entry_pathname_utf8(e);
 1361|  6.76k|	if(cur_filename == NULL) {
  ------------------
  |  Branch (1361:5): [True: 0, False: 6.76k]
  ------------------
 1362|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1363|      0|		    "Version entry without file name");
 1364|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1365|      0|	}
 1366|       |
 1367|  6.76k|	archive_string_init(&version_string);
  ------------------
  |  |   71|  6.76k|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 6.76k]
  |  |  ------------------
  ------------------
 1368|  6.76k|	archive_string_init(&name_utf8_string);
  ------------------
  |  |   71|  6.76k|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 6.76k]
  |  |  ------------------
  ------------------
 1369|       |
 1370|       |	/* Prepare a ;123 suffix for the filename, where '123' is the version
 1371|       |	 * value of this file. */
 1372|  6.76k|	archive_string_sprintf(&version_string, ";%zu", version);
 1373|       |
 1374|       |	/* Build the new filename. */
 1375|  6.76k|	archive_strcat(&name_utf8_string, cur_filename);
 1376|  6.76k|	archive_strcat(&name_utf8_string, version_string.s);
 1377|       |
 1378|       |	/* Apply the new filename into this file's context. */
 1379|  6.76k|	archive_entry_update_pathname_utf8(e, name_utf8_string.s);
 1380|       |
 1381|       |	/* Free buffers. */
 1382|  6.76k|	archive_string_free(&version_string);
 1383|  6.76k|	archive_string_free(&name_utf8_string);
 1384|  6.76k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  6.76k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1385|  6.76k|}
archive_read_support_format_rar5.c:scan_for_signature:
 3369|  17.4k|static int scan_for_signature(struct archive_read* a) {
 3370|  17.4k|	const uint8_t* p;
 3371|  17.4k|	const int chunk_size = 512;
 3372|  17.4k|	ssize_t i;
 3373|  17.4k|	char signature[sizeof(rar5_signature_xor)];
 3374|       |
 3375|       |	/* If we're here, it means we're on an 'unknown territory' data.
 3376|       |	 * There's no indication what kind of data we're reading here.
 3377|       |	 * It could be some text comment, any kind of binary data,
 3378|       |	 * digital sign, dragons, etc.
 3379|       |	 *
 3380|       |	 * We want to find a valid RARv5 magic header inside this unknown
 3381|       |	 * data. */
 3382|       |
 3383|       |	/* Is it possible in libarchive to just skip everything until the
 3384|       |	 * end of the file? If so, it would be a better approach than the
 3385|       |	 * current implementation of this function. */
 3386|       |
 3387|  17.4k|	rar5_signature(signature);
 3388|       |
 3389|  18.9k|	while(1) {
  ------------------
  |  Branch (3389:8): [True: 18.9k, Folded]
  ------------------
 3390|  18.9k|		if(!read_ahead(a, chunk_size, &p))
  ------------------
  |  Branch (3390:6): [True: 166, False: 18.8k]
  ------------------
 3391|    166|			return ARCHIVE_EOF;
  ------------------
  |  |  232|    166|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3392|       |
 3393|  5.34M|		for(i = 0; i < chunk_size - (int)sizeof(rar5_signature_xor);
  ------------------
  |  Branch (3393:14): [True: 5.34M, False: 1.56k]
  ------------------
 3394|  5.34M|		    i++) {
 3395|  5.34M|			if(memcmp(&p[i], signature,
  ------------------
  |  Branch (3395:7): [True: 17.2k, False: 5.33M]
  ------------------
 3396|  5.34M|			    sizeof(rar5_signature_xor)) == 0) {
 3397|       |				/* Consume the number of bytes we've used to
 3398|       |				 * search for the signature, as well as the
 3399|       |				 * number of bytes used by the signature
 3400|       |				 * itself. After this we should be standing
 3401|       |				 * on a valid base block header. */
 3402|  17.2k|				(void) consume(a,
 3403|  17.2k|				    i + sizeof(rar5_signature_xor));
 3404|  17.2k|				return ARCHIVE_OK;
  ------------------
  |  |  233|  17.2k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3405|  17.2k|			}
 3406|  5.34M|		}
 3407|       |
 3408|  1.56k|		consume(a, chunk_size);
 3409|  1.56k|	}
 3410|       |
 3411|      0|	return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3412|  17.4k|}
archive_read_support_format_rar5.c:rar5_read_data:
 4218|  29.9k|    size_t *size, int64_t *offset) {
 4219|  29.9k|	int ret;
 4220|  29.9k|	struct rar5* rar = get_context(a);
 4221|       |
 4222|  29.9k|	if (size)
  ------------------
  |  Branch (4222:6): [True: 11.7k, False: 18.2k]
  ------------------
 4223|  11.7k|		*size = 0;
 4224|       |
 4225|  29.9k|	if (rar->has_encrypted_entries == ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW) {
  ------------------
  |  |  411|  29.9k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  |  Branch (4225:6): [True: 0, False: 29.9k]
  ------------------
 4226|      0|		rar->has_encrypted_entries = 0;
 4227|      0|	}
 4228|       |
 4229|  29.9k|	if (rar->headers_are_encrypted || rar->cstate.data_encrypted) {
  ------------------
  |  Branch (4229:6): [True: 0, False: 29.9k]
  |  Branch (4229:36): [True: 3, False: 29.9k]
  ------------------
 4230|      3|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      3|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 4231|      3|		    "Reading encrypted data is not currently supported");
 4232|      3|		return ARCHIVE_FAILED;
  ------------------
  |  |  237|      3|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 4233|      3|	}
 4234|       |
 4235|  29.9k|	if(rar->file.dir > 0) {
  ------------------
  |  Branch (4235:5): [True: 0, False: 29.9k]
  ------------------
 4236|       |		/* Don't process any data if this file entry was declared
 4237|       |		 * as a directory. This is needed, because entries marked as
 4238|       |		 * directory doesn't have any dictionary buffer allocated, so
 4239|       |		 * it's impossible to perform any decompression. */
 4240|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 4241|      0|		    "Can't decompress an entry marked as a directory");
 4242|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4243|      0|	}
 4244|       |
 4245|  29.9k|	if(!rar->skip_mode && (rar->cstate.last_write_ptr > rar->file.unpacked_size)) {
  ------------------
  |  Branch (4245:5): [True: 11.7k, False: 18.2k]
  |  Branch (4245:24): [True: 0, False: 11.7k]
  ------------------
 4246|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 4247|      0|		    "Unpacker has written too many bytes");
 4248|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4249|      0|	}
 4250|       |
 4251|  29.9k|	ret = use_data(rar, buff, size, offset);
 4252|  29.9k|	if(ret == ARCHIVE_OK) {
  ------------------
  |  |  233|  29.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4252:5): [True: 1.27k, False: 28.6k]
  ------------------
 4253|  1.27k|		return ret;
 4254|  1.27k|	}
 4255|       |
 4256|  28.6k|	if(rar->file.eof == 1) {
  ------------------
  |  Branch (4256:5): [True: 22, False: 28.6k]
  ------------------
 4257|     22|		return ARCHIVE_EOF;
  ------------------
  |  |  232|     22|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 4258|     22|	}
 4259|       |
 4260|  28.6k|	ret = do_unpack(a, rar, buff, size, offset);
 4261|  28.6k|	if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  28.6k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4261:5): [True: 14.4k, False: 14.1k]
  ------------------
 4262|  14.4k|		return ret;
 4263|  14.4k|	}
 4264|       |
 4265|  14.1k|	if(rar->file.bytes_remaining == 0 &&
  ------------------
  |  Branch (4265:5): [True: 4.43k, False: 9.76k]
  ------------------
 4266|  4.43k|			rar->cstate.last_write_ptr == rar->file.unpacked_size)
  ------------------
  |  Branch (4266:4): [True: 27, False: 4.40k]
  ------------------
 4267|     27|	{
 4268|       |		/* If all bytes of current file were processed, run
 4269|       |		 * finalization.
 4270|       |		 *
 4271|       |		 * Finalization will check checksum against proper values. If
 4272|       |		 * some of the checksums will not match, we'll return an error
 4273|       |		 * value in the last `archive_read_data` call to signal an error
 4274|       |		 * to the user. */
 4275|       |
 4276|     27|		rar->file.eof = 1;
 4277|     27|		return verify_global_checksums(a);
 4278|     27|	}
 4279|       |
 4280|  14.1k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  14.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4281|  14.1k|}
archive_read_support_format_rar5.c:use_data:
 3761|  29.9k|{
 3762|  29.9k|	int i;
 3763|       |
 3764|  87.3k|	for(i = 0; i < rar5_countof(rar->cstate.dready); i++) {
  ------------------
  |  |   63|  87.3k|#define rar5_countof(X) ((const ssize_t) (sizeof(X) / sizeof(*X)))
  ------------------
  |  Branch (3764:13): [True: 58.7k, False: 28.6k]
  ------------------
 3765|  58.7k|		struct data_ready *d = &rar->cstate.dready[i];
 3766|       |
 3767|  58.7k|		if(d->used) {
  ------------------
  |  Branch (3767:6): [True: 1.27k, False: 57.4k]
  ------------------
 3768|  1.27k|			if(buf)    *buf = d->buf;
  ------------------
  |  Branch (3768:7): [True: 1.25k, False: 23]
  ------------------
 3769|  1.27k|			if(size)   *size = d->size;
  ------------------
  |  Branch (3769:7): [True: 1.25k, False: 23]
  ------------------
 3770|  1.27k|			if(offset) *offset = d->offset;
  ------------------
  |  Branch (3770:7): [True: 1.25k, False: 23]
  ------------------
 3771|       |
 3772|  1.27k|			d->used = 0;
 3773|  1.27k|			return ARCHIVE_OK;
  ------------------
  |  |  233|  1.27k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3774|  1.27k|		}
 3775|  58.7k|	}
 3776|       |
 3777|  28.6k|	return ARCHIVE_RETRY;
  ------------------
  |  |  234|  28.6k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
 3778|  29.9k|}
archive_read_support_format_rar5.c:do_unpack:
 4057|  28.6k|{
 4058|  28.6k|	enum COMPRESSION_METHOD {
 4059|  28.6k|		STORE = 0, FASTEST = 1, FAST = 2, NORMAL = 3, GOOD = 4,
 4060|  28.6k|		BEST = 5
 4061|  28.6k|	};
 4062|       |
 4063|  28.6k|	if(rar->file.service > 0) {
  ------------------
  |  Branch (4063:5): [True: 0, False: 28.6k]
  ------------------
 4064|      0|		return do_unstore_file(a, rar, buf, size, offset);
 4065|  28.6k|	} else {
 4066|  28.6k|		switch(rar->cstate.method) {
 4067|  6.81k|			case STORE:
  ------------------
  |  Branch (4067:4): [True: 6.81k, False: 21.8k]
  ------------------
 4068|  6.81k|				return do_unstore_file(a, rar, buf, size,
 4069|  6.81k|				    offset);
 4070|  19.3k|			case FASTEST:
  ------------------
  |  Branch (4070:4): [True: 19.3k, False: 9.23k]
  ------------------
 4071|       |				/* fallthrough */
 4072|  21.0k|			case FAST:
  ------------------
  |  Branch (4072:4): [True: 1.67k, False: 26.9k]
  ------------------
 4073|       |				/* fallthrough */
 4074|  21.4k|			case NORMAL:
  ------------------
  |  Branch (4074:4): [True: 365, False: 28.2k]
  ------------------
 4075|       |				/* fallthrough */
 4076|  21.7k|			case GOOD:
  ------------------
  |  Branch (4076:4): [True: 365, False: 28.2k]
  ------------------
 4077|       |				/* fallthrough */
 4078|  21.8k|			case BEST:
  ------------------
  |  Branch (4078:4): [True: 16, False: 28.6k]
  ------------------
 4079|       |				/* No data is returned here. But because a sparse-file aware
 4080|       |				 * caller (like archive_read_data_into_fd) may treat zero-size
 4081|       |				 * as a sparse file block, we need to update the offset
 4082|       |				 * accordingly. At this point the decoder doesn't have any
 4083|       |				 * pending uncompressed data blocks, so the current position in
 4084|       |				 * the output file should be last_write_ptr. */
 4085|  21.8k|				if (offset) *offset = rar->cstate.last_write_ptr;
  ------------------
  |  Branch (4085:9): [True: 3.64k, False: 18.1k]
  ------------------
 4086|  21.8k|				return uncompress_file(a);
 4087|      0|			default:
  ------------------
  |  Branch (4087:4): [True: 0, False: 28.6k]
  ------------------
 4088|      0|				archive_set_error(&a->archive,
 4089|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 4090|      0|				    "Compression method not supported: 0x%x",
 4091|      0|				    (unsigned int)rar->cstate.method);
 4092|       |
 4093|      0|				return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4094|  28.6k|		}
 4095|  28.6k|	}
 4096|       |
 4097|      0|#if !defined WIN32
 4098|       |	/* Not reached. */
 4099|      0|	return ARCHIVE_OK;
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4100|  28.6k|#endif
 4101|  28.6k|}
archive_read_support_format_rar5.c:do_unstore_file:
 4009|  6.81k|{
 4010|  6.81k|	size_t to_read;
 4011|  6.81k|	const uint8_t* p;
 4012|       |
 4013|  6.81k|	if(rar->file.bytes_remaining == 0 && rar->main.volume > 0 &&
  ------------------
  |  Branch (4013:5): [True: 5.28k, False: 1.53k]
  |  Branch (4013:39): [True: 5.28k, False: 0]
  ------------------
 4014|  5.28k|	    rar->generic.split_after > 0)
  ------------------
  |  Branch (4014:6): [True: 4.54k, False: 736]
  ------------------
 4015|  4.54k|	{
 4016|  4.54k|		int ret;
 4017|       |
 4018|  4.54k|		rar->cstate.switch_multivolume = 1;
 4019|  4.54k|		ret = advance_multivolume(a);
 4020|  4.54k|		rar->cstate.switch_multivolume = 0;
 4021|       |
 4022|  4.54k|		if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  4.54k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4022:6): [True: 1.57k, False: 2.97k]
  ------------------
 4023|       |			/* Failed to advance to next multivolume archive
 4024|       |			 * file. */
 4025|  1.57k|			return ret;
 4026|  1.57k|		}
 4027|  4.54k|	}
 4028|       |
 4029|  5.23k|	to_read = rar5_min(rar->file.bytes_remaining, 64 * 1024);
  ------------------
  |  |   61|  5.23k|#define rar5_min(a, b) (((a) > (b)) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (61:25): [True: 14, False: 5.22k]
  |  |  ------------------
  ------------------
 4030|  5.23k|	if(to_read == 0) {
  ------------------
  |  Branch (4030:5): [True: 882, False: 4.35k]
  ------------------
 4031|    882|		return ARCHIVE_EOF;
  ------------------
  |  |  232|    882|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 4032|    882|	}
 4033|       |
 4034|  4.35k|	if(!read_ahead(a, to_read, &p)) {
  ------------------
  |  Branch (4034:5): [True: 8, False: 4.34k]
  ------------------
 4035|      8|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      8|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 4036|      8|		    "I/O error when unstoring file");
 4037|      8|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      8|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4038|      8|	}
 4039|       |
 4040|  4.34k|	if(ARCHIVE_OK != consume(a, to_read)) {
  ------------------
  |  |  233|  4.34k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4040:5): [True: 0, False: 4.34k]
  ------------------
 4041|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 4042|      0|	}
 4043|       |
 4044|  4.34k|	if(buf)    *buf = p;
  ------------------
  |  Branch (4044:5): [True: 4.32k, False: 21]
  ------------------
 4045|  4.34k|	if(size)   *size = to_read;
  ------------------
  |  Branch (4045:5): [True: 4.32k, False: 21]
  ------------------
 4046|  4.34k|	if(offset) *offset = rar->cstate.last_unstore_ptr;
  ------------------
  |  Branch (4046:5): [True: 4.32k, False: 21]
  ------------------
 4047|       |
 4048|  4.34k|	rar->file.bytes_remaining -= to_read;
 4049|  4.34k|	rar->cstate.last_unstore_ptr += to_read;
 4050|       |
 4051|  4.34k|	update_crc(rar, p, to_read);
 4052|  4.34k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  4.34k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4053|  4.34k|}
archive_read_support_format_rar5.c:advance_multivolume:
 3416|  15.3k|static int advance_multivolume(struct archive_read* a) {
 3417|  15.3k|	int lret;
 3418|  15.3k|	struct rar5* rar = get_context(a);
 3419|       |
 3420|       |	/* A small state machine that will skip unnecessary data, needed to
 3421|       |	 * switch from one multivolume to another. Such skipping is needed if
 3422|       |	 * we want to be an stream-oriented (instead of file-oriented)
 3423|       |	 * unpacker.
 3424|       |	 *
 3425|       |	 * The state machine starts with `rar->main.endarc` == 0. It also
 3426|       |	 * assumes that current stream pointer points to some base block
 3427|       |	 * header.
 3428|       |	 *
 3429|       |	 * The `endarc` field is being set when the base block parsing
 3430|       |	 * function encounters the 'end of archive' marker.
 3431|       |	 */
 3432|       |
 3433|  35.8k|	while(1) {
  ------------------
  |  Branch (3433:8): [True: 35.8k, Folded]
  ------------------
 3434|  35.8k|		if(rar->main.endarc == 1) {
  ------------------
  |  Branch (3434:6): [True: 14.4k, False: 21.3k]
  ------------------
 3435|  14.4k|			int looping = 1;
 3436|       |
 3437|  14.4k|			rar->main.endarc = 0;
 3438|       |
 3439|  31.0k|			while(looping) {
  ------------------
  |  Branch (3439:10): [True: 27.4k, False: 3.58k]
  ------------------
 3440|  27.4k|				lret = skip_base_block(a);
 3441|  27.4k|				switch(lret) {
 3442|  13.0k|					case ARCHIVE_RETRY:
  ------------------
  |  |  234|  13.0k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  |  Branch (3442:6): [True: 13.0k, False: 14.4k]
  ------------------
 3443|       |						/* Continue looping. */
 3444|  13.0k|						break;
 3445|  3.58k|					case ARCHIVE_OK:
  ------------------
  |  |  233|  3.58k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3445:6): [True: 3.58k, False: 23.9k]
  ------------------
 3446|       |						/* Break loop. */
 3447|  3.58k|						looping = 0;
 3448|  3.58k|						break;
 3449|  10.8k|					default:
  ------------------
  |  Branch (3449:6): [True: 10.8k, False: 16.6k]
  ------------------
 3450|       |						/* Forward any errors to the
 3451|       |						 * caller. */
 3452|  10.8k|						return lret;
 3453|  27.4k|				}
 3454|  27.4k|			}
 3455|       |
 3456|  3.58k|			break;
 3457|  21.3k|		} else {
 3458|       |			/* Skip current base block. In order to properly skip
 3459|       |			 * it, we really need to simply parse it and discard
 3460|       |			 * the results. */
 3461|       |
 3462|  21.3k|			lret = skip_base_block(a);
 3463|  21.3k|			if(lret == ARCHIVE_FATAL || lret == ARCHIVE_FAILED)
  ------------------
  |  |  239|  42.7k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
              			if(lret == ARCHIVE_FATAL || lret == ARCHIVE_FAILED)
  ------------------
  |  |  237|  21.3k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (3463:7): [True: 13, False: 21.3k]
  |  Branch (3463:32): [True: 16, False: 21.3k]
  ------------------
 3464|     29|				return lret;
 3465|       |
 3466|       |			/* The `skip_base_block` function tells us if we
 3467|       |			 * should continue with skipping, or we should stop
 3468|       |			 * skipping. We're trying to skip everything up to
 3469|       |			 * a base FILE block. */
 3470|       |
 3471|  21.3k|			if(lret != ARCHIVE_RETRY) {
  ------------------
  |  |  234|  21.3k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  |  Branch (3471:7): [True: 869, False: 20.4k]
  ------------------
 3472|       |				/* If there was an error during skipping, or we
 3473|       |				 * have just skipped a FILE base block... */
 3474|       |
 3475|    869|				if(rar->main.endarc == 0) {
  ------------------
  |  Branch (3475:8): [True: 817, False: 52]
  ------------------
 3476|    817|					return lret;
 3477|    817|				} else {
 3478|     52|					continue;
 3479|     52|				}
 3480|    869|			}
 3481|  21.3k|		}
 3482|  35.8k|	}
 3483|       |
 3484|  3.58k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  3.58k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3485|  15.3k|}
archive_read_support_format_rar5.c:skip_base_block:
 2447|  48.8k|static int skip_base_block(struct archive_read* a) {
 2448|  48.8k|	int ret;
 2449|  48.8k|	struct rar5* rar = get_context(a);
 2450|       |
 2451|       |	/* Create a new local archive_entry structure that will be operated on
 2452|       |	 * by header reader; operations on this archive_entry will be discarded.
 2453|       |	 */
 2454|  48.8k|	struct archive_entry* entry = archive_entry_new();
 2455|  48.8k|	ret = process_base_block(a, entry);
 2456|       |
 2457|       |	/* Discard operations on this archive_entry structure. */
 2458|  48.8k|	archive_entry_free(entry);
 2459|  48.8k|	if(ret == ARCHIVE_FATAL)
  ------------------
  |  |  239|  48.8k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (2459:5): [True: 2.37k, False: 46.4k]
  ------------------
 2460|  2.37k|		return ret;
 2461|       |
 2462|  46.4k|	if(rar->generic.last_header_id == 2 && rar->generic.split_before > 0)
  ------------------
  |  Branch (2462:5): [True: 17.6k, False: 28.8k]
  |  Branch (2462:41): [True: 3.74k, False: 13.9k]
  ------------------
 2463|  3.74k|		return ARCHIVE_OK;
  ------------------
  |  |  233|  3.74k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2464|       |
 2465|  42.7k|	if(ret == ARCHIVE_OK)
  ------------------
  |  |  233|  42.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2465:5): [True: 26.9k, False: 15.8k]
  ------------------
 2466|  26.9k|		return ARCHIVE_RETRY;
  ------------------
  |  |  234|  26.9k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
 2467|  15.8k|	else
 2468|  15.8k|		return ret;
 2469|  42.7k|}
archive_read_support_format_rar5.c:update_crc:
 2596|  5.62k|static void update_crc(struct rar5* rar, const uint8_t* p, size_t to_read) {
 2597|  5.62k|    int verify_crc;
 2598|       |
 2599|  5.62k|	if(rar->skip_mode) {
  ------------------
  |  Branch (2599:5): [True: 21, False: 5.60k]
  ------------------
 2600|       |#if defined CHECK_CRC_ON_SOLID_SKIP
 2601|       |		verify_crc = 1;
 2602|       |#else
 2603|     21|		verify_crc = 0;
 2604|     21|#endif
 2605|     21|	} else
 2606|  5.60k|		verify_crc = 1;
 2607|       |
 2608|  5.62k|	if(verify_crc) {
  ------------------
  |  Branch (2608:5): [True: 5.60k, False: 21]
  ------------------
 2609|       |		/* Don't update CRC32 if the file doesn't have the
 2610|       |		 * `stored_crc32` info filled in. */
 2611|  5.60k|		if(rar->file.stored_crc32 > 0) {
  ------------------
  |  Branch (2611:6): [True: 2.83k, False: 2.76k]
  ------------------
 2612|  2.83k|			rar->file.calculated_crc32 =
 2613|  2.83k|				crc32(rar->file.calculated_crc32, p, (unsigned int)to_read);
 2614|  2.83k|		}
 2615|       |
 2616|       |		/* Check if the file uses an optional BLAKE2sp checksum
 2617|       |		 * algorithm. */
 2618|  5.60k|		if(rar->file.has_blake2 > 0) {
  ------------------
  |  Branch (2618:6): [True: 2.65k, False: 2.94k]
  ------------------
 2619|       |			/* Return value of the `update` function is always 0,
 2620|       |			 * so we can explicitly ignore it here. */
 2621|  2.65k|			(void) blake2sp_update(&rar->file.b2state, p, to_read);
 2622|  2.65k|		}
 2623|  5.60k|	}
 2624|  5.62k|}
archive_read_support_format_rar5.c:uncompress_file:
 3993|  21.8k|static int uncompress_file(struct archive_read* a) {
 3994|  21.8k|	int ret;
 3995|       |
 3996|  21.8k|	while(1) {
  ------------------
  |  Branch (3996:8): [True: 21.8k, Folded]
  ------------------
 3997|       |		/* Sometimes the uncompression function will return a
 3998|       |		 * 'retry' signal. If this will happen, we have to retry
 3999|       |		 * the function. */
 4000|  21.8k|		ret = do_uncompress_file(a);
 4001|  21.8k|		if(ret != ARCHIVE_RETRY)
  ------------------
  |  |  234|  21.8k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  |  Branch (4001:6): [True: 21.8k, False: 0]
  ------------------
 4002|  21.8k|			return ret;
 4003|  21.8k|	}
 4004|  21.8k|}
archive_read_support_format_rar5.c:do_uncompress_file:
 3880|  21.8k|static int do_uncompress_file(struct archive_read* a) {
 3881|  21.8k|	struct rar5* rar = get_context(a);
 3882|  21.8k|	int ret;
 3883|  21.8k|	int64_t max_end_pos;
 3884|       |
 3885|  21.8k|	if(!rar->cstate.initialized) {
  ------------------
  |  Branch (3885:5): [True: 11.0k, False: 10.7k]
  ------------------
 3886|       |		/* Don't perform full context reinitialization if we're
 3887|       |		 * processing a solid archive. */
 3888|  11.0k|		if(!rar->main.solid || !rar->cstate.window_buf) {
  ------------------
  |  Branch (3888:6): [True: 328, False: 10.7k]
  |  Branch (3888:26): [True: 56, False: 10.6k]
  ------------------
 3889|    384|			if((ret = init_unpack(rar)) != ARCHIVE_OK)
  ------------------
  |  |  233|    384|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3889:7): [True: 0, False: 384]
  ------------------
 3890|      0|				return ret;
 3891|    384|		}
 3892|       |
 3893|  11.0k|		rar->cstate.initialized = 1;
 3894|  11.0k|	}
 3895|       |
 3896|       |	/* Don't allow extraction if window_size is invalid. */
 3897|  21.8k|	if(rar->cstate.window_size == 0) {
  ------------------
  |  Branch (3897:5): [True: 0, False: 21.8k]
  ------------------
 3898|      0|		archive_set_error(&a->archive,
 3899|      0|			ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3900|      0|			"Invalid window size declaration in this file");
 3901|       |
 3902|       |		/* This should never happen in valid files. */
 3903|      0|		return ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3904|      0|	}
 3905|       |
 3906|  21.8k|	if(rar->cstate.all_filters_applied == 1) {
  ------------------
  |  Branch (3906:5): [True: 21.8k, False: 0]
  ------------------
 3907|       |		/* We use while(1) here, but standard case allows for just 1
 3908|       |		 * iteration. The loop will iterate if process_block() didn't
 3909|       |		 * generate any data at all. This can happen if the block
 3910|       |		 * contains only filter definitions (this is common in big
 3911|       |		 * files). */
 3912|  47.3k|		while(1) {
  ------------------
  |  Branch (3912:9): [True: 47.3k, Folded]
  ------------------
 3913|  47.3k|			ret = process_block(a);
 3914|  47.3k|			if(ret != ARCHIVE_OK)
  ------------------
  |  |  233|  47.3k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3914:7): [True: 11.2k, False: 36.1k]
  ------------------
 3915|  11.2k|				return ret;
 3916|       |
 3917|  36.1k|			if(rar->cstate.last_write_ptr ==
  ------------------
  |  Branch (3917:7): [True: 26.2k, False: 9.85k]
  ------------------
 3918|  36.1k|			    rar->cstate.write_ptr) {
 3919|       |				/* The block didn't generate any new data,
 3920|       |				 * so just process a new block if this one
 3921|       |				 * wasn't the last block in the file. */
 3922|  26.2k|				if (bf_is_last_block(&rar->last_block_hdr)) {
  ------------------
  |  Branch (3922:9): [True: 674, False: 25.5k]
  ------------------
 3923|    674|					return ARCHIVE_EOF;
  ------------------
  |  |  232|    674|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3924|    674|				}
 3925|       |
 3926|  25.5k|				continue;
 3927|  26.2k|			}
 3928|       |
 3929|       |			/* The block has generated some new data, so break
 3930|       |			 * the loop. */
 3931|  9.85k|			break;
 3932|  36.1k|		}
 3933|  21.8k|	}
 3934|       |
 3935|       |	/* Try to run filters. If filters won't be applied, it means that
 3936|       |	 * insufficient data was generated. */
 3937|  9.85k|	ret = apply_filters(a);
 3938|  9.85k|	if(ret == ARCHIVE_RETRY) {
  ------------------
  |  |  234|  9.85k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  |  Branch (3938:5): [True: 0, False: 9.85k]
  ------------------
 3939|      0|		return ARCHIVE_OK;
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3940|  9.85k|	} else if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  9.85k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3940:12): [True: 0, False: 9.85k]
  ------------------
 3941|      0|		return ret;
 3942|      0|	}
 3943|       |
 3944|  9.85k|	if(cdeque_size(&rar->cstate.filters) > 0) {
  ------------------
  |  Branch (3944:5): [True: 0, False: 9.85k]
  ------------------
 3945|       |		/* Check if we can write something before hitting first
 3946|       |		 * filter. */
 3947|      0|		struct filter_info* flt;
 3948|       |
 3949|       |		/* Get the block_start offset from the first filter. */
 3950|      0|		if(CDE_OK != cdeque_front(&rar->cstate.filters,
  ------------------
  |  Branch (3950:6): [True: 0, False: 0]
  ------------------
 3951|      0|		    cdeque_filter_p(&flt)))
 3952|      0|		{
 3953|      0|			archive_set_error(&a->archive,
 3954|      0|			    ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 3955|      0|			    "Can't read first filter");
 3956|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3957|      0|		}
 3958|       |
 3959|      0|		max_end_pos = rar5_min(flt->block_start,
  ------------------
  |  |   61|      0|#define rar5_min(a, b) (((a) > (b)) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (61:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3960|      0|		    rar->cstate.write_ptr);
 3961|  9.85k|	} else {
 3962|       |		/* There are no filters defined, or all filters were applied.
 3963|       |		 * This means we can just store the data without any
 3964|       |		 * postprocessing. */
 3965|  9.85k|		max_end_pos = rar->cstate.write_ptr;
 3966|  9.85k|	}
 3967|       |
 3968|  9.85k|	if(max_end_pos == rar->cstate.last_write_ptr) {
  ------------------
  |  Branch (3968:5): [True: 0, False: 9.85k]
  ------------------
 3969|       |		/* We can't write anything yet. The block uncompression
 3970|       |		 * function did not generate enough data, and no filter can be
 3971|       |		 * applied. At the same time we don't have any data that can be
 3972|       |		 *  stored without filter postprocessing. This means we need to
 3973|       |		 *  wait for more data to be generated, so we can apply the
 3974|       |		 * filters.
 3975|       |		 *
 3976|       |		 * Signal the caller that we need more data to be able to do
 3977|       |		 * anything.
 3978|       |		 */
 3979|      0|		return ARCHIVE_RETRY;
  ------------------
  |  |  234|      0|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
 3980|  9.85k|	} else {
 3981|       |		/* We can write the data before hitting the first filter.
 3982|       |		 * So let's do it. The push_window_data() function will
 3983|       |		 * effectively return the selected data block to the user
 3984|       |		 * application. */
 3985|  9.85k|		push_window_data(a, rar, rar->cstate.last_write_ptr,
 3986|  9.85k|		    max_end_pos);
 3987|  9.85k|		rar->cstate.last_write_ptr = max_end_pos;
 3988|  9.85k|	}
 3989|       |
 3990|  9.85k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  9.85k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3991|  9.85k|}
archive_read_support_format_rar5.c:init_unpack:
 2564|    384|static int init_unpack(struct rar5* rar) {
 2565|    384|	rar->file.calculated_crc32 = 0;
 2566|    384|	init_window_mask(rar);
 2567|       |
 2568|    384|	free(rar->cstate.window_buf);
 2569|    384|	free(rar->cstate.filtered_buf);
 2570|       |
 2571|    384|	rar->cstate.window_buf = NULL;
 2572|    384|	rar->cstate.filtered_buf = NULL;
 2573|       |
 2574|    384|	if(rar->cstate.window_size > 0) {
  ------------------
  |  Branch (2574:5): [True: 384, False: 0]
  ------------------
 2575|    384|		rar->cstate.window_buf = calloc(1, rar->cstate.window_size);
 2576|    384|		if(rar->cstate.window_buf == NULL)
  ------------------
  |  Branch (2576:6): [True: 0, False: 384]
  ------------------
 2577|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2578|    384|		rar->cstate.filtered_buf = calloc(1, rar->cstate.window_size);
 2579|    384|		if(rar->cstate.filtered_buf == NULL)
  ------------------
  |  Branch (2579:6): [True: 0, False: 384]
  ------------------
 2580|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2581|    384|	}
 2582|       |
 2583|    384|	clear_data_ready_stack(rar);
 2584|       |
 2585|    384|	rar->cstate.write_ptr = 0;
 2586|    384|	rar->cstate.last_write_ptr = 0;
 2587|       |
 2588|    384|	memset(&rar->cstate.bd, 0, sizeof(rar->cstate.bd));
 2589|    384|	memset(&rar->cstate.ld, 0, sizeof(rar->cstate.ld));
 2590|    384|	memset(&rar->cstate.dd, 0, sizeof(rar->cstate.dd));
 2591|    384|	memset(&rar->cstate.ldd, 0, sizeof(rar->cstate.ldd));
 2592|    384|	memset(&rar->cstate.rd, 0, sizeof(rar->cstate.rd));
 2593|    384|	return ARCHIVE_OK;
  ------------------
  |  |  233|    384|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2594|    384|}
archive_read_support_format_rar5.c:process_block:
 3610|  47.3k|static int process_block(struct archive_read* a) {
 3611|  47.3k|	const uint8_t* p;
 3612|  47.3k|	struct rar5* rar = get_context(a);
 3613|  47.3k|	int ret;
 3614|       |
 3615|       |	/* If we don't have any data to be processed, this most probably means
 3616|       |	 * we need to switch to the next volume. */
 3617|  47.3k|	if(rar->main.volume && rar->file.bytes_remaining == 0) {
  ------------------
  |  Branch (3617:5): [True: 46.5k, False: 791]
  |  Branch (3617:25): [True: 9.24k, False: 37.3k]
  ------------------
 3618|  9.24k|		ret = advance_multivolume(a);
 3619|  9.24k|		if(ret != ARCHIVE_OK)
  ------------------
  |  |  233|  9.24k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3619:6): [True: 8.97k, False: 270]
  ------------------
 3620|  8.97k|			return ret;
 3621|  9.24k|	}
 3622|       |
 3623|  38.4k|	if(rar->cstate.block_parsing_finished) {
  ------------------
  |  Branch (3623:5): [True: 38.0k, False: 358]
  ------------------
 3624|  38.0k|		ssize_t block_size;
 3625|  38.0k|		ssize_t to_skip;
 3626|  38.0k|		ssize_t cur_block_size;
 3627|       |
 3628|       |		/* The header size won't be bigger than 6 bytes. */
 3629|  38.0k|		if(!read_ahead(a, 6, &p)) {
  ------------------
  |  Branch (3629:6): [True: 277, False: 37.7k]
  ------------------
 3630|       |			/* Failed to prefetch data block header. */
 3631|    277|			return ARCHIVE_EOF;
  ------------------
  |  |  232|    277|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3632|    277|		}
 3633|       |
 3634|       |		/*
 3635|       |		 * Read block_size by parsing block header. Validate the header
 3636|       |		 * by calculating CRC byte stored inside the header. Size of
 3637|       |		 * the header is not constant (block size can be stored either
 3638|       |		 * in 1 or 2 bytes), that's why block size is left out from the
 3639|       |		 * `compressed_block_header` structure and returned by
 3640|       |		 * `parse_block_header` as the second argument. */
 3641|       |
 3642|  37.7k|		ret = parse_block_header(a, p, &block_size,
 3643|  37.7k|		    &rar->last_block_hdr);
 3644|  37.7k|		if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  37.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3644:6): [True: 44, False: 37.7k]
  ------------------
 3645|     44|			return ret;
 3646|     44|		}
 3647|       |
 3648|       |		/* Skip block header. Next data is huffman tables,
 3649|       |		 * if present. */
 3650|  37.7k|		to_skip = sizeof(struct compressed_block_header) +
 3651|  37.7k|			bf_byte_count(&rar->last_block_hdr) + 1;
 3652|       |
 3653|  37.7k|		if(ARCHIVE_OK != consume(a, to_skip))
  ------------------
  |  |  233|  37.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3653:6): [True: 0, False: 37.7k]
  ------------------
 3654|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3655|       |
 3656|  37.7k|		rar->file.bytes_remaining -= to_skip;
 3657|       |
 3658|       |		/* The block size gives information about the whole block size,
 3659|       |		 * but the block could be stored in split form when using
 3660|       |		 * multi-volume archives. In this case, the block size will be
 3661|       |		 * bigger than the actual data stored in this file. Remaining
 3662|       |		 * part of the data will be in another file. */
 3663|       |
 3664|  37.7k|		cur_block_size =
 3665|  37.7k|			rar5_min(rar->file.bytes_remaining, block_size);
  ------------------
  |  |   61|  37.7k|#define rar5_min(a, b) (((a) > (b)) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (61:25): [True: 27.3k, False: 10.3k]
  |  |  ------------------
  ------------------
 3666|       |
 3667|  37.7k|		if(block_size > rar->file.bytes_remaining) {
  ------------------
  |  Branch (3667:6): [True: 1.76k, False: 35.9k]
  ------------------
 3668|       |			/* If current blocks' size is bigger than our data
 3669|       |			 * size, this means we have a multivolume archive.
 3670|       |			 * In this case, skip all base headers until the end
 3671|       |			 * of the file, proceed to next "partXXX.rar" volume,
 3672|       |			 * find its signature, skip all headers up to the first
 3673|       |			 * FILE base header, and continue from there.
 3674|       |			 *
 3675|       |			 * Note that `merge_block` will update the `rar`
 3676|       |			 * context structure quite extensively. */
 3677|       |
 3678|  1.76k|			ret = merge_block(a, block_size, &p);
 3679|  1.76k|			if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  1.76k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3679:7): [True: 1.67k, False: 92]
  ------------------
 3680|  1.67k|				return ret;
 3681|  1.67k|			}
 3682|       |
 3683|     92|			cur_block_size = block_size;
 3684|       |
 3685|       |			/* Current stream pointer should be now directly
 3686|       |			 * *after* the block that spanned through multiple
 3687|       |			 * archive files. `p` pointer should have the data of
 3688|       |			 * the *whole* block (merged from partial blocks
 3689|       |			 * stored in multiple archives files). */
 3690|  35.9k|		} else {
 3691|  35.9k|			rar->cstate.switch_multivolume = 0;
 3692|       |
 3693|       |			/* Read the whole block size into memory. This can take
 3694|       |			 * up to  8 megabytes of memory in theoretical cases.
 3695|       |			 * Might be worth to optimize this and use a standard
 3696|       |			 * chunk of 4kb's. */
 3697|  35.9k|			if(!read_ahead(a, 4 + cur_block_size, &p)) {
  ------------------
  |  Branch (3697:7): [True: 232, False: 35.7k]
  ------------------
 3698|       |				/* Failed to prefetch block data. */
 3699|    232|				return ARCHIVE_EOF;
  ------------------
  |  |  232|    232|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3700|    232|			}
 3701|  35.9k|		}
 3702|       |
 3703|  35.8k|		rar->cstate.block_buf = p;
 3704|  35.8k|		rar->cstate.cur_block_size = cur_block_size;
 3705|  35.8k|		rar->cstate.block_parsing_finished = 0;
 3706|       |
 3707|  35.8k|		rar->bits.in_addr = 0;
 3708|  35.8k|		rar->bits.bit_addr = 0;
 3709|       |
 3710|  35.8k|		if(bf_is_table_present(&rar->last_block_hdr)) {
  ------------------
  |  Branch (3710:6): [True: 155, False: 35.6k]
  ------------------
 3711|       |			/* Load Huffman tables. */
 3712|    155|			ret = parse_tables(a, rar, p);
 3713|    155|			if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|    155|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3713:7): [True: 80, False: 75]
  ------------------
 3714|       |				/* Error during decompression of Huffman
 3715|       |				 * tables. */
 3716|     80|				return ret;
 3717|     80|			}
 3718|    155|		}
 3719|  35.8k|	} else {
 3720|       |		/* Block parsing not finished, reuse previous memory buffer. */
 3721|    358|		p = rar->cstate.block_buf;
 3722|    358|	}
 3723|       |
 3724|       |	/* Uncompress the block, or a part of it, depending on how many bytes
 3725|       |	 * will be generated by uncompressing the block.
 3726|       |	 *
 3727|       |	 * In case too many bytes will be generated, calling this function
 3728|       |	 * again will resume the uncompression operation. */
 3729|  36.1k|	ret = do_uncompress_block(a, p);
 3730|  36.1k|	if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  36.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3730:5): [True: 0, False: 36.1k]
  ------------------
 3731|      0|		return ret;
 3732|      0|	}
 3733|       |
 3734|  36.1k|	if(rar->cstate.block_parsing_finished &&
  ------------------
  |  Branch (3734:5): [True: 35.7k, False: 331]
  ------------------
 3735|  35.7k|	    rar->cstate.switch_multivolume == 0 &&
  ------------------
  |  Branch (3735:6): [True: 35.6k, False: 92]
  ------------------
 3736|  35.6k|	    rar->cstate.cur_block_size > 0)
  ------------------
  |  Branch (3736:6): [True: 9.42k, False: 26.2k]
  ------------------
 3737|  9.42k|	{
 3738|       |		/* If we're processing a normal block, consume the whole
 3739|       |		 * block. We can do this because we've already read the whole
 3740|       |		 * block to memory. */
 3741|  9.42k|		if(ARCHIVE_OK != consume(a, rar->cstate.cur_block_size))
  ------------------
  |  |  233|  9.42k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3741:6): [True: 0, False: 9.42k]
  ------------------
 3742|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3743|       |
 3744|  9.42k|		rar->file.bytes_remaining -= rar->cstate.cur_block_size;
 3745|  26.6k|	} else if(rar->cstate.switch_multivolume) {
  ------------------
  |  Branch (3745:12): [True: 92, False: 26.5k]
  ------------------
 3746|       |		/* Don't consume the block if we're doing multivolume
 3747|       |		 * processing. The volume switching function will consume
 3748|       |		 * the proper count of bytes instead. */
 3749|     92|		rar->cstate.switch_multivolume = 0;
 3750|     92|	}
 3751|       |
 3752|  36.1k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  36.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3753|  36.1k|}
archive_read_support_format_rar5.c:parse_block_header:
 2921|  37.7k|{
 2922|  37.7k|	uint8_t calculated_cksum;
 2923|  37.7k|	memcpy(hdr, p, sizeof(struct compressed_block_header));
 2924|       |
 2925|  37.7k|	if(bf_byte_count(hdr) > 2) {
  ------------------
  |  Branch (2925:5): [True: 44, False: 37.7k]
  ------------------
 2926|     44|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     44|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2927|     44|		    "Unsupported block header size (was %d, max is 2)",
 2928|     44|		    bf_byte_count(hdr));
 2929|     44|		return ARCHIVE_FAILED;
  ------------------
  |  |  237|     44|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2930|     44|	}
 2931|       |
 2932|       |	/* This should probably use bit reader interface in order to be more
 2933|       |	 * future-proof. */
 2934|  37.7k|	*block_size = 0;
 2935|  37.7k|	switch(bf_byte_count(hdr)) {
 2936|       |		/* 1-byte block size */
 2937|  36.5k|		case 0:
  ------------------
  |  Branch (2937:3): [True: 36.5k, False: 1.18k]
  ------------------
 2938|  36.5k|			*block_size = *(const uint8_t*) &p[2];
 2939|  36.5k|			break;
 2940|       |
 2941|       |		/* 2-byte block size */
 2942|  1.12k|		case 1:
  ------------------
  |  Branch (2942:3): [True: 1.12k, False: 36.6k]
  ------------------
 2943|  1.12k|			*block_size = archive_le16dec(&p[2]);
 2944|  1.12k|			break;
 2945|       |
 2946|       |		/* 3-byte block size */
 2947|     58|		case 2:
  ------------------
  |  Branch (2947:3): [True: 58, False: 37.6k]
  ------------------
 2948|     58|			*block_size = archive_le32dec(&p[2]);
 2949|     58|			*block_size &= 0x00FFFFFF;
 2950|     58|			break;
 2951|       |
 2952|       |		/* Other block sizes are not supported. This case is not
 2953|       |		 * reached, because we have an 'if' guard before the switch
 2954|       |		 * that makes sure of it. */
 2955|      0|		default:
  ------------------
  |  Branch (2955:3): [True: 0, False: 37.7k]
  ------------------
 2956|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2957|  37.7k|	}
 2958|       |
 2959|       |	/* Verify the block header checksum. 0x5A is a magic value and is
 2960|       |	 * always * constant. */
 2961|  37.7k|	calculated_cksum = 0x5A
 2962|  37.7k|	    ^ (uint8_t) hdr->block_flags_u8
 2963|  37.7k|	    ^ (uint8_t) *block_size
 2964|  37.7k|	    ^ (uint8_t) (*block_size >> 8)
 2965|  37.7k|	    ^ (uint8_t) (*block_size >> 16);
 2966|       |
 2967|  37.7k|	if(calculated_cksum != hdr->block_cksum) {
  ------------------
  |  Branch (2967:5): [True: 37.6k, False: 128]
  ------------------
 2968|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 2969|       |		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
 2970|       |		    "Block checksum error: got 0x%x, expected 0x%x",
 2971|       |		    hdr->block_cksum, calculated_cksum);
 2972|       |
 2973|       |		return ARCHIVE_FAILED;
 2974|       |#endif
 2975|  37.6k|	}
 2976|       |
 2977|  37.7k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  37.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2978|  37.7k|}
archive_read_support_format_rar5.c:bf_byte_count:
  503|   113k|uint8_t bf_byte_count(const struct compressed_block_header* hdr) {
  504|   113k|	return (hdr->block_flags_u8 >> 3) & 7;
  505|   113k|}
archive_read_support_format_rar5.c:merge_block:
 3493|  1.76k|{
 3494|  1.76k|	struct rar5* rar = get_context(a);
 3495|  1.76k|	ssize_t cur_block_size, partial_offset = 0;
 3496|  1.76k|	const uint8_t* lp;
 3497|  1.76k|	int ret;
 3498|       |
 3499|  1.76k|	if(rar->merge_mode) {
  ------------------
  |  Branch (3499:5): [True: 0, False: 1.76k]
  ------------------
 3500|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 3501|      0|		    "Recursive merge is not allowed");
 3502|       |
 3503|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3504|      0|	}
 3505|       |
 3506|       |	/* Set a flag that we're in the switching mode. */
 3507|  1.76k|	rar->cstate.switch_multivolume = 1;
 3508|       |
 3509|       |	/* Reallocate the memory which will hold the whole block. */
 3510|  1.76k|	if(rar->vol.push_buf)
  ------------------
  |  Branch (3510:5): [True: 1.67k, False: 90]
  ------------------
 3511|  1.67k|		free((void*) rar->vol.push_buf);
 3512|       |
 3513|       |	/* Increasing the allocation block by 8 is due to bit reading functions,
 3514|       |	 * which are using additional 2 or 4 bytes. Allocating the block size
 3515|       |	 * by exact value would make bit reader perform reads from invalid
 3516|       |	 * memory block when reading the last byte from the buffer. */
 3517|  1.76k|	rar->vol.push_buf = malloc(block_size + 8);
 3518|  1.76k|	if(!rar->vol.push_buf) {
  ------------------
  |  Branch (3518:5): [True: 0, False: 1.76k]
  ------------------
 3519|      0|		archive_set_error(&a->archive, ENOMEM,
 3520|      0|		    "Can't allocate memory for a merge block buffer");
 3521|      0|		rar->cstate.switch_multivolume = 0;
 3522|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3523|      0|	}
 3524|       |
 3525|       |	/* Valgrind complains if the extension block for bit reader is not
 3526|       |	 * initialized, so initialize it. */
 3527|  1.76k|	memset(&rar->vol.push_buf[block_size], 0, 8);
 3528|       |
 3529|       |	/* A single block can span across multiple multivolume archive files,
 3530|       |	 * so we use a loop here. This loop will consume enough multivolume
 3531|       |	 * archive files until the whole block is read. */
 3532|       |
 3533|  2.26k|	while(1) {
  ------------------
  |  Branch (3533:8): [True: 2.26k, Folded]
  ------------------
 3534|       |		/* Get the size of current block chunk in this multivolume
 3535|       |		 * archive file and read it. */
 3536|  2.26k|		cur_block_size = rar5_min(rar->file.bytes_remaining,
  ------------------
  |  |   61|  2.26k|#define rar5_min(a, b) (((a) > (b)) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (61:25): [True: 93, False: 2.17k]
  |  |  ------------------
  ------------------
 3537|  2.26k|		    block_size - partial_offset);
 3538|       |
 3539|  2.26k|		if(cur_block_size == 0) {
  ------------------
  |  Branch (3539:6): [True: 4, False: 2.26k]
  ------------------
 3540|       |			/* bytes_remaining is 0 at the wrong point in the merge
 3541|       |			 * loop, indicating corrupt volume accounting. */
 3542|      4|			archive_set_error(&a->archive,
 3543|      4|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      4|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3544|      4|			    "Encountered block size == 0 during block merge");
 3545|      4|			rar->cstate.switch_multivolume = 0;
 3546|      4|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3547|      4|		}
 3548|       |
 3549|  2.26k|		if(!read_ahead(a, cur_block_size, &lp)) {
  ------------------
  |  Branch (3549:6): [True: 659, False: 1.60k]
  ------------------
 3550|    659|			rar->cstate.switch_multivolume = 0;
 3551|    659|			return ARCHIVE_EOF;
  ------------------
  |  |  232|    659|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3552|    659|		}
 3553|       |
 3554|       |		/* Sanity check; there should never be a situation where this
 3555|       |		 * function reads more data than the block's size. */
 3556|  1.60k|		if(partial_offset + cur_block_size > block_size) {
  ------------------
  |  Branch (3556:6): [True: 0, False: 1.60k]
  ------------------
 3557|      0|			archive_set_error(&a->archive,
 3558|      0|			    ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 3559|      0|			    "Consumed too much data when merging blocks");
 3560|      0|			rar->cstate.switch_multivolume = 0;
 3561|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3562|      0|		}
 3563|       |
 3564|       |		/* Merge previous block chunk with current block chunk,
 3565|       |		 * or create first block chunk if this is our first
 3566|       |		 * iteration. */
 3567|  1.60k|		memcpy(&rar->vol.push_buf[partial_offset], lp, cur_block_size);
 3568|       |
 3569|       |		/* Advance the stream read pointer by this block chunk size. */
 3570|  1.60k|		if(ARCHIVE_OK != consume(a, cur_block_size)) {
  ------------------
  |  |  233|  1.60k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3570:6): [True: 0, False: 1.60k]
  ------------------
 3571|       |			/* Data was copied but stream pointer didn't advance;
 3572|       |			 * stream position is unrecoverable. */
 3573|      0|			rar->cstate.switch_multivolume = 0;
 3574|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3575|      0|		}
 3576|       |
 3577|       |		/* Update the pointers. `partial_offset` contains information
 3578|       |		 * about the sum of merged block chunks. */
 3579|  1.60k|		partial_offset += cur_block_size;
 3580|  1.60k|		rar->file.bytes_remaining -= cur_block_size;
 3581|       |
 3582|       |		/* If `partial_offset` is the same as `block_size`, this means
 3583|       |		 * we've merged all block chunks and we have a valid full
 3584|       |		 * block. */
 3585|  1.60k|		if(partial_offset == block_size) {
  ------------------
  |  Branch (3585:6): [True: 92, False: 1.51k]
  ------------------
 3586|     92|			break;
 3587|     92|		}
 3588|       |
 3589|       |		/* If we don't have any bytes to read, this means we should
 3590|       |		 * switch to another multivolume archive file. */
 3591|  1.51k|		if(rar->file.bytes_remaining == 0) {
  ------------------
  |  Branch (3591:6): [True: 1.51k, False: 0]
  ------------------
 3592|  1.51k|			rar->merge_mode++;
 3593|  1.51k|			ret = advance_multivolume(a);
 3594|  1.51k|			rar->merge_mode--;
 3595|  1.51k|			if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  1.51k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3595:7): [True: 1.00k, False: 503]
  ------------------
 3596|  1.00k|				rar->cstate.switch_multivolume = 0;
 3597|  1.00k|				return ret;
 3598|  1.00k|			}
 3599|  1.51k|		}
 3600|  1.51k|	}
 3601|       |
 3602|     92|	*p = rar->vol.push_buf;
 3603|       |
 3604|       |	/* If we're here, we can resume unpacking by processing the block
 3605|       |	 * pointed to by the `*p` memory pointer. */
 3606|       |
 3607|     92|	return ARCHIVE_OK;
  ------------------
  |  |  233|     92|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3608|  1.76k|}
archive_read_support_format_rar5.c:bf_is_table_present:
  508|  35.8k|uint8_t bf_is_table_present(const struct compressed_block_header* hdr) {
  509|  35.8k|	return (hdr->block_flags_u8 >> 7) & 1;
  510|  35.8k|}
archive_read_support_format_rar5.c:parse_tables:
 2748|    155|{
 2749|    155|	int ret, value, i, w, idx = 0;
 2750|    155|	uint8_t bit_length[HUFF_BC],
 2751|    155|		table[HUFF_TABLE_SIZE],
 2752|    155|		nibble_mask = 0xF0,
 2753|    155|		nibble_shift = 4;
 2754|       |
 2755|    155|	enum { ESCAPE = 15 };
 2756|       |
 2757|       |	/* The data for table generation is compressed using a simple RLE-like
 2758|       |	 * algorithm when storing zeroes, so we need to unpack it first. */
 2759|  2.14k|	for(w = 0, i = 0; w < HUFF_BC;) {
  ------------------
  |  |  248|  2.14k|#define HUFF_BC 20
  ------------------
  |  Branch (2759:20): [True: 1.98k, False: 155]
  ------------------
 2760|  1.98k|		if(i >= rar->cstate.cur_block_size) {
  ------------------
  |  Branch (2760:6): [True: 0, False: 1.98k]
  ------------------
 2761|       |			/* Truncated data, can't continue. */
 2762|      0|			archive_set_error(&a->archive,
 2763|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2764|      0|			    "Truncated data in huffman tables");
 2765|      0|			return ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2766|      0|		}
 2767|       |
 2768|  1.98k|		value = (p[i] & nibble_mask) >> nibble_shift;
 2769|       |
 2770|  1.98k|		if(nibble_mask == 0x0F)
  ------------------
  |  Branch (2770:6): [True: 979, False: 1.01k]
  ------------------
 2771|    979|			++i;
 2772|       |
 2773|  1.98k|		nibble_mask ^= 0xFF;
 2774|  1.98k|		nibble_shift ^= 4;
 2775|       |
 2776|       |		/* Values smaller than 15 is data, so we write it directly.
 2777|       |		 * Value 15 is a flag telling us that we need to unpack more
 2778|       |		 * bytes. */
 2779|  1.98k|		if(value == ESCAPE) {
  ------------------
  |  Branch (2779:6): [True: 127, False: 1.86k]
  ------------------
 2780|    127|			value = (p[i] & nibble_mask) >> nibble_shift;
 2781|    127|			if(nibble_mask == 0x0F)
  ------------------
  |  Branch (2781:7): [True: 32, False: 95]
  ------------------
 2782|     32|				++i;
 2783|    127|			nibble_mask ^= 0xFF;
 2784|    127|			nibble_shift ^= 4;
 2785|       |
 2786|    127|			if(value == 0) {
  ------------------
  |  Branch (2786:7): [True: 0, False: 127]
  ------------------
 2787|       |				/* We sometimes need to write the actual value
 2788|       |				 * of 15, so this case handles that. */
 2789|      0|				bit_length[w++] = ESCAPE;
 2790|    127|			} else {
 2791|    127|				int k;
 2792|       |
 2793|       |				/* Fill zeroes. */
 2794|  1.36k|				for(k = 0; (k < value + 2) && (w < HUFF_BC);
  ------------------
  |  |  248|  1.26k|#define HUFF_BC 20
  ------------------
  |  Branch (2794:16): [True: 1.26k, False: 96]
  |  Branch (2794:35): [True: 1.23k, False: 31]
  ------------------
 2795|  1.23k|				    k++) {
 2796|  1.23k|					bit_length[w++] = 0;
 2797|  1.23k|				}
 2798|    127|			}
 2799|  1.86k|		} else {
 2800|  1.86k|			bit_length[w++] = value;
 2801|  1.86k|		}
 2802|  1.98k|	}
 2803|       |
 2804|    155|	rar->bits.in_addr = i;
 2805|    155|	rar->bits.bit_addr = nibble_shift ^ 4;
 2806|       |
 2807|    155|	ret = create_decode_tables(bit_length, &rar->cstate.bd, HUFF_BC);
  ------------------
  |  |  248|    155|#define HUFF_BC 20
  ------------------
 2808|    155|	if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|    155|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2808:5): [True: 57, False: 98]
  ------------------
 2809|     57|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     57|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2810|     57|		    "Decoding huffman tables failed");
 2811|     57|		return ARCHIVE_FAILED;
  ------------------
  |  |  237|     57|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2812|     57|	}
 2813|       |
 2814|  7.46k|	for(i = 0; i < HUFF_TABLE_SIZE;) {
  ------------------
  |  |  258|  7.46k|#define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  250|  7.46k|#define HUFF_NC 306
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  252|  7.46k|#define HUFF_DC 64
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  256|  7.46k|#define HUFF_RC 44
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  254|  7.46k|#define HUFF_LDC 16
  |  |  ------------------
  ------------------
  |  Branch (2814:13): [True: 7.37k, False: 98]
  ------------------
 2815|  7.37k|		uint16_t num;
 2816|       |
 2817|  7.37k|		ret = decode_number(a, &rar->cstate.bd, p, &num);
 2818|  7.37k|		if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  7.37k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2818:6): [True: 0, False: 7.37k]
  ------------------
 2819|      0|			archive_set_error(&a->archive,
 2820|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2821|      0|			    "Decoding huffman tables failed");
 2822|      0|			return ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2823|      0|		}
 2824|       |
 2825|  7.37k|		if(num < 16) {
  ------------------
  |  Branch (2825:6): [True: 6.00k, False: 1.36k]
  ------------------
 2826|       |			/* 0..15: store directly */
 2827|  6.00k|			table[i] = (uint8_t) num;
 2828|  6.00k|			i++;
 2829|  6.00k|		} else if(num < 18) {
  ------------------
  |  Branch (2829:13): [True: 10, False: 1.35k]
  ------------------
 2830|       |			/* 16..17: repeat previous code */
 2831|     10|			uint16_t n;
 2832|       |
 2833|     10|			if(ARCHIVE_OK != (ret = read_bits_16(a, rar, p, &n)))
  ------------------
  |  |  233|     10|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2833:7): [True: 0, False: 10]
  ------------------
 2834|      0|				return ret;
 2835|       |
 2836|     10|			if(num == 16) {
  ------------------
  |  Branch (2836:7): [True: 8, False: 2]
  ------------------
 2837|      8|				n >>= 13;
 2838|      8|				n += 3;
 2839|      8|				skip_bits(rar, 3);
 2840|      8|			} else {
 2841|      2|				n >>= 9;
 2842|      2|				n += 11;
 2843|      2|				skip_bits(rar, 7);
 2844|      2|			}
 2845|       |
 2846|     10|			if(i > 0) {
  ------------------
  |  Branch (2846:7): [True: 10, False: 0]
  ------------------
 2847|    180|				while(n-- > 0 && i < HUFF_TABLE_SIZE) {
  ------------------
  |  |  258|    170|#define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  250|    170|#define HUFF_NC 306
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  252|    170|#define HUFF_DC 64
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  256|    170|#define HUFF_RC 44
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  254|    170|#define HUFF_LDC 16
  |  |  ------------------
  ------------------
  |  Branch (2847:11): [True: 170, False: 10]
  |  Branch (2847:22): [True: 170, False: 0]
  ------------------
 2848|    170|					table[i] = table[i - 1];
 2849|    170|					i++;
 2850|    170|				}
 2851|     10|			} else {
 2852|      0|				archive_set_error(&a->archive,
 2853|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2854|      0|				    "Unexpected error when decoding "
 2855|      0|				    "huffman tables");
 2856|      0|				return ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2857|      0|			}
 2858|  1.35k|		} else {
 2859|       |			/* other codes: fill with zeroes `n` times */
 2860|  1.35k|			uint16_t n;
 2861|       |
 2862|  1.35k|			if(ARCHIVE_OK != (ret = read_bits_16(a, rar, p, &n)))
  ------------------
  |  |  233|  1.35k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2862:7): [True: 0, False: 1.35k]
  ------------------
 2863|      0|				return ret;
 2864|       |
 2865|  1.35k|			if(num == 18) {
  ------------------
  |  Branch (2865:7): [True: 872, False: 485]
  ------------------
 2866|    872|				n >>= 13;
 2867|    872|				n += 3;
 2868|    872|				skip_bits(rar, 3);
 2869|    872|			} else {
 2870|    485|				n >>= 9;
 2871|    485|				n += 11;
 2872|    485|				skip_bits(rar, 7);
 2873|    485|			}
 2874|       |
 2875|  37.3k|			while(n-- > 0 && i < HUFF_TABLE_SIZE)
  ------------------
  |  |  258|  36.0k|#define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  250|  36.0k|#define HUFF_NC 306
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  252|  36.0k|#define HUFF_DC 64
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  256|  36.0k|#define HUFF_RC 44
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  254|  36.0k|#define HUFF_LDC 16
  |  |  ------------------
  ------------------
  |  Branch (2875:10): [True: 36.0k, False: 1.26k]
  |  Branch (2875:21): [True: 35.9k, False: 92]
  ------------------
 2876|  35.9k|				table[i++] = 0;
 2877|  1.35k|		}
 2878|  7.37k|	}
 2879|       |
 2880|     98|	ret = create_decode_tables(&table[idx], &rar->cstate.ld, HUFF_NC);
  ------------------
  |  |  250|     98|#define HUFF_NC 306
  ------------------
 2881|     98|	if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|     98|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2881:5): [True: 21, False: 77]
  ------------------
 2882|     21|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     21|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2883|     21|		     "Failed to create literal table");
 2884|     21|		return ARCHIVE_FAILED;
  ------------------
  |  |  237|     21|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2885|     21|	}
 2886|       |
 2887|     77|	idx += HUFF_NC;
  ------------------
  |  |  250|     77|#define HUFF_NC 306
  ------------------
 2888|       |
 2889|     77|	ret = create_decode_tables(&table[idx], &rar->cstate.dd, HUFF_DC);
  ------------------
  |  |  252|     77|#define HUFF_DC 64
  ------------------
 2890|     77|	if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|     77|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2890:5): [True: 2, False: 75]
  ------------------
 2891|      2|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      2|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2892|      2|		    "Failed to create distance table");
 2893|      2|		return ARCHIVE_FAILED;
  ------------------
  |  |  237|      2|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2894|      2|	}
 2895|       |
 2896|     75|	idx += HUFF_DC;
  ------------------
  |  |  252|     75|#define HUFF_DC 64
  ------------------
 2897|       |
 2898|     75|	ret = create_decode_tables(&table[idx], &rar->cstate.ldd, HUFF_LDC);
  ------------------
  |  |  254|     75|#define HUFF_LDC 16
  ------------------
 2899|     75|	if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|     75|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2899:5): [True: 0, False: 75]
  ------------------
 2900|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2901|      0|		    "Failed to create lower bits of distances table");
 2902|      0|		return ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2903|      0|	}
 2904|       |
 2905|     75|	idx += HUFF_LDC;
  ------------------
  |  |  254|     75|#define HUFF_LDC 16
  ------------------
 2906|       |
 2907|     75|	ret = create_decode_tables(&table[idx], &rar->cstate.rd, HUFF_RC);
  ------------------
  |  |  256|     75|#define HUFF_RC 44
  ------------------
 2908|     75|	if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|     75|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2908:5): [True: 0, False: 75]
  ------------------
 2909|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2910|      0|		    "Failed to create repeating distances table");
 2911|      0|		return ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2912|      0|	}
 2913|       |
 2914|     75|	return ARCHIVE_OK;
  ------------------
  |  |  233|     75|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2915|     75|}
archive_read_support_format_rar5.c:create_decode_tables:
 2628|    480|{
 2629|    480|	int code, upper_limit = 0, i, lc[16];
 2630|    480|	uint32_t decode_pos_clone[rar5_countof(table->decode_pos)];
 2631|    480|	ssize_t cur_len, quick_data_size;
 2632|       |
 2633|    480|	memset(&lc, 0, sizeof(lc));
 2634|    480|	memset(table->decode_num, 0, sizeof(table->decode_num));
 2635|    480|	table->size = size;
 2636|    480|	table->quick_bits = size == HUFF_NC ? 10 : 7;
  ------------------
  |  |  250|    480|#define HUFF_NC 306
  ------------------
  |  Branch (2636:22): [True: 98, False: 382]
  ------------------
 2637|       |
 2638|  42.9k|	for(i = 0; i < size; i++) {
  ------------------
  |  Branch (2638:13): [True: 42.5k, False: 480]
  ------------------
 2639|  42.5k|		lc[bit_length[i] & 15]++;
 2640|  42.5k|	}
 2641|       |
 2642|    480|	lc[0] = 0;
 2643|    480|	table->decode_pos[0] = 0;
 2644|    480|	table->decode_len[0] = 0;
 2645|       |
 2646|  7.68k|	for(i = 1; i < 16; i++) {
  ------------------
  |  Branch (2646:13): [True: 7.20k, False: 480]
  ------------------
 2647|  7.20k|		upper_limit += lc[i];
 2648|       |
 2649|  7.20k|		table->decode_len[i] = upper_limit << (16 - i);
 2650|  7.20k|		table->decode_pos[i] = table->decode_pos[i - 1] + lc[i - 1];
 2651|       |
 2652|  7.20k|		upper_limit <<= 1;
 2653|  7.20k|	}
 2654|       |
 2655|       |	/* Verify the code-length distribution is not over-subscribed.
 2656|       |	 * After the loop above, upper_limit == sum(lc[i] * 2^(16-i)).
 2657|       |	 * For a valid prefix-free code this must be <= 2^16 = 65536.
 2658|       |	 * An over-subscribed table (> 65536) cannot produce a valid
 2659|       |	 * decode table and must be rejected. */
 2660|    480|	if(upper_limit > 65536) {
  ------------------
  |  Branch (2660:5): [True: 80, False: 400]
  ------------------
 2661|     80|		return ARCHIVE_FAILED;
  ------------------
  |  |  237|     80|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2662|     80|	}
 2663|       |
 2664|    400|	memcpy(decode_pos_clone, table->decode_pos, sizeof(decode_pos_clone));
 2665|       |
 2666|  35.2k|	for(i = 0; i < size; i++) {
  ------------------
  |  Branch (2666:13): [True: 34.8k, False: 400]
  ------------------
 2667|  34.8k|		uint8_t clen = bit_length[i] & 15;
 2668|  34.8k|		if(clen > 0) {
  ------------------
  |  Branch (2668:6): [True: 3.98k, False: 30.8k]
  ------------------
 2669|  3.98k|			int last_pos = decode_pos_clone[clen];
 2670|  3.98k|			table->decode_num[last_pos] = i;
 2671|  3.98k|			decode_pos_clone[clen]++;
 2672|  3.98k|		}
 2673|  34.8k|	}
 2674|       |
 2675|    400|	quick_data_size = (int64_t)1 << table->quick_bits;
 2676|    400|	cur_len = 1;
 2677|   120k|	for(code = 0; code < quick_data_size; code++) {
  ------------------
  |  Branch (2677:16): [True: 120k, False: 400]
  ------------------
 2678|   120k|		int bit_field = code << (16 - table->quick_bits);
 2679|   120k|		int dist, pos;
 2680|       |
 2681|   126k|		while(cur_len < rar5_countof(table->decode_len) &&
  ------------------
  |  |   63|   252k|#define rar5_countof(X) ((const ssize_t) (sizeof(X) / sizeof(*X)))
  ------------------
  |  Branch (2681:9): [True: 62.2k, False: 63.9k]
  ------------------
 2682|  62.2k|				bit_field >= table->decode_len[cur_len]) {
  ------------------
  |  Branch (2682:5): [True: 6.00k, False: 56.2k]
  ------------------
 2683|  6.00k|			cur_len++;
 2684|  6.00k|		}
 2685|       |
 2686|   120k|		table->quick_len[code] = (uint8_t) cur_len;
 2687|       |
 2688|   120k|		dist = bit_field - table->decode_len[cur_len - 1];
 2689|   120k|		dist >>= (16 - cur_len);
 2690|       |
 2691|   120k|		pos = table->decode_pos[cur_len & 15] + dist;
 2692|   120k|		if(cur_len < rar5_countof(table->decode_pos) && pos < size) {
  ------------------
  |  |   63|   240k|#define rar5_countof(X) ((const ssize_t) (sizeof(X) / sizeof(*X)))
  ------------------
  |  Branch (2692:6): [True: 56.2k, False: 63.9k]
  |  Branch (2692:51): [True: 56.2k, False: 0]
  ------------------
 2693|  56.2k|			table->quick_num[code] = table->decode_num[pos];
 2694|  63.9k|		} else {
 2695|  63.9k|			table->quick_num[code] = 0;
 2696|  63.9k|		}
 2697|   120k|	}
 2698|       |
 2699|    400|	return ARCHIVE_OK;
  ------------------
  |  |  233|    400|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2700|    480|}
archive_read_support_format_rar5.c:decode_number:
 2704|   309k|{
 2705|   309k|	int i, bits, dist, ret;
 2706|   309k|	uint16_t bitfield;
 2707|   309k|	uint32_t pos;
 2708|   309k|	struct rar5* rar = get_context(a);
 2709|       |
 2710|   309k|	if(ARCHIVE_OK != (ret = read_bits_16(a, rar, p, &bitfield))) {
  ------------------
  |  |  233|   309k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2710:5): [True: 0, False: 309k]
  ------------------
 2711|      0|		return ret;
 2712|      0|	}
 2713|       |
 2714|   309k|	bitfield &= 0xfffe;
 2715|       |
 2716|   309k|	if(bitfield < table->decode_len[table->quick_bits]) {
  ------------------
  |  Branch (2716:5): [True: 16.4k, False: 292k]
  ------------------
 2717|  16.4k|		int code = bitfield >> (16 - table->quick_bits);
 2718|  16.4k|		skip_bits(rar, table->quick_len[code]);
 2719|  16.4k|		*num = table->quick_num[code];
 2720|  16.4k|		return ARCHIVE_OK;
  ------------------
  |  |  233|  16.4k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2721|  16.4k|	}
 2722|       |
 2723|   292k|	bits = 15;
 2724|       |
 2725|  4.26M|	for(i = table->quick_bits + 1; i < 15; i++) {
  ------------------
  |  Branch (2725:33): [True: 3.97M, False: 288k]
  ------------------
 2726|  3.97M|		if(bitfield < table->decode_len[i]) {
  ------------------
  |  Branch (2726:6): [True: 3.84k, False: 3.97M]
  ------------------
 2727|  3.84k|			bits = i;
 2728|  3.84k|			break;
 2729|  3.84k|		}
 2730|  3.97M|	}
 2731|       |
 2732|   292k|	skip_bits(rar, bits);
 2733|       |
 2734|   292k|	dist = bitfield - table->decode_len[bits - 1];
 2735|   292k|	dist >>= (16 - bits);
 2736|   292k|	pos = table->decode_pos[bits] + dist;
 2737|       |
 2738|   292k|	if(pos >= table->size)
  ------------------
  |  Branch (2738:5): [True: 288k, False: 3.87k]
  ------------------
 2739|   288k|		pos = 0;
 2740|       |
 2741|   292k|	*num = table->decode_num[pos];
 2742|   292k|	return ARCHIVE_OK;
  ------------------
  |  |  233|   292k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2743|   309k|}
archive_read_support_format_rar5.c:read_bits_16:
 1061|   326k|{
 1062|   326k|	if(rar->bits.in_addr >= rar->cstate.cur_block_size) {
  ------------------
  |  Branch (1062:5): [True: 0, False: 326k]
  ------------------
 1063|      0|		archive_set_error(&a->archive,
 1064|      0|			ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1065|      0|			"Premature end of stream during extraction of data (#2)");
 1066|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1067|      0|	}
 1068|       |
 1069|   326k|	int bits = (int) ((uint32_t) p[rar->bits.in_addr]) << 16;
 1070|   326k|	bits |= (int) p[rar->bits.in_addr + 1] << 8;
 1071|   326k|	bits |= (int) p[rar->bits.in_addr + 2];
 1072|   326k|	bits >>= (8 - rar->bits.bit_addr);
 1073|   326k|	*value = bits & 0xffff;
 1074|   326k|	return ARCHIVE_OK;
  ------------------
  |  |  233|   326k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1075|   326k|}
archive_read_support_format_rar5.c:skip_bits:
 1077|   326k|static void skip_bits(struct rar5* rar, int bits) {
 1078|   326k|	const int new_bits = rar->bits.bit_addr + bits;
 1079|   326k|	rar->bits.in_addr += new_bits >> 3;
 1080|   326k|	rar->bits.bit_addr = new_bits & 7;
 1081|   326k|}
archive_read_support_format_rar5.c:do_uncompress_block:
 3150|  36.1k|static int do_uncompress_block(struct archive_read* a, const uint8_t* p) {
 3151|  36.1k|	struct rar5* rar = get_context(a);
 3152|  36.1k|	uint16_t num;
 3153|  36.1k|	int ret;
 3154|       |
 3155|  36.1k|	const uint64_t cmask = rar->cstate.window_mask;
 3156|  36.1k|	const struct compressed_block_header* hdr = &rar->last_block_hdr;
 3157|  36.1k|	const uint8_t bit_size = 1 + bf_bit_size(hdr);
 3158|       |
 3159|   329k|	while(1) {
  ------------------
  |  Branch (3159:8): [True: 329k, Folded]
  ------------------
 3160|   329k|		if(rar->cstate.write_ptr - rar->cstate.last_write_ptr >
  ------------------
  |  Branch (3160:6): [True: 331, False: 328k]
  ------------------
 3161|   329k|		    (rar->cstate.window_size >> 1)) {
 3162|       |			/* Don't allow growing data by more than half of the
 3163|       |			 * window size at a time. In such case, break the loop;
 3164|       |			 *  next call to this function will continue processing
 3165|       |			 *  from this moment. */
 3166|    331|			break;
 3167|    331|		}
 3168|       |
 3169|   328k|		if(rar->bits.in_addr > rar->cstate.cur_block_size - 1 ||
  ------------------
  |  Branch (3169:6): [True: 26.8k, False: 301k]
  ------------------
 3170|   301k|		    (rar->bits.in_addr == rar->cstate.cur_block_size - 1 &&
  ------------------
  |  Branch (3170:8): [True: 9.24k, False: 292k]
  ------------------
 3171|  9.24k|		    rar->bits.bit_addr >= bit_size))
  ------------------
  |  Branch (3171:7): [True: 8.92k, False: 314]
  ------------------
 3172|  35.7k|		{
 3173|       |			/* If the program counter is here, it means the
 3174|       |			 * function has finished processing the block. */
 3175|  35.7k|			rar->cstate.block_parsing_finished = 1;
 3176|  35.7k|			break;
 3177|  35.7k|		}
 3178|       |
 3179|       |		/* Decode the next literal. */
 3180|   292k|		if(ARCHIVE_OK != decode_number(a, &rar->cstate.ld, p, &num)) {
  ------------------
  |  |  233|   292k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3180:6): [True: 0, False: 292k]
  ------------------
 3181|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3182|      0|		}
 3183|       |
 3184|       |		/* Num holds a decompression literal, or 'command code'.
 3185|       |		 *
 3186|       |		 * - Values lower than 256 are just bytes. Those codes
 3187|       |		 *   can be stored in the output buffer directly.
 3188|       |		 *
 3189|       |		 * - Code 256 defines a new filter, which is later used to
 3190|       |		 *   transform the data block accordingly to the filter type.
 3191|       |		 *   The data block needs to be fully uncompressed first.
 3192|       |		 *
 3193|       |		 * - Code bigger than 257 and smaller than 262 define
 3194|       |		 *   a repetition pattern that should be copied from
 3195|       |		 *   an already uncompressed chunk of data.
 3196|       |		 */
 3197|       |
 3198|   292k|		if(num < 256) {
  ------------------
  |  Branch (3198:6): [True: 284k, False: 8.62k]
  ------------------
 3199|       |			/* Directly store the byte. */
 3200|   284k|			int64_t write_idx = rar->cstate.solid_offset +
 3201|   284k|			    rar->cstate.write_ptr++;
 3202|       |
 3203|   284k|			rar->cstate.window_buf[write_idx & cmask] =
 3204|   284k|			    (uint8_t) num;
 3205|   284k|			continue;
 3206|   284k|		} else if(num >= 262) {
  ------------------
  |  Branch (3206:13): [True: 8.25k, False: 376]
  ------------------
 3207|  8.25k|			uint16_t dist_slot;
 3208|  8.25k|			int len = decode_code_length(a, rar, p, num - 262),
 3209|  8.25k|				dbits,
 3210|  8.25k|				dist = 1;
 3211|       |
 3212|  8.25k|			if(len == -1) {
  ------------------
  |  Branch (3212:7): [True: 0, False: 8.25k]
  ------------------
 3213|      0|				archive_set_error(&a->archive,
 3214|      0|				    ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 3215|      0|				    "Failed to decode the code length");
 3216|       |
 3217|      0|				return rar->main.solid ? ARCHIVE_FATAL : ARCHIVE_FAILED;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
              				return rar->main.solid ? ARCHIVE_FATAL : ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (3217:12): [True: 0, False: 0]
  ------------------
 3218|      0|			}
 3219|       |
 3220|  8.25k|			if(ARCHIVE_OK != decode_number(a, &rar->cstate.dd, p,
  ------------------
  |  |  233|  8.25k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3220:7): [True: 0, False: 8.25k]
  ------------------
 3221|  8.25k|			    &dist_slot))
 3222|      0|			{
 3223|      0|				archive_set_error(&a->archive,
 3224|      0|				    ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 3225|      0|				    "Failed to decode the distance slot");
 3226|       |
 3227|      0|				return rar->main.solid ? ARCHIVE_FATAL : ARCHIVE_FAILED;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
              				return rar->main.solid ? ARCHIVE_FATAL : ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (3227:12): [True: 0, False: 0]
  ------------------
 3228|      0|			}
 3229|       |
 3230|  8.25k|			if(dist_slot < 4) {
  ------------------
  |  Branch (3230:7): [True: 14, False: 8.23k]
  ------------------
 3231|     14|				dbits = 0;
 3232|     14|				dist += dist_slot;
 3233|  8.23k|			} else {
 3234|  8.23k|				dbits = dist_slot / 2 - 1;
 3235|       |
 3236|       |				/* Cast to uint32_t will make sure the shift
 3237|       |				 * left operation won't produce undefined
 3238|       |				 * result. Then, the uint32_t type will
 3239|       |				 * be implicitly casted to int. */
 3240|  8.23k|				dist += (uint32_t) (2 |
 3241|  8.23k|				    (dist_slot & 1)) << dbits;
 3242|  8.23k|			}
 3243|       |
 3244|  8.25k|			if(dbits > 0) {
  ------------------
  |  Branch (3244:7): [True: 8.23k, False: 14]
  ------------------
 3245|  8.23k|				if(dbits >= 4) {
  ------------------
  |  Branch (3245:8): [True: 104, False: 8.13k]
  ------------------
 3246|    104|					uint32_t add = 0;
 3247|    104|					uint16_t low_dist;
 3248|       |
 3249|    104|					if(dbits > 4) {
  ------------------
  |  Branch (3249:9): [True: 100, False: 4]
  ------------------
 3250|    100|						if(ARCHIVE_OK != (ret = read_bits_32(
  ------------------
  |  |  233|    100|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3250:10): [True: 0, False: 100]
  ------------------
 3251|    100|						    a, rar, p, &add))) {
 3252|       |							/* Return EOF if we
 3253|       |							 * can't read more
 3254|       |							 * data. */
 3255|      0|							return ret;
 3256|      0|						}
 3257|       |
 3258|    100|						skip_bits(rar, dbits - 4);
 3259|    100|						add = (add >> (
 3260|    100|						    36 - dbits)) << 4;
 3261|    100|						dist += add;
 3262|    100|					}
 3263|       |
 3264|    104|					if(ARCHIVE_OK != decode_number(a,
  ------------------
  |  |  233|    104|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3264:9): [True: 0, False: 104]
  ------------------
 3265|    104|					    &rar->cstate.ldd, p, &low_dist))
 3266|      0|					{
 3267|      0|						archive_set_error(&a->archive,
 3268|      0|						    ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 3269|      0|						    "Failed to decode the "
 3270|      0|						    "distance slot");
 3271|       |
 3272|      0|						return rar->main.solid ? ARCHIVE_FATAL : ARCHIVE_FAILED;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
              						return rar->main.solid ? ARCHIVE_FATAL : ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (3272:14): [True: 0, False: 0]
  ------------------
 3273|      0|					}
 3274|       |
 3275|    104|					if(dist >= INT_MAX - low_dist - 1) {
  ------------------
  |  Branch (3275:9): [True: 0, False: 104]
  ------------------
 3276|       |						/* This only happens in
 3277|       |						 * invalid archives. */
 3278|      0|						archive_set_error(&a->archive,
 3279|      0|						    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3280|      0|						    "Distance pointer "
 3281|      0|						    "overflow");
 3282|      0|						return rar->main.solid ? ARCHIVE_FATAL : ARCHIVE_FAILED;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
              						return rar->main.solid ? ARCHIVE_FATAL : ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (3282:14): [True: 0, False: 0]
  ------------------
 3283|      0|					}
 3284|       |
 3285|    104|					dist += low_dist;
 3286|  8.13k|				} else {
 3287|       |					/* dbits is one of [0,1,2,3] */
 3288|  8.13k|					int add;
 3289|       |
 3290|  8.13k|					if(ARCHIVE_OK != (ret = read_consume_bits(a, rar,
  ------------------
  |  |  233|  8.13k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3290:9): [True: 0, False: 8.13k]
  ------------------
 3291|  8.13k|					     p, dbits, &add))) {
 3292|       |						/* Return EOF if we can't read
 3293|       |						 * more data. */
 3294|      0|						return ret;
 3295|      0|					}
 3296|       |
 3297|  8.13k|					dist += add;
 3298|  8.13k|				}
 3299|  8.23k|			}
 3300|       |
 3301|  8.25k|			if(dist > 0x100) {
  ------------------
  |  Branch (3301:7): [True: 76, False: 8.17k]
  ------------------
 3302|     76|				len++;
 3303|       |
 3304|     76|				if(dist > 0x2000) {
  ------------------
  |  Branch (3304:8): [True: 43, False: 33]
  ------------------
 3305|     43|					len++;
 3306|       |
 3307|     43|					if(dist > 0x40000) {
  ------------------
  |  Branch (3307:9): [True: 30, False: 13]
  ------------------
 3308|     30|						len++;
 3309|     30|					}
 3310|     43|				}
 3311|     76|			}
 3312|       |
 3313|  8.25k|			dist_cache_push(rar, dist);
 3314|  8.25k|			rar->cstate.last_len = len;
 3315|       |
 3316|  8.25k|			if(ARCHIVE_OK != copy_string(a, len, dist))
  ------------------
  |  |  233|  8.25k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3316:7): [True: 0, False: 8.25k]
  ------------------
 3317|      0|				return rar->main.solid ? ARCHIVE_FATAL : ARCHIVE_FAILED;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
              				return rar->main.solid ? ARCHIVE_FATAL : ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (3317:12): [True: 0, False: 0]
  ------------------
 3318|       |
 3319|  8.25k|			continue;
 3320|  8.25k|		} else if(num == 256) {
  ------------------
  |  Branch (3320:13): [True: 0, False: 376]
  ------------------
 3321|       |			/* Create a filter. */
 3322|      0|			ret = parse_filter(a, p);
 3323|      0|			if(ret != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3323:7): [True: 0, False: 0]
  ------------------
 3324|      0|				return ret;
 3325|       |
 3326|      0|			continue;
 3327|    376|		} else if(num == 257) {
  ------------------
  |  Branch (3327:13): [True: 0, False: 376]
  ------------------
 3328|      0|			if(rar->cstate.last_len != 0) {
  ------------------
  |  Branch (3328:7): [True: 0, False: 0]
  ------------------
 3329|      0|				if(ARCHIVE_OK != copy_string(a,
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3329:8): [True: 0, False: 0]
  ------------------
 3330|      0|				    rar->cstate.last_len,
 3331|      0|				    rar->cstate.dist_cache[0]))
 3332|      0|				{
 3333|      0|					return rar->main.solid ? ARCHIVE_FATAL : ARCHIVE_FAILED;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
              					return rar->main.solid ? ARCHIVE_FATAL : ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (3333:13): [True: 0, False: 0]
  ------------------
 3334|      0|				}
 3335|      0|			}
 3336|       |
 3337|      0|			continue;
 3338|    376|		} else {
 3339|       |			/* num < 262 */
 3340|    376|			const int idx = num - 258;
 3341|    376|			const int dist = dist_cache_touch(rar, idx);
 3342|       |
 3343|    376|			uint16_t len_slot;
 3344|    376|			int len;
 3345|       |
 3346|    376|			if(ARCHIVE_OK != decode_number(a, &rar->cstate.rd, p,
  ------------------
  |  |  233|    376|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3346:7): [True: 0, False: 376]
  ------------------
 3347|    376|			    &len_slot)) {
 3348|      0|				return rar->main.solid ? ARCHIVE_FATAL : ARCHIVE_FAILED;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
              				return rar->main.solid ? ARCHIVE_FATAL : ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (3348:12): [True: 0, False: 0]
  ------------------
 3349|      0|			}
 3350|       |
 3351|    376|			len = decode_code_length(a, rar, p, len_slot);
 3352|    376|			if (len == -1) {
  ------------------
  |  Branch (3352:8): [True: 0, False: 376]
  ------------------
 3353|      0|				return rar->main.solid ? ARCHIVE_FATAL : ARCHIVE_FAILED;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
              				return rar->main.solid ? ARCHIVE_FATAL : ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (3353:12): [True: 0, False: 0]
  ------------------
 3354|      0|			}
 3355|       |
 3356|    376|			rar->cstate.last_len = len;
 3357|       |
 3358|    376|			if(ARCHIVE_OK != copy_string(a, len, dist))
  ------------------
  |  |  233|    376|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3358:7): [True: 0, False: 376]
  ------------------
 3359|      0|				return rar->main.solid ? ARCHIVE_FATAL : ARCHIVE_FAILED;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
              				return rar->main.solid ? ARCHIVE_FATAL : ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (3359:12): [True: 0, False: 0]
  ------------------
 3360|       |
 3361|    376|			continue;
 3362|    376|		}
 3363|   292k|	}
 3364|       |
 3365|  36.1k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  36.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3366|  36.1k|}
archive_read_support_format_rar5.c:bf_bit_size:
  498|  36.1k|uint8_t bf_bit_size(const struct compressed_block_header* hdr) {
  499|  36.1k|	return hdr->block_flags_u8 & 7;
  500|  36.1k|}
archive_read_support_format_rar5.c:decode_code_length:
 3099|  8.62k|{
 3100|  8.62k|	int lbits, length = 2;
 3101|       |
 3102|  8.62k|	if(code < 8) {
  ------------------
  |  Branch (3102:5): [True: 371, False: 8.25k]
  ------------------
 3103|    371|		lbits = 0;
 3104|    371|		length += code;
 3105|  8.25k|	} else {
 3106|  8.25k|		lbits = code / 4 - 1;
 3107|  8.25k|		length += (4 | (code & 3)) << lbits;
 3108|  8.25k|	}
 3109|       |
 3110|  8.62k|	if(lbits > 0) {
  ------------------
  |  Branch (3110:5): [True: 8.25k, False: 371]
  ------------------
 3111|  8.25k|		int add;
 3112|       |
 3113|  8.25k|		if(ARCHIVE_OK != read_consume_bits(a, rar, p, lbits, &add))
  ------------------
  |  |  233|  8.25k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3113:6): [True: 0, False: 8.25k]
  ------------------
 3114|      0|			return -1;
 3115|       |
 3116|  8.25k|		length += add;
 3117|  8.25k|	}
 3118|       |
 3119|  8.62k|	return length;
 3120|  8.62k|}
archive_read_support_format_rar5.c:read_bits_32:
 1041|    100|{
 1042|    100|	if(rar->bits.in_addr >= rar->cstate.cur_block_size) {
  ------------------
  |  Branch (1042:5): [True: 0, False: 100]
  ------------------
 1043|      0|		archive_set_error(&a->archive,
 1044|      0|			ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1045|      0|			"Premature end of stream during extraction of data (#1)");
 1046|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1047|      0|	}
 1048|       |
 1049|    100|	uint32_t bits = ((uint32_t) p[rar->bits.in_addr]) << 24;
 1050|    100|	bits |= p[rar->bits.in_addr + 1] << 16;
 1051|    100|	bits |= p[rar->bits.in_addr + 2] << 8;
 1052|    100|	bits |= p[rar->bits.in_addr + 3];
 1053|    100|	bits <<= rar->bits.bit_addr;
 1054|    100|	bits |= p[rar->bits.in_addr + 4] >> (8 - rar->bits.bit_addr);
 1055|    100|	*value = bits;
 1056|    100|	return ARCHIVE_OK;
  ------------------
  |  |  233|    100|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1057|    100|}
archive_read_support_format_rar5.c:read_consume_bits:
 1086|  16.3k|{
 1087|  16.3k|	uint16_t v;
 1088|  16.3k|	int ret, num;
 1089|       |
 1090|  16.3k|	if(n == 0 || n > 16) {
  ------------------
  |  Branch (1090:5): [True: 0, False: 16.3k]
  |  Branch (1090:15): [True: 0, False: 16.3k]
  ------------------
 1091|       |		/* This is a programmer error and should never happen
 1092|       |		 * in runtime. */
 1093|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1094|      0|	}
 1095|       |
 1096|  16.3k|	ret = read_bits_16(a, rar, p, &v);
 1097|  16.3k|	if(ret != ARCHIVE_OK)
  ------------------
  |  |  233|  16.3k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1097:5): [True: 0, False: 16.3k]
  ------------------
 1098|      0|		return ret;
 1099|       |
 1100|  16.3k|	num = (int) v;
 1101|  16.3k|	num >>= 16 - n;
 1102|       |
 1103|  16.3k|	skip_bits(rar, n);
 1104|       |
 1105|  16.3k|	if(value)
  ------------------
  |  Branch (1105:5): [True: 16.3k, False: 0]
  ------------------
 1106|  16.3k|		*value = num;
 1107|       |
 1108|  16.3k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  16.3k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1109|  16.3k|}
archive_read_support_format_rar5.c:dist_cache_push:
  830|  8.25k|static void dist_cache_push(struct rar5* rar, int value) {
  831|  8.25k|	int* q = rar->cstate.dist_cache;
  832|       |
  833|  8.25k|	q[3] = q[2];
  834|  8.25k|	q[2] = q[1];
  835|  8.25k|	q[1] = q[0];
  836|  8.25k|	q[0] = value;
  837|  8.25k|}
archive_read_support_format_rar5.c:copy_string:
 3122|  8.62k|static int copy_string(struct archive_read* a, int len, int dist) {
 3123|  8.62k|	struct rar5* rar = get_context(a);
 3124|  8.62k|	const ssize_t cmask = rar->cstate.window_mask;
 3125|  8.62k|	const uint64_t write_ptr = rar->cstate.write_ptr +
 3126|  8.62k|	    rar->cstate.solid_offset;
 3127|  8.62k|	int i;
 3128|       |
 3129|  8.62k|	if (rar->cstate.window_buf == NULL)
  ------------------
  |  Branch (3129:6): [True: 0, False: 8.62k]
  ------------------
 3130|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3131|       |
 3132|       |	/* The unpacker spends most of the time in this function. It would be
 3133|       |	 * a good idea to introduce some optimizations here.
 3134|       |	 *
 3135|       |	 * Just remember that this loop treats buffers that overlap differently
 3136|       |	 * than buffers that do not overlap. This is why a simple memcpy(3)
 3137|       |	 * call will not be enough. */
 3138|       |
 3139|  22.1M|	for(i = 0; i < len; i++) {
  ------------------
  |  Branch (3139:13): [True: 22.1M, False: 8.62k]
  ------------------
 3140|  22.1M|		const ssize_t write_idx = (write_ptr + i) & cmask;
 3141|  22.1M|		const ssize_t read_idx = (write_ptr + i - dist) & cmask;
 3142|  22.1M|		rar->cstate.window_buf[write_idx] =
 3143|  22.1M|		    rar->cstate.window_buf[read_idx];
 3144|  22.1M|	}
 3145|       |
 3146|  8.62k|	rar->cstate.write_ptr += len;
 3147|  8.62k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  8.62k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3148|  8.62k|}
archive_read_support_format_rar5.c:dist_cache_touch:
  839|    376|static int dist_cache_touch(struct rar5* rar, int idx) {
  840|    376|	int* q = rar->cstate.dist_cache;
  841|    376|	int i, dist = q[idx];
  842|       |
  843|  1.50k|	for(i = idx; i > 0; i--)
  ------------------
  |  Branch (843:15): [True: 1.12k, False: 376]
  ------------------
  844|  1.12k|		q[i] = q[i - 1];
  845|       |
  846|    376|	q[0] = dist;
  847|    376|	return dist;
  848|    376|}
archive_read_support_format_rar5.c:bf_is_last_block:
  513|  26.2k|uint8_t bf_is_last_block(const struct compressed_block_header* hdr) {
  514|  26.2k|	return (hdr->block_flags_u8 >> 6) & 1;
  515|  26.2k|}
archive_read_support_format_rar5.c:apply_filters:
  778|  9.85k|static int apply_filters(struct archive_read* a) {
  779|  9.85k|	struct filter_info* flt;
  780|  9.85k|	struct rar5* rar = get_context(a);
  781|  9.85k|	int ret;
  782|       |
  783|  9.85k|	rar->cstate.all_filters_applied = 0;
  784|       |
  785|       |	/* Get the first filter that can be applied to our data. The data
  786|       |	 * needs to be fully unpacked before the filter can be run. */
  787|  9.85k|	if(CDE_OK == cdeque_front(&rar->cstate.filters,
  ------------------
  |  Branch (787:5): [True: 0, False: 9.85k]
  ------------------
  788|  9.85k|	    cdeque_filter_p(&flt))) {
  789|       |		/* Check if our unpacked data fully covers this filter's
  790|       |		 * range. */
  791|      0|		if(rar->cstate.write_ptr > flt->block_start &&
  ------------------
  |  Branch (791:6): [True: 0, False: 0]
  ------------------
  792|      0|		    rar->cstate.write_ptr >= flt->block_start +
  ------------------
  |  Branch (792:7): [True: 0, False: 0]
  ------------------
  793|      0|		    flt->block_length) {
  794|       |			/* Check if we have some data pending to be written
  795|       |			 * right before the filter's start offset. */
  796|      0|			if(rar->cstate.last_write_ptr == flt->block_start) {
  ------------------
  |  Branch (796:7): [True: 0, False: 0]
  ------------------
  797|       |				/* Run the filter specified by descriptor
  798|       |				 * `flt`. */
  799|      0|				ret = run_filter(a, flt);
  800|      0|				if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (800:8): [True: 0, False: 0]
  ------------------
  801|       |					/* Filter failure, return error. */
  802|      0|					return ret;
  803|      0|				}
  804|       |
  805|       |				/* Filter descriptor won't be needed anymore
  806|       |				 * after it's used, * so remove it from the
  807|       |				 * filter list and free its memory. */
  808|      0|				(void) cdeque_pop_front(&rar->cstate.filters,
  809|      0|				    cdeque_filter_p(&flt));
  810|       |
  811|      0|				free(flt);
  812|      0|			} else {
  813|       |				/* We can't run filters yet, dump the memory
  814|       |				 * right before the filter. */
  815|      0|				push_window_data(a, rar,
  816|      0|				    rar->cstate.last_write_ptr,
  817|      0|				    flt->block_start);
  818|      0|			}
  819|       |
  820|       |			/* Return 'filter applied or not needed' state to the
  821|       |			 * caller. */
  822|      0|			return ARCHIVE_RETRY;
  ------------------
  |  |  234|      0|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  823|      0|		}
  824|      0|	}
  825|       |
  826|  9.85k|	rar->cstate.all_filters_applied = 1;
  827|  9.85k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  9.85k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  828|  9.85k|}
archive_read_support_format_rar5.c:push_data_ready:
 3789|  10.0k|{
 3790|  10.0k|	int i;
 3791|       |
 3792|       |	/* Don't push if we're in skip mode. This is needed because solid
 3793|       |	 * streams need full processing even if we're skipping data. After
 3794|       |	 * fully processing the stream, we need to discard the generated bytes,
 3795|       |	 * because we're interested only in the side effect: building up the
 3796|       |	 * internal window circular buffer. This window buffer will be used
 3797|       |	 * later during unpacking of requested data. */
 3798|  10.0k|	if(rar->skip_mode)
  ------------------
  |  Branch (3798:5): [True: 8.74k, False: 1.27k]
  ------------------
 3799|  8.74k|		return ARCHIVE_OK;
  ------------------
  |  |  233|  8.74k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3800|       |
 3801|       |	/* Sanity check. */
 3802|  1.27k|	if(offset != rar->file.last_offset + rar->file.last_size) {
  ------------------
  |  Branch (3802:5): [True: 3, False: 1.27k]
  ------------------
 3803|      3|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      3|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 3804|      3|		    "Sanity check error: output stream is not continuous");
 3805|      3|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      3|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3806|      3|	}
 3807|       |
 3808|  1.44k|	for(i = 0; i < rar5_countof(rar->cstate.dready); i++) {
  ------------------
  |  |   63|  1.44k|#define rar5_countof(X) ((const ssize_t) (sizeof(X) / sizeof(*X)))
  ------------------
  |  Branch (3808:13): [True: 1.44k, False: 0]
  ------------------
 3809|  1.44k|		struct data_ready* d = &rar->cstate.dready[i];
 3810|  1.44k|		if(!d->used) {
  ------------------
  |  Branch (3810:6): [True: 1.27k, False: 169]
  ------------------
 3811|  1.27k|			d->used = 1;
 3812|  1.27k|			d->buf = buf;
 3813|  1.27k|			d->size = size;
 3814|  1.27k|			d->offset = offset;
 3815|       |
 3816|       |			/* These fields are used only in sanity checking. */
 3817|  1.27k|			rar->file.last_offset = offset;
 3818|  1.27k|			rar->file.last_size = size;
 3819|       |
 3820|       |			/* Calculate the checksum of this new block before
 3821|       |			 * submitting data to libarchive's engine. */
 3822|  1.27k|			update_crc(rar, d->buf, d->size);
 3823|       |
 3824|  1.27k|			return ARCHIVE_OK;
  ------------------
  |  |  233|  1.27k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3825|  1.27k|		}
 3826|  1.44k|	}
 3827|       |
 3828|       |	/* Program counter will reach this code if the `rar->cstate.data_ready`
 3829|       |	 * stack will be filled up so that no new entries will be allowed. The
 3830|       |	 * code shouldn't allow such situation to occur. So we treat this case
 3831|       |	 * as an internal error. */
 3832|       |
 3833|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 3834|      0|	    "Premature end of data_ready stack");
 3835|      0|	return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3836|  1.27k|}
archive_read_support_format_rar5.c:cdeque_front:
  425|  9.85k|static int cdeque_front(struct cdeque* d, void** value) {
  426|  9.85k|	if(d->size > 0) {
  ------------------
  |  Branch (426:5): [True: 0, False: 9.85k]
  ------------------
  427|      0|		cdeque_front_fast(d, value);
  428|      0|		return CDE_OK;
  429|      0|	} else
  430|  9.85k|		return CDE_OUT_OF_BOUNDS;
  431|  9.85k|}
archive_read_support_format_rar5.c:push_window_data:
  774|  9.85k|{
  775|  9.85k|	push_data(a, rar, rar->cstate.window_buf, idx_begin, idx_end);
  776|  9.85k|}
archive_read_support_format_rar5.c:push_data:
  730|  9.85k|{
  731|  9.85k|	const ssize_t wmask = rar->cstate.window_mask;
  732|  9.85k|	const ssize_t solid_write_ptr = (rar->cstate.solid_offset +
  733|  9.85k|	    rar->cstate.last_write_ptr) & wmask;
  734|       |
  735|  9.85k|	idx_begin += rar->cstate.solid_offset;
  736|  9.85k|	idx_end += rar->cstate.solid_offset;
  737|       |
  738|       |	/* Check if our unpacked data is wrapped inside the window circular
  739|       |	 * buffer.  If it's not wrapped, it can be copied out by using
  740|       |	 * a single memcpy, but when it's wrapped, we need to copy the first
  741|       |	 * part with one memcpy, and the second part with another memcpy. */
  742|       |
  743|  9.85k|	if((idx_begin & wmask) > (idx_end & wmask)) {
  ------------------
  |  Branch (743:5): [True: 169, False: 9.68k]
  ------------------
  744|       |		/* The data is wrapped (begin offset sis bigger than end
  745|       |		 * offset). */
  746|    169|		const ssize_t frag1_size = rar->cstate.window_size -
  747|    169|		    (idx_begin & wmask);
  748|    169|		const ssize_t frag2_size = idx_end & wmask;
  749|       |
  750|       |		/* Copy the first part of the buffer first. */
  751|    169|		push_data_ready(a, rar, buf + solid_write_ptr, frag1_size,
  752|    169|		    rar->cstate.last_write_ptr);
  753|       |
  754|       |		/* Copy the second part of the buffer. */
  755|    169|		push_data_ready(a, rar, buf, frag2_size,
  756|    169|		    rar->cstate.last_write_ptr + frag1_size);
  757|       |
  758|    169|		rar->cstate.last_write_ptr += frag1_size + frag2_size;
  759|  9.68k|	} else {
  760|       |		/* Data is not wrapped, so we can just use one call to copy the
  761|       |		 * data. */
  762|  9.68k|		push_data_ready(a, rar,
  763|  9.68k|		    buf + solid_write_ptr, (idx_end - idx_begin) & wmask,
  764|  9.68k|		    rar->cstate.last_write_ptr);
  765|       |
  766|  9.68k|		rar->cstate.last_write_ptr += idx_end - idx_begin;
  767|  9.68k|	}
  768|  9.85k|}
archive_read_support_format_rar5.c:verify_global_checksums:
 4201|     27|static int verify_global_checksums(struct archive_read* a) {
 4202|     27|	return verify_checksums(a);
 4203|     27|}
archive_read_support_format_rar5.c:verify_checksums:
 4103|     27|static int verify_checksums(struct archive_read* a) {
 4104|     27|	int verify_crc;
 4105|     27|	struct rar5* rar = get_context(a);
 4106|       |
 4107|       |	/* Check checksums only when actually unpacking the data. There's no
 4108|       |	 * need to calculate checksum when we're skipping data in solid archives
 4109|       |	 * (skipping in solid archives is the same thing as unpacking compressed
 4110|       |	 * data and discarding the result). */
 4111|       |
 4112|     27|	if(!rar->skip_mode) {
  ------------------
  |  Branch (4112:5): [True: 11, False: 16]
  ------------------
 4113|       |		/* Always check checksums if we're not in skip mode */
 4114|     11|		verify_crc = 1;
 4115|     16|	} else {
 4116|       |		/* We can override the logic above with a compile-time option
 4117|       |		 * NO_CRC_ON_SOLID_SKIP. This option is used during debugging,
 4118|       |		 * and it will check checksums of unpacked data even when
 4119|       |		 * we're skipping it. */
 4120|       |
 4121|       |#if defined CHECK_CRC_ON_SOLID_SKIP
 4122|       |		/* Debug case */
 4123|       |		verify_crc = 1;
 4124|       |#else
 4125|       |		/* Normal case */
 4126|     16|		verify_crc = 0;
 4127|     16|#endif
 4128|     16|	}
 4129|       |
 4130|     27|	if(verify_crc) {
  ------------------
  |  Branch (4130:5): [True: 11, False: 16]
  ------------------
 4131|       |		/* During unpacking, on each unpacked block we're calling the
 4132|       |		 * update_crc() function. Since we are here, the unpacking
 4133|       |		 * process is already over and we can check if calculated
 4134|       |		 * checksum (CRC32 or BLAKE2sp) is the same as what is stored
 4135|       |		 * in the archive. */
 4136|     11|		if(rar->file.stored_crc32 > 0) {
  ------------------
  |  Branch (4136:6): [True: 11, False: 0]
  ------------------
 4137|       |			/* Check CRC32 only when the file contains a CRC32
 4138|       |			 * value for this file. */
 4139|       |
 4140|     11|			if(rar->file.calculated_crc32 !=
  ------------------
  |  Branch (4140:7): [True: 11, False: 0]
  ------------------
 4141|     11|			    rar->file.stored_crc32) {
 4142|       |				/* Checksums do not match; the unpacked file
 4143|       |				 * is corrupted. */
 4144|       |
 4145|     11|				DEBUG_CODE {
  ------------------
  |  |   69|     11|#define DEBUG_CODE if(0)
  |  |  ------------------
  |  |  |  Branch (69:23): [Folded, False: 11]
  |  |  ------------------
  ------------------
 4146|      0|					printf("Checksum error: CRC32 "
 4147|      0|					    "(was: %08" PRIx32 ", expected: %08" PRIx32 ")\n",
 4148|      0|					    rar->file.calculated_crc32,
 4149|      0|					    rar->file.stored_crc32);
 4150|      0|				}
 4151|       |
 4152|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 4153|       |				archive_set_error(&a->archive,
 4154|       |				    ARCHIVE_ERRNO_FILE_FORMAT,
 4155|       |				    "Checksum error: CRC32");
 4156|       |				return ARCHIVE_FAILED;
 4157|       |#endif
 4158|     11|			} else {
 4159|      0|				DEBUG_CODE {
  ------------------
  |  |   69|      0|#define DEBUG_CODE if(0)
  |  |  ------------------
  |  |  |  Branch (69:23): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4160|      0|					printf("Checksum OK: CRC32 "
 4161|      0|					    "(%08" PRIx32 "/%08" PRIx32 ")\n",
 4162|      0|					    rar->file.stored_crc32,
 4163|      0|					    rar->file.calculated_crc32);
 4164|      0|				}
 4165|      0|			}
 4166|     11|		}
 4167|       |
 4168|     11|		if(rar->file.has_blake2 > 0) {
  ------------------
  |  Branch (4168:6): [True: 10, False: 1]
  ------------------
 4169|       |			/* BLAKE2sp is an optional checksum algorithm that is
 4170|       |			 * added to RARv5 archives when using the `-htb` switch
 4171|       |			 *  during creation of archive.
 4172|       |			 *
 4173|       |			 * We now finalize the hash calculation by calling the
 4174|       |			 * `final` function. This will generate the final hash
 4175|       |			 * value we can use to compare it with the BLAKE2sp
 4176|       |			 * checksum that is stored in the archive.
 4177|       |			 *
 4178|       |			 * The return value of this `final` function is not
 4179|       |			 * very helpful, as it guards only against improper use.
 4180|       | 			 * This is why we're explicitly ignoring it. */
 4181|       |
 4182|     10|			uint8_t b2_buf[32];
 4183|     10|			(void) blake2sp_final(&rar->file.b2state, b2_buf, 32);
 4184|       |
 4185|     10|			if(memcmp(&rar->file.blake2sp, b2_buf, 32) != 0) {
  ------------------
  |  Branch (4185:7): [True: 10, False: 0]
  ------------------
 4186|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 4187|       |				archive_set_error(&a->archive,
 4188|       |				    ARCHIVE_ERRNO_FILE_FORMAT,
 4189|       |				    "Checksum error: BLAKE2");
 4190|       |
 4191|       |				return ARCHIVE_FAILED;
 4192|       |#endif
 4193|     10|			}
 4194|     10|		}
 4195|     11|	}
 4196|       |
 4197|       |	/* Finalization for this file has been successfully completed. */
 4198|     27|	return ARCHIVE_OK;
  ------------------
  |  |  233|     27|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4199|     27|}
archive_read_support_format_rar5.c:rar5_read_data_skip:
 4283|  14.8k|static int rar5_read_data_skip(struct archive_read *a) {
 4284|  14.8k|	struct rar5* rar = get_context(a);
 4285|       |
 4286|  14.8k|	if(rar->main.solid && (rar->cstate.data_encrypted == 0)) {
  ------------------
  |  Branch (4286:5): [True: 12.6k, False: 2.24k]
  |  Branch (4286:24): [True: 11.9k, False: 616]
  ------------------
 4287|       |		/* In solid archives, instead of skipping the data, we need to
 4288|       |		 * extract it, and dispose the result. The side effect of this
 4289|       |		 * operation will be setting up the initial window buffer state
 4290|       |		 * needed to be able to extract the selected file. Note that
 4291|       |		 * this is only possible when data withing this solid block is
 4292|       |		 * not encrypted, in which case we'll skip and fail if the user
 4293|       |		 * tries to read data. */
 4294|       |
 4295|  11.9k|		int ret;
 4296|       |
 4297|       |		/* Make sure to process all blocks in the compressed stream. */
 4298|  20.7k|		while(rar->file.bytes_remaining > 0) {
  ------------------
  |  Branch (4298:9): [True: 18.2k, False: 2.57k]
  ------------------
 4299|       |			/* Setting the "skip mode" will allow us to skip
 4300|       |			 * checksum checks during data skipping. Checking the
 4301|       |			 * checksum of skipped data isn't really necessary and
 4302|       |			 * it's only slowing things down.
 4303|       |			 *
 4304|       |			 * This is incremented instead of setting to 1 because
 4305|       |			 * this data skipping function can be called
 4306|       |			 * recursively. */
 4307|  18.2k|			rar->skip_mode++;
 4308|       |
 4309|       |			/* We're disposing 1 block of data, so we use triple
 4310|       |			 * NULLs in arguments. */
 4311|  18.2k|			ret = rar5_read_data(a, NULL, NULL, NULL);
 4312|       |
 4313|       |			/* Turn off "skip mode". */
 4314|  18.2k|			rar->skip_mode--;
 4315|       |
 4316|  18.2k|			if(ret < 0 || ret == ARCHIVE_EOF) {
  ------------------
  |  |  232|  13.4k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (4316:7): [True: 4.79k, False: 13.4k]
  |  Branch (4316:18): [True: 4.63k, False: 8.78k]
  ------------------
 4317|       |				/* Propagate any potential error conditions
 4318|       |				 * to the caller. */
 4319|  9.42k|				return ret;
 4320|  9.42k|			}
 4321|  18.2k|		}
 4322|  11.9k|	} else {
 4323|       |		/* In standard archives, we can just jump over the compressed
 4324|       |		 * stream. Each file in non-solid archives starts from an empty
 4325|       |		 * window buffer. */
 4326|       |
 4327|  2.85k|		if(ARCHIVE_OK != consume(a, rar->file.bytes_remaining)) {
  ------------------
  |  |  233|  2.85k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4327:6): [True: 56, False: 2.80k]
  ------------------
 4328|     56|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|     56|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4329|     56|		}
 4330|       |
 4331|  2.80k|		rar->file.bytes_remaining = 0;
 4332|  2.80k|	}
 4333|       |
 4334|  5.37k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  5.37k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4335|  14.8k|}
archive_read_support_format_rar5.c:rar5_cleanup:
 4349|  2.49k|static int rar5_cleanup(struct archive_read *a) {
 4350|  2.49k|	struct rar5* rar = get_context(a);
 4351|       |
 4352|  2.49k|	free(rar->cstate.window_buf);
 4353|  2.49k|	free(rar->cstate.filtered_buf);
 4354|  2.49k|	clear_data_ready_stack(rar);
 4355|       |
 4356|  2.49k|	free(rar->vol.push_buf);
 4357|       |
 4358|  2.49k|	free_filters(rar);
 4359|  2.49k|	rar5_deinit(rar);
 4360|       |
 4361|  2.49k|	free(rar);
 4362|  2.49k|	a->format->data = NULL;
 4363|       |
 4364|  2.49k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4365|  2.49k|}
archive_read_support_format_rar5.c:rar5_capabilities:
 4367|    524|static int rar5_capabilities(struct archive_read * a) {
 4368|    524|	(void) a;
 4369|    524|	return (ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA
  ------------------
  |  |  398|    524|#define ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA (1<<0)  /* reader can detect encrypted data */
  ------------------
 4370|    524|			| ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA);
  ------------------
  |  |  399|    524|#define ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA (1<<1)  /* reader can detect encryptable metadata (pathname, mtime, etc.) */
  ------------------
 4371|    524|}
archive_read_support_format_rar5.c:rar5_has_encrypted_entries:
 4373|    262|static int rar5_has_encrypted_entries(struct archive_read *_a) {
 4374|    262|	if (_a && _a->format) {
  ------------------
  |  Branch (4374:6): [True: 262, False: 0]
  |  Branch (4374:12): [True: 262, False: 0]
  ------------------
 4375|    262|		struct rar5 *rar = (struct rar5 *)_a->format->data;
 4376|    262|		if (rar) {
  ------------------
  |  Branch (4376:7): [True: 262, False: 0]
  ------------------
 4377|    262|			return rar->has_encrypted_entries;
 4378|    262|		}
 4379|    262|	}
 4380|       |
 4381|      0|	return ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW;
  ------------------
  |  |  411|      0|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
 4382|    262|}
archive_read_support_format_rar5.c:rar5_deinit:
 4401|  2.49k|static void rar5_deinit(struct rar5* rar) {
 4402|  2.49k|	cdeque_free(&rar->cstate.filters);
 4403|  2.49k|}
archive_read_support_format_rar5.c:cdeque_free:
  482|  2.49k|static void cdeque_free(struct cdeque* d) {
  483|  2.49k|	if(!d)
  ------------------
  |  Branch (483:5): [True: 0, False: 2.49k]
  ------------------
  484|      0|		return;
  485|       |
  486|  2.49k|	if(!d->arr)
  ------------------
  |  Branch (486:5): [True: 0, False: 2.49k]
  ------------------
  487|      0|		return;
  488|       |
  489|  2.49k|	free(d->arr);
  490|       |
  491|       |	d->arr = NULL;
  492|  2.49k|	d->beg_pos = -1;
  493|  2.49k|	d->end_pos = -1;
  494|  2.49k|	d->cap_mask = 0;
  495|  2.49k|}

archive_read_support_format_raw:
   56|  2.49k|{
   57|  2.49k|	struct raw_info *info;
   58|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
   59|  2.49k|	int r;
   60|       |
   61|  2.49k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  151|  2.49k|	do { \
  |  |  152|  2.49k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|  2.49k|			(allowed_states), (function_name)); \
  |  |  154|  2.49k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  2.49k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 2.49k]
  |  |  ------------------
  |  |  155|  2.49k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|  2.49k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 2.49k]
  |  |  ------------------
  ------------------
   62|  2.49k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_raw");
   63|       |
   64|  2.49k|	info = calloc(1, sizeof(*info));
   65|  2.49k|	if (info == NULL) {
  ------------------
  |  Branch (65:6): [True: 0, False: 2.49k]
  ------------------
   66|      0|		archive_set_error(&a->archive, ENOMEM,
   67|      0|		    "Can't allocate raw_info data");
   68|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
   69|      0|	}
   70|       |
   71|  2.49k|	r = __archive_read_register_format(a,
   72|  2.49k|	    info,
   73|  2.49k|	    "raw",
   74|  2.49k|	    archive_read_format_raw_bid,
   75|  2.49k|	    NULL,
   76|  2.49k|	    archive_read_format_raw_read_header,
   77|  2.49k|	    archive_read_format_raw_read_data,
   78|  2.49k|	    archive_read_format_raw_read_data_skip,
   79|  2.49k|	    NULL,
   80|  2.49k|	    archive_read_format_raw_cleanup,
   81|  2.49k|	    NULL,
   82|  2.49k|	    NULL);
   83|  2.49k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (83:6): [True: 0, False: 2.49k]
  ------------------
   84|      0|		free(info);
   85|  2.49k|	return (r);
   86|  2.49k|}
archive_read_support_format_raw.c:archive_read_format_raw_bid:
   97|  2.46k|{
   98|  2.46k|	if (best_bid < 1 && __archive_read_ahead(a, 1, NULL) != NULL)
  ------------------
  |  Branch (98:6): [True: 81, False: 2.37k]
  |  Branch (98:22): [True: 64, False: 17]
  ------------------
   99|     64|		return (1);
  100|  2.39k|	return (-1);
  101|  2.46k|}
archive_read_support_format_raw.c:archive_read_format_raw_read_header:
  109|    128|{
  110|    128|	struct raw_info *info;
  111|       |
  112|    128|	info = (struct raw_info *)(a->format->data);
  113|    128|	if (info->end_of_file)
  ------------------
  |  Branch (113:6): [True: 64, False: 64]
  ------------------
  114|     64|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|     64|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  115|       |
  116|     64|	a->archive.archive_format = ARCHIVE_FORMAT_RAW;
  ------------------
  |  |  380|     64|#define	ARCHIVE_FORMAT_RAW			0x90000
  ------------------
  117|     64|	a->archive.archive_format_name = "raw";
  118|     64|	archive_entry_set_pathname(entry, "data");
  119|     64|	archive_entry_set_filetype(entry, AE_IFREG);
  ------------------
  |  |  216|     64|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
  120|     64|	archive_entry_set_perm(entry, 0644);
  121|       |	/* I'm deliberately leaving most fields unset here. */
  122|       |
  123|       |	/* Let the filter fill out any fields it might have. */
  124|     64|	return __archive_read_header(a, entry);
  125|    128|}
archive_read_support_format_raw.c:archive_read_format_raw_read_data:
  130|    687|{
  131|    687|	struct raw_info *info;
  132|    687|	ssize_t avail;
  133|       |
  134|    687|	info = (struct raw_info *)(a->format->data);
  135|       |
  136|       |	/* Consume the bytes we read last time. */
  137|    687|	if (info->unconsumed) {
  ------------------
  |  Branch (137:6): [True: 569, False: 118]
  ------------------
  138|    569|		__archive_read_consume(a, info->unconsumed);
  139|    569|		info->unconsumed = 0;
  140|    569|	}
  141|       |
  142|    687|	if (info->end_of_file)
  ------------------
  |  Branch (142:6): [True: 54, False: 633]
  ------------------
  143|     54|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|     54|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  144|       |
  145|       |	/* Get whatever bytes are immediately available. */
  146|    633|	*buff = __archive_read_ahead(a, 1, &avail);
  147|    633|	if (avail > 0) {
  ------------------
  |  Branch (147:6): [True: 569, False: 64]
  ------------------
  148|       |		/* Return the bytes we just read */
  149|    569|		*size = avail;
  150|    569|		*offset = info->offset;
  151|    569|		info->offset += *size;
  152|    569|		info->unconsumed = avail;
  153|    569|		return (ARCHIVE_OK);
  ------------------
  |  |  233|    569|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  154|    569|	} else if (0 == avail) {
  ------------------
  |  Branch (154:13): [True: 64, False: 0]
  ------------------
  155|       |		/* Record and return end-of-file. */
  156|     64|		info->end_of_file = 1;
  157|     64|		*size = 0;
  158|     64|		*offset = info->offset;
  159|     64|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|     64|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  160|     64|	} else {
  161|       |		/* Record and return an error. */
  162|      0|		*size = 0;
  163|      0|		*offset = info->offset;
  164|      0|		return ((int)avail);
  165|      0|	}
  166|    633|}
archive_read_support_format_raw.c:archive_read_format_raw_read_data_skip:
  170|     64|{
  171|     64|	struct raw_info *info = (struct raw_info *)(a->format->data);
  172|       |
  173|       |	/* Consume the bytes we read last time. */
  174|     64|	if (info->unconsumed) {
  ------------------
  |  Branch (174:6): [True: 0, False: 64]
  ------------------
  175|      0|		__archive_read_consume(a, info->unconsumed);
  176|      0|		info->unconsumed = 0;
  177|      0|	}
  178|     64|	info->end_of_file = 1;
  179|     64|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     64|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  180|     64|}
archive_read_support_format_raw.c:archive_read_format_raw_cleanup:
  184|  2.49k|{
  185|  2.49k|	struct raw_info *info;
  186|       |
  187|  2.49k|	info = (struct raw_info *)(a->format->data);
  188|  2.49k|	free(info);
  189|  2.49k|	a->format->data = NULL;
  190|  2.49k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  191|  2.49k|}

archive_read_support_format_gnutar:
  283|  2.49k|{
  284|  2.49k|	archive_check_magic(a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  151|  2.49k|	do { \
  |  |  152|  2.49k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|  2.49k|			(allowed_states), (function_name)); \
  |  |  154|  2.49k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  2.49k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 2.49k]
  |  |  ------------------
  |  |  155|  2.49k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|  2.49k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 2.49k]
  |  |  ------------------
  ------------------
  285|  2.49k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_gnutar");
  286|  2.49k|	return (archive_read_support_format_tar(a));
  287|  2.49k|}
archive_read_support_format_tar:
  292|  4.99k|{
  293|  4.99k|	struct archive_read *a = (struct archive_read *)_a;
  294|  4.99k|	struct tar *tar;
  295|  4.99k|	int r;
  296|       |
  297|  4.99k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  151|  4.99k|	do { \
  |  |  152|  4.99k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|  4.99k|			(allowed_states), (function_name)); \
  |  |  154|  4.99k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  4.99k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 4.99k]
  |  |  ------------------
  |  |  155|  4.99k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|  4.99k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 4.99k]
  |  |  ------------------
  ------------------
  298|  4.99k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_tar");
  299|       |
  300|  4.99k|	tar = calloc(1, sizeof(*tar));
  301|  4.99k|	if (tar == NULL) {
  ------------------
  |  Branch (301:6): [True: 0, False: 4.99k]
  ------------------
  302|      0|		archive_set_error(&a->archive, ENOMEM,
  303|      0|		    "Can't allocate tar data");
  304|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  305|      0|	}
  306|       |#ifdef HAVE_COPYFILE_H
  307|       |	/* Set this by default on Mac OS. */
  308|       |	tar->process_mac_extensions = 1;
  309|       |#endif
  310|       |
  311|  4.99k|	r = __archive_read_register_format(a, tar, "tar",
  312|  4.99k|	    archive_read_format_tar_bid,
  313|  4.99k|	    archive_read_format_tar_options,
  314|  4.99k|	    archive_read_format_tar_read_header,
  315|  4.99k|	    archive_read_format_tar_read_data,
  316|  4.99k|	    archive_read_format_tar_skip,
  317|  4.99k|	    NULL,
  318|  4.99k|	    archive_read_format_tar_cleanup,
  319|  4.99k|	    NULL,
  320|  4.99k|	    NULL);
  321|       |
  322|  4.99k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  4.99k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (322:6): [True: 2.49k, False: 2.49k]
  ------------------
  323|  2.49k|		free(tar);
  324|  4.99k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  4.99k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  325|  4.99k|}
archive_read_support_format_tar.c:archive_read_format_tar_cleanup:
  329|  2.49k|{
  330|  2.49k|	struct tar *tar;
  331|       |
  332|  2.49k|	tar = (struct tar *)(a->format->data);
  333|  2.49k|	gnu_clear_sparse_list(tar);
  334|  2.49k|	archive_string_free(&tar->entry_pathname);
  335|  2.49k|	archive_string_free(&tar->entry_pathname_override);
  336|  2.49k|	archive_string_free(&tar->entry_uname);
  337|  2.49k|	archive_string_free(&tar->entry_gname);
  338|  2.49k|	archive_string_free(&tar->entry_linkpath);
  339|  2.49k|	archive_string_free(&tar->line);
  340|  2.49k|	archive_string_free(&tar->localname);
  341|  2.49k|	free(tar);
  342|  2.49k|	(a->format->data) = NULL;
  343|  2.49k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  344|  2.49k|}
archive_read_support_format_tar.c:gnu_clear_sparse_list:
 3181|   257k|{
 3182|   257k|	struct sparse_block *p;
 3183|       |
 3184|   511k|	while (tar->sparse_list != NULL) {
  ------------------
  |  Branch (3184:9): [True: 253k, False: 257k]
  ------------------
 3185|   253k|		p = tar->sparse_list;
 3186|   253k|		tar->sparse_list = p->next;
 3187|   253k|		free(p);
 3188|   253k|	}
 3189|       |	tar->sparse_last = NULL;
 3190|   257k|}
archive_read_support_format_tar.c:archive_read_format_tar_bid:
  400|  7.62k|{
  401|  7.62k|	int bid;
  402|  7.62k|	const char *h;
  403|  7.62k|	const struct archive_entry_header_ustar *header;
  404|       |
  405|  7.62k|	(void)best_bid; /* UNUSED */
  406|       |
  407|  7.62k|	bid = 0;
  408|       |
  409|       |	/* Now let's look at the actual header and see if it matches. */
  410|  7.62k|	h = __archive_read_ahead(a, 512, NULL);
  411|  7.62k|	if (h == NULL)
  ------------------
  |  Branch (411:6): [True: 30, False: 7.59k]
  ------------------
  412|     30|		return (-1);
  413|       |
  414|       |	/* If it's an end-of-archive mark, we can handle it. */
  415|  7.59k|	if (h[0] == 0 && archive_block_is_null(h)) {
  ------------------
  |  Branch (415:6): [True: 5.09k, False: 2.50k]
  |  Branch (415:19): [True: 129, False: 4.96k]
  ------------------
  416|       |		/*
  417|       |		 * Usually, I bid the number of bits verified, but
  418|       |		 * in this case, 4096 seems excessive so I picked 10 as
  419|       |		 * an arbitrary but reasonable-seeming value.
  420|       |		 */
  421|    129|		return (10);
  422|    129|	}
  423|       |
  424|       |	/* If it's not an end-of-archive mark, it must have a valid checksum.*/
  425|  7.46k|	if (!checksum(a, h))
  ------------------
  |  Branch (425:6): [True: 1.67k, False: 5.78k]
  ------------------
  426|  1.67k|		return (0);
  427|  5.78k|	bid += 48;  /* Checksum is usually 6 octal digits. */
  428|       |
  429|  5.78k|	header = (const struct archive_entry_header_ustar *)h;
  430|       |
  431|       |	/* Recognize POSIX formats. */
  432|  5.78k|	if ((memcmp(header->magic, "ustar\0", 6) == 0)
  ------------------
  |  Branch (432:6): [True: 677, False: 5.11k]
  ------------------
  433|    677|	    && (memcmp(header->version, "00", 2) == 0))
  ------------------
  |  Branch (433:9): [True: 433, False: 244]
  ------------------
  434|    433|		bid += 56;
  435|       |
  436|       |	/* Recognize GNU tar format. */
  437|  5.78k|	if ((memcmp(header->magic, "ustar ", 6) == 0)
  ------------------
  |  Branch (437:6): [True: 4.46k, False: 1.32k]
  ------------------
  438|  4.46k|	    && (memcmp(header->version, " \0", 2) == 0))
  ------------------
  |  Branch (438:9): [True: 143, False: 4.32k]
  ------------------
  439|    143|		bid += 56;
  440|       |
  441|       |	/* Type flag must be null, digit or A-Z, a-z. */
  442|  5.78k|	if (header->typeflag[0] != 0 &&
  ------------------
  |  Branch (442:6): [True: 5.46k, False: 321]
  ------------------
  443|  5.46k|	    !( header->typeflag[0] >= '0' && header->typeflag[0] <= '9') &&
  ------------------
  |  Branch (443:9): [True: 5.45k, False: 10]
  |  Branch (443:39): [True: 5.30k, False: 155]
  ------------------
  444|    165|	    !( header->typeflag[0] >= 'A' && header->typeflag[0] <= 'Z') &&
  ------------------
  |  Branch (444:9): [True: 154, False: 11]
  |  Branch (444:39): [True: 105, False: 49]
  ------------------
  445|     60|	    !( header->typeflag[0] >= 'a' && header->typeflag[0] <= 'z') )
  ------------------
  |  Branch (445:9): [True: 49, False: 11]
  |  Branch (445:39): [True: 49, False: 0]
  ------------------
  446|     11|		return (0);
  447|  5.77k|	bid += 2;  /* 6 bits of variation in an 8-bit field leaves 2 bits. */
  448|       |
  449|       |	/*
  450|       |	 * Check format of mode/uid/gid/mtime/size/rdevmajor/rdevminor fields.
  451|       |	 */
  452|  5.77k|	if (validate_number_field(header->mode, sizeof(header->mode)) == 0
  ------------------
  |  Branch (452:6): [True: 292, False: 5.48k]
  ------------------
  453|  5.48k|	    || validate_number_field(header->uid, sizeof(header->uid)) == 0
  ------------------
  |  Branch (453:9): [True: 183, False: 5.30k]
  ------------------
  454|  5.30k|	    || validate_number_field(header->gid, sizeof(header->gid)) == 0
  ------------------
  |  Branch (454:9): [True: 482, False: 4.82k]
  ------------------
  455|  4.82k|	    || validate_number_field(header->mtime, sizeof(header->mtime)) == 0
  ------------------
  |  Branch (455:9): [True: 286, False: 4.53k]
  ------------------
  456|  4.53k|	    || validate_number_field(header->size, sizeof(header->size)) == 0
  ------------------
  |  Branch (456:9): [True: 181, False: 4.35k]
  ------------------
  457|  4.35k|	    || validate_number_field(header->rdevmajor, sizeof(header->rdevmajor)) == 0
  ------------------
  |  Branch (457:9): [True: 1.13k, False: 3.21k]
  ------------------
  458|  3.64k|	    || validate_number_field(header->rdevminor, sizeof(header->rdevminor)) == 0) {
  ------------------
  |  Branch (458:9): [True: 1.08k, False: 2.13k]
  ------------------
  459|  3.64k|		bid = 0;
  460|  3.64k|	}
  461|       |
  462|  5.77k|	return (bid);
  463|  5.78k|}
archive_read_support_format_tar.c:archive_block_is_null:
 1091|  55.6k|{
 1092|  55.6k|	unsigned i;
 1093|       |
 1094|  17.5M|	for (i = 0; i < 512; i++)
  ------------------
  |  Branch (1094:14): [True: 17.4M, False: 33.1k]
  ------------------
 1095|  17.4M|		if (*p++)
  ------------------
  |  Branch (1095:7): [True: 22.5k, False: 17.4M]
  ------------------
 1096|  22.5k|			return (0);
 1097|  33.1k|	return (1);
 1098|  55.6k|}
archive_read_support_format_tar.c:checksum:
 1031|   243k|{
 1032|   243k|	const unsigned char *bytes;
 1033|   243k|	const struct archive_entry_header_ustar	*header;
 1034|   243k|	int check, sum;
 1035|   243k|	size_t i;
 1036|       |
 1037|   243k|	(void)a; /* UNUSED */
 1038|   243k|	bytes = (const unsigned char *)h;
 1039|   243k|	header = (const struct archive_entry_header_ustar *)h;
 1040|       |
 1041|       |	/* Checksum field must hold an octal number */
 1042|   533k|	for (i = 0; i < sizeof(header->checksum); ++i) {
  ------------------
  |  Branch (1042:14): [True: 504k, False: 29.0k]
  ------------------
 1043|   504k|		char c = header->checksum[i];
 1044|   504k|		if (c != ' ' && c != '\0' && (c < '0' || c > '7'))
  ------------------
  |  Branch (1044:7): [True: 389k, False: 114k]
  |  Branch (1044:19): [True: 301k, False: 87.7k]
  |  Branch (1044:33): [True: 4.86k, False: 296k]
  |  Branch (1044:44): [True: 209k, False: 87.6k]
  ------------------
 1045|   213k|			return 0;
 1046|   504k|	}
 1047|       |
 1048|       |	/*
 1049|       |	 * Test the checksum.  Note that POSIX specifies _unsigned_
 1050|       |	 * bytes for this calculation.
 1051|       |	 */
 1052|  29.0k|	sum = (int)tar_atol(header->checksum, sizeof(header->checksum));
 1053|  29.0k|	check = 0;
 1054|  4.33M|	for (i = 0; i < 148; i++)
  ------------------
  |  Branch (1054:14): [True: 4.30M, False: 29.0k]
  ------------------
 1055|  4.30M|		check += (unsigned char)bytes[i];
 1056|   261k|	for (; i < 156; i++)
  ------------------
  |  Branch (1056:9): [True: 232k, False: 29.0k]
  ------------------
 1057|   232k|		check += 32;
 1058|  10.3M|	for (; i < 512; i++)
  ------------------
  |  Branch (1058:9): [True: 10.3M, False: 29.0k]
  ------------------
 1059|  10.3M|		check += (unsigned char)bytes[i];
 1060|  29.0k|	if (sum == check)
  ------------------
  |  Branch (1060:6): [True: 0, False: 29.0k]
  ------------------
 1061|      0|		return (1);
 1062|       |
 1063|       |	/*
 1064|       |	 * Repeat test with _signed_ bytes, just in case this archive
 1065|       |	 * was created by an old BSD, Solaris, or HP-UX tar with a
 1066|       |	 * broken checksum calculation.
 1067|       |	 */
 1068|  29.0k|	check = 0;
 1069|  4.33M|	for (i = 0; i < 148; i++)
  ------------------
  |  Branch (1069:14): [True: 4.30M, False: 29.0k]
  ------------------
 1070|  4.30M|		check += (signed char)bytes[i];
 1071|   261k|	for (; i < 156; i++)
  ------------------
  |  Branch (1071:9): [True: 232k, False: 29.0k]
  ------------------
 1072|   232k|		check += 32;
 1073|  10.3M|	for (; i < 512; i++)
  ------------------
  |  Branch (1073:9): [True: 10.3M, False: 29.0k]
  ------------------
 1074|  10.3M|		check += (signed char)bytes[i];
 1075|  29.0k|	if (sum == check)
  ------------------
  |  Branch (1075:6): [True: 0, False: 29.0k]
  ------------------
 1076|      0|		return (1);
 1077|       |
 1078|  29.0k|#if DONT_FAIL_ON_CRC_ERROR
 1079|       |	/* Speed up fuzzing by pretending the checksum is always right. */
 1080|  29.0k|	return (1);
 1081|       |#else
 1082|       |	return (0);
 1083|       |#endif
 1084|  29.0k|}
archive_read_support_format_tar.c:tar_atol:
 3503|   265k|{
 3504|       |	/*
 3505|       |	 * Technically, GNU tar considers a field to be in base-256
 3506|       |	 * only if the first byte is 0xff or 0x80.
 3507|       |	 */
 3508|   265k|	if (*p & 0x80)
  ------------------
  |  Branch (3508:6): [True: 2.00k, False: 263k]
  ------------------
 3509|  2.00k|		return (tar_atol256(p, char_cnt));
 3510|   263k|	return (tar_atol8(p, char_cnt));
 3511|   265k|}
archive_read_support_format_tar.c:tar_atol256:
 3586|  2.00k|{
 3587|  2.00k|	uint64_t l;
 3588|  2.00k|	const unsigned char *p = (const unsigned char *)_p;
 3589|  2.00k|	unsigned char c, neg;
 3590|       |
 3591|       |	/* Extend 7-bit 2s-comp to 8-bit 2s-comp, decide sign. */
 3592|  2.00k|	c = *p;
 3593|  2.00k|	if (c & 0x40) {
  ------------------
  |  Branch (3593:6): [True: 1.71k, False: 290]
  ------------------
 3594|  1.71k|		neg = 0xff;
 3595|  1.71k|		c |= 0x80;
 3596|  1.71k|		l = ~ARCHIVE_LITERAL_ULL(0);
  ------------------
  |  |  180|  1.71k|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  ------------------
 3597|  1.71k|	} else {
 3598|    290|		neg = 0;
 3599|    290|		c &= 0x7f;
 3600|    290|		l = 0;
 3601|    290|	}
 3602|       |
 3603|       |	/* If more than 8 bytes, check that we can ignore
 3604|       |	 * high-order bits without overflow. */
 3605|  3.16k|	while (char_cnt > sizeof(int64_t)) {
  ------------------
  |  Branch (3605:9): [True: 1.25k, False: 1.91k]
  ------------------
 3606|  1.25k|		--char_cnt;
 3607|  1.25k|		if (c != neg)
  ------------------
  |  Branch (3607:7): [True: 91, False: 1.16k]
  ------------------
 3608|     91|			return neg ? INT64_MIN : INT64_MAX;
  ------------------
  |  Branch (3608:11): [True: 49, False: 42]
  ------------------
 3609|  1.16k|		c = *++p;
 3610|  1.16k|	}
 3611|       |
 3612|       |	/* c is first byte that fits; if sign mismatch, return overflow */
 3613|  1.91k|	if ((c ^ neg) & 0x80) {
  ------------------
  |  Branch (3613:6): [True: 148, False: 1.76k]
  ------------------
 3614|    148|		return neg ? INT64_MIN : INT64_MAX;
  ------------------
  |  Branch (3614:10): [True: 148, False: 0]
  ------------------
 3615|    148|	}
 3616|       |
 3617|       |	/* Accumulate remaining bytes. */
 3618|  14.0k|	while (--char_cnt > 0) {
  ------------------
  |  Branch (3618:9): [True: 12.3k, False: 1.76k]
  ------------------
 3619|  12.3k|		l = (l << 8) | c;
 3620|  12.3k|		c = *++p;
 3621|  12.3k|	}
 3622|  1.76k|	l = (l << 8) | c;
 3623|       |	/* Return signed twos-complement value. */
 3624|  1.76k|	return (int64_t)(l);
 3625|  1.91k|}
archive_read_support_format_tar.c:tar_atol8:
 3564|   263k|{
 3565|   263k|	return tar_atol_base_n(p, char_cnt, 8);
 3566|   263k|}
archive_read_support_format_tar.c:tar_atol_base_n:
 3520|   263k|{
 3521|   263k|	int64_t	l, maxval, limit, last_digit_limit;
 3522|   263k|	int digit, sign;
 3523|       |
 3524|   263k|	maxval = INT64_MAX;
 3525|   263k|	limit = INT64_MAX / base;
 3526|   263k|	last_digit_limit = INT64_MAX % base;
 3527|       |
 3528|       |	/* the pointer will not be dereferenced if char_cnt is zero
 3529|       |	 * due to the way the && operator is evaluated.
 3530|       |	 */
 3531|  1.02M|	while (char_cnt != 0 && (*p == ' ' || *p == '\t')) {
  ------------------
  |  Branch (3531:9): [True: 963k, False: 58.0k]
  |  Branch (3531:27): [True: 755k, False: 207k]
  |  Branch (3531:40): [True: 2.06k, False: 205k]
  ------------------
 3532|   757k|		p++;
 3533|   757k|		char_cnt--;
 3534|   757k|	}
 3535|       |
 3536|   263k|	sign = 1;
 3537|   263k|	if (char_cnt != 0 && *p == '-') {
  ------------------
  |  Branch (3537:6): [True: 205k, False: 58.0k]
  |  Branch (3537:23): [True: 3, False: 205k]
  ------------------
 3538|      3|		sign = -1;
 3539|      3|		p++;
 3540|      3|		char_cnt--;
 3541|       |
 3542|      3|		maxval = INT64_MIN;
 3543|      3|		limit = -(INT64_MIN / base);
 3544|      3|		last_digit_limit = -(INT64_MIN % base);
 3545|      3|	}
 3546|       |
 3547|   263k|	l = 0;
 3548|   263k|	if (char_cnt != 0) {
  ------------------
  |  Branch (3548:6): [True: 205k, False: 58.0k]
  ------------------
 3549|   205k|		digit = *p - '0';
 3550|   585k|		while (digit >= 0 && digit < base  && char_cnt != 0) {
  ------------------
  |  Branch (3550:10): [True: 469k, False: 116k]
  |  Branch (3550:24): [True: 393k, False: 75.1k]
  |  Branch (3550:41): [True: 379k, False: 14.1k]
  ------------------
 3551|   379k|			if (l>limit || (l == limit && digit >= last_digit_limit)) {
  ------------------
  |  Branch (3551:8): [True: 0, False: 379k]
  |  Branch (3551:20): [True: 0, False: 379k]
  |  Branch (3551:34): [True: 0, False: 0]
  ------------------
 3552|      0|				return maxval; /* Truncate on overflow. */
 3553|      0|			}
 3554|   379k|			l = (l * base) + digit;
 3555|   379k|			digit = *++p - '0';
 3556|   379k|			char_cnt--;
 3557|   379k|		}
 3558|   205k|	}
 3559|   263k|	return (sign < 0) ? -l : l;
  ------------------
  |  Branch (3559:9): [True: 3, False: 263k]
  ------------------
 3560|   263k|}
archive_read_support_format_tar.c:validate_number_field:
  371|  33.4k|{
  372|  33.4k|	unsigned char marker = (unsigned char)p_field[0];
  373|  33.4k|	if (marker == 128 || marker == 255 || marker == 0) {
  ------------------
  |  Branch (373:6): [True: 0, False: 33.4k]
  |  Branch (373:23): [True: 37, False: 33.4k]
  |  Branch (373:40): [True: 4.52k, False: 28.9k]
  ------------------
  374|       |		/* Base-256 marker, there's nothing we can check. */
  375|  4.55k|		return 1;
  376|  28.9k|	} else {
  377|       |		/* Must be octal */
  378|  28.9k|		size_t i = 0;
  379|       |		/* Skip any leading spaces */
  380|   160k|		while (i < i_size && p_field[i] == ' ') {
  ------------------
  |  Branch (380:10): [True: 151k, False: 8.98k]
  |  Branch (380:24): [True: 131k, False: 19.9k]
  ------------------
  381|   131k|			++i;
  382|   131k|		}
  383|       |		/* Skip octal digits. */
  384|   105k|		while (i < i_size && p_field[i] >= '0' && p_field[i] <= '7') {
  ------------------
  |  Branch (384:10): [True: 92.9k, False: 12.2k]
  |  Branch (384:24): [True: 78.4k, False: 14.5k]
  |  Branch (384:45): [True: 76.3k, False: 2.13k]
  ------------------
  385|  76.3k|			++i;
  386|  76.3k|		}
  387|       |		/* Any remaining characters must be space or NUL padding. */
  388|  67.9k|		while (i < i_size) {
  ------------------
  |  Branch (388:10): [True: 42.6k, False: 25.2k]
  ------------------
  389|  42.6k|			if (p_field[i] != ' ' && p_field[i] != 0) {
  ------------------
  |  Branch (389:8): [True: 24.4k, False: 18.1k]
  |  Branch (389:29): [True: 3.64k, False: 20.8k]
  ------------------
  390|  3.64k|				return 0;
  391|  3.64k|			}
  392|  39.0k|			++i;
  393|  39.0k|		}
  394|  25.2k|		return 1;
  395|  28.9k|	}
  396|  33.4k|}
archive_read_support_format_tar.c:archive_read_format_tar_options:
  468|  4.99k|{
  469|  4.99k|	struct tar *tar;
  470|  4.99k|	int ret = ARCHIVE_FAILED;
  ------------------
  |  |  237|  4.99k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  471|       |
  472|  4.99k|	tar = (struct tar *)(a->format->data);
  473|  4.99k|	if (strcmp(key, "compat-2x")  == 0) {
  ------------------
  |  Branch (473:6): [True: 0, False: 4.99k]
  ------------------
  474|       |		/* Handle UTF-8 filenames as libarchive 2.x */
  475|      0|		tar->compat_2x = (val != NULL && val[0] != 0);
  ------------------
  |  Branch (475:21): [True: 0, False: 0]
  |  Branch (475:36): [True: 0, False: 0]
  ------------------
  476|      0|		tar->init_default_conversion = tar->compat_2x;
  477|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  478|  4.99k|	} else if (strcmp(key, "hdrcharset")  == 0) {
  ------------------
  |  Branch (478:13): [True: 0, False: 4.99k]
  ------------------
  479|      0|		if (val == NULL || val[0] == 0)
  ------------------
  |  Branch (479:7): [True: 0, False: 0]
  |  Branch (479:22): [True: 0, False: 0]
  ------------------
  480|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  481|      0|			    "tar: hdrcharset option needs a character-set name");
  482|      0|		else {
  483|      0|			tar->opt_sconv =
  484|      0|			    archive_string_conversion_from_charset(
  485|      0|				&a->archive, val, 0);
  486|      0|			if (tar->opt_sconv != NULL)
  ------------------
  |  Branch (486:8): [True: 0, False: 0]
  ------------------
  487|      0|				ret = ARCHIVE_OK;
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  488|      0|			else
  489|      0|				ret = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  490|      0|		}
  491|      0|		return (ret);
  492|  4.99k|	} else if (strcmp(key, "mac-ext") == 0) {
  ------------------
  |  Branch (492:13): [True: 2.49k, False: 2.49k]
  ------------------
  493|  2.49k|		tar->process_mac_extensions = (val != NULL && val[0] != 0);
  ------------------
  |  Branch (493:34): [True: 2.49k, False: 0]
  |  Branch (493:49): [True: 2.49k, False: 0]
  ------------------
  494|  2.49k|		return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  495|  2.49k|	} else if (strcmp(key, "read_concatenated_archives") == 0) {
  ------------------
  |  Branch (495:13): [True: 2.49k, False: 0]
  ------------------
  496|  2.49k|		tar->read_concatenated_archives = (val != NULL && val[0] != 0);
  ------------------
  |  Branch (496:38): [True: 2.49k, False: 0]
  |  Branch (496:53): [True: 2.49k, False: 0]
  ------------------
  497|  2.49k|		return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  498|  2.49k|	}
  499|       |
  500|       |	/* Note: The "warn" return is just to inform the options
  501|       |	 * supervisor that we didn't handle it.  It will generate
  502|       |	 * a suitable error if no one used this option. */
  503|      0|	return (ARCHIVE_WARN);
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  504|  4.99k|}
archive_read_support_format_tar.c:archive_read_format_tar_read_header:
  540|   233k|{
  541|       |	/*
  542|       |	 * When converting tar archives to cpio archives, it is
  543|       |	 * essential that each distinct file have a distinct inode
  544|       |	 * number.  To simplify this, we keep a static count here to
  545|       |	 * assign fake dev/inode numbers to each tar entry.  Note that
  546|       |	 * pax format archives may overwrite this with something more
  547|       |	 * useful.
  548|       |	 *
  549|       |	 * Ideally, we would track every file read from the archive so
  550|       |	 * that we could assign the same dev/ino pair to hardlinks,
  551|       |	 * but the memory required to store a complete lookup table is
  552|       |	 * probably not worthwhile just to support the relatively
  553|       |	 * obscure tar->cpio conversion case.
  554|       |	 */
  555|       |	/* TODO: Move this into `struct tar` to avoid conflicts
  556|       |	 * when reading multiple archives */
  557|   233k|	static int default_inode;
  558|   233k|	static int default_dev;
  559|   233k|	struct tar *tar;
  560|   233k|	const char *p;
  561|   233k|	const wchar_t *wp;
  562|   233k|	int r;
  563|   233k|	size_t l;
  564|   233k|	int64_t unconsumed = 0;
  565|       |
  566|       |	/* Assign default device/inode values. */
  567|   233k|	archive_entry_set_dev(entry, 1 + default_dev); /* Don't use zero. */
  568|   233k|	archive_entry_set_ino(entry, ++default_inode); /* Don't use zero. */
  569|       |	/* Limit generated st_ino number to 16 bits. */
  570|   233k|	if (default_inode >= 0xffff) {
  ------------------
  |  Branch (570:6): [True: 3, False: 233k]
  ------------------
  571|      3|		++default_dev;
  572|      3|		default_inode = 0;
  573|      3|	}
  574|       |
  575|   233k|	tar = (struct tar *)(a->format->data);
  576|   233k|	tar->entry_offset = 0;
  577|   233k|	gnu_clear_sparse_list(tar);
  578|   233k|	tar->size_fields = 0; /* We don't have any size info yet */
  579|       |
  580|       |	/* Setup default string conversion. */
  581|   233k|	tar->sconv = tar->opt_sconv;
  582|   233k|	if (tar->sconv == NULL) {
  ------------------
  |  Branch (582:6): [True: 233k, False: 0]
  ------------------
  583|   233k|		if (!tar->init_default_conversion) {
  ------------------
  |  Branch (583:7): [True: 342, False: 233k]
  ------------------
  584|    342|			tar->sconv_default =
  585|    342|			    archive_string_default_conversion_for_read(&(a->archive));
  586|    342|			tar->init_default_conversion = 1;
  587|    342|		}
  588|   233k|		tar->sconv = tar->sconv_default;
  589|   233k|	}
  590|       |
  591|   233k|	r = tar_read_header(a, tar, entry, &unconsumed);
  592|       |
  593|   233k|	tar_flush_unconsumed(a, &unconsumed);
  594|       |
  595|       |	/*
  596|       |	 * "non-sparse" files are really just sparse files with
  597|       |	 * a single block.
  598|       |	 */
  599|   233k|	if (tar->sparse_list == NULL) {
  ------------------
  |  Branch (599:6): [True: 232k, False: 1.56k]
  ------------------
  600|   232k|		if (gnu_add_sparse_entry(a, tar, 0, tar->entry_bytes_remaining)
  ------------------
  |  Branch (600:7): [True: 0, False: 232k]
  ------------------
  601|   232k|		    != ARCHIVE_OK)
  ------------------
  |  |  233|   232k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  602|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  603|   232k|	} else {
  604|  1.56k|		struct sparse_block *sb;
  605|       |
  606|  40.7k|		for (sb = tar->sparse_list; sb != NULL; sb = sb->next) {
  ------------------
  |  Branch (606:31): [True: 39.1k, False: 1.56k]
  ------------------
  607|  39.1k|			if (!sb->hole)
  ------------------
  |  Branch (607:8): [True: 39.1k, False: 0]
  ------------------
  608|  39.1k|				archive_entry_sparse_add_entry(entry,
  609|  39.1k|				    sb->offset, sb->remaining);
  610|  39.1k|		}
  611|  1.56k|	}
  612|       |
  613|   233k|	if (r == ARCHIVE_OK && archive_entry_filetype(entry) == AE_IFREG) {
  ------------------
  |  |  233|   467k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
              	if (r == ARCHIVE_OK && archive_entry_filetype(entry) == AE_IFREG) {
  ------------------
  |  |  216|  21.0k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
  |  Branch (613:6): [True: 21.0k, False: 212k]
  |  Branch (613:25): [True: 18.8k, False: 2.24k]
  ------------------
  614|       |		/*
  615|       |		 * "Regular" entry with trailing '/' is really
  616|       |		 * directory: This is needed for certain old tar
  617|       |		 * variants and even for some broken newer ones.
  618|       |		 */
  619|  18.8k|		if ((wp = archive_entry_pathname_w(entry)) != NULL) {
  ------------------
  |  Branch (619:7): [True: 18.1k, False: 646]
  ------------------
  620|  18.1k|			l = wcslen(wp);
  621|  18.1k|			if (l > 0 && wp[l - 1] == L'/') {
  ------------------
  |  Branch (621:8): [True: 12.1k, False: 5.98k]
  |  Branch (621:17): [True: 4.98k, False: 7.19k]
  ------------------
  622|  4.98k|				archive_entry_set_filetype(entry, AE_IFDIR);
  ------------------
  |  |  221|  4.98k|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  623|  4.98k|				tar->entry_bytes_remaining = 0;
  624|  4.98k|				tar->entry_padding = 0;
  625|  4.98k|			}
  626|  18.1k|		} else if ((p = archive_entry_pathname(entry)) != NULL) {
  ------------------
  |  Branch (626:14): [True: 646, False: 0]
  ------------------
  627|    646|			l = strlen(p);
  628|    646|			if (l > 0 && p[l - 1] == '/') {
  ------------------
  |  Branch (628:8): [True: 646, False: 0]
  |  Branch (628:17): [True: 232, False: 414]
  ------------------
  629|    232|				archive_entry_set_filetype(entry, AE_IFDIR);
  ------------------
  |  |  221|    232|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  630|    232|				tar->entry_bytes_remaining = 0;
  631|    232|				tar->entry_padding = 0;
  632|    232|			}
  633|    646|		}
  634|  18.8k|	}
  635|   233k|	return (r);
  636|   233k|}
archive_read_support_format_tar.c:tar_read_header:
  750|   233k|{
  751|   233k|	ssize_t bytes;
  752|   233k|	int err = ARCHIVE_OK, err2;
  ------------------
  |  |  233|   233k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  753|   233k|	int eof_fatal = 0; /* EOF is okay at some points... */
  754|   233k|	const char *h;
  755|   233k|	const struct archive_entry_header_ustar *header;
  756|   233k|	const struct archive_entry_header_gnutar *gnuheader;
  757|       |
  758|       |	/* Bitmask of what header types we've seen. */
  759|   233k|	int32_t seen_headers = 0;
  760|   233k|	static const int32_t seen_A_header = 1;
  761|   233k|	static const int32_t seen_g_header = 2;
  762|   233k|	static const int32_t seen_K_header = 4;
  763|   233k|	static const int32_t seen_L_header = 8;
  764|   233k|	static const int32_t seen_V_header = 16;
  765|   233k|	static const int32_t seen_x_header = 32; /* Also X */
  766|   233k|	static const int32_t seen_mac_metadata = 512;
  767|       |
  768|   233k|	tar_reset_header_state(tar);
  769|       |
  770|       |	/* Ensure format is set. */
  771|   233k|	if (a->archive.archive_format_name == NULL) {
  ------------------
  |  Branch (771:6): [True: 342, False: 233k]
  ------------------
  772|    342|		a->archive.archive_format = ARCHIVE_FORMAT_TAR;
  ------------------
  |  |  367|    342|#define	ARCHIVE_FORMAT_TAR			0x30000
  ------------------
  773|    342|		a->archive.archive_format_name = "tar";
  774|    342|	}
  775|       |
  776|       |	/*
  777|       |	 * TODO: Write global/default pax options into
  778|       |	 * 'entry' struct here before overwriting with
  779|       |	 * file-specific options.
  780|       |	 */
  781|       |
  782|       |	/* Loop over all the headers needed for the next entry */
  783|   235k|	for (;;) {
  784|       |
  785|       |		/* Find the next valid header record. */
  786|   268k|		while (1) {
  ------------------
  |  Branch (786:10): [True: 268k, Folded]
  ------------------
  787|   268k|			if (tar_flush_unconsumed(a, unconsumed) != ARCHIVE_OK) {
  ------------------
  |  |  233|   268k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (787:8): [True: 78, False: 268k]
  ------------------
  788|     78|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     78|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  789|     78|			}
  790|       |
  791|       |			/* Read 512-byte header record */
  792|   268k|			h = __archive_read_ahead(a, 512, &bytes);
  793|   268k|			if (bytes == 0) { /* EOF at a block boundary. */
  ------------------
  |  Branch (793:8): [True: 16, False: 268k]
  ------------------
  794|     16|				if (eof_fatal) {
  ------------------
  |  Branch (794:9): [True: 8, False: 8]
  ------------------
  795|       |					/* We've read a special header already;
  796|       |					 * if there's no regular header, then this is
  797|       |					 * a premature EOF. */
  798|      8|					archive_set_error(&a->archive, EINVAL,
  799|      8|							  "Damaged tar archive (end-of-archive within a sequence of headers)");
  800|      8|					return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      8|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  801|      8|				} else {
  802|      8|					return (ARCHIVE_EOF);
  ------------------
  |  |  232|      8|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  803|      8|				}
  804|     16|			}
  805|   268k|			if (h == NULL) {  /* Short block at EOF; this is bad. */
  ------------------
  |  Branch (805:8): [True: 190, False: 268k]
  ------------------
  806|    190|				archive_set_error(&a->archive,
  807|    190|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    190|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  808|    190|				    "Truncated tar archive"
  809|    190|				    " detected while reading next header");
  810|    190|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    190|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  811|    190|			}
  812|   268k|			*unconsumed += 512;
  813|       |
  814|   268k|			if (h[0] == 0 && archive_block_is_null(h)) {
  ------------------
  |  Branch (814:8): [True: 50.5k, False: 217k]
  |  Branch (814:21): [True: 32.9k, False: 17.5k]
  ------------------
  815|       |				/* We found a NULL block which indicates end-of-archive */
  816|       |
  817|  32.9k|				if (tar->read_concatenated_archives) {
  ------------------
  |  Branch (817:9): [True: 32.9k, False: 0]
  ------------------
  818|       |					/* We're ignoring NULL blocks, so keep going. */
  819|  32.9k|					continue;
  820|  32.9k|				}
  821|       |
  822|       |				/* Try to consume a second all-null record, as well. */
  823|       |				/* If we can't, that's okay. */
  824|      0|				tar_flush_unconsumed(a, unconsumed);
  825|      0|				h = __archive_read_ahead(a, 512, NULL);
  826|      0|				if (h != NULL && h[0] == 0 && archive_block_is_null(h))
  ------------------
  |  Branch (826:9): [True: 0, False: 0]
  |  Branch (826:22): [True: 0, False: 0]
  |  Branch (826:35): [True: 0, False: 0]
  ------------------
  827|      0|						__archive_read_consume(a, 512);
  828|       |
  829|      0|				archive_clear_error(&a->archive);
  830|      0|				return (ARCHIVE_EOF);
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  831|  32.9k|			}
  832|       |
  833|       |			/* This is NOT a null block, so it must be a valid header. */
  834|   235k|			if (!checksum(a, h)) {
  ------------------
  |  Branch (834:8): [True: 212k, False: 23.2k]
  ------------------
  835|   212k|				if (tar_flush_unconsumed(a, unconsumed) != ARCHIVE_OK) {
  ------------------
  |  |  233|   212k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (835:9): [True: 0, False: 212k]
  ------------------
  836|      0|					return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  837|      0|				}
  838|   212k|				archive_set_error(&a->archive, EINVAL,
  839|   212k|						  "Damaged tar archive (bad header checksum)");
  840|       |				/* If we've read some critical information (pax headers, etc)
  841|       |				 * and _then_ see a bad header, we can't really recover. */
  842|   212k|				if (eof_fatal) {
  ------------------
  |  Branch (842:9): [True: 12, False: 212k]
  ------------------
  843|     12|					return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     12|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  844|   212k|				} else {
  845|   212k|					return (ARCHIVE_RETRY);
  ------------------
  |  |  234|   212k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  846|   212k|				}
  847|   212k|			}
  848|  23.2k|			break;
  849|   235k|		}
  850|       |
  851|       |		/* Determine the format variant. */
  852|  23.2k|		header = (const struct archive_entry_header_ustar *)h;
  853|  23.2k|		switch(header->typeflag[0]) {
  854|    122|		case 'A': /* Solaris tar ACL */
  ------------------
  |  Branch (854:3): [True: 122, False: 23.1k]
  ------------------
  855|    122|			if (seen_headers & seen_A_header) {
  ------------------
  |  Branch (855:8): [True: 0, False: 122]
  ------------------
  856|      0|				archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  857|      0|						  "Redundant 'A' header");
  858|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  859|      0|			}
  860|    122|			seen_headers |= seen_A_header;
  861|    122|			a->archive.archive_format = ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE;
  ------------------
  |  |  369|    122|#define	ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE	(ARCHIVE_FORMAT_TAR | 2)
  |  |  ------------------
  |  |  |  |  367|    122|#define	ARCHIVE_FORMAT_TAR			0x30000
  |  |  ------------------
  ------------------
  862|    122|			a->archive.archive_format_name = "Solaris tar";
  863|    122|			err2 = header_Solaris_ACL(a, tar, entry, h, unconsumed);
  864|    122|			break;
  865|  1.24k|		case 'g': /* POSIX-standard 'g' header. */
  ------------------
  |  Branch (865:3): [True: 1.24k, False: 22.0k]
  ------------------
  866|  1.24k|			if (seen_headers & seen_g_header) {
  ------------------
  |  Branch (866:8): [True: 0, False: 1.24k]
  ------------------
  867|      0|				archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  868|      0|						  "Redundant 'g' header");
  869|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  870|      0|			}
  871|  1.24k|			seen_headers |= seen_g_header;
  872|  1.24k|			a->archive.archive_format = ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE;
  ------------------
  |  |  369|  1.24k|#define	ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE	(ARCHIVE_FORMAT_TAR | 2)
  |  |  ------------------
  |  |  |  |  367|  1.24k|#define	ARCHIVE_FORMAT_TAR			0x30000
  |  |  ------------------
  ------------------
  873|  1.24k|			a->archive.archive_format_name = "POSIX pax interchange format";
  874|  1.24k|			err2 = header_pax_global(a, tar, entry, h, unconsumed);
  875|  1.24k|			break;
  876|    379|		case 'K': /* Long link name (GNU tar, others) */
  ------------------
  |  Branch (876:3): [True: 379, False: 22.9k]
  ------------------
  877|    379|			if (seen_headers & seen_K_header) {
  ------------------
  |  Branch (877:8): [True: 369, False: 10]
  ------------------
  878|    369|				archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|    369|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  879|    369|						  "Damaged archive: Redundant 'K' headers may cause linknames to be incorrect");
  880|    369|				err = err_combine(err, ARCHIVE_WARN);
  ------------------
  |  |  173|    369|#define	err_combine(a,b)	((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (173:27): [True: 0, False: 369]
  |  |  ------------------
  ------------------
  881|    369|			}
  882|    379|			seen_headers |= seen_K_header;
  883|    379|			a->archive.archive_format = ARCHIVE_FORMAT_TAR_GNUTAR;
  ------------------
  |  |  371|    379|#define	ARCHIVE_FORMAT_TAR_GNUTAR		(ARCHIVE_FORMAT_TAR | 4)
  |  |  ------------------
  |  |  |  |  367|    379|#define	ARCHIVE_FORMAT_TAR			0x30000
  |  |  ------------------
  ------------------
  884|    379|			a->archive.archive_format_name = "GNU tar format";
  885|    379|			err2 = header_gnu_longlink(a, tar, entry, h, unconsumed);
  886|    379|			break;
  887|    146|		case 'L': /* Long filename (GNU tar, others) */
  ------------------
  |  Branch (887:3): [True: 146, False: 23.1k]
  ------------------
  888|    146|			if (seen_headers & seen_L_header) {
  ------------------
  |  Branch (888:8): [True: 143, False: 3]
  ------------------
  889|    143|				archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|    143|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  890|    143|						  "Damaged archive: Redundant 'L' headers may cause filenames to be incorrect");
  891|    143|				err = err_combine(err, ARCHIVE_WARN);
  ------------------
  |  |  173|    143|#define	err_combine(a,b)	((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (173:27): [True: 0, False: 143]
  |  |  ------------------
  ------------------
  892|    143|			}
  893|    146|			seen_headers |= seen_L_header;
  894|    146|			a->archive.archive_format = ARCHIVE_FORMAT_TAR_GNUTAR;
  ------------------
  |  |  371|    146|#define	ARCHIVE_FORMAT_TAR_GNUTAR		(ARCHIVE_FORMAT_TAR | 4)
  |  |  ------------------
  |  |  |  |  367|    146|#define	ARCHIVE_FORMAT_TAR			0x30000
  |  |  ------------------
  ------------------
  895|    146|			a->archive.archive_format_name = "GNU tar format";
  896|    146|			err2 = header_gnu_longname(a, tar, entry, h, unconsumed);
  897|    146|			break;
  898|      0|		case 'V': /* GNU volume header */
  ------------------
  |  Branch (898:3): [True: 0, False: 23.2k]
  ------------------
  899|      0|			if (seen_headers & seen_V_header) {
  ------------------
  |  Branch (899:8): [True: 0, False: 0]
  ------------------
  900|      0|				archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  901|      0|						  "Redundant 'V' header");
  902|      0|				err = err_combine(err, ARCHIVE_WARN);
  ------------------
  |  |  173|      0|#define	err_combine(a,b)	((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (173:27): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  903|      0|			}
  904|      0|			seen_headers |= seen_V_header;
  905|      0|			a->archive.archive_format = ARCHIVE_FORMAT_TAR_GNUTAR;
  ------------------
  |  |  371|      0|#define	ARCHIVE_FORMAT_TAR_GNUTAR		(ARCHIVE_FORMAT_TAR | 4)
  |  |  ------------------
  |  |  |  |  367|      0|#define	ARCHIVE_FORMAT_TAR			0x30000
  |  |  ------------------
  ------------------
  906|      0|			a->archive.archive_format_name = "GNU tar format";
  907|      0|			err2 = header_volume(a, tar, entry, h, unconsumed);
  908|      0|			break;
  909|      0|		case 'X': /* Used by SUN tar; same as 'x'. */
  ------------------
  |  Branch (909:3): [True: 0, False: 23.2k]
  ------------------
  910|      0|			if (seen_headers & seen_x_header) {
  ------------------
  |  Branch (910:8): [True: 0, False: 0]
  ------------------
  911|      0|				archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  912|      0|						  "Redundant 'X'/'x' header");
  913|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  914|      0|			}
  915|      0|			seen_headers |= seen_x_header;
  916|      0|			a->archive.archive_format = ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE;
  ------------------
  |  |  369|      0|#define	ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE	(ARCHIVE_FORMAT_TAR | 2)
  |  |  ------------------
  |  |  |  |  367|      0|#define	ARCHIVE_FORMAT_TAR			0x30000
  |  |  ------------------
  ------------------
  917|      0|			a->archive.archive_format_name =
  918|      0|				"POSIX pax interchange format (Sun variant)";
  919|      0|			err2 = header_pax_extension(a, tar, entry, h, unconsumed);
  920|      0|			break;
  921|    146|		case 'x': /* POSIX-standard 'x' header. */
  ------------------
  |  Branch (921:3): [True: 146, False: 23.1k]
  ------------------
  922|    146|			if (seen_headers & seen_x_header) {
  ------------------
  |  Branch (922:8): [True: 0, False: 146]
  ------------------
  923|      0|				archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  924|      0|						  "Redundant 'x' header");
  925|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  926|      0|			}
  927|    146|			seen_headers |= seen_x_header;
  928|    146|			a->archive.archive_format = ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE;
  ------------------
  |  |  369|    146|#define	ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE	(ARCHIVE_FORMAT_TAR | 2)
  |  |  ------------------
  |  |  |  |  367|    146|#define	ARCHIVE_FORMAT_TAR			0x30000
  |  |  ------------------
  ------------------
  929|    146|			a->archive.archive_format_name = "POSIX pax interchange format";
  930|    146|			err2 = header_pax_extension(a, tar, entry, h, unconsumed);
  931|    146|			break;
  932|  21.2k|		default: /* Regular header: Legacy tar, GNU tar, or ustar */
  ------------------
  |  Branch (932:3): [True: 21.2k, False: 2.04k]
  ------------------
  933|  21.2k|			gnuheader = (const struct archive_entry_header_gnutar *)h;
  934|  21.2k|			if (memcmp(gnuheader->magic, "ustar  \0", 8) == 0) {
  ------------------
  |  Branch (934:8): [True: 1.84k, False: 19.3k]
  ------------------
  935|  1.84k|				a->archive.archive_format = ARCHIVE_FORMAT_TAR_GNUTAR;
  ------------------
  |  |  371|  1.84k|#define	ARCHIVE_FORMAT_TAR_GNUTAR		(ARCHIVE_FORMAT_TAR | 4)
  |  |  ------------------
  |  |  |  |  367|  1.84k|#define	ARCHIVE_FORMAT_TAR			0x30000
  |  |  ------------------
  ------------------
  936|  1.84k|				a->archive.archive_format_name = "GNU tar format";
  937|  1.84k|				err2 = header_gnutar(a, tar, entry, h, unconsumed);
  938|  19.3k|			} else if (memcmp(header->magic, "ustar", 5) == 0) {
  ------------------
  |  Branch (938:15): [True: 6.16k, False: 13.2k]
  ------------------
  939|  6.16k|				if (a->archive.archive_format != ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE) {
  ------------------
  |  |  369|  6.16k|#define	ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE	(ARCHIVE_FORMAT_TAR | 2)
  |  |  ------------------
  |  |  |  |  367|  6.16k|#define	ARCHIVE_FORMAT_TAR			0x30000
  |  |  ------------------
  ------------------
  |  Branch (939:9): [True: 5.92k, False: 241]
  ------------------
  940|  5.92k|					a->archive.archive_format = ARCHIVE_FORMAT_TAR_USTAR;
  ------------------
  |  |  368|  5.92k|#define	ARCHIVE_FORMAT_TAR_USTAR		(ARCHIVE_FORMAT_TAR | 1)
  |  |  ------------------
  |  |  |  |  367|  5.92k|#define	ARCHIVE_FORMAT_TAR			0x30000
  |  |  ------------------
  ------------------
  941|  5.92k|					a->archive.archive_format_name = "POSIX ustar format";
  942|  5.92k|				}
  943|  6.16k|				err2 = header_ustar(a, tar, entry, h);
  944|  13.2k|			} else {
  945|  13.2k|				a->archive.archive_format = ARCHIVE_FORMAT_TAR;
  ------------------
  |  |  367|  13.2k|#define	ARCHIVE_FORMAT_TAR			0x30000
  ------------------
  946|  13.2k|				a->archive.archive_format_name = "tar (non-POSIX)";
  947|  13.2k|				err2 = header_old_tar(a, tar, entry, h);
  948|  13.2k|			}
  949|  21.2k|			err = err_combine(err, err2);
  ------------------
  |  |  173|  21.2k|#define	err_combine(a,b)	((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (173:27): [True: 162, False: 21.0k]
  |  |  ------------------
  ------------------
  950|       |			/* We return warnings or success as-is.  Anything else is fatal. */
  951|  21.2k|			if (err < ARCHIVE_WARN) {
  ------------------
  |  |  235|  21.2k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (951:8): [True: 19, False: 21.2k]
  ------------------
  952|     19|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     19|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  953|     19|			}
  954|       |			/* Filename of the form `._filename` is an AppleDouble
  955|       |			 * extension entry.  The body is the macOS metadata blob;
  956|       |			 * this is followed by another entry with the actual
  957|       |			 * regular file data.
  958|       |			 * This design has two drawbacks:
  959|       |			 * = it's brittle; you might just have a file with such a name
  960|       |			 * = it duplicates any long pathname extensions
  961|       |			 *
  962|       |			 * TODO: This probably shouldn't be here at all.  Consider
  963|       |			 * just returning the contents as a regular entry here and
  964|       |			 * then dealing with it when we write data to disk.
  965|       |			 */
  966|  21.2k|			if (tar->process_mac_extensions
  ------------------
  |  Branch (966:8): [True: 21.2k, False: 0]
  ------------------
  967|  21.2k|			    && ((seen_headers & seen_mac_metadata) == 0)
  ------------------
  |  Branch (967:11): [True: 21.2k, False: 0]
  ------------------
  968|  21.2k|			    && is_mac_metadata_entry(entry)) {
  ------------------
  |  Branch (968:11): [True: 0, False: 21.2k]
  ------------------
  969|      0|				err2 = read_mac_metadata_blob(a, entry, unconsumed);
  970|      0|				if (err2 < ARCHIVE_WARN) {
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (970:9): [True: 0, False: 0]
  ------------------
  971|      0|					return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  972|      0|				}
  973|      0|				err = err_combine(err, err2);
  ------------------
  |  |  173|      0|#define	err_combine(a,b)	((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (173:27): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  974|       |				/* Note: Other headers can appear again. */
  975|      0|				seen_headers = seen_mac_metadata;
  976|      0|				tar_reset_header_state(tar);
  977|      0|				break;
  978|      0|			}
  979|       |
  980|       |			/* Reconcile GNU sparse attributes */
  981|  21.2k|			if (tar->sparse_gnu_attributes_seen) {
  ------------------
  |  Branch (981:8): [True: 25, False: 21.1k]
  ------------------
  982|       |				/* Only 'S' (GNU sparse) and ustar '0' regular files can be sparse */
  983|     25|				if (tar->filetype != 'S' && tar->filetype != '0') {
  ------------------
  |  Branch (983:9): [True: 25, False: 0]
  |  Branch (983:33): [True: 14, False: 11]
  ------------------
  984|     14|					archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     14|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  985|     14|							  "Non-regular file cannot be sparse");
  986|     14|					return (ARCHIVE_WARN);
  ------------------
  |  |  235|     14|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  987|     14|				} else if (tar->sparse_gnu_major == 0 &&
  ------------------
  |  Branch (987:16): [True: 8, False: 3]
  ------------------
  988|      8|				    tar->sparse_gnu_minor == 0) {
  ------------------
  |  Branch (988:9): [True: 5, False: 3]
  ------------------
  989|       |					/* Sparse map already parsed from 'x' header */
  990|      6|				} else if (tar->sparse_gnu_major == 0 &&
  ------------------
  |  Branch (990:16): [True: 3, False: 3]
  ------------------
  991|      3|				    tar->sparse_gnu_minor == 1) {
  ------------------
  |  Branch (991:9): [True: 0, False: 3]
  ------------------
  992|       |					/* Sparse map already parsed from 'x' header */
  993|      6|				} else if (tar->sparse_gnu_major == 1 &&
  ------------------
  |  Branch (993:16): [True: 3, False: 3]
  ------------------
  994|      3|				    tar->sparse_gnu_minor == 0) {
  ------------------
  |  Branch (994:9): [True: 3, False: 0]
  ------------------
  995|       |					/* Sparse map is prepended to file contents */
  996|      3|					ssize_t bytes_read;
  997|      3|					bytes_read = gnu_sparse_10_read(a, tar, unconsumed);
  998|      3|					if (bytes_read < 0)
  ------------------
  |  Branch (998:10): [True: 3, False: 0]
  ------------------
  999|      3|						return ((int)bytes_read);
 1000|      0|					tar->entry_bytes_remaining -= bytes_read;
 1001|      3|				} else {
 1002|      3|					archive_set_error(&a->archive,
 1003|      3|							  ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      3|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1004|      3|							  "Unrecognized GNU sparse file format");
 1005|      3|					return (ARCHIVE_WARN);
  ------------------
  |  |  235|      3|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1006|      3|				}
 1007|     25|			}
 1008|  21.2k|			return (err);
 1009|  23.2k|		}
 1010|       |
 1011|       |		/* We're between headers ... */
 1012|  2.04k|		err = err_combine(err, err2);
  ------------------
  |  |  173|  2.04k|#define	err_combine(a,b)	((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (173:27): [True: 512, False: 1.52k]
  |  |  ------------------
  ------------------
 1013|  2.04k|		if (err == ARCHIVE_FATAL)
  ------------------
  |  |  239|  2.04k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (1013:7): [True: 9, False: 2.03k]
  ------------------
 1014|      9|			return (err);
 1015|       |
 1016|       |		/* The GNU volume header and the pax `g` global header
 1017|       |		 * are both allowed to be the only header in an
 1018|       |		 * archive.  If we've seen any other header, a
 1019|       |		 * following EOF is fatal. */
 1020|  2.03k|		if ((seen_headers & ~seen_V_header & ~seen_g_header) != 0) {
  ------------------
  |  Branch (1020:7): [True: 784, False: 1.24k]
  ------------------
 1021|    784|			eof_fatal = 1;
 1022|    784|		}
 1023|  2.03k|	}
 1024|   233k|}
archive_read_support_format_tar.c:tar_reset_header_state:
  733|   233k|{
  734|   233k|	tar->pax_hdrcharset_utf8 = 1;
  735|   233k|	tar->sparse_gnu_attributes_seen = 0;
  736|   233k|	archive_string_empty(&(tar->entry_gname));
  ------------------
  |  |  181|   233k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  737|   233k|	archive_string_empty(&(tar->entry_pathname));
  ------------------
  |  |  181|   233k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  738|   233k|	archive_string_empty(&(tar->entry_pathname_override));
  ------------------
  |  |  181|   233k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  739|   233k|	archive_string_empty(&(tar->entry_uname));
  ------------------
  |  |  181|   233k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  740|   233k|	archive_string_empty(&tar->entry_linkpath);
  ------------------
  |  |  181|   233k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  741|   233k|}
archive_read_support_format_tar.c:header_Solaris_ACL:
 1106|    122|{
 1107|    122|	const struct archive_entry_header_ustar *header;
 1108|    122|	struct archive_string	 acl_text;
 1109|    122|	size_t size;
 1110|    122|	int err, acl_type;
 1111|    122|	uint64_t type;
 1112|    122|	char *acl, *p;
 1113|       |
 1114|    122|	header = (const struct archive_entry_header_ustar *)h;
 1115|    122|	size = (size_t)tar_atol(header->size, sizeof(header->size));
 1116|    122|	archive_string_init(&acl_text);
  ------------------
  |  |   71|    122|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 122]
  |  |  ------------------
  ------------------
 1117|    122|	err = read_body_to_string(a, tar, &acl_text, h, unconsumed);
 1118|    122|	if (err != ARCHIVE_OK) {
  ------------------
  |  |  233|    122|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1118:6): [True: 6, False: 116]
  ------------------
 1119|      6|		archive_string_free(&acl_text);
 1120|      6|		return (err);
 1121|      6|	}
 1122|       |
 1123|       |	/* TODO: Examine the first characters to see if this
 1124|       |	 * is an AIX ACL descriptor.  We'll likely never support
 1125|       |	 * them, but it would be polite to recognize and warn when
 1126|       |	 * we do see them. */
 1127|       |
 1128|       |	/* Leading octal number indicates ACL type and number of entries. */
 1129|    116|	p = acl = acl_text.s;
 1130|    116|	type = 0;
 1131|    928|	while (*p != '\0' && p < acl + size) {
  ------------------
  |  Branch (1131:9): [True: 812, False: 116]
  |  Branch (1131:23): [True: 812, False: 0]
  ------------------
 1132|    812|		if (*p < '0' || *p > '7') {
  ------------------
  |  Branch (1132:7): [True: 0, False: 812]
  |  Branch (1132:19): [True: 0, False: 812]
  ------------------
 1133|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1134|      0|			    "Malformed Solaris ACL attribute (invalid digit)");
 1135|      0|			archive_string_free(&acl_text);
 1136|      0|			return(ARCHIVE_WARN);
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1137|      0|		}
 1138|    812|		type <<= 3;
 1139|    812|		type += *p - '0';
 1140|    812|		if (type > 077777777) {
  ------------------
  |  Branch (1140:7): [True: 0, False: 812]
  ------------------
 1141|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1142|      0|			    "Malformed Solaris ACL attribute (count too large)");
 1143|      0|			archive_string_free(&acl_text);
 1144|      0|			return (ARCHIVE_WARN);
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1145|      0|		}
 1146|    812|		p++;
 1147|    812|	}
 1148|    116|	switch (type & ~0777777) {
 1149|     89|	case 01000000:
  ------------------
  |  Branch (1149:2): [True: 89, False: 27]
  ------------------
 1150|       |		/* POSIX.1e ACL */
 1151|     89|		acl_type = ARCHIVE_ENTRY_ACL_TYPE_ACCESS;
  ------------------
  |  |  534|     89|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  ------------------
 1152|     89|		break;
 1153|     27|	case 03000000:
  ------------------
  |  Branch (1153:2): [True: 27, False: 89]
  ------------------
 1154|       |		/* NFSv4 ACL */
 1155|     27|		acl_type = ARCHIVE_ENTRY_ACL_TYPE_NFS4;
  ------------------
  |  |  542|     27|#define	ARCHIVE_ENTRY_ACL_TYPE_NFS4	(ARCHIVE_ENTRY_ACL_TYPE_ALLOW \
  |  |  ------------------
  |  |  |  |  536|     27|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  |  |  ------------------
  |  |  543|     27|	    | ARCHIVE_ENTRY_ACL_TYPE_DENY \
  |  |  ------------------
  |  |  |  |  537|     27|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  |  |  ------------------
  |  |  544|     27|	    | ARCHIVE_ENTRY_ACL_TYPE_AUDIT \
  |  |  ------------------
  |  |  |  |  538|     27|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  |  |  ------------------
  |  |  545|     27|	    | ARCHIVE_ENTRY_ACL_TYPE_ALARM)
  |  |  ------------------
  |  |  |  |  539|     27|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  |  |  ------------------
  ------------------
 1156|     27|		break;
 1157|      0|	default:
  ------------------
  |  Branch (1157:2): [True: 0, False: 116]
  ------------------
 1158|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1159|      0|		    "Malformed Solaris ACL attribute (unsupported type %llu)",
 1160|      0|		    (unsigned long long)type);
 1161|      0|		archive_string_free(&acl_text);
 1162|      0|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1163|    116|	}
 1164|    116|	p++;
 1165|       |
 1166|    116|	if (p >= acl + size) {
  ------------------
  |  Branch (1166:6): [True: 0, False: 116]
  ------------------
 1167|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1168|      0|		    "Malformed Solaris ACL attribute (body overflow)");
 1169|      0|		archive_string_free(&acl_text);
 1170|      0|		return(ARCHIVE_WARN);
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1171|      0|	}
 1172|       |
 1173|       |	/* ACL text is null-terminated; find the end. */
 1174|    116|	size -= (p - acl);
 1175|    116|	acl = p;
 1176|       |
 1177|   251k|	while (*p != '\0' && p < acl + size)
  ------------------
  |  Branch (1177:9): [True: 251k, False: 116]
  |  Branch (1177:23): [True: 251k, False: 0]
  ------------------
 1178|   251k|		p++;
 1179|       |
 1180|    116|	if (tar->sconv_acl == NULL) {
  ------------------
  |  Branch (1180:6): [True: 83, False: 33]
  ------------------
 1181|     83|		tar->sconv_acl = archive_string_conversion_from_charset(
 1182|     83|		    &(a->archive), "UTF-8", 1);
 1183|     83|		if (tar->sconv_acl == NULL) {
  ------------------
  |  Branch (1183:7): [True: 0, False: 83]
  ------------------
 1184|      0|			archive_string_free(&acl_text);
 1185|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1186|      0|		}
 1187|     83|	}
 1188|    116|	archive_strncpy(&(tar->localname), acl, p - acl);
  ------------------
  |  |  173|    116|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 1189|    116|	err = archive_acl_from_text_l(archive_entry_acl(entry),
 1190|    116|	    tar->localname.s, acl_type, tar->sconv_acl);
 1191|       |	/* Workaround: Force perm_is_set() to be correct */
 1192|       |	/* If this bit were stored in the ACL, this wouldn't be needed */
 1193|    116|	archive_entry_set_perm(entry, archive_entry_perm(entry));
 1194|    116|	if (err != ARCHIVE_OK) {
  ------------------
  |  |  233|    116|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1194:6): [True: 116, False: 0]
  ------------------
 1195|    116|		if (errno == ENOMEM) {
  ------------------
  |  Branch (1195:7): [True: 0, False: 116]
  ------------------
 1196|      0|			archive_set_error(&a->archive, ENOMEM,
 1197|      0|			    "Can't allocate memory for ACL");
 1198|      0|		} else
 1199|    116|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|    116|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1200|    116|			    "Malformed Solaris ACL attribute (unparsable)");
 1201|    116|	}
 1202|    116|	archive_string_free(&acl_text);
 1203|    116|	return (err);
 1204|    116|}
archive_read_support_format_tar.c:read_body_to_string:
 1328|    647|{
 1329|    647|	int64_t size;
 1330|    647|	const struct archive_entry_header_ustar *header;
 1331|    647|	int r;
 1332|       |
 1333|    647|	(void)tar; /* UNUSED */
 1334|    647|	header = (const struct archive_entry_header_ustar *)h;
 1335|    647|	size  = tar_atol(header->size, sizeof(header->size));
 1336|    647|	if (size < 0 || size > entry_limit) {
  ------------------
  |  Branch (1336:6): [True: 1, False: 646]
  |  Branch (1336:18): [True: 0, False: 646]
  ------------------
 1337|      1|		archive_set_error(&a->archive, EINVAL,
 1338|      1|		    "Special header has invalid size: %lld",
 1339|      1|		    (long long)size);
 1340|      1|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1341|      1|	}
 1342|    646|	if (size > (int64_t)pathname_limit) {
  ------------------
  |  Branch (1342:6): [True: 4, False: 642]
  ------------------
 1343|      4|		archive_string_empty(as);
  ------------------
  |  |  181|      4|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 1344|      4|		int64_t to_consume = ((size + 511) & ~511);
 1345|      4|		if (to_consume != __archive_read_consume(a, to_consume)) {
  ------------------
  |  Branch (1345:7): [True: 1, False: 3]
  ------------------
 1346|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1347|      1|		}
 1348|      3|		archive_set_error(&a->archive, EINVAL,
 1349|      3|		    "Special header too large: %lld > 1MiB",
 1350|      3|		    (long long)size);
 1351|      3|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|      3|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1352|      4|	}
 1353|    642|	r = read_bytes_to_string(a, as, size, unconsumed);
 1354|    642|	*unconsumed += 0x1ff & (-size);
 1355|    642|	return(r);
 1356|    646|}
archive_read_support_format_tar.c:read_bytes_to_string:
 1292|    808|		     int64_t *unconsumed) {
 1293|    808|	const void *src;
 1294|       |
 1295|       |	/* Fail if we can't make our buffer big enough. */
 1296|    808|	if (archive_string_ensure(as, size + 1) == NULL) {
  ------------------
  |  Branch (1296:6): [True: 0, False: 808]
  ------------------
 1297|      0|		archive_set_error(&a->archive, ENOMEM,
 1298|      0|		    "No memory");
 1299|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1300|      0|	}
 1301|       |
 1302|    808|	if (tar_flush_unconsumed(a, unconsumed) != ARCHIVE_OK) {
  ------------------
  |  |  233|    808|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1302:6): [True: 0, False: 808]
  ------------------
 1303|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1304|      0|	}
 1305|       |
 1306|       |	/* Read the body into the string. */
 1307|    808|	src = __archive_read_ahead(a, size, NULL);
 1308|    808|	if (src == NULL) {
  ------------------
  |  Branch (1308:6): [True: 1, False: 807]
  ------------------
 1309|      1|		archive_set_error(&a->archive, EINVAL,
 1310|      1|		    "Truncated archive"
 1311|      1|		    " detected while reading metadata");
 1312|      1|		*unconsumed = 0;
 1313|      1|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1314|      1|	}
 1315|    807|	memcpy(as->s, src, size);
 1316|    807|	as->s[size] = '\0';
 1317|    807|	as->length = size;
 1318|    807|	*unconsumed += size;
 1319|    807|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    807|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1320|    808|}
archive_read_support_format_tar.c:header_pax_global:
 1786|  1.24k|{
 1787|  1.24k|	const struct archive_entry_header_ustar *header;
 1788|  1.24k|	int64_t size, to_consume;
 1789|       |
 1790|  1.24k|	(void)a; /* UNUSED */
 1791|  1.24k|	(void)tar; /* UNUSED */
 1792|  1.24k|	(void)entry; /* UNUSED */
 1793|       |
 1794|  1.24k|	header = (const struct archive_entry_header_ustar *)h;
 1795|  1.24k|	size = tar_atol(header->size, sizeof(header->size));
 1796|  1.24k|	if (size < 0 || size > entry_limit) {
  ------------------
  |  Branch (1796:6): [True: 0, False: 1.24k]
  |  Branch (1796:18): [True: 0, False: 1.24k]
  ------------------
 1797|      0|		archive_set_error(&a->archive, EINVAL,
 1798|      0|		    "Special header has invalid size: %lld",
 1799|      0|		    (long long)size);
 1800|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1801|      0|	}
 1802|  1.24k|	to_consume = ((size + 511) & ~511);
 1803|  1.24k|	*unconsumed += to_consume;
 1804|  1.24k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.24k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1805|  1.24k|}
archive_read_support_format_tar.c:header_gnu_longlink:
 1212|    379|{
 1213|    379|	int err;
 1214|       |
 1215|    379|	struct archive_string linkpath;
 1216|    379|	archive_string_init(&linkpath);
  ------------------
  |  |   71|    379|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 379]
  |  |  ------------------
  ------------------
 1217|    379|	err = read_body_to_string(a, tar, &linkpath, h, unconsumed);
 1218|    379|	if (err == ARCHIVE_OK) {
  ------------------
  |  |  233|    379|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1218:6): [True: 379, False: 0]
  ------------------
 1219|    379|		archive_entry_set_link(entry, linkpath.s);
 1220|    379|	}
 1221|    379|	archive_string_free(&linkpath);
 1222|    379|	return (err);
 1223|    379|}
archive_read_support_format_tar.c:header_gnu_longname:
 1246|    146|{
 1247|    146|	int err;
 1248|    146|	struct archive_string longname;
 1249|       |
 1250|    146|	archive_string_init(&longname);
  ------------------
  |  |   71|    146|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 146]
  |  |  ------------------
  ------------------
 1251|    146|	err = read_body_to_string(a, tar, &longname, h, unconsumed);
 1252|    146|	if (err == ARCHIVE_OK) {
  ------------------
  |  |  233|    146|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1252:6): [True: 146, False: 0]
  ------------------
 1253|    146|		if (archive_entry_copy_pathname_l(entry, longname.s,
  ------------------
  |  |   80|    146|#define archive_entry_copy_pathname_l	_archive_entry_copy_pathname_l
  ------------------
  |  Branch (1253:7): [True: 0, False: 146]
  ------------------
 1254|    146|		    archive_strlen(&longname), tar->sconv) != 0)
  ------------------
  |  |  178|    146|#define	archive_strlen(a) ((a)->length)
  ------------------
 1255|      0|			err = set_conversion_failed_error(a, tar->sconv, "Pathname");
 1256|    146|	}
 1257|    146|	archive_string_free(&longname);
 1258|    146|	return (err);
 1259|    146|}
archive_read_support_format_tar.c:header_pax_extension:
 1896|    146|{
 1897|       |	/* Sanity checks: The largest `x` body I've ever heard of was
 1898|       |	 * a little over 4MB.  So I doubt there has ever been a
 1899|       |	 * well-formed archive with an `x` body over 1GiB.  Similarly,
 1900|       |	 * it seems plausible that no single attribute has ever been
 1901|       |	 * larger than 100MB.  So if we see a larger value here, it's
 1902|       |	 * almost certainly a sign of a corrupted/malicious archive. */
 1903|       |
 1904|       |	/* Maximum sane size for extension body: 1 GiB */
 1905|       |	/* This cannot be raised to larger than 8GiB without
 1906|       |	 * exceeding the maximum size for a standard ustar
 1907|       |	 * entry. */
 1908|    146|	const int64_t ext_size_limit = 1024 * 1024 * (int64_t)1024;
 1909|       |	/* Maximum size for a single line/attr: 100 million characters */
 1910|       |	/* This cannot be raised to more than 2GiB without exceeding
 1911|       |	 * a `size_t` on 32-bit platforms. */
 1912|    146|	const size_t max_parsed_line_length = 99999999ULL;
 1913|       |	/* Largest attribute prolog:  size + name. */
 1914|    146|	const size_t max_size_name = 512;
 1915|       |
 1916|       |	/* Size and padding of the full extension body */
 1917|    146|	int64_t ext_size, ext_padding;
 1918|    146|	size_t line_length, value_length, name_length;
 1919|    146|	ssize_t to_read, did_read;
 1920|    146|	const struct archive_entry_header_ustar *header;
 1921|    146|	const char *p, *attr_start, *name_start;
 1922|    146|	struct archive_string_conv *sconv;
 1923|    146|	struct archive_string *pas = NULL;
 1924|    146|	struct archive_string attr_name;
 1925|    146|	int err = ARCHIVE_OK, r;
  ------------------
  |  |  233|    146|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1926|       |
 1927|    146|	header = (const struct archive_entry_header_ustar *)h;
 1928|    146|	ext_size  = tar_atol(header->size, sizeof(header->size));
 1929|    146|	if (ext_size > entry_limit) {
  ------------------
  |  Branch (1929:6): [True: 0, False: 146]
  ------------------
 1930|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1931|      0|	}
 1932|    146|	if (ext_size < 0) {
  ------------------
  |  Branch (1932:6): [True: 0, False: 146]
  ------------------
 1933|      0|	  archive_set_error(&a->archive, EINVAL,
 1934|      0|			    "pax extension header has invalid size: %lld",
 1935|      0|			    (long long)ext_size);
 1936|      0|	  return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1937|      0|	}
 1938|       |
 1939|    146|	ext_padding = 0x1ff & (-ext_size);
 1940|    146|	if (ext_size > ext_size_limit) {
  ------------------
  |  Branch (1940:6): [True: 0, False: 146]
  ------------------
 1941|       |		/* Consume the pax extension body and return an error */
 1942|      0|		if (ext_size + ext_padding != __archive_read_consume(a, ext_size + ext_padding)) {
  ------------------
  |  Branch (1942:7): [True: 0, False: 0]
  ------------------
 1943|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1944|      0|		}
 1945|      0|		archive_set_error(&a->archive, EINVAL,
 1946|      0|		    "Ignoring oversized pax extensions: %lld > %lld",
 1947|      0|		    (long long)ext_size, (long long)ext_size_limit);
 1948|      0|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1949|      0|	}
 1950|    146|	if (tar_flush_unconsumed(a, unconsumed) != ARCHIVE_OK) {
  ------------------
  |  |  233|    146|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1950:6): [True: 0, False: 146]
  ------------------
 1951|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1952|      0|	}
 1953|       |
 1954|       |	/* Parse the size/name of each pax attribute in the body */
 1955|    146|	archive_string_init(&attr_name);
  ------------------
  |  |   71|    146|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 146]
  |  |  ------------------
  ------------------
 1956|  1.12k|	while (ext_size > 0) {
  ------------------
  |  Branch (1956:9): [True: 1.12k, False: 0]
  ------------------
 1957|       |		/* Read enough bytes to parse the size/name of the next attribute */
 1958|  1.12k|		to_read = max_size_name;
 1959|  1.12k|		if (to_read > ext_size) {
  ------------------
  |  Branch (1959:7): [True: 198, False: 929]
  ------------------
 1960|    198|			to_read = ext_size;
 1961|    198|		}
 1962|  1.12k|		p = __archive_read_ahead(a, to_read, &did_read);
 1963|  1.12k|		if (p == NULL) { /* EOF */
  ------------------
  |  Branch (1963:7): [True: 1, False: 1.12k]
  ------------------
 1964|      1|			archive_set_error(&a->archive, EINVAL,
 1965|      1|					  "Truncated tar archive"
 1966|      1|					  " detected while reading pax attribute name");
 1967|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1968|      1|		}
 1969|  1.12k|		if (did_read > ext_size) {
  ------------------
  |  Branch (1969:7): [True: 255, False: 871]
  ------------------
 1970|    255|			did_read = ext_size;
 1971|    255|		}
 1972|       |
 1973|       |		/* Parse size of attribute */
 1974|  1.12k|		line_length = 0;
 1975|  1.12k|		attr_start = p;
 1976|  3.78k|		while (1) {
  ------------------
  |  Branch (1976:10): [True: 3.78k, Folded]
  ------------------
 1977|  3.78k|			if (p >= attr_start + did_read) {
  ------------------
  |  Branch (1977:8): [True: 0, False: 3.78k]
  ------------------
 1978|      0|				archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1979|      0|						  "Ignoring malformed pax attributes: overlarge attribute size field");
 1980|      0|				*unconsumed += ext_size + ext_padding;
 1981|      0|				return (ARCHIVE_WARN);
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1982|      0|			}
 1983|  3.78k|			if (*p == ' ') {
  ------------------
  |  Branch (1983:8): [True: 1.03k, False: 2.75k]
  ------------------
 1984|  1.03k|				p++;
 1985|  1.03k|				break;
 1986|  1.03k|			}
 1987|  2.75k|			if (*p < '0' || *p > '9') {
  ------------------
  |  Branch (1987:8): [True: 95, False: 2.65k]
  |  Branch (1987:20): [True: 0, False: 2.65k]
  ------------------
 1988|     95|				archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     95|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1989|     95|						  "Ignoring malformed pax attributes: malformed attribute size field");
 1990|     95|				*unconsumed += ext_size + ext_padding;
 1991|     95|				return (ARCHIVE_WARN);
  ------------------
  |  |  235|     95|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1992|     95|			}
 1993|  2.65k|			line_length *= 10;
 1994|  2.65k|			line_length += *p - '0';
 1995|  2.65k|			if (line_length > max_parsed_line_length) {
  ------------------
  |  Branch (1995:8): [True: 0, False: 2.65k]
  ------------------
 1996|      0|				archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1997|      0|						  "Ignoring malformed pax attribute: size > %lld",
 1998|      0|						  (long long)max_parsed_line_length);
 1999|      0|				*unconsumed += ext_size + ext_padding;
 2000|      0|				return (ARCHIVE_WARN);
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2001|      0|			}
 2002|  2.65k|			p++;
 2003|  2.65k|		}
 2004|       |
 2005|  1.03k|		if ((int64_t)line_length > ext_size) {
  ------------------
  |  Branch (2005:7): [True: 0, False: 1.03k]
  ------------------
 2006|      0|				archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2007|      0|						  "Ignoring malformed pax attribute:  %lld > %lld",
 2008|      0|						  (long long)line_length, (long long)ext_size);
 2009|      0|				*unconsumed += ext_size + ext_padding;
 2010|      0|				return (ARCHIVE_WARN);
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2011|      0|		}
 2012|       |
 2013|       |		/* Parse name of attribute */
 2014|  1.03k|		if (p >= attr_start + did_read
  ------------------
  |  Branch (2014:7): [True: 0, False: 1.03k]
  ------------------
 2015|  1.03k|		    || p >= attr_start + line_length
  ------------------
  |  Branch (2015:10): [True: 0, False: 1.03k]
  ------------------
 2016|  1.03k|		    || *p == '=') {
  ------------------
  |  Branch (2016:10): [True: 0, False: 1.03k]
  ------------------
 2017|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2018|      0|					  "Ignoring malformed pax attributes: empty name found");
 2019|      0|			*unconsumed += ext_size + ext_padding;
 2020|      0|			return (ARCHIVE_WARN);
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2021|      0|		}
 2022|  1.03k|		name_start = p;
 2023|  36.5k|		while (1) {
  ------------------
  |  Branch (2023:10): [True: 36.5k, Folded]
  ------------------
 2024|  36.5k|			if (p >= attr_start + did_read || p >= attr_start + line_length) {
  ------------------
  |  Branch (2024:8): [True: 0, False: 36.5k]
  |  Branch (2024:38): [True: 4, False: 36.5k]
  ------------------
 2025|      4|				archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      4|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2026|      4|						  "Ignoring malformed pax attributes: overlarge attribute name");
 2027|      4|				*unconsumed += ext_size + ext_padding;
 2028|      4|				return (ARCHIVE_WARN);
  ------------------
  |  |  235|      4|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2029|      4|			}
 2030|  36.5k|			if (*p == '=') {
  ------------------
  |  Branch (2030:8): [True: 1.02k, False: 35.5k]
  ------------------
 2031|  1.02k|				break;
 2032|  1.02k|			}
 2033|  35.5k|			p++;
 2034|  35.5k|		}
 2035|  1.02k|		name_length = p - name_start;
 2036|  1.02k|		p++; // Skip '='
 2037|       |
 2038|       |		// Save the name before we consume it
 2039|  1.02k|		archive_strncpy(&attr_name, name_start, name_length);
  ------------------
  |  |  173|  1.02k|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 2040|       |
 2041|  1.02k|		ext_size -= p - attr_start;
 2042|  1.02k|		value_length = line_length - (p - attr_start);
 2043|       |
 2044|       |		/* Consume size, name, and `=` */
 2045|  1.02k|		*unconsumed += p - attr_start;
 2046|  1.02k|		if (tar_flush_unconsumed(a, unconsumed) != ARCHIVE_OK) {
  ------------------
  |  |  233|  1.02k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2046:7): [True: 0, False: 1.02k]
  ------------------
 2047|      0|			archive_string_free(&attr_name);
 2048|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2049|      0|		}
 2050|       |
 2051|  1.02k|		if (value_length == 0) {
  ------------------
  |  Branch (2051:7): [True: 1, False: 1.02k]
  ------------------
 2052|      1|			archive_set_error(&a->archive, EINVAL,
 2053|      1|					  "Malformed pax attributes");
 2054|      1|			*unconsumed += ext_size + ext_padding;
 2055|      1|			archive_string_free(&attr_name);
 2056|      1|			return (ARCHIVE_WARN);
  ------------------
  |  |  235|      1|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2057|      1|		}
 2058|       |
 2059|       |		/* pax_attribute will consume value_length - 1 */
 2060|  1.02k|		r = pax_attribute(a, tar, entry, attr_name.s, archive_strlen(&attr_name), value_length - 1, unconsumed);
  ------------------
  |  |  178|  1.02k|#define	archive_strlen(a) ((a)->length)
  ------------------
 2061|  1.02k|		ext_size -= value_length - 1;
 2062|       |
 2063|       |		// Release the allocated attr_name (either here or before every return in this function)
 2064|  1.02k|		archive_string_free(&attr_name);
 2065|       |
 2066|  1.02k|		if (r < ARCHIVE_WARN) {
  ------------------
  |  |  235|  1.02k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (2066:7): [True: 2, False: 1.02k]
  ------------------
 2067|      2|			*unconsumed += ext_size + ext_padding;
 2068|      2|			return (r);
 2069|      2|		}
 2070|  1.02k|		err = err_combine(err, r);
  ------------------
  |  |  173|  1.02k|#define	err_combine(a,b)	((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (173:27): [True: 746, False: 278]
  |  |  ------------------
  ------------------
 2071|       |
 2072|       |		/* Consume the `\n` that follows the pax attribute value. */
 2073|  1.02k|		if (tar_flush_unconsumed(a, unconsumed) != ARCHIVE_OK) {
  ------------------
  |  |  233|  1.02k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2073:7): [True: 0, False: 1.02k]
  ------------------
 2074|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2075|      0|		}
 2076|  1.02k|		p = __archive_read_ahead(a, 1, &did_read);
 2077|  1.02k|		if (p == NULL) {
  ------------------
  |  Branch (2077:7): [True: 3, False: 1.02k]
  ------------------
 2078|      3|			archive_set_error(&a->archive, EINVAL,
 2079|      3|					  "Truncated tar archive"
 2080|      3|					  " detected while completing pax attribute");
 2081|      3|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      3|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2082|      3|		}
 2083|  1.02k|		if (p[0] != '\n') {
  ------------------
  |  Branch (2083:7): [True: 40, False: 981]
  ------------------
 2084|     40|			archive_set_error(&a->archive, EINVAL,
 2085|     40|					  "Malformed pax attributes");
 2086|     40|			*unconsumed += ext_size + ext_padding;
 2087|     40|			return (ARCHIVE_WARN);
  ------------------
  |  |  235|     40|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2088|     40|		}
 2089|    981|		ext_size -= 1;
 2090|    981|		*unconsumed += 1;
 2091|    981|		if (tar_flush_unconsumed(a, unconsumed) != ARCHIVE_OK) {
  ------------------
  |  |  233|    981|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2091:7): [True: 0, False: 981]
  ------------------
 2092|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2093|      0|		}
 2094|    981|	}
 2095|      0|	*unconsumed += ext_size + ext_padding;
 2096|       |
 2097|       |	/*
 2098|       |	 * Some PAX values -- pathname, linkpath, uname, gname --
 2099|       |	 * can't be copied into the entry until we know the character
 2100|       |	 * set to use:
 2101|       |	 */
 2102|      0|	if (!tar->pax_hdrcharset_utf8)
  ------------------
  |  Branch (2102:6): [True: 0, False: 0]
  ------------------
 2103|       |		/* PAX specified "BINARY", so use the default charset */
 2104|      0|		sconv = tar->opt_sconv;
 2105|      0|	else {
 2106|       |		/* PAX default UTF-8 */
 2107|      0|		sconv = archive_string_conversion_from_charset(
 2108|      0|		    &(a->archive), "UTF-8", 1);
 2109|      0|		if (sconv == NULL)
  ------------------
  |  Branch (2109:7): [True: 0, False: 0]
  ------------------
 2110|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2111|      0|		if (tar->compat_2x)
  ------------------
  |  Branch (2111:7): [True: 0, False: 0]
  ------------------
 2112|      0|			archive_string_conversion_set_opt(sconv,
 2113|      0|			    SCONV_SET_OPT_UTF8_LIBARCHIVE2X);
  ------------------
  |  |  113|      0|#define SCONV_SET_OPT_UTF8_LIBARCHIVE2X	1
  ------------------
 2114|      0|	}
 2115|       |
 2116|       |	/* Pathname */
 2117|      0|	pas = NULL;
 2118|      0|	if (archive_strlen(&(tar->entry_pathname_override)) > 0) {
  ------------------
  |  |  178|      0|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (2118:6): [True: 0, False: 0]
  ------------------
 2119|       |		/* Prefer GNU.sparse.name attribute if present */
 2120|       |		/* GNU sparse files store a fake name under the standard
 2121|       |		 * "pathname" key. */
 2122|      0|		pas = &(tar->entry_pathname_override);
 2123|      0|	} else if (archive_strlen(&(tar->entry_pathname)) > 0) {
  ------------------
  |  |  178|      0|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (2123:13): [True: 0, False: 0]
  ------------------
 2124|       |		/* Use standard "pathname" PAX extension */
 2125|      0|		pas = &(tar->entry_pathname);
 2126|      0|	}
 2127|      0|	if (pas != NULL) {
  ------------------
  |  Branch (2127:6): [True: 0, False: 0]
  ------------------
 2128|      0|		if (archive_entry_copy_pathname_l(entry, pas->s,
  ------------------
  |  |   80|      0|#define archive_entry_copy_pathname_l	_archive_entry_copy_pathname_l
  ------------------
  |  Branch (2128:7): [True: 0, False: 0]
  ------------------
 2129|      0|		    archive_strlen(pas), sconv) != 0) {
  ------------------
  |  |  178|      0|#define	archive_strlen(a) ((a)->length)
  ------------------
 2130|      0|			err = set_conversion_failed_error(a, sconv, "Pathname");
 2131|      0|			if (err == ARCHIVE_FATAL)
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (2131:8): [True: 0, False: 0]
  ------------------
 2132|      0|				return (err);
 2133|       |			/* Use raw name without conversion */
 2134|      0|			archive_entry_copy_pathname(entry, pas->s);
 2135|      0|		}
 2136|      0|	}
 2137|       |	/* Uname */
 2138|      0|	if (archive_strlen(&(tar->entry_uname)) > 0) {
  ------------------
  |  |  178|      0|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (2138:6): [True: 0, False: 0]
  ------------------
 2139|      0|		if (archive_entry_copy_uname_l(entry, tar->entry_uname.s,
  ------------------
  |  |   86|      0|#define archive_entry_copy_uname_l	_archive_entry_copy_uname_l
  ------------------
  |  Branch (2139:7): [True: 0, False: 0]
  ------------------
 2140|      0|		    archive_strlen(&(tar->entry_uname)), sconv) != 0) {
  ------------------
  |  |  178|      0|#define	archive_strlen(a) ((a)->length)
  ------------------
 2141|      0|			err = set_conversion_failed_error(a, sconv, "Uname");
 2142|      0|			if (err == ARCHIVE_FATAL)
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (2142:8): [True: 0, False: 0]
  ------------------
 2143|      0|				return (err);
 2144|       |			/* Use raw name without conversion */
 2145|      0|			archive_entry_copy_uname(entry, tar->entry_uname.s);
 2146|      0|		}
 2147|      0|	}
 2148|       |	/* Gname */
 2149|      0|	if (archive_strlen(&(tar->entry_gname)) > 0) {
  ------------------
  |  |  178|      0|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (2149:6): [True: 0, False: 0]
  ------------------
 2150|      0|		if (archive_entry_copy_gname_l(entry, tar->entry_gname.s,
  ------------------
  |  |   71|      0|#define archive_entry_copy_gname_l	_archive_entry_copy_gname_l
  ------------------
  |  Branch (2150:7): [True: 0, False: 0]
  ------------------
 2151|      0|		    archive_strlen(&(tar->entry_gname)), sconv) != 0) {
  ------------------
  |  |  178|      0|#define	archive_strlen(a) ((a)->length)
  ------------------
 2152|      0|			err = set_conversion_failed_error(a, sconv, "Gname");
 2153|      0|			if (err == ARCHIVE_FATAL)
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (2153:8): [True: 0, False: 0]
  ------------------
 2154|      0|				return (err);
 2155|       |			/* Use raw name without conversion */
 2156|      0|			archive_entry_copy_gname(entry, tar->entry_gname.s);
 2157|      0|		}
 2158|      0|	}
 2159|       |	/* Linkpath */
 2160|      0|	if (archive_strlen(&(tar->entry_linkpath)) > 0) {
  ------------------
  |  |  178|      0|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (2160:6): [True: 0, False: 0]
  ------------------
 2161|      0|		if (archive_entry_copy_link_l(entry, tar->entry_linkpath.s,
  ------------------
  |  |   77|      0|#define archive_entry_copy_link_l	_archive_entry_copy_link_l
  ------------------
  |  Branch (2161:7): [True: 0, False: 0]
  ------------------
 2162|      0|		    archive_strlen(&(tar->entry_linkpath)), sconv) != 0) {
  ------------------
  |  |  178|      0|#define	archive_strlen(a) ((a)->length)
  ------------------
 2163|      0|			err = set_conversion_failed_error(a, sconv, "Linkpath");
 2164|      0|			if (err == ARCHIVE_FATAL)
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (2164:8): [True: 0, False: 0]
  ------------------
 2165|      0|				return (err);
 2166|       |			/* Use raw name without conversion */
 2167|      0|			archive_entry_copy_link(entry, tar->entry_linkpath.s);
 2168|      0|		}
 2169|      0|	}
 2170|       |
 2171|       |	/* Extension may have given us a corrected `entry_bytes_remaining` for
 2172|       |	 * the main entry; update the padding appropriately. */
 2173|      0|	tar->entry_padding = 0x1ff & (-tar->entry_bytes_remaining);
 2174|      0|	return (err);
 2175|      0|}
archive_read_support_format_tar.c:pax_attribute:
 2388|  1.02k|{
 2389|  1.02k|	int64_t t;
 2390|  1.02k|	long n;
 2391|  1.02k|	const char *p;
 2392|  1.02k|	ssize_t bytes_read;
 2393|  1.02k|	int err = ARCHIVE_OK;
  ------------------
  |  |  233|  1.02k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2394|       |
 2395|  1.02k|	switch (key[0]) {
  ------------------
  |  Branch (2395:10): [True: 1.00k, False: 25]
  ------------------
 2396|     28|	case 'G':
  ------------------
  |  Branch (2396:2): [True: 28, False: 998]
  ------------------
 2397|       |		/* GNU.* extensions */
 2398|     28|		if (key_length > 4 && memcmp(key, "GNU.", 4) == 0) {
  ------------------
  |  Branch (2398:7): [True: 28, False: 0]
  |  Branch (2398:25): [True: 26, False: 2]
  ------------------
 2399|     26|			key += 4;
 2400|     26|			key_length -= 4;
 2401|       |
 2402|       |			/* GNU.sparse marks the existence of GNU sparse information */
 2403|     26|			if (key_length == 6 && memcmp(key, "sparse", 6) == 0) {
  ------------------
  |  Branch (2403:8): [True: 0, False: 26]
  |  Branch (2403:27): [True: 0, False: 0]
  ------------------
 2404|      0|				tar->sparse_gnu_attributes_seen = 1;
 2405|      0|			}
 2406|       |
 2407|       |			/* GNU.sparse.* extensions */
 2408|     26|			else if (key_length > 7 && memcmp(key, "sparse.", 7) == 0) {
  ------------------
  |  Branch (2408:13): [True: 26, False: 0]
  |  Branch (2408:31): [True: 26, False: 0]
  ------------------
 2409|     26|				tar->sparse_gnu_attributes_seen = 1;
 2410|     26|				key += 7;
 2411|     26|				key_length -= 7;
 2412|       |
 2413|       |				/* GNU "0.0" sparse pax format. */
 2414|     26|				if (key_length == 9 && memcmp(key, "numblocks", 9) == 0) {
  ------------------
  |  Branch (2414:9): [True: 0, False: 26]
  |  Branch (2414:28): [True: 0, False: 0]
  ------------------
 2415|       |					/* GNU.sparse.numblocks */
 2416|      0|					tar->sparse_offset = -1;
 2417|      0|					tar->sparse_numbytes = -1;
 2418|      0|					tar->sparse_gnu_major = 0;
 2419|      0|					tar->sparse_gnu_minor = 0;
 2420|      0|				}
 2421|     26|				else if (key_length == 6 && memcmp(key, "offset", 6) == 0) {
  ------------------
  |  Branch (2421:14): [True: 0, False: 26]
  |  Branch (2421:33): [True: 0, False: 0]
  ------------------
 2422|       |					/* GNU.sparse.offset */
 2423|      0|					if ((err = pax_attribute_read_number(a, value_length, &t)) == ARCHIVE_OK) {
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2423:10): [True: 0, False: 0]
  ------------------
 2424|      0|						tar->sparse_offset = t;
 2425|      0|						if (tar->sparse_numbytes != -1) {
  ------------------
  |  Branch (2425:11): [True: 0, False: 0]
  ------------------
 2426|      0|							if (gnu_add_sparse_entry(a, tar,
  ------------------
  |  Branch (2426:12): [True: 0, False: 0]
  ------------------
 2427|      0|									 tar->sparse_offset, tar->sparse_numbytes)
 2428|      0|							    != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2429|      0|								return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2430|      0|							tar->sparse_offset = -1;
 2431|      0|							tar->sparse_numbytes = -1;
 2432|      0|						}
 2433|      0|					}
 2434|      0|					return (err);
 2435|      0|				}
 2436|     26|				else if (key_length == 8 && memcmp(key, "numbytes", 8) == 0) {
  ------------------
  |  Branch (2436:14): [True: 0, False: 26]
  |  Branch (2436:33): [True: 0, False: 0]
  ------------------
 2437|       |					/* GNU.sparse.numbytes */
 2438|      0|					if ((err = pax_attribute_read_number(a, value_length, &t)) == ARCHIVE_OK) {
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2438:10): [True: 0, False: 0]
  ------------------
 2439|      0|						tar->sparse_numbytes = t;
 2440|      0|						if (tar->sparse_offset != -1) {
  ------------------
  |  Branch (2440:11): [True: 0, False: 0]
  ------------------
 2441|      0|							if (gnu_add_sparse_entry(a, tar,
  ------------------
  |  Branch (2441:12): [True: 0, False: 0]
  ------------------
 2442|      0|									 tar->sparse_offset, tar->sparse_numbytes)
 2443|      0|							    != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2444|      0|								return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2445|      0|							tar->sparse_offset = -1;
 2446|      0|							tar->sparse_numbytes = -1;
 2447|      0|						}
 2448|      0|					}
 2449|      0|					return (err);
 2450|      0|				}
 2451|     26|				else if (key_length == 4 && memcmp(key, "size", 4) == 0) {
  ------------------
  |  Branch (2451:14): [True: 0, False: 26]
  |  Branch (2451:33): [True: 0, False: 0]
  ------------------
 2452|       |					/* GNU.sparse.size */
 2453|       |					/* This is either the size of stored entry OR the size of data on disk,
 2454|       |					 * depending on which GNU sparse format version is in use.
 2455|       |					 * Since pax attributes can be in any order, we may not actually
 2456|       |					 * know at this point how to interpret this. */
 2457|      0|					if ((err = pax_attribute_read_number(a, value_length, &t)) == ARCHIVE_OK) {
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2457:10): [True: 0, False: 0]
  ------------------
 2458|      0|						tar->GNU_sparse_size = t;
 2459|      0|						tar->size_fields |= TAR_SIZE_GNU_SPARSE_SIZE;
  ------------------
  |  |  161|      0|#define TAR_SIZE_GNU_SPARSE_SIZE 4
  ------------------
 2460|      0|					}
 2461|      0|					return (err);
 2462|      0|				}
 2463|       |
 2464|       |				/* GNU "0.1" sparse pax format. */
 2465|     26|				else if (key_length == 3 && memcmp(key, "map", 3) == 0) {
  ------------------
  |  Branch (2465:14): [True: 0, False: 26]
  |  Branch (2465:33): [True: 0, False: 0]
  ------------------
 2466|       |					/* GNU.sparse.map */
 2467|      0|					tar->sparse_gnu_major = 0;
 2468|      0|					tar->sparse_gnu_minor = 1;
 2469|      0|					if (value_length > sparse_map_limit) {
  ------------------
  |  Branch (2469:10): [True: 0, False: 0]
  ------------------
 2470|      0|						archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2471|      0|								  "Unreasonably large sparse map: %llu > %llu",
 2472|      0|								  (unsigned long long)value_length,
 2473|      0|								  (unsigned long long)sparse_map_limit);
 2474|      0|						err = ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2475|      0|					} else {
 2476|      0|						p = __archive_read_ahead(a, value_length, &bytes_read);
 2477|      0|						if (p == NULL) {
  ------------------
  |  Branch (2477:11): [True: 0, False: 0]
  ------------------
 2478|      0|							archive_set_error(&a->archive, EINVAL,
 2479|      0|									  "Truncated archive"
 2480|      0|									  " detected while reading GNU sparse data");
 2481|      0|							return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2482|      0|						}
 2483|      0|						if (gnu_sparse_01_parse(a, tar, p, value_length) != ARCHIVE_OK) {
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2483:11): [True: 0, False: 0]
  ------------------
 2484|      0|							err = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2485|      0|						}
 2486|      0|					}
 2487|      0|					__archive_read_consume(a, value_length);
 2488|      0|					return (err);
 2489|      0|				}
 2490|       |
 2491|       |				/* GNU "1.0" sparse pax format */
 2492|     26|				else if (key_length == 5 && memcmp(key, "major", 5) == 0) {
  ------------------
  |  Branch (2492:14): [True: 26, False: 0]
  |  Branch (2492:33): [True: 11, False: 15]
  ------------------
 2493|       |					/* GNU.sparse.major */
 2494|     11|					if ((err = pax_attribute_read_number(a, value_length, &t)) == ARCHIVE_OK
  ------------------
  |  |  233|     22|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2494:10): [True: 11, False: 0]
  ------------------
 2495|     11|					    && t >= 0
  ------------------
  |  Branch (2495:13): [True: 11, False: 0]
  ------------------
 2496|     11|					    && t <= 10) {
  ------------------
  |  Branch (2496:13): [True: 11, False: 0]
  ------------------
 2497|     11|						tar->sparse_gnu_major = (int)t;
 2498|     11|					}
 2499|     11|					return (err);
 2500|     11|				}
 2501|     15|				else if (key_length == 5 && memcmp(key, "minor", 5) == 0) {
  ------------------
  |  Branch (2501:14): [True: 15, False: 0]
  |  Branch (2501:33): [True: 10, False: 5]
  ------------------
 2502|       |					/* GNU.sparse.minor */
 2503|     10|					if ((err = pax_attribute_read_number(a, value_length, &t)) == ARCHIVE_OK
  ------------------
  |  |  233|     20|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2503:10): [True: 10, False: 0]
  ------------------
 2504|     10|					    && t >= 0
  ------------------
  |  Branch (2504:13): [True: 10, False: 0]
  ------------------
 2505|     10|					    && t <= 10) {
  ------------------
  |  Branch (2505:13): [True: 10, False: 0]
  ------------------
 2506|     10|						tar->sparse_gnu_minor = (int)t;
 2507|     10|					}
 2508|     10|					return (err);
 2509|     10|				}
 2510|      5|				else if (key_length == 4 && memcmp(key, "name", 4) == 0) {
  ------------------
  |  Branch (2510:14): [True: 0, False: 5]
  |  Branch (2510:33): [True: 0, False: 0]
  ------------------
 2511|       |					/* GNU.sparse.name */
 2512|       |					/*
 2513|       |					 * The real filename; when storing sparse
 2514|       |					 * files, GNU tar puts a synthesized name into
 2515|       |					 * the regular 'path' attribute in an attempt
 2516|       |					 * to limit confusion. ;-)
 2517|       |					 */
 2518|      0|					if (value_length > pathname_limit) {
  ------------------
  |  Branch (2518:10): [True: 0, False: 0]
  ------------------
 2519|      0|						*unconsumed += value_length;
 2520|      0|						err = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2521|      0|					} else {
 2522|      0|						err = read_bytes_to_string(a, &(tar->entry_pathname_override),
 2523|      0|									   value_length, unconsumed);
 2524|      0|					}
 2525|      0|					return (err);
 2526|      0|				}
 2527|      5|				else if (key_length == 8 && memcmp(key, "realsize", 8) == 0) {
  ------------------
  |  Branch (2527:14): [True: 0, False: 5]
  |  Branch (2527:33): [True: 0, False: 0]
  ------------------
 2528|       |					/* GNU.sparse.realsize = size of file on disk */
 2529|      0|					if ((err = pax_attribute_read_number(a, value_length, &t)) == ARCHIVE_OK) {
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2529:10): [True: 0, False: 0]
  ------------------
 2530|      0|						tar->GNU_sparse_realsize = t;
 2531|      0|						tar->size_fields |= TAR_SIZE_GNU_SPARSE_REALSIZE;
  ------------------
  |  |  160|      0|#define TAR_SIZE_GNU_SPARSE_REALSIZE 2
  ------------------
 2532|      0|					}
 2533|      0|					return (err);
 2534|      0|				}
 2535|     26|			}
 2536|     26|		}
 2537|      7|		break;
 2538|     50|	case 'L':
  ------------------
  |  Branch (2538:2): [True: 50, False: 976]
  ------------------
 2539|       |		/* LIBARCHIVE extensions */
 2540|     50|		if (key_length > 11 && memcmp(key, "LIBARCHIVE.", 11) == 0) {
  ------------------
  |  Branch (2540:7): [True: 50, False: 0]
  |  Branch (2540:26): [True: 48, False: 2]
  ------------------
 2541|     48|			key_length -= 11;
 2542|     48|			key += 11;
 2543|       |
 2544|       |			/* TODO: Handle arbitrary extended attributes... */
 2545|       |			/*
 2546|       |			  if (strcmp(key, "LIBARCHIVE.xxxxxxx") == 0)
 2547|       |				  archive_entry_set_xxxxxx(entry, value);
 2548|       |			*/
 2549|     48|			if (key_length == 12 && memcmp(key, "creationtime", 12) == 0) {
  ------------------
  |  Branch (2549:8): [True: 1, False: 47]
  |  Branch (2549:28): [True: 1, False: 0]
  ------------------
 2550|       |				/* LIBARCHIVE.creationtime */
 2551|      1|				__LA_TIME_T sec = 0;
  ------------------
  |  |  107|      1|#define __LA_TIME_T time_t
  ------------------
 2552|      1|				if ((err = pax_attribute_read_time(a, value_length, &sec, &n, unconsumed)) == ARCHIVE_OK) {
  ------------------
  |  |  233|      1|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2552:9): [True: 0, False: 1]
  ------------------
 2553|      0|					archive_entry_set_birthtime(entry, sec, n);
 2554|      1|				} else {
 2555|      1|					archive_set_error(&a->archive,
 2556|      1|							  ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2557|      1|							  "Ignoring malformed pax creationtime");
 2558|      1|				}
 2559|      1|				return (err);
 2560|      1|			}
 2561|     47|			else if (key_length == 11 && memcmp(key, "symlinktype", 11) == 0) {
  ------------------
  |  Branch (2561:13): [True: 14, False: 33]
  |  Branch (2561:33): [True: 0, False: 14]
  ------------------
 2562|       |				/* LIBARCHIVE.symlinktype */
 2563|      0|				if (value_length < 16) {
  ------------------
  |  Branch (2563:9): [True: 0, False: 0]
  ------------------
 2564|      0|					p = __archive_read_ahead(a, value_length, &bytes_read);
 2565|      0|					if (p == NULL) {
  ------------------
  |  Branch (2565:10): [True: 0, False: 0]
  ------------------
 2566|      0|						archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2567|      0|								  "Truncated tar archive "
 2568|      0|								  "detected while reading `symlinktype` attribute");
 2569|      0|						return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2570|      0|					}
 2571|      0|					if (value_length == 4 && memcmp(p, "file", 4) == 0) {
  ------------------
  |  Branch (2571:10): [True: 0, False: 0]
  |  Branch (2571:31): [True: 0, False: 0]
  ------------------
 2572|      0|						archive_entry_set_symlink_type(entry,
 2573|      0|									       AE_SYMLINK_TYPE_FILE);
  ------------------
  |  |  228|      0|#define AE_SYMLINK_TYPE_FILE		1
  ------------------
 2574|      0|					} else if (value_length == 3 && memcmp(p, "dir", 3) == 0) {
  ------------------
  |  Branch (2574:17): [True: 0, False: 0]
  |  Branch (2574:38): [True: 0, False: 0]
  ------------------
 2575|      0|							archive_entry_set_symlink_type(entry,
 2576|      0|										       AE_SYMLINK_TYPE_DIRECTORY);
  ------------------
  |  |  229|      0|#define AE_SYMLINK_TYPE_DIRECTORY	2
  ------------------
 2577|      0|					} else {
 2578|      0|						archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2579|      0|								  "Unrecognized symlink type");
 2580|      0|						err = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2581|      0|					}
 2582|      0|				} else {
 2583|      0|					archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2584|      0|							  "symlink type is very long"
 2585|      0|							  "(longest recognized value is 4 bytes, this is %llu)",
 2586|      0|							  (unsigned long long)value_length);
 2587|      0|					err = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2588|      0|				}
 2589|      0|				__archive_read_consume(a, value_length);
 2590|      0|				return (err);
 2591|      0|			}
 2592|     47|			else if (key_length > 6 && memcmp(key, "xattr.", 6) == 0) {
  ------------------
  |  Branch (2592:13): [True: 41, False: 6]
  |  Branch (2592:31): [True: 37, False: 4]
  ------------------
 2593|     37|				key_length -= 6;
 2594|     37|				key += 6;
 2595|     37|				if (value_length > xattr_limit) {
  ------------------
  |  Branch (2595:9): [True: 0, False: 37]
  ------------------
 2596|      0|					err = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2597|     37|				} else {
 2598|     37|					p = __archive_read_ahead(a, value_length, &bytes_read);
 2599|     37|					if (p == NULL) {
  ------------------
  |  Branch (2599:10): [True: 1, False: 36]
  ------------------
 2600|      1|						archive_set_error(&a->archive, EINVAL,
 2601|      1|								  "Truncated archive"
 2602|      1|								  " detected while reading xattr information");
 2603|      1|						return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2604|      1|					}
 2605|     36|					if (pax_attribute_LIBARCHIVE_xattr(entry, key, key_length, p, value_length)) {
  ------------------
  |  Branch (2605:10): [True: 0, False: 36]
  ------------------
 2606|       |						/* TODO: Unable to parse xattr */
 2607|      0|						err = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2608|      0|					}
 2609|     36|				}
 2610|     36|				__archive_read_consume(a, value_length);
 2611|     36|				return (err);
 2612|     37|			}
 2613|     48|		}
 2614|     12|		break;
 2615|     12|	case 'R':
  ------------------
  |  Branch (2615:2): [True: 0, False: 1.02k]
  ------------------
 2616|       |		/* GNU tar uses RHT.security header to store SELinux xattrs
 2617|       |		 * SCHILY.xattr.security.selinux == RHT.security.selinux */
 2618|      0|		if (key_length == 20 && memcmp(key, "RHT.security.selinux", 20) == 0) {
  ------------------
  |  Branch (2618:7): [True: 0, False: 0]
  |  Branch (2618:27): [True: 0, False: 0]
  ------------------
 2619|      0|			if (value_length > xattr_limit) {
  ------------------
  |  Branch (2619:8): [True: 0, False: 0]
  ------------------
 2620|      0|				archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2621|      0|						  "Ignoring unreasonably large security.selinux attribute:"
 2622|      0|						  " %llu > %llu",
 2623|      0|						  (unsigned long long)value_length,
 2624|      0|						  (unsigned long long)xattr_limit);
 2625|       |				/* TODO: Should this be FAILED instead? */
 2626|      0|				err = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2627|      0|			} else {
 2628|      0|				p = __archive_read_ahead(a, value_length, &bytes_read);
 2629|      0|				if (p == NULL) {
  ------------------
  |  Branch (2629:9): [True: 0, False: 0]
  ------------------
 2630|      0|					archive_set_error(&a->archive, EINVAL,
 2631|      0|							  "Truncated archive"
 2632|      0|							  " detected while reading selinux data");
 2633|      0|					return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2634|      0|				}
 2635|      0|				if (pax_attribute_RHT_security_selinux(entry, p, value_length)) {
  ------------------
  |  Branch (2635:9): [True: 0, False: 0]
  ------------------
 2636|       |					/* TODO: Unable to parse xattr */
 2637|      0|					err = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2638|      0|				}
 2639|      0|			}
 2640|      0|			__archive_read_consume(a, value_length);
 2641|      0|			return (err);
 2642|      0|		}
 2643|      0|		break;
 2644|    109|	case 'S':
  ------------------
  |  Branch (2644:2): [True: 109, False: 917]
  ------------------
 2645|       |		/* SCHILY.* extensions used by "star" archiver */
 2646|    109|		if (key_length > 7 && memcmp(key, "SCHILY.", 7) == 0) {
  ------------------
  |  Branch (2646:7): [True: 108, False: 1]
  |  Branch (2646:25): [True: 76, False: 32]
  ------------------
 2647|     76|			key_length -= 7;
 2648|     76|			key += 7;
 2649|       |
 2650|     76|			if (key_length == 10 && memcmp(key, "acl.access", 10) == 0) {
  ------------------
  |  Branch (2650:8): [True: 0, False: 76]
  |  Branch (2650:28): [True: 0, False: 0]
  ------------------
 2651|      0|				err = pax_attribute_SCHILY_acl(a, tar, entry, value_length,
 2652|      0|						      ARCHIVE_ENTRY_ACL_TYPE_ACCESS);
  ------------------
  |  |  534|      0|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  ------------------
 2653|       |				// TODO: Mark mode as set
 2654|      0|				return (err);
 2655|      0|			}
 2656|     76|			else if (key_length == 11 && memcmp(key, "acl.default", 11) == 0) {
  ------------------
  |  Branch (2656:13): [True: 0, False: 76]
  |  Branch (2656:33): [True: 0, False: 0]
  ------------------
 2657|      0|				err = pax_attribute_SCHILY_acl(a, tar, entry, value_length,
 2658|      0|						      ARCHIVE_ENTRY_ACL_TYPE_DEFAULT);
  ------------------
  |  |  535|      0|#define	ARCHIVE_ENTRY_ACL_TYPE_DEFAULT	0x00000200  /* POSIX.1e only */
  ------------------
 2659|      0|				return (err);
 2660|      0|			}
 2661|     76|			else if (key_length == 7 && memcmp(key, "acl.ace", 7) == 0) {
  ------------------
  |  Branch (2661:13): [True: 0, False: 76]
  |  Branch (2661:32): [True: 0, False: 0]
  ------------------
 2662|      0|				err = pax_attribute_SCHILY_acl(a, tar, entry, value_length,
 2663|      0|						      ARCHIVE_ENTRY_ACL_TYPE_NFS4);
  ------------------
  |  |  542|      0|#define	ARCHIVE_ENTRY_ACL_TYPE_NFS4	(ARCHIVE_ENTRY_ACL_TYPE_ALLOW \
  |  |  ------------------
  |  |  |  |  536|      0|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  |  |  ------------------
  |  |  543|      0|	    | ARCHIVE_ENTRY_ACL_TYPE_DENY \
  |  |  ------------------
  |  |  |  |  537|      0|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  |  |  ------------------
  |  |  544|      0|	    | ARCHIVE_ENTRY_ACL_TYPE_AUDIT \
  |  |  ------------------
  |  |  |  |  538|      0|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  |  |  ------------------
  |  |  545|      0|	    | ARCHIVE_ENTRY_ACL_TYPE_ALARM)
  |  |  ------------------
  |  |  |  |  539|      0|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  |  |  ------------------
  ------------------
 2664|       |				// TODO: Mark mode as set
 2665|      0|				return (err);
 2666|      0|			}
 2667|     76|			else if (key_length == 8 && memcmp(key, "devmajor", 8) == 0) {
  ------------------
  |  Branch (2667:13): [True: 20, False: 56]
  |  Branch (2667:32): [True: 0, False: 20]
  ------------------
 2668|      0|				if ((err = pax_attribute_read_number(a, value_length, &t)) == ARCHIVE_OK) {
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2668:9): [True: 0, False: 0]
  ------------------
 2669|      0|					archive_entry_set_rdevmajor(entry, (dev_t)t);
 2670|      0|				}
 2671|      0|				return (err);
 2672|      0|			}
 2673|     76|			else if (key_length == 8 && memcmp(key, "devminor", 8) == 0) {
  ------------------
  |  Branch (2673:13): [True: 20, False: 56]
  |  Branch (2673:32): [True: 0, False: 20]
  ------------------
 2674|      0|				if ((err = pax_attribute_read_number(a, value_length, &t)) == ARCHIVE_OK) {
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2674:9): [True: 0, False: 0]
  ------------------
 2675|      0|					archive_entry_set_rdevminor(entry, (dev_t)t);
 2676|      0|				}
 2677|      0|				return (err);
 2678|      0|			}
 2679|     76|			else if (key_length == 6 && memcmp(key, "fflags", 6) == 0) {
  ------------------
  |  Branch (2679:13): [True: 0, False: 76]
  |  Branch (2679:32): [True: 0, False: 0]
  ------------------
 2680|      0|				if (value_length < fflags_limit) {
  ------------------
  |  Branch (2680:9): [True: 0, False: 0]
  ------------------
 2681|      0|					p = __archive_read_ahead(a, value_length, &bytes_read);
 2682|      0|					if (p == NULL) {
  ------------------
  |  Branch (2682:10): [True: 0, False: 0]
  ------------------
 2683|       |						/* Truncated archive */
 2684|      0|						archive_set_error(&a->archive, EINVAL,
 2685|      0|								  "Truncated archive"
 2686|      0|								  " detected while reading SCHILY.fflags");
 2687|      0|						return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2688|      0|					}
 2689|      0|					archive_entry_copy_fflags_text_len(entry, p, value_length);
 2690|      0|					err = ARCHIVE_OK;
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2691|      0|				} else {
 2692|       |					/* Overlong fflags field */
 2693|      0|					err = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2694|      0|				}
 2695|      0|				__archive_read_consume(a, value_length);
 2696|      0|				return (err);
 2697|      0|			}
 2698|     76|			else if (key_length == 3 && memcmp(key, "dev", 3) == 0) {
  ------------------
  |  Branch (2698:13): [True: 56, False: 20]
  |  Branch (2698:32): [True: 48, False: 8]
  ------------------
 2699|     48|				if ((err = pax_attribute_read_number(a, value_length, &t)) == ARCHIVE_OK) {
  ------------------
  |  |  233|     48|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2699:9): [True: 48, False: 0]
  ------------------
 2700|     48|					archive_entry_set_dev(entry, (dev_t)t);
 2701|     48|				}
 2702|     48|				return (err);
 2703|     48|			}
 2704|     28|			else if (key_length == 3 && memcmp(key, "ino", 3) == 0) {
  ------------------
  |  Branch (2704:13): [True: 8, False: 20]
  |  Branch (2704:32): [True: 0, False: 8]
  ------------------
 2705|      0|				if ((err = pax_attribute_read_number(a, value_length, &t)) == ARCHIVE_OK) {
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2705:9): [True: 0, False: 0]
  ------------------
 2706|      0|					archive_entry_set_ino(entry, t);
 2707|      0|				}
 2708|      0|				return (err);
 2709|      0|			}
 2710|     28|			else if (key_length == 5 && memcmp(key, "nlink", 5) == 0) {
  ------------------
  |  Branch (2710:13): [True: 0, False: 28]
  |  Branch (2710:32): [True: 0, False: 0]
  ------------------
 2711|      0|				if ((err = pax_attribute_read_number(a, value_length, &t)) == ARCHIVE_OK) {
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2711:9): [True: 0, False: 0]
  ------------------
 2712|      0|					archive_entry_set_nlink(entry, (unsigned int)t);
 2713|      0|				}
 2714|      0|				return (err);
 2715|      0|			}
 2716|     28|			else if (key_length == 8 && memcmp(key, "realsize", 8) == 0) {
  ------------------
  |  Branch (2716:13): [True: 20, False: 8]
  |  Branch (2716:32): [True: 14, False: 6]
  ------------------
 2717|     14|				if ((err = pax_attribute_read_number(a, value_length, &t)) == ARCHIVE_OK) {
  ------------------
  |  |  233|     14|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2717:9): [True: 14, False: 0]
  ------------------
 2718|     14|					tar->SCHILY_sparse_realsize = t;
 2719|     14|					tar->size_fields |= TAR_SIZE_SCHILY_SPARSE_REALSIZE;
  ------------------
  |  |  162|     14|#define TAR_SIZE_SCHILY_SPARSE_REALSIZE 8
  ------------------
 2720|     14|				}
 2721|     14|				return (err);
 2722|     14|			}
 2723|       |			/* TODO: Is there a SCHILY.sparse.size similar to GNU.sparse.size ? */
 2724|     14|			else if (key_length > 6 && memcmp(key, "xattr.", 6) == 0) {
  ------------------
  |  Branch (2724:13): [True: 6, False: 8]
  |  Branch (2724:31): [True: 0, False: 6]
  ------------------
 2725|      0|				key_length -= 6;
 2726|      0|				key += 6;
 2727|      0|				if (value_length < xattr_limit) {
  ------------------
  |  Branch (2727:9): [True: 0, False: 0]
  ------------------
 2728|      0|					p = __archive_read_ahead(a, value_length, &bytes_read);
 2729|      0|					if (p == NULL) {
  ------------------
  |  Branch (2729:10): [True: 0, False: 0]
  ------------------
 2730|      0|						archive_set_error(&a->archive, EINVAL,
 2731|      0|								  "Truncated archive"
 2732|      0|								  " detected while reading SCHILY.xattr");
 2733|      0|						return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2734|      0|					}
 2735|      0|					if (pax_attribute_SCHILY_xattr(entry, key, key_length, p, value_length)) {
  ------------------
  |  Branch (2735:10): [True: 0, False: 0]
  ------------------
 2736|       |						/* TODO: Unable to parse xattr */
 2737|      0|						err = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2738|      0|					}
 2739|      0|				} else {
 2740|      0|					archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2741|      0|							  "Unreasonably large xattr: %llu > %llu",
 2742|      0|							  (unsigned long long)value_length,
 2743|      0|							  (unsigned long long)xattr_limit);
 2744|      0|					err = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2745|      0|				}
 2746|      0|				__archive_read_consume(a, value_length);
 2747|      0|				return (err);
 2748|      0|			}
 2749|     76|		}
 2750|       |		/* SUN.* extensions from Solaris tar */
 2751|     47|		if (key_length > 4 && memcmp(key, "SUN.", 4) == 0) {
  ------------------
  |  Branch (2751:7): [True: 39, False: 8]
  |  Branch (2751:25): [True: 0, False: 39]
  ------------------
 2752|      0|			key_length -= 4;
 2753|      0|			key += 4;
 2754|       |
 2755|      0|			if (key_length == 9 && memcmp(key, "holesdata", 9) == 0) {
  ------------------
  |  Branch (2755:8): [True: 0, False: 0]
  |  Branch (2755:27): [True: 0, False: 0]
  ------------------
 2756|       |				/* SUN.holesdata */
 2757|      0|				if (value_length < sparse_map_limit) {
  ------------------
  |  Branch (2757:9): [True: 0, False: 0]
  ------------------
 2758|      0|					p = __archive_read_ahead(a, value_length, &bytes_read);
 2759|      0|					if (p == NULL) {
  ------------------
  |  Branch (2759:10): [True: 0, False: 0]
  ------------------
 2760|      0|						archive_set_error(&a->archive, EINVAL,
 2761|      0|								  "Truncated archive"
 2762|      0|								  " detected while reading SUN.holesdata");
 2763|      0|						return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2764|      0|					}
 2765|      0|					err = pax_attribute_SUN_holesdata(a, tar, entry, p, value_length);
 2766|      0|					if (err < ARCHIVE_OK) {
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2766:10): [True: 0, False: 0]
  ------------------
 2767|      0|						archive_set_error(&a->archive,
 2768|      0|								  ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2769|      0|								  "Parse error: SUN.holesdata");
 2770|      0|					}
 2771|      0|				} else {
 2772|      0|					archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2773|      0|							  "Unreasonably large sparse map: %llu > %llu",
 2774|      0|							  (unsigned long long)value_length,
 2775|      0|							  (unsigned long long)sparse_map_limit);
 2776|      0|					err = ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2777|      0|				}
 2778|      0|				__archive_read_consume(a, value_length);
 2779|      0|				return (err);
 2780|      0|			}
 2781|      0|		}
 2782|     47|		break;
 2783|    516|	case 'a':
  ------------------
  |  Branch (2783:2): [True: 516, False: 510]
  ------------------
 2784|    516|		if (key_length == 5 && memcmp(key, "atime", 5) == 0) {
  ------------------
  |  Branch (2784:7): [True: 491, False: 25]
  |  Branch (2784:26): [True: 0, False: 491]
  ------------------
 2785|      0|			__LA_TIME_T sec = 0;
  ------------------
  |  |  107|      0|#define __LA_TIME_T time_t
  ------------------
 2786|      0|			if ((err = pax_attribute_read_time(a, value_length, &sec, &n, unconsumed)) == ARCHIVE_OK) {
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2786:8): [True: 0, False: 0]
  ------------------
 2787|      0|				archive_entry_set_atime(entry, sec, n);
 2788|      0|			} else {
 2789|      0|				archive_set_error(&a->archive,
 2790|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2791|      0|				    "Ignoring malformed pax atime");
 2792|      0|			}
 2793|      0|			return (err);
 2794|      0|		}
 2795|    516|		break;
 2796|    516|	case 'c':
  ------------------
  |  Branch (2796:2): [True: 34, False: 992]
  ------------------
 2797|     34|		if (key_length == 5 && memcmp(key, "ctime", 5) == 0) {
  ------------------
  |  Branch (2797:7): [True: 0, False: 34]
  |  Branch (2797:26): [True: 0, False: 0]
  ------------------
 2798|      0|			__LA_TIME_T sec = 0;
  ------------------
  |  |  107|      0|#define __LA_TIME_T time_t
  ------------------
 2799|      0|			if ((err = pax_attribute_read_time(a, value_length, &sec, &n, unconsumed)) == ARCHIVE_OK) {
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2799:8): [True: 0, False: 0]
  ------------------
 2800|      0|				archive_entry_set_ctime(entry, sec, n);
 2801|      0|			} else {
 2802|      0|				archive_set_error(&a->archive,
 2803|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2804|      0|				    "Ignoring malformed pax ctime");
 2805|      0|			}
 2806|      0|			return (err);
 2807|     34|		} else if (key_length == 7 && memcmp(key, "charset", 7) == 0) {
  ------------------
  |  Branch (2807:14): [True: 0, False: 34]
  |  Branch (2807:33): [True: 0, False: 0]
  ------------------
 2808|       |			/* TODO: Publish charset information in entry. */
 2809|     34|		} else if (key_length == 7 && memcmp(key, "comment", 7) == 0) {
  ------------------
  |  Branch (2809:14): [True: 0, False: 34]
  |  Branch (2809:33): [True: 0, False: 0]
  ------------------
 2810|       |			/* TODO: Publish comment in entry. */
 2811|      0|		}
 2812|     34|		break;
 2813|     34|	case 'g':
  ------------------
  |  Branch (2813:2): [True: 0, False: 1.02k]
  ------------------
 2814|      0|		if (key_length == 3 && memcmp(key, "gid", 3) == 0) {
  ------------------
  |  Branch (2814:7): [True: 0, False: 0]
  |  Branch (2814:26): [True: 0, False: 0]
  ------------------
 2815|      0|			if ((err = pax_attribute_read_number(a, value_length, &t)) == ARCHIVE_OK) {
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2815:8): [True: 0, False: 0]
  ------------------
 2816|      0|				archive_entry_set_gid(entry, t);
 2817|      0|			}
 2818|      0|			return (err);
 2819|      0|		} else if (key_length == 5 && memcmp(key, "gname", 5) == 0) {
  ------------------
  |  Branch (2819:14): [True: 0, False: 0]
  |  Branch (2819:33): [True: 0, False: 0]
  ------------------
 2820|      0|			if (value_length > guname_limit) {
  ------------------
  |  Branch (2820:8): [True: 0, False: 0]
  ------------------
 2821|      0|				*unconsumed += value_length;
 2822|      0|				err = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2823|      0|			} else {
 2824|      0|				err = read_bytes_to_string(a, &(tar->entry_gname), value_length, unconsumed);
 2825|      0|			}
 2826|      0|			return (err);
 2827|      0|		}
 2828|      0|		break;
 2829|      0|	case 'h':
  ------------------
  |  Branch (2829:2): [True: 0, False: 1.02k]
  ------------------
 2830|      0|		if (key_length == 10 && memcmp(key, "hdrcharset", 10) == 0) {
  ------------------
  |  Branch (2830:7): [True: 0, False: 0]
  |  Branch (2830:27): [True: 0, False: 0]
  ------------------
 2831|      0|			if (value_length < 64) {
  ------------------
  |  Branch (2831:8): [True: 0, False: 0]
  ------------------
 2832|      0|				p = __archive_read_ahead(a, value_length, &bytes_read);
 2833|      0|				if (p == NULL) {
  ------------------
  |  Branch (2833:9): [True: 0, False: 0]
  ------------------
 2834|      0|					archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2835|      0|							  "Truncated tar archive "
 2836|      0|							  "detected while reading hdrcharset attribute");
 2837|      0|					return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2838|      0|				}
 2839|      0|				if (value_length == 6
  ------------------
  |  Branch (2839:9): [True: 0, False: 0]
  ------------------
 2840|      0|				    && memcmp(p, "BINARY", 6) == 0) {
  ------------------
  |  Branch (2840:12): [True: 0, False: 0]
  ------------------
 2841|       |					/* Binary  mode. */
 2842|      0|					tar->pax_hdrcharset_utf8 = 0;
 2843|      0|					err = ARCHIVE_OK;
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2844|      0|				} else if (value_length == 23
  ------------------
  |  Branch (2844:16): [True: 0, False: 0]
  ------------------
 2845|      0|					   && memcmp(p, "ISO-IR 10646 2000 UTF-8", 23) == 0) {
  ------------------
  |  Branch (2845:12): [True: 0, False: 0]
  ------------------
 2846|      0|					tar->pax_hdrcharset_utf8 = 1;
 2847|      0|					err = ARCHIVE_OK;
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2848|      0|				} else {
 2849|       |					/* TODO: Unrecognized character set */
 2850|      0|					err  = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2851|      0|				}
 2852|      0|			} else {
 2853|      0|				archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2854|      0|						  "hdrcharset attribute is unreasonably large (%llu bytes)",
 2855|      0|						  (unsigned long long)value_length);
 2856|      0|				err = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2857|      0|			}
 2858|      0|			__archive_read_consume(a, value_length);
 2859|      0|			return (err);
 2860|      0|		}
 2861|      0|		break;
 2862|      9|	case 'l':
  ------------------
  |  Branch (2862:2): [True: 9, False: 1.01k]
  ------------------
 2863|       |		/* pax interchange doesn't distinguish hardlink vs. symlink. */
 2864|      9|		if (key_length == 8 && memcmp(key, "linkpath", 8) == 0) {
  ------------------
  |  Branch (2864:7): [True: 0, False: 9]
  |  Branch (2864:26): [True: 0, False: 0]
  ------------------
 2865|      0|			if (value_length > pathname_limit) {
  ------------------
  |  Branch (2865:8): [True: 0, False: 0]
  ------------------
 2866|      0|				*unconsumed += value_length;
 2867|      0|				err = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2868|      0|			} else {
 2869|      0|				err = read_bytes_to_string(a, &tar->entry_linkpath, value_length, unconsumed);
 2870|      0|			}
 2871|      0|			return (err);
 2872|      0|		}
 2873|      9|		break;
 2874|    204|	case 'm':
  ------------------
  |  Branch (2874:2): [True: 204, False: 822]
  ------------------
 2875|    204|		if (key_length == 5 && memcmp(key, "mtime", 5) == 0) {
  ------------------
  |  Branch (2875:7): [True: 85, False: 119]
  |  Branch (2875:26): [True: 83, False: 2]
  ------------------
 2876|     83|			__LA_TIME_T sec;
  ------------------
  |  |  107|     83|#define __LA_TIME_T time_t
  ------------------
 2877|     83|			if ((err = pax_attribute_read_time(a, value_length, &sec, &n, unconsumed)) == ARCHIVE_OK) {
  ------------------
  |  |  233|     83|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2877:8): [True: 38, False: 45]
  ------------------
 2878|     38|				archive_entry_set_mtime(entry, sec, n);
 2879|     45|			} else {
 2880|     45|				archive_set_error(&a->archive,
 2881|     45|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     45|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2882|     45|				    "Ignoring malformed pax mtime");
 2883|     45|			}
 2884|     83|			return (err);
 2885|     83|		}
 2886|    121|		break;
 2887|    121|	case 'p':
  ------------------
  |  Branch (2887:2): [True: 2, False: 1.02k]
  ------------------
 2888|      2|		if (key_length == 4 && memcmp(key, "path", 4) == 0) {
  ------------------
  |  Branch (2888:7): [True: 0, False: 2]
  |  Branch (2888:26): [True: 0, False: 0]
  ------------------
 2889|      0|			if (value_length > pathname_limit) {
  ------------------
  |  Branch (2889:8): [True: 0, False: 0]
  ------------------
 2890|      0|				*unconsumed += value_length;
 2891|      0|				err = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2892|      0|			} else {
 2893|      0|				err = read_bytes_to_string(a, &(tar->entry_pathname), value_length, unconsumed);
 2894|      0|			}
 2895|      0|			return (err);
 2896|      0|		}
 2897|      2|		break;
 2898|      2|	case 'r':
  ------------------
  |  Branch (2898:2): [True: 0, False: 1.02k]
  ------------------
 2899|       |		/* POSIX has reserved 'realtime.*' */
 2900|      0|		break;
 2901|     11|	case 's':
  ------------------
  |  Branch (2901:2): [True: 11, False: 1.01k]
  ------------------
 2902|       |		/* POSIX has reserved 'security.*' */
 2903|       |		/* Someday: if (strcmp(key, "security.acl") == 0) { ... } */
 2904|     11|		if (key_length == 4 && memcmp(key, "size", 4) == 0) {
  ------------------
  |  Branch (2904:7): [True: 0, False: 11]
  |  Branch (2904:26): [True: 0, False: 0]
  ------------------
 2905|       |			/* "size" is the size of the data in the entry. */
 2906|      0|			if ((err = pax_attribute_read_number(a, value_length, &t)) == ARCHIVE_OK) {
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2906:8): [True: 0, False: 0]
  ------------------
 2907|      0|				tar->pax_size = t;
 2908|      0|				tar->size_fields |= TAR_SIZE_PAX_SIZE;
  ------------------
  |  |  159|      0|#define TAR_SIZE_PAX_SIZE 1
  ------------------
 2909|      0|			}
 2910|      0|			else if (t == INT64_MAX) {
  ------------------
  |  Branch (2910:13): [True: 0, False: 0]
  ------------------
 2911|       |				/* Note: pax_attr_read_number returns INT64_MAX on overflow or < 0 */
 2912|      0|				tar->entry_bytes_remaining = 0;
 2913|      0|				archive_set_error(&a->archive,
 2914|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2915|      0|				    "Tar size attribute overflow");
 2916|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2917|      0|			}
 2918|      0|			return (err);
 2919|      0|		}
 2920|     11|		break;
 2921|     38|	case 'u':
  ------------------
  |  Branch (2921:2): [True: 38, False: 988]
  ------------------
 2922|     38|		if (key_length == 3 && memcmp(key, "uid", 3) == 0) {
  ------------------
  |  Branch (2922:7): [True: 38, False: 0]
  |  Branch (2922:26): [True: 0, False: 38]
  ------------------
 2923|      0|			if ((err = pax_attribute_read_number(a, value_length, &t)) == ARCHIVE_OK) {
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2923:8): [True: 0, False: 0]
  ------------------
 2924|      0|				archive_entry_set_uid(entry, t);
 2925|      0|			}
 2926|      0|			return (err);
 2927|     38|		} else if (key_length == 5 && memcmp(key, "uname", 5) == 0) {
  ------------------
  |  Branch (2927:14): [True: 0, False: 38]
  |  Branch (2927:33): [True: 0, False: 0]
  ------------------
 2928|      0|			if (value_length > guname_limit) {
  ------------------
  |  Branch (2928:8): [True: 0, False: 0]
  ------------------
 2929|      0|				*unconsumed += value_length;
 2930|      0|				err = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2931|      0|			} else {
 2932|      0|				err = read_bytes_to_string(a, &(tar->entry_uname), value_length, unconsumed);
 2933|      0|			}
 2934|      0|			return (err);
 2935|      0|		}
 2936|     38|		break;
 2937|  1.02k|	}
 2938|       |
 2939|       |	/* Unrecognized key, just skip the entire value. */
 2940|    822|	__archive_read_consume(a, value_length);
 2941|    822|	return (err);
 2942|  1.02k|}
archive_read_support_format_tar.c:pax_attribute_read_number:
 2341|     83|pax_attribute_read_number(struct archive_read *a, size_t value_length, int64_t *result) {
 2342|     83|	struct archive_string as;
 2343|     83|	int64_t unconsumed = 0;
 2344|     83|	int r;
 2345|       |
 2346|     83|	if (value_length > 64) {
  ------------------
  |  Branch (2346:6): [True: 0, False: 83]
  ------------------
 2347|      0|		__archive_read_consume(a, value_length);
 2348|      0|		*result = 0;
 2349|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2350|      0|	}
 2351|       |
 2352|     83|	archive_string_init(&as);
  ------------------
  |  |   71|     83|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 83]
  |  |  ------------------
  ------------------
 2353|     83|	r = read_bytes_to_string(a, &as, value_length, &unconsumed);
 2354|     83|	if (tar_flush_unconsumed(a, &unconsumed) != ARCHIVE_OK) {
  ------------------
  |  |  233|     83|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2354:6): [True: 0, False: 83]
  ------------------
 2355|      0|		*result = 0;
 2356|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2357|      0|	}
 2358|     83|	if (r < ARCHIVE_OK) {
  ------------------
  |  |  233|     83|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2358:6): [True: 0, False: 83]
  ------------------
 2359|      0|		archive_string_free(&as);
 2360|      0|		*result = 0;
 2361|      0|		return (r);
 2362|      0|	}
 2363|       |
 2364|     83|	*result = tar_atol10(as.s, archive_strlen(&as));
  ------------------
  |  |  178|     83|#define	archive_strlen(a) ((a)->length)
  ------------------
 2365|     83|	archive_string_free(&as);
 2366|     83|	if (*result < 0 || *result == INT64_MAX) {
  ------------------
  |  Branch (2366:6): [True: 0, False: 83]
  |  Branch (2366:21): [True: 0, False: 83]
  ------------------
 2367|      0|		*result = INT64_MAX;
 2368|      0|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2369|      0|	}
 2370|     83|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     83|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2371|     83|}
archive_read_support_format_tar.c:tar_atol10:
 3570|     83|{
 3571|     83|	return tar_atol_base_n(p, char_cnt, 10);
 3572|     83|}
archive_read_support_format_tar.c:pax_attribute_read_time:
 2306|     84|pax_attribute_read_time(struct archive_read *a, size_t value_length, __LA_TIME_T *ps, long *pn, int64_t *unconsumed) {
 2307|     84|	struct archive_string as;
 2308|     84|	int r;
 2309|       |
 2310|     84|	if (value_length > 128) {
  ------------------
  |  Branch (2310:6): [True: 1, False: 83]
  ------------------
 2311|      1|		__archive_read_consume(a, value_length);
 2312|      1|		*ps = 0;
 2313|      1|		*pn = 0;
 2314|      1|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2315|      1|	}
 2316|       |
 2317|     83|	archive_string_init(&as);
  ------------------
  |  |   71|     83|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 83]
  |  |  ------------------
  ------------------
 2318|     83|	r = read_bytes_to_string(a, &as, value_length, unconsumed);
 2319|     83|	if (r < ARCHIVE_OK) {
  ------------------
  |  |  233|     83|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2319:6): [True: 0, False: 83]
  ------------------
 2320|      0|		archive_string_free(&as);
 2321|      0|		*ps = 0;
 2322|      0|		*pn = 0;
 2323|      0|		return (r);
 2324|      0|	}
 2325|       |
 2326|     83|	int64_t sec = 0;
 2327|     83|	pax_time(as.s, archive_strlen(&as), &sec, pn);
  ------------------
  |  |  178|     83|#define	archive_strlen(a) ((a)->length)
  ------------------
 2328|     83|	archive_string_free(&as);
 2329|       |
 2330|     83|	if (sec == INT64_MIN) {
  ------------------
  |  Branch (2330:6): [True: 45, False: 38]
  ------------------
 2331|     45|		*ps = 0;
 2332|     45|		*pn = 0;
 2333|     45|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|     45|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2334|     45|	} else {
 2335|     38|		*ps = (__LA_TIME_T)sec;
 2336|     38|	}
 2337|     38|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     38|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2338|     83|}
archive_read_support_format_tar.c:pax_time:
 2954|     83|{
 2955|     83|	char digit;
 2956|     83|	int64_t	s;
 2957|     83|	unsigned long l;
 2958|     83|	int sign;
 2959|     83|	int64_t limit, last_digit_limit;
 2960|       |
 2961|     83|	limit = INT64_MAX / 10;
 2962|     83|	last_digit_limit = INT64_MAX % 10;
 2963|       |
 2964|     83|	if (length <= 0) {
  ------------------
  |  Branch (2964:6): [True: 0, False: 83]
  ------------------
 2965|      0|		*ps = 0;
 2966|      0|		*pn = 0;
 2967|      0|		return;
 2968|      0|	}
 2969|     83|	s = 0;
 2970|     83|	sign = 1;
 2971|     83|	if (*p == '-') {
  ------------------
  |  Branch (2971:6): [True: 83, False: 0]
  ------------------
 2972|     83|		sign = -1;
 2973|     83|		p++;
 2974|     83|		length--;
 2975|     83|	}
 2976|    845|	while (length > 0 && *p >= '0' && *p <= '9') {
  ------------------
  |  Branch (2976:9): [True: 845, False: 0]
  |  Branch (2976:23): [True: 763, False: 82]
  |  Branch (2976:36): [True: 762, False: 1]
  ------------------
 2977|    762|		digit = *p - '0';
 2978|    762|		if (s > limit ||
  ------------------
  |  Branch (2978:7): [True: 0, False: 762]
  ------------------
 2979|    762|		    (s == limit && digit > last_digit_limit)) {
  ------------------
  |  Branch (2979:8): [True: 0, False: 762]
  |  Branch (2979:22): [True: 0, False: 0]
  ------------------
 2980|      0|			*ps = INT64_MIN;
 2981|      0|			*pn = 0;
 2982|      0|			return;
 2983|      0|		}
 2984|    762|		s = (s * 10) + digit;
 2985|    762|		++p;
 2986|    762|		--length;
 2987|    762|	}
 2988|       |
 2989|     83|	*ps = s * sign;
 2990|       |
 2991|     83|#if ARCHIVE_VERSION_NUMBER < 4000000
 2992|       |	/* Libarchive 4.0 will have __LA_TIME_T == int64_t, so
 2993|       |	   this will be unnecessary. */
 2994|       |	/* Test whether it overflows __LA_TIME_T */
 2995|     83|	__LA_TIME_T sec = (__LA_TIME_T)*ps;
  ------------------
  |  |  107|     83|#define __LA_TIME_T time_t
  ------------------
 2996|     83|	if ((int64_t)sec != *ps) {
  ------------------
  |  Branch (2996:6): [True: 0, False: 83]
  ------------------
 2997|      0|		*ps = INT64_MIN;
 2998|      0|		*pn = 0;
 2999|      0|		return;
 3000|      0|	}
 3001|     83|#endif
 3002|       |
 3003|       |	/* Calculate nanoseconds. */
 3004|     83|	*pn = 0;
 3005|       |
 3006|     83|	if (length <= 0) {
  ------------------
  |  Branch (3006:6): [True: 0, False: 83]
  ------------------
 3007|      0|		return;
 3008|      0|	}
 3009|       |
 3010|       |	/* Skip `.` */
 3011|     83|	if (*p != '.') {
  ------------------
  |  Branch (3011:6): [True: 28, False: 55]
  ------------------
 3012|     28|		*ps = INT64_MIN;
 3013|     28|		*pn = 0;
 3014|     28|		return;
 3015|     28|	}
 3016|     55|	++p;
 3017|     55|	--length;
 3018|       |
 3019|     55|	l = 100000000UL;
 3020|    277|	do {
 3021|    277|		if (length <= 0) {
  ------------------
  |  Branch (3021:7): [True: 38, False: 239]
  ------------------
 3022|     38|			return;
 3023|     38|		}
 3024|    239|		if (*p >= '0' && *p <= '9') {
  ------------------
  |  Branch (3024:7): [True: 231, False: 8]
  |  Branch (3024:20): [True: 222, False: 9]
  ------------------
 3025|    222|			*pn += (*p - '0') * l;
 3026|    222|		} else {
 3027|     17|			*ps = INT64_MIN;
 3028|     17|			*pn = 0;
 3029|     17|			return;
 3030|     17|		}
 3031|    222|		++p;
 3032|    222|		--length;
 3033|    222|	} while (l /= 10);
  ------------------
  |  Branch (3033:11): [True: 222, False: 0]
  ------------------
 3034|       |
 3035|       |	/* Ignore resolution beyond nanoseconds,
 3036|       |	   but verify it's all decimal digits. */
 3037|      0|	while (length > 0) {
  ------------------
  |  Branch (3037:9): [True: 0, False: 0]
  ------------------
 3038|      0|		if (*p < '0' || *p > '9') {
  ------------------
  |  Branch (3038:7): [True: 0, False: 0]
  |  Branch (3038:19): [True: 0, False: 0]
  ------------------
 3039|      0|			*ps = INT64_MIN;
 3040|      0|			*pn = 0;
 3041|      0|			return;
 3042|      0|		}
 3043|      0|		++p;
 3044|      0|		--length;
 3045|      0|	}
 3046|      0|}
archive_read_support_format_tar.c:pax_attribute_LIBARCHIVE_xattr:
 2180|     36|{
 2181|     36|	char *name_decoded;
 2182|     36|	void *value_decoded;
 2183|     36|	size_t value_len;
 2184|       |
 2185|     36|	if (name_length < 1)
  ------------------
  |  Branch (2185:6): [True: 0, False: 36]
  ------------------
 2186|      0|		return 3;
 2187|       |
 2188|       |	/* URL-decode name */
 2189|     36|	name_decoded = url_decode(name, name_length);
 2190|     36|	if (name_decoded == NULL)
  ------------------
  |  Branch (2190:6): [True: 0, False: 36]
  ------------------
 2191|      0|		return 2;
 2192|       |
 2193|       |	/* Base-64 decode value */
 2194|     36|	value_decoded = base64_decode(value, value_length, &value_len);
 2195|     36|	if (value_decoded == NULL) {
  ------------------
  |  Branch (2195:6): [True: 0, False: 36]
  ------------------
 2196|      0|		free(name_decoded);
 2197|      0|		return 1;
 2198|      0|	}
 2199|       |
 2200|     36|	archive_entry_xattr_add_entry(entry, name_decoded,
 2201|     36|		value_decoded, value_len);
 2202|       |
 2203|     36|	free(name_decoded);
 2204|     36|	free(value_decoded);
 2205|     36|	return 0;
 2206|     36|}
archive_read_support_format_tar.c:url_decode:
 3783|     36|{
 3784|     36|	char *out, *d;
 3785|     36|	const char *s;
 3786|       |
 3787|     36|	out = malloc(length + 1);
 3788|     36|	if (out == NULL)
  ------------------
  |  Branch (3788:6): [True: 0, False: 36]
  ------------------
 3789|      0|		return (NULL);
 3790|    155|	for (s = in, d = out; length > 0 && *s != '\0'; ) {
  ------------------
  |  Branch (3790:24): [True: 119, False: 36]
  |  Branch (3790:38): [True: 119, False: 0]
  ------------------
 3791|    119|		if (s[0] == '%' && length > 2) {
  ------------------
  |  Branch (3791:7): [True: 9, False: 110]
  |  Branch (3791:22): [True: 9, False: 0]
  ------------------
 3792|       |			/* Try to convert % escape */
 3793|      9|			int digit1 = tohex(s[1]);
 3794|      9|			int digit2 = tohex(s[2]);
 3795|      9|			if (digit1 >= 0 && digit2 >= 0) {
  ------------------
  |  Branch (3795:8): [True: 0, False: 9]
  |  Branch (3795:23): [True: 0, False: 0]
  ------------------
 3796|       |				/* Looks good, consume three chars */
 3797|      0|				s += 3;
 3798|      0|				length -= 3;
 3799|       |				/* Convert output */
 3800|      0|				*d++ = ((digit1 << 4) | digit2);
 3801|      0|				continue;
 3802|      0|			}
 3803|       |			/* Else fall through and treat '%' as normal char */
 3804|      9|		}
 3805|    119|		*d++ = *s++;
 3806|    119|		--length;
 3807|    119|	}
 3808|     36|	*d = '\0';
 3809|     36|	return (out);
 3810|     36|}
archive_read_support_format_tar.c:tohex:
 3814|     18|{
 3815|     18|	if (c >= '0' && c <= '9')
  ------------------
  |  Branch (3815:6): [True: 17, False: 1]
  |  Branch (3815:18): [True: 0, False: 17]
  ------------------
 3816|      0|		return (c - '0');
 3817|     18|	else if (c >= 'A' && c <= 'F')
  ------------------
  |  Branch (3817:11): [True: 17, False: 1]
  |  Branch (3817:23): [True: 0, False: 17]
  ------------------
 3818|      0|		return (c - 'A' + 10);
 3819|     18|	else if (c >= 'a' && c <= 'f')
  ------------------
  |  Branch (3819:11): [True: 17, False: 1]
  |  Branch (3819:23): [True: 8, False: 9]
  ------------------
 3820|      8|		return (c - 'a' + 10);
 3821|     10|	else
 3822|     10|		return (-1);
 3823|     18|}
archive_read_support_format_tar.c:base64_decode:
 3711|     36|{
 3712|     36|	static const unsigned char digits[64] = {
 3713|     36|		'A','B','C','D','E','F','G','H','I','J','K','L','M','N',
 3714|     36|		'O','P','Q','R','S','T','U','V','W','X','Y','Z','a','b',
 3715|     36|		'c','d','e','f','g','h','i','j','k','l','m','n','o','p',
 3716|     36|		'q','r','s','t','u','v','w','x','y','z','0','1','2','3',
 3717|     36|		'4','5','6','7','8','9','+','/' };
 3718|     36|	static unsigned char decode_table[128];
 3719|     36|	char *out, *d;
 3720|     36|	const unsigned char *src = (const unsigned char *)s;
 3721|       |
 3722|       |	/* If the decode table is not yet initialized, prepare it. */
 3723|     36|	if (decode_table[digits[1]] != 1) {
  ------------------
  |  Branch (3723:6): [True: 1, False: 35]
  ------------------
 3724|      1|		unsigned i;
 3725|      1|		memset(decode_table, 0xff, sizeof(decode_table));
 3726|     65|		for (i = 0; i < sizeof(digits); i++)
  ------------------
  |  Branch (3726:15): [True: 64, False: 1]
  ------------------
 3727|     64|			decode_table[digits[i]] = i;
 3728|      1|	}
 3729|       |
 3730|       |	/* Allocate enough space to hold the entire output. */
 3731|       |	/* Note that we may not use all of this... */
 3732|     36|	out = malloc(len - len / 4 + 1);
 3733|     36|	if (out == NULL) {
  ------------------
  |  Branch (3733:6): [True: 0, False: 36]
  ------------------
 3734|      0|		*out_len = 0;
 3735|      0|		return (NULL);
 3736|      0|	}
 3737|     36|	d = out;
 3738|       |
 3739|    975|	while (len > 0) {
  ------------------
  |  Branch (3739:9): [True: 939, False: 36]
  ------------------
 3740|       |		/* Collect the next group of (up to) four characters. */
 3741|    939|		int v = 0;
 3742|    939|		int group_size = 0;
 3743|  13.1k|		while (group_size < 4 && len > 0) {
  ------------------
  |  Branch (3743:10): [True: 12.2k, False: 903]
  |  Branch (3743:28): [True: 12.1k, False: 6]
  ------------------
 3744|       |			/* '=' or '_' padding indicates final group. */
 3745|  12.1k|			if (*src == '=' || *src == '_') {
  ------------------
  |  Branch (3745:8): [True: 30, False: 12.1k]
  |  Branch (3745:23): [True: 0, False: 12.1k]
  ------------------
 3746|     30|				len = 0;
 3747|     30|				break;
 3748|     30|			}
 3749|       |			/* Skip illegal characters (including line breaks) */
 3750|  12.1k|			if (*src > 127 || *src < 32
  ------------------
  |  Branch (3750:8): [True: 3.49k, False: 8.67k]
  |  Branch (3750:22): [True: 4.40k, False: 4.26k]
  ------------------
 3751|  8.49k|			    || decode_table[*src] == 0xff) {
  ------------------
  |  Branch (3751:11): [True: 599, False: 3.66k]
  ------------------
 3752|  8.49k|				len--;
 3753|  8.49k|				src++;
 3754|  8.49k|				continue;
 3755|  8.49k|			}
 3756|  3.66k|			v <<= 6;
 3757|  3.66k|			v |= decode_table[*src++];
 3758|  3.66k|			len --;
 3759|  3.66k|			group_size++;
 3760|  3.66k|		}
 3761|       |		/* Align a short group properly. */
 3762|    939|		v <<= 6 * (4 - group_size);
 3763|       |		/* Unpack the group we just collected. */
 3764|    939|		switch (group_size) {
  ------------------
  |  Branch (3764:11): [True: 930, False: 9]
  ------------------
 3765|    903|		case 4: d[2] = v & 0xff;
  ------------------
  |  Branch (3765:3): [True: 903, False: 36]
  ------------------
 3766|       |			/* FALLTHROUGH */
 3767|    913|		case 3: d[1] = (v >> 8) & 0xff;
  ------------------
  |  Branch (3767:3): [True: 10, False: 929]
  ------------------
 3768|       |			/* FALLTHROUGH */
 3769|    921|		case 2: d[0] = (v >> 16) & 0xff;
  ------------------
  |  Branch (3769:3): [True: 8, False: 931]
  ------------------
 3770|    921|			break;
 3771|      9|		case 1: /* this is invalid! */
  ------------------
  |  Branch (3771:3): [True: 9, False: 930]
  ------------------
 3772|      9|			break;
 3773|    939|		}
 3774|    939|		d += group_size * 3 / 4;
 3775|    939|	}
 3776|       |
 3777|     36|	*out_len = d - out;
 3778|     36|	return (out);
 3779|     36|}
archive_read_support_format_tar.c:header_gnutar:
 3054|  1.84k|{
 3055|  1.84k|	const struct archive_entry_header_gnutar *header;
 3056|  1.84k|	int64_t t;
 3057|  1.84k|	int err = ARCHIVE_OK;
  ------------------
  |  |  233|  1.84k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3058|       |
 3059|       |	/*
 3060|       |	 * GNU header is like POSIX ustar, except 'prefix' is
 3061|       |	 * replaced with some other fields. This also means the
 3062|       |	 * filename is stored as in old-style archives.
 3063|       |	 */
 3064|       |
 3065|       |	/* Copy filename over (to ensure null termination). */
 3066|  1.84k|	header = (const struct archive_entry_header_gnutar *)h;
 3067|  1.84k|	const char *existing_pathname = archive_entry_pathname(entry);
 3068|  1.84k|	const wchar_t *existing_wcs_pathname = archive_entry_pathname_w(entry);
 3069|  1.84k|	if ((existing_pathname == NULL || existing_pathname[0] == '\0')
  ------------------
  |  Branch (3069:7): [True: 1.84k, False: 0]
  |  Branch (3069:36): [True: 0, False: 0]
  ------------------
 3070|  1.84k|	    && (existing_wcs_pathname == NULL || existing_wcs_pathname[0] == L'\0')) {
  ------------------
  |  Branch (3070:10): [True: 1.84k, False: 0]
  |  Branch (3070:43): [True: 0, False: 0]
  ------------------
 3071|  1.84k|		if (archive_entry_copy_pathname_l(entry,
  ------------------
  |  |   80|  1.84k|#define archive_entry_copy_pathname_l	_archive_entry_copy_pathname_l
  ------------------
  |  Branch (3071:7): [True: 0, False: 1.84k]
  ------------------
 3072|  1.84k|		    header->name, sizeof(header->name), tar->sconv) != 0) {
 3073|      0|			err = set_conversion_failed_error(a, tar->sconv, "Pathname");
 3074|      0|			if (err == ARCHIVE_FATAL)
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (3074:8): [True: 0, False: 0]
  ------------------
 3075|      0|				return (err);
 3076|      0|		}
 3077|  1.84k|	}
 3078|       |
 3079|       |	/* Fields common to ustar and GNU */
 3080|       |	/* XXX Can the following be factored out since it's common
 3081|       |	 * to ustar and gnu tar?  Is it okay to move it down into
 3082|       |	 * header_common, perhaps?  */
 3083|  1.84k|	const char *existing_uname = archive_entry_uname(entry);
 3084|  1.84k|	if (existing_uname == NULL || existing_uname[0] == '\0') {
  ------------------
  |  Branch (3084:6): [True: 1.84k, False: 0]
  |  Branch (3084:32): [True: 0, False: 0]
  ------------------
 3085|  1.84k|		if (archive_entry_copy_uname_l(entry,
  ------------------
  |  |   86|  1.84k|#define archive_entry_copy_uname_l	_archive_entry_copy_uname_l
  ------------------
  |  Branch (3085:7): [True: 0, False: 1.84k]
  ------------------
 3086|  1.84k|		    header->uname, sizeof(header->uname), tar->sconv) != 0) {
 3087|      0|			err = set_conversion_failed_error(a, tar->sconv, "Uname");
 3088|      0|			if (err == ARCHIVE_FATAL)
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (3088:8): [True: 0, False: 0]
  ------------------
 3089|      0|				return (err);
 3090|      0|		}
 3091|  1.84k|	}
 3092|       |
 3093|  1.84k|	const char *existing_gname = archive_entry_gname(entry);
 3094|  1.84k|	if (existing_gname == NULL || existing_gname[0] == '\0') {
  ------------------
  |  Branch (3094:6): [True: 1.84k, False: 0]
  |  Branch (3094:32): [True: 0, False: 0]
  ------------------
 3095|  1.84k|		if (archive_entry_copy_gname_l(entry,
  ------------------
  |  |   71|  1.84k|#define archive_entry_copy_gname_l	_archive_entry_copy_gname_l
  ------------------
  |  Branch (3095:7): [True: 0, False: 1.84k]
  ------------------
 3096|  1.84k|		    header->gname, sizeof(header->gname), tar->sconv) != 0) {
 3097|      0|			err = set_conversion_failed_error(a, tar->sconv, "Gname");
 3098|      0|			if (err == ARCHIVE_FATAL)
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (3098:8): [True: 0, False: 0]
  ------------------
 3099|      0|				return (err);
 3100|      0|		}
 3101|  1.84k|	}
 3102|       |
 3103|       |	/* Parse out device numbers only for char and block specials */
 3104|  1.84k|	if (header->typeflag[0] == '3' || header->typeflag[0] == '4') {
  ------------------
  |  Branch (3104:6): [True: 189, False: 1.65k]
  |  Branch (3104:36): [True: 247, False: 1.40k]
  ------------------
 3105|    436|		if (!archive_entry_rdev_is_set(entry)) {
  ------------------
  |  Branch (3105:7): [True: 436, False: 0]
  ------------------
 3106|    436|			archive_entry_set_rdevmajor(entry, (dev_t)
 3107|    436|			    tar_atol(header->rdevmajor, sizeof(header->rdevmajor)));
 3108|    436|			archive_entry_set_rdevminor(entry, (dev_t)
 3109|    436|			    tar_atol(header->rdevminor, sizeof(header->rdevminor)));
 3110|    436|		}
 3111|  1.40k|	} else {
 3112|  1.40k|		archive_entry_set_rdev(entry, 0);
 3113|  1.40k|	}
 3114|       |
 3115|       |	/* Grab GNU-specific fields. */
 3116|  1.84k|	if (!archive_entry_atime_is_set(entry)) {
  ------------------
  |  Branch (3116:6): [True: 1.84k, False: 0]
  ------------------
 3117|  1.84k|		t = tar_atol(header->atime, sizeof(header->atime));
 3118|  1.84k|		if (t > 0)
  ------------------
  |  Branch (3118:7): [True: 707, False: 1.13k]
  ------------------
 3119|    707|			archive_entry_set_atime(entry, t, 0);
 3120|  1.84k|	}
 3121|  1.84k|	if (!archive_entry_ctime_is_set(entry)) {
  ------------------
  |  Branch (3121:6): [True: 1.84k, False: 0]
  ------------------
 3122|  1.84k|		t = tar_atol(header->ctime, sizeof(header->ctime));
 3123|  1.84k|		if (t > 0)
  ------------------
  |  Branch (3123:7): [True: 1.16k, False: 678]
  ------------------
 3124|  1.16k|			archive_entry_set_ctime(entry, t, 0);
 3125|  1.84k|	}
 3126|       |
 3127|  1.84k|	if (header->realsize[0] != 0) {
  ------------------
  |  Branch (3127:6): [True: 690, False: 1.15k]
  ------------------
 3128|       |		/* Treat as a synonym for the pax GNU.sparse.realsize attr */
 3129|    690|		tar->GNU_sparse_realsize
 3130|    690|		    = tar_atol(header->realsize, sizeof(header->realsize));
 3131|    690|		tar->size_fields |= TAR_SIZE_GNU_SPARSE_REALSIZE;
  ------------------
  |  |  160|    690|#define TAR_SIZE_GNU_SPARSE_REALSIZE 2
  ------------------
 3132|    690|	}
 3133|       |
 3134|  1.84k|	if (header->sparse[0].offset[0] != 0) {
  ------------------
  |  Branch (3134:6): [True: 1.56k, False: 276]
  ------------------
 3135|  1.56k|		if (gnu_sparse_old_read(a, tar, header, unconsumed)
  ------------------
  |  Branch (3135:7): [True: 8, False: 1.56k]
  ------------------
 3136|  1.56k|		    != ARCHIVE_OK)
  ------------------
  |  |  233|  1.56k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3137|      8|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      8|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3138|  1.56k|	} else {
 3139|    276|		if (header->isextended[0] != 0) {
  ------------------
  |  Branch (3139:7): [True: 37, False: 239]
  ------------------
 3140|       |			/* XXX WTF? XXX */
 3141|     37|		}
 3142|    276|	}
 3143|       |
 3144|       |	/* Grab fields common to all tar variants. */
 3145|  1.83k|	err = header_common(a, tar, entry, h);
 3146|  1.83k|	if (err == ARCHIVE_FATAL)
  ------------------
  |  |  239|  1.83k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (3146:6): [True: 0, False: 1.83k]
  ------------------
 3147|      0|		return (err);
 3148|       |
 3149|  1.83k|	tar->entry_padding = 0x1ff & (-tar->entry_bytes_remaining);
 3150|       |
 3151|  1.83k|	return (err);
 3152|  1.83k|}
archive_read_support_format_tar.c:gnu_sparse_old_read:
 3207|  1.56k|{
 3208|  1.56k|	ssize_t bytes_read;
 3209|  1.56k|	const void *data;
 3210|  1.56k|	struct extended {
 3211|  1.56k|		struct gnu_sparse sparse[21];
 3212|  1.56k|		char	isextended[1];
 3213|  1.56k|		char	padding[7];
 3214|  1.56k|	};
 3215|  1.56k|	const struct extended *ext;
 3216|       |
 3217|  1.56k|	if (gnu_sparse_old_parse(a, tar, header->sparse, 4) != ARCHIVE_OK)
  ------------------
  |  |  233|  1.56k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3217:6): [True: 0, False: 1.56k]
  ------------------
 3218|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3219|  1.56k|	if (header->isextended[0] == 0)
  ------------------
  |  Branch (3219:6): [True: 1.05k, False: 518]
  ------------------
 3220|  1.05k|		return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.05k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3221|       |
 3222|  2.23k|	do {
 3223|  2.23k|		if (tar_flush_unconsumed(a, unconsumed) != ARCHIVE_OK) {
  ------------------
  |  |  233|  2.23k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3223:7): [True: 0, False: 2.23k]
  ------------------
 3224|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3225|      0|		}
 3226|  2.23k|		data = __archive_read_ahead(a, 512, &bytes_read);
 3227|  2.23k|		if (data == NULL) {
  ------------------
  |  Branch (3227:7): [True: 7, False: 2.23k]
  ------------------
 3228|      7|			archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      7|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3229|      7|			    "Truncated tar archive "
 3230|      7|			    "detected while reading sparse file data");
 3231|      7|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      7|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3232|      7|		}
 3233|  2.23k|		*unconsumed = 512;
 3234|  2.23k|		ext = (const struct extended *)data;
 3235|  2.23k|		if (gnu_sparse_old_parse(a, tar, ext->sparse, 21) != ARCHIVE_OK)
  ------------------
  |  |  233|  2.23k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3235:7): [True: 1, False: 2.23k]
  ------------------
 3236|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3237|  2.23k|	} while (ext->isextended[0] != 0);
  ------------------
  |  Branch (3237:11): [True: 1.72k, False: 510]
  ------------------
 3238|    510|	if (tar->sparse_list != NULL)
  ------------------
  |  Branch (3238:6): [True: 510, False: 0]
  ------------------
 3239|    510|		tar->entry_offset = tar->sparse_list->offset;
 3240|    510|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    510|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3241|    518|}
archive_read_support_format_tar.c:gnu_sparse_old_parse:
 3246|  3.79k|{
 3247|  43.9k|	while (length > 0 && sparse->offset[0] != 0) {
  ------------------
  |  Branch (3247:9): [True: 41.5k, False: 2.35k]
  |  Branch (3247:23): [True: 40.1k, False: 1.44k]
  ------------------
 3248|  40.1k|		if (gnu_add_sparse_entry(a, tar,
  ------------------
  |  Branch (3248:7): [True: 1, False: 40.1k]
  ------------------
 3249|  40.1k|		    tar_atol(sparse->offset, sizeof(sparse->offset)),
 3250|  40.1k|		    tar_atol(sparse->numbytes, sizeof(sparse->numbytes)))
 3251|  40.1k|		    != ARCHIVE_OK)
  ------------------
  |  |  233|  40.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3252|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3253|  40.1k|		sparse++;
 3254|  40.1k|		length--;
 3255|  40.1k|	}
 3256|  3.79k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  3.79k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3257|  3.79k|}
archive_read_support_format_tar.c:header_common:
 1376|  21.2k|{
 1377|  21.2k|	const struct archive_entry_header_ustar	*header;
 1378|  21.2k|	const char *existing_linkpath;
 1379|  21.2k|	const wchar_t *existing_wcs_linkpath;
 1380|  21.2k|	int     err = ARCHIVE_OK;
  ------------------
  |  |  233|  21.2k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1381|       |
 1382|  21.2k|	header = (const struct archive_entry_header_ustar *)h;
 1383|       |
 1384|       |	/* Parse out the numeric fields (all are octal) */
 1385|       |
 1386|       |	/* Split mode handling: Set filetype always, perm only if not already set */
 1387|  21.2k|	archive_entry_set_filetype(entry,
 1388|  21.2k|	    (mode_t)tar_atol(header->mode, sizeof(header->mode)));
 1389|  21.2k|	if (!archive_entry_perm_is_set(entry)) {
  ------------------
  |  Branch (1389:6): [True: 21.1k, False: 39]
  ------------------
 1390|  21.1k|		archive_entry_set_perm(entry,
 1391|  21.1k|			(mode_t)tar_atol(header->mode, sizeof(header->mode)));
 1392|  21.1k|	}
 1393|       |
 1394|       |	/* Set uid, gid, mtime if not already set */
 1395|  21.2k|	if (!archive_entry_uid_is_set(entry)) {
  ------------------
  |  Branch (1395:6): [True: 21.2k, False: 0]
  ------------------
 1396|  21.2k|		archive_entry_set_uid(entry, tar_atol(header->uid, sizeof(header->uid)));
 1397|  21.2k|	}
 1398|  21.2k|	if (!archive_entry_gid_is_set(entry)) {
  ------------------
  |  Branch (1398:6): [True: 21.2k, False: 0]
  ------------------
 1399|  21.2k|		archive_entry_set_gid(entry, tar_atol(header->gid, sizeof(header->gid)));
 1400|  21.2k|	}
 1401|  21.2k|	if (!archive_entry_mtime_is_set(entry)) {
  ------------------
  |  Branch (1401:6): [True: 21.2k, False: 0]
  ------------------
 1402|  21.2k|		int64_t t64 = tar_atol(header->mtime, sizeof(header->mtime));
 1403|  21.2k|		time_t t = (time_t)t64;
 1404|  21.2k|		if ((int64_t)t != t64) { /* time_t overflowed */
  ------------------
  |  Branch (1404:7): [True: 0, False: 21.2k]
  ------------------
 1405|      0|			t = get_time_t_max();
 1406|      0|		}
 1407|  21.2k|		archive_entry_set_mtime(entry, t, 0);
 1408|  21.2k|	}
 1409|       |
 1410|       |	/* Reconcile the size info. */
 1411|       |	/* First, how big is the file on disk? */
 1412|  21.2k|	if ((tar->size_fields & TAR_SIZE_GNU_SPARSE_REALSIZE) != 0) {
  ------------------
  |  |  160|  21.2k|#define TAR_SIZE_GNU_SPARSE_REALSIZE 2
  ------------------
  |  Branch (1412:6): [True: 682, False: 20.5k]
  ------------------
 1413|       |		/* GNU sparse format 1.0 uses `GNU.sparse.realsize`
 1414|       |		 * to hold the size of the file on disk. */
 1415|    682|		tar->disk_size = tar->GNU_sparse_realsize;
 1416|  20.5k|	} else if ((tar->size_fields & TAR_SIZE_GNU_SPARSE_SIZE) != 0
  ------------------
  |  |  161|  20.5k|#define TAR_SIZE_GNU_SPARSE_SIZE 4
  ------------------
  |  Branch (1416:13): [True: 0, False: 20.5k]
  ------------------
 1417|      0|		   && (tar->sparse_gnu_major == 0)) {
  ------------------
  |  Branch (1417:9): [True: 0, False: 0]
  ------------------
 1418|       |		/* GNU sparse format 0.0 and 0.1 use `GNU.sparse.size`
 1419|       |		 * to hold the size of the file on disk. */
 1420|      0|		tar->disk_size = tar->GNU_sparse_size;
 1421|  20.5k|	} else if ((tar->size_fields & TAR_SIZE_SCHILY_SPARSE_REALSIZE) != 0) {
  ------------------
  |  |  162|  20.5k|#define TAR_SIZE_SCHILY_SPARSE_REALSIZE 8
  ------------------
  |  Branch (1421:13): [True: 4, False: 20.5k]
  ------------------
 1422|      4|		tar->disk_size = tar->SCHILY_sparse_realsize;
 1423|  20.5k|	} else if ((tar->size_fields & TAR_SIZE_PAX_SIZE) != 0) {
  ------------------
  |  |  159|  20.5k|#define TAR_SIZE_PAX_SIZE 1
  ------------------
  |  Branch (1423:13): [True: 0, False: 20.5k]
  ------------------
 1424|      0|		tar->disk_size = tar->pax_size;
 1425|  20.5k|	} else {
 1426|       |		/* There wasn't a suitable pax header, so use the ustar info */
 1427|  20.5k|		tar->disk_size = tar_atol(header->size, sizeof(header->size));
 1428|  20.5k|	}
 1429|       |
 1430|  21.2k|	if (tar->disk_size < 0) {
  ------------------
  |  Branch (1430:6): [True: 11, False: 21.2k]
  ------------------
 1431|     11|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     11|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1432|     11|				  "Tar entry has negative file size");
 1433|     11|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     11|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1434|  21.2k|	} else if (tar->disk_size > entry_limit) {
  ------------------
  |  Branch (1434:13): [True: 0, False: 21.2k]
  ------------------
 1435|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1436|      0|				  "Tar entry size overflow");
 1437|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1438|  21.2k|	} else {
 1439|  21.2k|		archive_entry_set_size(entry, tar->disk_size);
 1440|  21.2k|	}
 1441|       |
 1442|       |	/* Second, how big is the data in the archive? */
 1443|  21.2k|	if ((tar->size_fields & TAR_SIZE_GNU_SPARSE_SIZE) != 0
  ------------------
  |  |  161|  21.2k|#define TAR_SIZE_GNU_SPARSE_SIZE 4
  ------------------
  |  Branch (1443:6): [True: 0, False: 21.2k]
  ------------------
 1444|      0|	    && (tar->sparse_gnu_major == 1)) {
  ------------------
  |  Branch (1444:9): [True: 0, False: 0]
  ------------------
 1445|       |		/* GNU sparse format 1.0 uses `GNU.sparse.size`
 1446|       |		 * to hold the size of the data in the archive. */
 1447|      0|		tar->entry_bytes_remaining = tar->GNU_sparse_size;
 1448|  21.2k|	} else if ((tar->size_fields & TAR_SIZE_PAX_SIZE) != 0) {
  ------------------
  |  |  159|  21.2k|#define TAR_SIZE_PAX_SIZE 1
  ------------------
  |  Branch (1448:13): [True: 0, False: 21.2k]
  ------------------
 1449|      0|		tar->entry_bytes_remaining = tar->pax_size;
 1450|  21.2k|	} else {
 1451|  21.2k|		tar->entry_bytes_remaining
 1452|  21.2k|			= tar_atol(header->size, sizeof(header->size));
 1453|  21.2k|	}
 1454|  21.2k|	if (tar->entry_bytes_remaining < 0) {
  ------------------
  |  Branch (1454:6): [True: 0, False: 21.2k]
  ------------------
 1455|      0|		tar->entry_bytes_remaining = 0;
 1456|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1457|      0|				  "Tar entry has negative size");
 1458|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1459|  21.2k|	} else if (tar->entry_bytes_remaining > entry_limit) {
  ------------------
  |  Branch (1459:13): [True: 0, False: 21.2k]
  ------------------
 1460|      0|		tar->entry_bytes_remaining = 0;
 1461|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1462|      0|				  "Tar entry size overflow");
 1463|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1464|      0|	}
 1465|       |
 1466|       |	/* Handle the tar type flag appropriately. */
 1467|  21.2k|	tar->filetype = header->typeflag[0];
 1468|       |
 1469|       |	/*
 1470|       |	 * TODO: If the linkpath came from Pax extension header, then
 1471|       |	 * we should obey the hdrcharset_utf8 flag when converting these.
 1472|       |	 */
 1473|  21.2k|	switch (tar->filetype) {
 1474|  6.19k|	case '1': /* Hard link */
  ------------------
  |  Branch (1474:2): [True: 6.19k, False: 15.0k]
  ------------------
 1475|  6.19k|		archive_entry_set_link_to_hardlink(entry);
 1476|  6.19k|		existing_wcs_linkpath = archive_entry_hardlink_w(entry);
 1477|  6.19k|		existing_linkpath = archive_entry_hardlink(entry);
 1478|  6.19k|		if ((existing_linkpath == NULL || existing_linkpath[0] == '\0')
  ------------------
  |  Branch (1478:8): [True: 6.19k, False: 0]
  |  Branch (1478:37): [True: 0, False: 0]
  ------------------
 1479|  6.19k|		    && (existing_wcs_linkpath == NULL || existing_wcs_linkpath[0] == '\0')) {
  ------------------
  |  Branch (1479:11): [True: 6.19k, False: 0]
  |  Branch (1479:44): [True: 0, False: 0]
  ------------------
 1480|  6.19k|			struct archive_string linkpath;
 1481|  6.19k|			archive_string_init(&linkpath);
  ------------------
  |  |   71|  6.19k|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 6.19k]
  |  |  ------------------
  ------------------
 1482|  6.19k|			archive_strncpy(&linkpath,
  ------------------
  |  |  173|  6.19k|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 1483|  6.19k|					header->linkname, sizeof(header->linkname));
 1484|  6.19k|			if (archive_entry_copy_hardlink_l(entry, linkpath.s,
  ------------------
  |  |   74|  6.19k|#define archive_entry_copy_hardlink_l	_archive_entry_copy_hardlink_l
  ------------------
  |  Branch (1484:8): [True: 0, False: 6.19k]
  ------------------
 1485|  6.19k|							  archive_strlen(&linkpath), tar->sconv) != 0) {
  ------------------
  |  |  178|  6.19k|#define	archive_strlen(a) ((a)->length)
  ------------------
 1486|      0|				err = set_conversion_failed_error(a, tar->sconv,
 1487|      0|								  "Linkname");
 1488|      0|				if (err == ARCHIVE_FATAL) {
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (1488:9): [True: 0, False: 0]
  ------------------
 1489|      0|					archive_string_free(&linkpath);
 1490|      0|					return (err);
 1491|      0|				}
 1492|      0|			}
 1493|  6.19k|			archive_string_free(&linkpath);
 1494|  6.19k|		}
 1495|       |		/*
 1496|       |		 * The following may seem odd, but: Technically, tar
 1497|       |		 * does not store the file type for a "hard link"
 1498|       |		 * entry, only the fact that it is a hard link.  So, I
 1499|       |		 * leave the type zero normally.  But, pax interchange
 1500|       |		 * format allows hard links to have data, which
 1501|       |		 * implies that the underlying entry is a regular
 1502|       |		 * file.
 1503|       |		 */
 1504|  6.19k|		if (archive_entry_size(entry) > 0)
  ------------------
  |  Branch (1504:7): [True: 5.84k, False: 353]
  ------------------
 1505|  5.84k|			archive_entry_set_filetype(entry, AE_IFREG);
  ------------------
  |  |  216|  5.84k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1506|       |
 1507|       |		/*
 1508|       |		 * A tricky point: Traditionally, tar readers have
 1509|       |		 * ignored the size field when reading hardlink
 1510|       |		 * entries, and some writers put non-zero sizes even
 1511|       |		 * though the body is empty.  POSIX blessed this
 1512|       |		 * convention in the 1988 standard, but broke with
 1513|       |		 * this tradition in 2001 by permitting hardlink
 1514|       |		 * entries to store valid bodies in pax interchange
 1515|       |		 * format, but not in ustar format.  Since there is no
 1516|       |		 * hard and fast way to distinguish pax interchange
 1517|       |		 * from earlier archives (the 'x' and 'g' entries are
 1518|       |		 * optional, after all), we need a heuristic.
 1519|       |		 */
 1520|  6.19k|		if (archive_entry_size(entry) == 0) {
  ------------------
  |  Branch (1520:7): [True: 353, False: 5.84k]
  ------------------
 1521|       |			/* If the size is already zero, we're done. */
 1522|  5.84k|		}  else if (a->archive.archive_format
  ------------------
  |  Branch (1522:15): [True: 0, False: 5.84k]
  ------------------
 1523|  5.84k|		    == ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE) {
  ------------------
  |  |  369|  5.84k|#define	ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE	(ARCHIVE_FORMAT_TAR | 2)
  |  |  ------------------
  |  |  |  |  367|  5.84k|#define	ARCHIVE_FORMAT_TAR			0x30000
  |  |  ------------------
  ------------------
 1524|       |			/* Definitely pax extended; must obey hardlink size. */
 1525|  5.84k|		} else if (a->archive.archive_format == ARCHIVE_FORMAT_TAR
  ------------------
  |  |  367|  11.6k|#define	ARCHIVE_FORMAT_TAR			0x30000
  ------------------
  |  Branch (1525:14): [True: 318, False: 5.52k]
  ------------------
 1526|  5.52k|		    || a->archive.archive_format == ARCHIVE_FORMAT_TAR_GNUTAR)
  ------------------
  |  |  371|  5.52k|#define	ARCHIVE_FORMAT_TAR_GNUTAR		(ARCHIVE_FORMAT_TAR | 4)
  |  |  ------------------
  |  |  |  |  367|  5.52k|#define	ARCHIVE_FORMAT_TAR			0x30000
  |  |  ------------------
  ------------------
  |  Branch (1526:10): [True: 357, False: 5.16k]
  ------------------
 1527|    675|		{
 1528|       |			/* Old-style or GNU tar: we must ignore the size. */
 1529|    675|			archive_entry_set_size(entry, 0);
 1530|    675|			tar->entry_bytes_remaining = 0;
 1531|  5.16k|		} else if (archive_read_format_tar_bid(a, 50) > 50) {
  ------------------
  |  Branch (1531:14): [True: 247, False: 4.92k]
  ------------------
 1532|       |			/*
 1533|       |			 * We don't know if it's pax: If the bid
 1534|       |			 * function sees a valid ustar header
 1535|       |			 * immediately following, then let's ignore
 1536|       |			 * the hardlink size.
 1537|       |			 */
 1538|    247|			archive_entry_set_size(entry, 0);
 1539|    247|			tar->entry_bytes_remaining = 0;
 1540|    247|		}
 1541|       |		/*
 1542|       |		 * TODO: There are still two cases I'd like to handle:
 1543|       |		 *   = a ustar non-pax archive with a hardlink entry at
 1544|       |		 *     end-of-archive.  (Look for block of nulls following?)
 1545|       |		 *   = a pax archive that has not seen any pax headers
 1546|       |		 *     and has an entry which is a hardlink entry storing
 1547|       |		 *     a body containing an uncompressed tar archive.
 1548|       |		 * The first is worth addressing; I don't see any reliable
 1549|       |		 * way to deal with the second possibility.
 1550|       |		 */
 1551|  6.19k|		break;
 1552|    178|	case '2': /* Symlink */
  ------------------
  |  Branch (1552:2): [True: 178, False: 21.0k]
  ------------------
 1553|    178|		archive_entry_set_link_to_symlink(entry);
 1554|    178|		existing_wcs_linkpath = archive_entry_symlink_w(entry);
 1555|    178|		existing_linkpath = archive_entry_symlink(entry);
 1556|    178|		if ((existing_linkpath == NULL || existing_linkpath[0] == '\0')
  ------------------
  |  Branch (1556:8): [True: 178, False: 0]
  |  Branch (1556:37): [True: 0, False: 0]
  ------------------
 1557|    178|		    && (existing_wcs_linkpath == NULL || existing_wcs_linkpath[0] == '\0')) {
  ------------------
  |  Branch (1557:11): [True: 178, False: 0]
  |  Branch (1557:44): [True: 0, False: 0]
  ------------------
 1558|    178|			struct archive_string linkpath;
 1559|    178|			archive_string_init(&linkpath);
  ------------------
  |  |   71|    178|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 178]
  |  |  ------------------
  ------------------
 1560|    178|			archive_strncpy(&linkpath,
  ------------------
  |  |  173|    178|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 1561|    178|					header->linkname, sizeof(header->linkname));
 1562|    178|			if (archive_entry_copy_symlink_l(entry, linkpath.s,
  ------------------
  |  |   83|    178|#define archive_entry_copy_symlink_l	_archive_entry_copy_symlink_l
  ------------------
  |  Branch (1562:8): [True: 0, False: 178]
  ------------------
 1563|    178|			    archive_strlen(&linkpath), tar->sconv) != 0) {
  ------------------
  |  |  178|    178|#define	archive_strlen(a) ((a)->length)
  ------------------
 1564|      0|				err = set_conversion_failed_error(a, tar->sconv,
 1565|      0|				    "Linkname");
 1566|      0|				if (err == ARCHIVE_FATAL) {
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (1566:9): [True: 0, False: 0]
  ------------------
 1567|      0|					archive_string_free(&linkpath);
 1568|      0|					return (err);
 1569|      0|				}
 1570|      0|			}
 1571|    178|			archive_string_free(&linkpath);
 1572|    178|		}
 1573|    178|		archive_entry_set_filetype(entry, AE_IFLNK);
  ------------------
  |  |  217|    178|#define AE_IFLNK	((__LA_MODE_T)0120000)
  ------------------
 1574|    178|		archive_entry_set_size(entry, 0);
 1575|    178|		tar->entry_bytes_remaining = 0;
 1576|    178|		break;
 1577|    270|	case '3': /* Character device */
  ------------------
  |  Branch (1577:2): [True: 270, False: 20.9k]
  ------------------
 1578|    270|		archive_entry_set_filetype(entry, AE_IFCHR);
  ------------------
  |  |  219|    270|#define AE_IFCHR	((__LA_MODE_T)0020000)
  ------------------
 1579|    270|		archive_entry_set_size(entry, 0);
 1580|    270|		tar->entry_bytes_remaining = 0;
 1581|    270|		break;
 1582|    494|	case '4': /* Block device */
  ------------------
  |  Branch (1582:2): [True: 494, False: 20.7k]
  ------------------
 1583|    494|		archive_entry_set_filetype(entry, AE_IFBLK);
  ------------------
  |  |  220|    494|#define AE_IFBLK	((__LA_MODE_T)0060000)
  ------------------
 1584|    494|		archive_entry_set_size(entry, 0);
 1585|    494|		tar->entry_bytes_remaining = 0;
 1586|    494|		break;
 1587|    239|	case '5': /* Dir */
  ------------------
  |  Branch (1587:2): [True: 239, False: 20.9k]
  ------------------
 1588|    239|		archive_entry_set_filetype(entry, AE_IFDIR);
  ------------------
  |  |  221|    239|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 1589|    239|		archive_entry_set_size(entry, 0);
 1590|    239|		tar->entry_bytes_remaining = 0;
 1591|    239|		break;
 1592|    289|	case '6': /* FIFO device */
  ------------------
  |  Branch (1592:2): [True: 289, False: 20.9k]
  ------------------
 1593|    289|		archive_entry_set_filetype(entry, AE_IFIFO);
  ------------------
  |  |  222|    289|#define AE_IFIFO	((__LA_MODE_T)0010000)
  ------------------
 1594|    289|		archive_entry_set_size(entry, 0);
 1595|    289|		tar->entry_bytes_remaining = 0;
 1596|    289|		break;
 1597|      6|	case 'D': /* GNU incremental directory type */
  ------------------
  |  Branch (1597:2): [True: 6, False: 21.2k]
  ------------------
 1598|       |		/*
 1599|       |		 * No special handling is actually required here.
 1600|       |		 * It might be nice someday to preprocess the file list and
 1601|       |		 * provide it to the client, though.
 1602|       |		 */
 1603|      6|		archive_entry_set_filetype(entry, AE_IFDIR);
  ------------------
  |  |  221|      6|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 1604|      6|		break;
 1605|    445|	case 'M': /* GNU "Multi-volume" (remainder of file from last archive)*/
  ------------------
  |  Branch (1605:2): [True: 445, False: 20.7k]
  ------------------
 1606|       |		/*
 1607|       |		 * As far as I can tell, this is just like a regular file
 1608|       |		 * entry, except that the contents should be _appended_ to
 1609|       |		 * the indicated file at the indicated offset.  This may
 1610|       |		 * require some API work to fully support.
 1611|       |		 */
 1612|    445|		break;
 1613|      0|	case 'N': /* Old GNU "long filename" entry. */
  ------------------
  |  Branch (1613:2): [True: 0, False: 21.2k]
  ------------------
 1614|       |		/* The body of this entry is a script for renaming
 1615|       |		 * previously-extracted entries.  Ugh.  It will never
 1616|       |		 * be supported by libarchive. */
 1617|      0|		archive_entry_set_filetype(entry, AE_IFREG);
  ------------------
  |  |  216|      0|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1618|      0|		break;
 1619|      0|	case 'S': /* GNU sparse files */
  ------------------
  |  Branch (1619:2): [True: 0, False: 21.2k]
  ------------------
 1620|       |		/*
 1621|       |		 * Sparse files are really just regular files with
 1622|       |		 * sparse information in the extended area.
 1623|       |		 */
 1624|       |		/* FALLTHROUGH */
 1625|  1.10k|	case '0': /* ustar "regular" file */
  ------------------
  |  Branch (1625:2): [True: 1.10k, False: 20.1k]
  ------------------
 1626|       |		/* FALLTHROUGH */
 1627|  13.1k|	default: /* Non-standard file types */
  ------------------
  |  Branch (1627:2): [True: 12.0k, False: 9.21k]
  ------------------
 1628|       |		/*
 1629|       |		 * Per POSIX: non-recognized types should always be
 1630|       |		 * treated as regular files.
 1631|       |		 */
 1632|  13.1k|		archive_entry_set_filetype(entry, AE_IFREG);
  ------------------
  |  |  216|  13.1k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1633|  13.1k|		break;
 1634|  21.2k|	}
 1635|  21.2k|	return (err);
 1636|  21.2k|}
archive_read_support_format_tar.c:header_ustar:
 1818|  6.16k|{
 1819|  6.16k|	const struct archive_entry_header_ustar	*header;
 1820|  6.16k|	struct archive_string as;
 1821|  6.16k|	int err = ARCHIVE_OK, r;
  ------------------
  |  |  233|  6.16k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1822|       |
 1823|  6.16k|	header = (const struct archive_entry_header_ustar *)h;
 1824|       |
 1825|       |	/* Copy name into an internal buffer to ensure null-termination. */
 1826|  6.16k|	const char *existing_pathname = archive_entry_pathname(entry);
 1827|  6.16k|	const wchar_t *existing_wcs_pathname = archive_entry_pathname_w(entry);
 1828|  6.16k|	if ((existing_pathname == NULL || existing_pathname[0] == '\0')
  ------------------
  |  Branch (1828:7): [True: 6.16k, False: 0]
  |  Branch (1828:36): [True: 0, False: 0]
  ------------------
 1829|  6.16k|	    && (existing_wcs_pathname == NULL || existing_wcs_pathname[0] == '\0')) {
  ------------------
  |  Branch (1829:10): [True: 6.16k, False: 0]
  |  Branch (1829:43): [True: 0, False: 0]
  ------------------
 1830|  6.16k|		archive_string_init(&as);
  ------------------
  |  |   71|  6.16k|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 6.16k]
  |  |  ------------------
  ------------------
 1831|  6.16k|		if (header->prefix[0]) {
  ------------------
  |  Branch (1831:7): [True: 5.71k, False: 451]
  ------------------
 1832|  5.71k|			archive_strncpy(&as, header->prefix, sizeof(header->prefix));
  ------------------
  |  |  173|  5.71k|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 1833|  5.71k|			if (as.s[archive_strlen(&as) - 1] != '/')
  ------------------
  |  |  178|  5.71k|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (1833:8): [True: 5.71k, False: 0]
  ------------------
 1834|  5.71k|				archive_strappend_char(&as, '/');
 1835|  5.71k|			archive_strncat(&as, header->name, sizeof(header->name));
 1836|  5.71k|		} else {
 1837|    451|			archive_strncpy(&as, header->name, sizeof(header->name));
  ------------------
  |  |  173|    451|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 1838|    451|		}
 1839|  6.16k|		if (archive_entry_copy_pathname_l(entry, as.s, archive_strlen(&as),
  ------------------
  |  |   80|  6.16k|#define archive_entry_copy_pathname_l	_archive_entry_copy_pathname_l
  ------------------
              		if (archive_entry_copy_pathname_l(entry, as.s, archive_strlen(&as),
  ------------------
  |  |  178|  6.16k|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (1839:7): [True: 0, False: 6.16k]
  ------------------
 1840|  6.16k|		    tar->sconv) != 0) {
 1841|      0|			err = set_conversion_failed_error(a, tar->sconv, "Pathname");
 1842|      0|			if (err == ARCHIVE_FATAL)
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (1842:8): [True: 0, False: 0]
  ------------------
 1843|      0|				return (err);
 1844|      0|		}
 1845|  6.16k|		archive_string_free(&as);
 1846|  6.16k|	}
 1847|       |
 1848|       |	/* Handle rest of common fields. */
 1849|  6.16k|	r = header_common(a, tar, entry, h);
 1850|  6.16k|	if (r == ARCHIVE_FATAL)
  ------------------
  |  |  239|  6.16k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (1850:6): [True: 0, False: 6.16k]
  ------------------
 1851|      0|		return (r);
 1852|  6.16k|	if (r < err)
  ------------------
  |  Branch (1852:6): [True: 0, False: 6.16k]
  ------------------
 1853|      0|		err = r;
 1854|       |
 1855|       |	/* Handle POSIX ustar fields. */
 1856|  6.16k|	const char *existing_uname = archive_entry_uname(entry);
 1857|  6.16k|	if (existing_uname == NULL || existing_uname[0] == '\0') {
  ------------------
  |  Branch (1857:6): [True: 6.16k, False: 0]
  |  Branch (1857:32): [True: 0, False: 0]
  ------------------
 1858|  6.16k|		if (archive_entry_copy_uname_l(entry,
  ------------------
  |  |   86|  6.16k|#define archive_entry_copy_uname_l	_archive_entry_copy_uname_l
  ------------------
  |  Branch (1858:7): [True: 0, False: 6.16k]
  ------------------
 1859|  6.16k|		    header->uname, sizeof(header->uname), tar->sconv) != 0) {
 1860|      0|			err = set_conversion_failed_error(a, tar->sconv, "Uname");
 1861|      0|			if (err == ARCHIVE_FATAL)
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (1861:8): [True: 0, False: 0]
  ------------------
 1862|      0|				return (err);
 1863|      0|		}
 1864|  6.16k|	}
 1865|       |
 1866|  6.16k|	const char *existing_gname = archive_entry_gname(entry);
 1867|  6.16k|	if (existing_gname == NULL || existing_gname[0] == '\0') {
  ------------------
  |  Branch (1867:6): [True: 6.16k, False: 0]
  |  Branch (1867:32): [True: 0, False: 0]
  ------------------
 1868|  6.16k|		if (archive_entry_copy_gname_l(entry,
  ------------------
  |  |   71|  6.16k|#define archive_entry_copy_gname_l	_archive_entry_copy_gname_l
  ------------------
  |  Branch (1868:7): [True: 0, False: 6.16k]
  ------------------
 1869|  6.16k|		    header->gname, sizeof(header->gname), tar->sconv) != 0) {
 1870|      0|			err = set_conversion_failed_error(a, tar->sconv, "Gname");
 1871|      0|			if (err == ARCHIVE_FATAL)
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (1871:8): [True: 0, False: 0]
  ------------------
 1872|      0|				return (err);
 1873|      0|		}
 1874|  6.16k|	}
 1875|       |
 1876|       |	/* Parse out device numbers only for char and block specials. */
 1877|  6.16k|	if (header->typeflag[0] == '3' || header->typeflag[0] == '4') {
  ------------------
  |  Branch (1877:6): [True: 66, False: 6.09k]
  |  Branch (1877:36): [True: 232, False: 5.86k]
  ------------------
 1878|    298|		if (!archive_entry_rdev_is_set(entry)) {
  ------------------
  |  Branch (1878:7): [True: 298, False: 0]
  ------------------
 1879|    298|			archive_entry_set_rdevmajor(entry, (dev_t)
 1880|    298|			    tar_atol(header->rdevmajor, sizeof(header->rdevmajor)));
 1881|    298|			archive_entry_set_rdevminor(entry, (dev_t)
 1882|    298|			    tar_atol(header->rdevminor, sizeof(header->rdevminor)));
 1883|    298|		}
 1884|  5.86k|	} else {
 1885|  5.86k|		archive_entry_set_rdev(entry, 0);
 1886|  5.86k|	}
 1887|       |
 1888|  6.16k|	tar->entry_padding = 0x1ff & (-tar->entry_bytes_remaining);
 1889|       |
 1890|  6.16k|	return (err);
 1891|  6.16k|}
archive_read_support_format_tar.c:header_old_tar:
 1644|  13.2k|{
 1645|  13.2k|	const struct archive_entry_header_ustar	*header;
 1646|  13.2k|	int err = ARCHIVE_OK, err2;
  ------------------
  |  |  233|  13.2k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1647|       |
 1648|       |	/*
 1649|       |	 * Copy filename over (to ensure null termination).
 1650|       |	 * Skip if pathname was already set e.g. by header_gnu_longname()
 1651|       |	 */
 1652|  13.2k|	header = (const struct archive_entry_header_ustar *)h;
 1653|       |
 1654|  13.2k|	const char *existing_pathname = archive_entry_pathname(entry);
 1655|  13.2k|	const wchar_t *existing_wcs_pathname = archive_entry_pathname_w(entry);
 1656|  13.2k|	if ((existing_pathname == NULL || existing_pathname[0] == '\0')
  ------------------
  |  Branch (1656:7): [True: 13.2k, False: 2]
  |  Branch (1656:36): [True: 0, False: 2]
  ------------------
 1657|  13.2k|	    && (existing_wcs_pathname == NULL || existing_wcs_pathname[0] == '\0') &&
  ------------------
  |  Branch (1657:10): [True: 13.2k, False: 0]
  |  Branch (1657:43): [True: 0, False: 0]
  ------------------
 1658|  13.2k|	    archive_entry_copy_pathname_l(entry,
  ------------------
  |  |   80|  13.2k|#define archive_entry_copy_pathname_l	_archive_entry_copy_pathname_l
  ------------------
  |  Branch (1658:6): [True: 0, False: 13.2k]
  ------------------
 1659|  13.2k|	    header->name, sizeof(header->name), tar->sconv) != 0) {
 1660|      0|		err = set_conversion_failed_error(a, tar->sconv, "Pathname");
 1661|      0|		if (err == ARCHIVE_FATAL)
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (1661:7): [True: 0, False: 0]
  ------------------
 1662|      0|			return (err);
 1663|      0|	}
 1664|       |
 1665|       |	/* Grab rest of common fields */
 1666|  13.2k|	err2 = header_common(a, tar, entry, h);
 1667|  13.2k|	if (err > err2)
  ------------------
  |  Branch (1667:6): [True: 11, False: 13.2k]
  ------------------
 1668|     11|		err = err2;
 1669|       |
 1670|  13.2k|	tar->entry_padding = 0x1ff & (-tar->entry_bytes_remaining);
 1671|  13.2k|	return (err);
 1672|  13.2k|}
archive_read_support_format_tar.c:is_mac_metadata_entry:
 1678|  21.2k|is_mac_metadata_entry(struct archive_entry *entry) {
 1679|  21.2k|	const char *p, *name;
 1680|  21.2k|	const wchar_t *wp, *wname;
 1681|       |
 1682|  21.2k|	wname = wp = archive_entry_pathname_w(entry);
 1683|  21.2k|	if (wp != NULL) {
  ------------------
  |  Branch (1683:6): [True: 20.5k, False: 660]
  ------------------
 1684|       |		/* Find the last path element. */
 1685|   918k|		for (; *wp != L'\0'; ++wp) {
  ------------------
  |  Branch (1685:10): [True: 897k, False: 20.5k]
  ------------------
 1686|   897k|			if (wp[0] == '/' && wp[1] != L'\0')
  ------------------
  |  Branch (1686:8): [True: 5.86k, False: 891k]
  |  Branch (1686:24): [True: 365, False: 5.49k]
  ------------------
 1687|    365|				wname = wp + 1;
 1688|   897k|		}
 1689|       |		/*
 1690|       |		 * If last path element starts with "._", then
 1691|       |		 * this is a Mac extension.
 1692|       |		 */
 1693|  20.5k|		if (wname[0] == L'.' && wname[1] == L'_' && wname[2] != L'\0')
  ------------------
  |  Branch (1693:7): [True: 38, False: 20.5k]
  |  Branch (1693:27): [True: 0, False: 38]
  |  Branch (1693:47): [True: 0, False: 0]
  ------------------
 1694|      0|			return 1;
 1695|  20.5k|	} else {
 1696|       |		/* Find the last path element. */
 1697|    660|		name = p = archive_entry_pathname(entry);
 1698|    660|		if (p == NULL)
  ------------------
  |  Branch (1698:7): [True: 0, False: 660]
  ------------------
 1699|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1700|  52.8k|		for (; *p != '\0'; ++p) {
  ------------------
  |  Branch (1700:10): [True: 52.1k, False: 660]
  ------------------
 1701|  52.1k|			if (p[0] == '/' && p[1] != '\0')
  ------------------
  |  Branch (1701:8): [True: 277, False: 51.8k]
  |  Branch (1701:23): [True: 45, False: 232]
  ------------------
 1702|     45|				name = p + 1;
 1703|  52.1k|		}
 1704|       |		/*
 1705|       |		 * If last path element starts with "._", then
 1706|       |		 * this is a Mac extension.
 1707|       |		 */
 1708|    660|		if (name[0] == '.' && name[1] == '_' && name[2] != '\0')
  ------------------
  |  Branch (1708:7): [True: 0, False: 660]
  |  Branch (1708:25): [True: 0, False: 0]
  |  Branch (1708:43): [True: 0, False: 0]
  ------------------
 1709|      0|			return 1;
 1710|    660|	}
 1711|       |	/* Not a mac extension */
 1712|  21.2k|	return 0;
 1713|  21.2k|}
archive_read_support_format_tar.c:gnu_sparse_10_read:
 3389|      3|{
 3390|      3|	int64_t bytes_read, entries, offset, size, to_skip, remaining;
 3391|       |
 3392|       |	/* Clear out the existing sparse list. */
 3393|      3|	gnu_clear_sparse_list(tar);
 3394|       |
 3395|      3|	remaining = tar->entry_bytes_remaining;
 3396|       |
 3397|       |	/* Parse entries. */
 3398|      3|	entries = gnu_sparse_10_atol(a, tar, &remaining, unconsumed);
 3399|      3|	if (entries < 0)
  ------------------
  |  Branch (3399:6): [True: 3, False: 0]
  ------------------
 3400|      3|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      3|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3401|       |	/* Parse the individual entries. */
 3402|      0|	while (entries-- > 0) {
  ------------------
  |  Branch (3402:9): [True: 0, False: 0]
  ------------------
 3403|       |		/* Parse offset/size */
 3404|      0|		offset = gnu_sparse_10_atol(a, tar, &remaining, unconsumed);
 3405|      0|		if (offset < 0)
  ------------------
  |  Branch (3405:7): [True: 0, False: 0]
  ------------------
 3406|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3407|      0|		size = gnu_sparse_10_atol(a, tar, &remaining, unconsumed);
 3408|      0|		if (size < 0)
  ------------------
  |  Branch (3408:7): [True: 0, False: 0]
  ------------------
 3409|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3410|       |		/* Add a new sparse entry. */
 3411|      0|		if (gnu_add_sparse_entry(a, tar, offset, size) != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3411:7): [True: 0, False: 0]
  ------------------
 3412|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3413|      0|	}
 3414|       |	/* Skip rest of block... */
 3415|      0|	if (tar_flush_unconsumed(a, unconsumed) != ARCHIVE_OK) {
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3415:6): [True: 0, False: 0]
  ------------------
 3416|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3417|      0|	}
 3418|      0|	bytes_read = tar->entry_bytes_remaining - remaining;
 3419|      0|	to_skip = 0x1ff & -bytes_read;
 3420|       |	/* Fail if tar->entry_bytes_remaing would get negative */
 3421|      0|	if (to_skip > remaining)
  ------------------
  |  Branch (3421:6): [True: 0, False: 0]
  ------------------
 3422|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3423|      0|	if (to_skip != __archive_read_consume(a, to_skip))
  ------------------
  |  Branch (3423:6): [True: 0, False: 0]
  ------------------
 3424|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3425|      0|	return (bytes_read + to_skip);
 3426|      0|}
archive_read_support_format_tar.c:gnu_sparse_10_atol:
 3343|      3|{
 3344|      3|	int64_t l, limit, last_digit_limit;
 3345|      3|	const char *p;
 3346|      3|	ssize_t bytes_read;
 3347|      3|	int base, digit;
 3348|       |
 3349|      3|	base = 10;
 3350|      3|	limit = INT64_MAX / base;
 3351|      3|	last_digit_limit = INT64_MAX % base;
 3352|       |
 3353|       |	/*
 3354|       |	 * Skip any lines starting with '#'; GNU tar specs
 3355|       |	 * don't require this, but they should.
 3356|       |	 */
 3357|      3|	do {
 3358|      3|		bytes_read = readline(a, tar, &p,
 3359|      3|			(ssize_t)tar_min(*remaining, 100), unconsumed);
  ------------------
  |  |   48|      3|#define tar_min(a,b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (48:23): [True: 0, False: 3]
  |  |  ------------------
  ------------------
 3360|      3|		if (bytes_read <= 0)
  ------------------
  |  Branch (3360:7): [True: 2, False: 1]
  ------------------
 3361|      2|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3362|      1|		*remaining -= bytes_read;
 3363|      1|	} while (p[0] == '#');
  ------------------
  |  Branch (3363:11): [True: 0, False: 1]
  ------------------
 3364|       |
 3365|      1|	l = 0;
 3366|      1|	while (bytes_read > 0) {
  ------------------
  |  Branch (3366:9): [True: 1, False: 0]
  ------------------
 3367|      1|		if (*p == '\n')
  ------------------
  |  Branch (3367:7): [True: 0, False: 1]
  ------------------
 3368|      0|			return (l);
 3369|      1|		if (*p < '0' || *p >= '0' + base)
  ------------------
  |  Branch (3369:7): [True: 1, False: 0]
  |  Branch (3369:19): [True: 0, False: 0]
  ------------------
 3370|      1|			return (ARCHIVE_WARN);
  ------------------
  |  |  235|      1|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 3371|      0|		digit = *p - '0';
 3372|      0|		if (l > limit || (l == limit && digit > last_digit_limit))
  ------------------
  |  Branch (3372:7): [True: 0, False: 0]
  |  Branch (3372:21): [True: 0, False: 0]
  |  Branch (3372:35): [True: 0, False: 0]
  ------------------
 3373|      0|			l = INT64_MAX; /* Truncate on overflow. */
 3374|      0|		else
 3375|      0|			l = (l * base) + digit;
 3376|      0|		p++;
 3377|      0|		bytes_read--;
 3378|      0|	}
 3379|       |	/* TODO: Error message. */
 3380|      0|	return (ARCHIVE_WARN);
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 3381|      1|}
archive_read_support_format_tar.c:readline:
 3636|      3|{
 3637|      3|	ssize_t bytes_read;
 3638|      3|	ssize_t total_size = 0;
 3639|      3|	const void *p, *t;
 3640|      3|	const char *s;
 3641|       |
 3642|      3|	if (tar_flush_unconsumed(a, unconsumed) != ARCHIVE_OK) {
  ------------------
  |  |  233|      3|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3642:6): [True: 0, False: 3]
  ------------------
 3643|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3644|      0|	}
 3645|       |
 3646|      3|	t = __archive_read_ahead(a, 1, &bytes_read);
 3647|      3|	if (bytes_read <= 0 || t == NULL)
  ------------------
  |  Branch (3647:6): [True: 0, False: 3]
  |  Branch (3647:25): [True: 0, False: 3]
  ------------------
 3648|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3649|      3|	s = t;  /* Start of line? */
 3650|      3|	p = memchr(t, '\n', bytes_read);
 3651|       |	/* If we found '\n' in the read buffer, return pointer to that. */
 3652|      3|	if (p != NULL) {
  ------------------
  |  Branch (3652:6): [True: 3, False: 0]
  ------------------
 3653|      3|		bytes_read = 1 + ((const char *)p) - s;
 3654|      3|		if (bytes_read > limit) {
  ------------------
  |  Branch (3654:7): [True: 2, False: 1]
  ------------------
 3655|      2|			archive_set_error(&a->archive,
 3656|      2|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      2|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3657|      2|			    "Line too long");
 3658|      2|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3659|      2|		}
 3660|      1|		*unconsumed = bytes_read;
 3661|      1|		*start = s;
 3662|      1|		return (bytes_read);
 3663|      3|	}
 3664|      0|	*unconsumed = bytes_read;
 3665|       |	/* Otherwise, we need to accumulate in a line buffer. */
 3666|      0|	for (;;) {
 3667|      0|		if (total_size + bytes_read > limit) {
  ------------------
  |  Branch (3667:7): [True: 0, False: 0]
  ------------------
 3668|      0|			archive_set_error(&a->archive,
 3669|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3670|      0|			    "Line too long");
 3671|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3672|      0|		}
 3673|      0|		if (archive_string_ensure(&tar->line, total_size + bytes_read) == NULL) {
  ------------------
  |  Branch (3673:7): [True: 0, False: 0]
  ------------------
 3674|      0|			archive_set_error(&a->archive, ENOMEM,
 3675|      0|			    "Can't allocate working buffer");
 3676|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3677|      0|		}
 3678|      0|		memcpy(tar->line.s + total_size, t, bytes_read);
 3679|      0|		tar_flush_unconsumed(a, unconsumed);
 3680|      0|		total_size += bytes_read;
 3681|       |		/* If we found '\n', clean up and return. */
 3682|      0|		if (p != NULL) {
  ------------------
  |  Branch (3682:7): [True: 0, False: 0]
  ------------------
 3683|      0|			*start = tar->line.s;
 3684|      0|			return (total_size);
 3685|      0|		}
 3686|       |		/* Read some more. */
 3687|      0|		t = __archive_read_ahead(a, 1, &bytes_read);
 3688|      0|		if (bytes_read <= 0 || t == NULL)
  ------------------
  |  Branch (3688:7): [True: 0, False: 0]
  |  Branch (3688:26): [True: 0, False: 0]
  ------------------
 3689|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3690|      0|		s = t;  /* Start of line? */
 3691|      0|		p = memchr(t, '\n', bytes_read);
 3692|       |		/* If we found '\n', trim the read. */
 3693|      0|		if (p != NULL) {
  ------------------
  |  Branch (3693:7): [True: 0, False: 0]
  ------------------
 3694|      0|			bytes_read = 1 + ((const char *)p) - s;
 3695|      0|		}
 3696|      0|		*unconsumed = bytes_read;
 3697|      0|	}
 3698|      0|}
archive_read_support_format_tar.c:tar_flush_unconsumed:
  512|   721k|{
  513|   721k|	if (*unconsumed) {
  ------------------
  |  Branch (513:6): [True: 273k, False: 447k]
  ------------------
  514|       |/*
  515|       |		void *data = (void *)__archive_read_ahead(a, *unconsumed, NULL);
  516|       |		 * this block of code is to poison claimed unconsumed space, ensuring
  517|       |		 * things break if it is in use still.
  518|       |		 * currently it WILL break things, so enable it only for debugging this issue
  519|       |		if (data) {
  520|       |			memset(data, 0xff, *unconsumed);
  521|       |		}
  522|       |*/
  523|   273k|		int64_t consumed = __archive_read_consume(a, *unconsumed);
  524|   273k|		if (consumed != *unconsumed) {
  ------------------
  |  Branch (524:7): [True: 159, False: 273k]
  ------------------
  525|    159|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    159|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  526|    159|		}
  527|   273k|		*unconsumed = 0;
  528|   273k|	}
  529|   721k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|   721k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  530|   721k|}
archive_read_support_format_tar.c:gnu_add_sparse_entry:
 3157|   272k|{
 3158|   272k|	struct sparse_block *p;
 3159|       |
 3160|   272k|	p = calloc(1, sizeof(*p));
 3161|   272k|	if (p == NULL) {
  ------------------
  |  Branch (3161:6): [True: 0, False: 272k]
  ------------------
 3162|      0|		archive_set_error(&a->archive, ENOMEM, "Out of memory");
 3163|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3164|      0|	}
 3165|   272k|	if (tar->sparse_last != NULL)
  ------------------
  |  Branch (3165:6): [True: 38.5k, False: 233k]
  ------------------
 3166|  38.5k|		tar->sparse_last->next = p;
 3167|   233k|	else
 3168|   233k|		tar->sparse_list = p;
 3169|   272k|	tar->sparse_last = p;
 3170|   272k|	if (remaining < 0 || offset < 0 || offset > INT64_MAX - remaining) {
  ------------------
  |  Branch (3170:6): [True: 1, False: 272k]
  |  Branch (3170:23): [True: 0, False: 272k]
  |  Branch (3170:37): [True: 0, False: 272k]
  ------------------
 3171|      1|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Malformed sparse map data");
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3172|      1|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3173|      1|	}
 3174|   272k|	p->offset = offset;
 3175|   272k|	p->remaining = remaining;
 3176|   272k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|   272k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3177|   272k|}
archive_read_support_format_tar.c:archive_read_format_tar_read_data:
  641|  37.4k|{
  642|  37.4k|	ssize_t bytes_read;
  643|  37.4k|	struct tar *tar;
  644|  37.4k|	struct sparse_block *p;
  645|       |
  646|  37.4k|	tar = (struct tar *)(a->format->data);
  647|       |
  648|  37.4k|	for (;;) {
  649|       |		/* Remove exhausted entries from sparse list. */
  650|  55.9k|		while (tar->sparse_list != NULL &&
  ------------------
  |  Branch (650:10): [True: 37.1k, False: 18.8k]
  ------------------
  651|  37.1k|		    tar->sparse_list->remaining == 0) {
  ------------------
  |  Branch (651:7): [True: 18.4k, False: 18.6k]
  ------------------
  652|  18.4k|			p = tar->sparse_list;
  653|  18.4k|			tar->sparse_list = p->next;
  654|  18.4k|			free(p);
  655|  18.4k|		}
  656|       |
  657|  37.4k|		if (tar->entry_bytes_unconsumed) {
  ------------------
  |  Branch (657:7): [True: 1.10k, False: 36.3k]
  ------------------
  658|  1.10k|			__archive_read_consume(a, tar->entry_bytes_unconsumed);
  659|  1.10k|			tar->entry_bytes_unconsumed = 0;
  660|  1.10k|		}
  661|       |
  662|       |		/* If we're at end of file, return EOF. */
  663|  37.4k|		if (tar->sparse_list == NULL ||
  ------------------
  |  Branch (663:7): [True: 18.8k, False: 18.6k]
  ------------------
  664|  36.2k|		    tar->entry_bytes_remaining == 0) {
  ------------------
  |  Branch (664:7): [True: 17.4k, False: 1.24k]
  ------------------
  665|  36.2k|			int64_t request = tar->entry_bytes_remaining +
  666|  36.2k|			    tar->entry_padding;
  667|       |
  668|  36.2k|			if (__archive_read_consume(a, request) != request)
  ------------------
  |  Branch (668:8): [True: 4, False: 36.2k]
  ------------------
  669|      4|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  670|  36.2k|			tar->entry_padding = 0;
  671|  36.2k|			*buff = NULL;
  672|  36.2k|			*size = 0;
  673|  36.2k|			*offset = tar->disk_size;
  674|  36.2k|			return (ARCHIVE_EOF);
  ------------------
  |  |  232|  36.2k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  675|  36.2k|		}
  676|       |
  677|  1.24k|		*buff = __archive_read_ahead(a, 1, &bytes_read);
  678|  1.24k|		if (*buff == NULL) {
  ------------------
  |  Branch (678:7): [True: 11, False: 1.23k]
  ------------------
  679|     11|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     11|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  680|     11|			    "Truncated tar archive"
  681|     11|			    " detected while reading data");
  682|     11|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     11|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  683|     11|		}
  684|  1.23k|		if (bytes_read > tar->entry_bytes_remaining)
  ------------------
  |  Branch (684:7): [True: 1.20k, False: 25]
  ------------------
  685|  1.20k|			bytes_read = (ssize_t)tar->entry_bytes_remaining;
  686|       |		/* Don't read more than is available in the
  687|       |		 * current sparse block. */
  688|  1.23k|		if (tar->sparse_list->remaining < bytes_read)
  ------------------
  |  Branch (688:7): [True: 260, False: 974]
  ------------------
  689|    260|			bytes_read = (ssize_t)tar->sparse_list->remaining;
  690|  1.23k|		*size = bytes_read;
  691|  1.23k|		*offset = tar->sparse_list->offset;
  692|  1.23k|		tar->sparse_list->remaining -= bytes_read;
  693|  1.23k|		tar->sparse_list->offset += bytes_read;
  694|  1.23k|		tar->entry_bytes_remaining -= bytes_read;
  695|  1.23k|		tar->entry_bytes_unconsumed = bytes_read;
  696|       |
  697|  1.23k|		if (!tar->sparse_list->hole)
  ------------------
  |  Branch (697:7): [True: 1.23k, False: 0]
  ------------------
  698|  1.23k|			return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.23k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  699|       |		/* Current is hole data and skip this. */
  700|  1.23k|	}
  701|  37.4k|}
archive_read_support_format_tar.c:archive_read_format_tar_skip:
  705|  21.2k|{
  706|  21.2k|	int64_t request;
  707|  21.2k|	struct tar* tar;
  708|       |
  709|  21.2k|	tar = (struct tar *)(a->format->data);
  710|       |
  711|  21.2k|	request = tar->entry_bytes_remaining + tar->entry_padding +
  712|  21.2k|	    tar->entry_bytes_unconsumed;
  713|       |
  714|  21.2k|	if (__archive_read_consume(a, request) != request)
  ------------------
  |  Branch (714:6): [True: 0, False: 21.2k]
  ------------------
  715|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  716|       |
  717|  21.2k|	tar->entry_bytes_remaining = 0;
  718|  21.2k|	tar->entry_bytes_unconsumed = 0;
  719|  21.2k|	tar->entry_padding = 0;
  720|       |
  721|       |	/* Free the sparse list. */
  722|  21.2k|	gnu_clear_sparse_list(tar);
  723|       |
  724|  21.2k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  21.2k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  725|  21.2k|}

archive_read_support_format_warc:
  140|  2.49k|{
  141|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
  142|  2.49k|	struct warc_s *w;
  143|  2.49k|	int r;
  144|       |
  145|  2.49k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  151|  2.49k|	do { \
  |  |  152|  2.49k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|  2.49k|			(allowed_states), (function_name)); \
  |  |  154|  2.49k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  2.49k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 2.49k]
  |  |  ------------------
  |  |  155|  2.49k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|  2.49k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 2.49k]
  |  |  ------------------
  ------------------
  146|  2.49k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_warc");
  147|       |
  148|  2.49k|	if ((w = calloc(1, sizeof(*w))) == NULL) {
  ------------------
  |  Branch (148:6): [True: 0, False: 2.49k]
  ------------------
  149|      0|		archive_set_error(&a->archive, ENOMEM,
  150|      0|		    "Can't allocate warc data");
  151|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  152|      0|	}
  153|       |
  154|  2.49k|	r = __archive_read_register_format(
  155|  2.49k|		a, w, "warc",
  156|  2.49k|		_warc_bid, NULL, _warc_rdhdr, _warc_read,
  157|  2.49k|		_warc_skip, NULL, _warc_cleanup, NULL, NULL);
  158|       |
  159|  2.49k|	if (r != ARCHIVE_OK) {
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (159:6): [True: 0, False: 2.49k]
  ------------------
  160|      0|		free(w);
  161|      0|		return (r);
  162|      0|	}
  163|  2.49k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  164|  2.49k|}
archive_read_support_format_warc.c:_warc_cleanup:
  168|  2.49k|{
  169|  2.49k|	struct warc_s *w = a->format->data;
  170|       |
  171|  2.49k|	if (w->pool.len > 0U) {
  ------------------
  |  Branch (171:6): [True: 138, False: 2.36k]
  ------------------
  172|    138|		free(w->pool.str);
  173|    138|	}
  174|  2.49k|	archive_string_free(&w->sver);
  175|  2.49k|	free(w);
  176|  2.49k|	a->format->data = NULL;
  177|  2.49k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  178|  2.49k|}
archive_read_support_format_warc.c:_warc_bid:
  182|  2.46k|{
  183|  2.46k|	const char *hdr;
  184|  2.46k|	ssize_t nrd;
  185|  2.46k|	unsigned int ver;
  186|       |
  187|  2.46k|	(void)best_bid; /* UNUSED */
  188|       |
  189|       |	/* check first line of file, it should be a record already */
  190|  2.46k|	if ((hdr = __archive_read_ahead(a, 12U, &nrd)) == NULL) {
  ------------------
  |  Branch (190:6): [True: 29, False: 2.43k]
  ------------------
  191|       |		/* no idea what to do */
  192|     29|		return -1;
  193|  2.43k|	} else if (nrd < 12) {
  ------------------
  |  Branch (193:13): [True: 0, False: 2.43k]
  ------------------
  194|       |		/* nah, not for us, our magic cookie is at least 12 bytes */
  195|      0|		return -1;
  196|      0|	}
  197|       |
  198|       |	/* otherwise snarf the record's version number */
  199|  2.43k|	ver = _warc_rdver(hdr, nrd);
  200|  2.43k|	if (ver < 1200U || ver > 10000U) {
  ------------------
  |  Branch (200:6): [True: 2.23k, False: 199]
  |  Branch (200:21): [True: 0, False: 199]
  ------------------
  201|       |		/* we only support WARC 0.12 to 1.0 */
  202|  2.23k|		return -1;
  203|  2.23k|	}
  204|       |
  205|       |	/* otherwise be confident */
  206|    199|	return (64);
  207|  2.43k|}
archive_read_support_format_warc.c:_warc_rdver:
  621|  17.5k|{
  622|  17.5k|	static const char magic[] = "WARC/";
  623|  17.5k|	const char *c;
  624|  17.5k|	unsigned int ver = 0U;
  625|  17.5k|	unsigned int end = 0U;
  626|       |
  627|  17.5k|	if (bsz < 12 || memcmp(buf, magic, sizeof(magic) - 1U) != 0) {
  ------------------
  |  Branch (627:6): [True: 0, False: 17.5k]
  |  Branch (627:18): [True: 2.24k, False: 15.3k]
  ------------------
  628|       |		/* buffer too small or invalid magic */
  629|  2.24k|		return ver;
  630|  2.24k|	}
  631|       |	/* looks good so far, read the version number for a laugh */
  632|  15.3k|	buf += sizeof(magic) - 1U;
  633|       |
  634|  15.3k|	if (isdigit((unsigned char)buf[0U]) && (buf[1U] == '.') &&
  ------------------
  |  Branch (634:6): [True: 15.3k, False: 1]
  |  Branch (634:41): [True: 15.3k, False: 6]
  ------------------
  635|  15.3k|	    isdigit((unsigned char)buf[2U])) {
  ------------------
  |  Branch (635:6): [True: 15.3k, False: 0]
  ------------------
  636|       |		/* we support a maximum of 2 digits in the minor version */
  637|  15.3k|		if (isdigit((unsigned char)buf[3U]))
  ------------------
  |  Branch (637:7): [True: 479, False: 14.8k]
  ------------------
  638|    479|			end = 1U;
  639|       |		/* set up major version */
  640|  15.3k|		ver = (buf[0U] - '0') * 10000U;
  641|       |		/* set up minor version */
  642|  15.3k|		if (end == 1U) {
  ------------------
  |  Branch (642:7): [True: 479, False: 14.8k]
  ------------------
  643|    479|			ver += (buf[2U] - '0') * 1000U;
  644|    479|			ver += (buf[3U] - '0') * 100U;
  645|    479|		} else
  646|  14.8k|			ver += (buf[2U] - '0') * 100U;
  647|       |		/*
  648|       |		 * WARC below version 0.12 has a space-separated header
  649|       |		 * WARC 0.12 and above terminates the version with a CRLF
  650|       |		 */
  651|  15.3k|		c = buf + 3U + end;
  652|  15.3k|		if (ver >= 1200U) {
  ------------------
  |  Branch (652:7): [True: 15.3k, False: 0]
  ------------------
  653|  15.3k|			if (memcmp(c, "\r\n", 2U) != 0)
  ------------------
  |  Branch (653:8): [True: 8, False: 15.3k]
  ------------------
  654|      8|				ver = 0U;
  655|  15.3k|		} else {
  656|       |			/* ver < 1200U */
  657|      0|			if (*c != ' ' && *c != '\t')
  ------------------
  |  Branch (657:8): [True: 0, False: 0]
  |  Branch (657:21): [True: 0, False: 0]
  ------------------
  658|      0|				ver = 0U;
  659|      0|		}
  660|  15.3k|	}
  661|  15.3k|	return ver;
  662|  17.5k|}
archive_read_support_format_warc.c:_warc_rdhdr:
  211|  7.89k|{
  212|  7.89k|#define HDR_PROBE_LEN		(12U)
  213|  7.89k|	struct warc_s *w = a->format->data;
  214|  7.89k|	unsigned int ver;
  215|  7.89k|	const char *buf;
  216|  7.89k|	ssize_t nrd;
  217|  7.89k|	const char *eoh;
  218|  7.89k|	char *tmp;
  219|       |	/* for the file name, saves some strndup()'ing */
  220|  7.89k|	warc_string_t fnam;
  221|       |	/* warc record type, not that we really use it a lot */
  222|  7.89k|	warc_type_t ftyp;
  223|       |	/* content-length+error monad */
  224|  7.89k|	ssize_t cntlen;
  225|       |	/* record time is the WARC-Date time we reinterpret it as ctime */
  226|  7.89k|	time_t rtime;
  227|       |	/* mtime is the Last-Modified time which will be the entry's mtime */
  228|  7.89k|	time_t mtime;
  229|       |
  230|  15.2k|start_over:
  231|       |	/* just use read_ahead() they keep track of unconsumed
  232|       |	 * bits and bobs for us; no need to put an extra shift in
  233|       |	 * and reproduce that functionality here */
  234|  15.2k|	buf = __archive_read_ahead(a, HDR_PROBE_LEN, &nrd);
  ------------------
  |  |  212|  15.2k|#define HDR_PROBE_LEN		(12U)
  ------------------
  235|       |
  236|  15.2k|	if (nrd < 0) {
  ------------------
  |  Branch (236:6): [True: 0, False: 15.2k]
  ------------------
  237|       |		/* no good */
  238|      0|		archive_set_error(
  239|      0|			&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  240|      0|			"Bad record header");
  241|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  242|  15.2k|	} else if (buf == NULL) {
  ------------------
  |  Branch (242:13): [True: 2, False: 15.2k]
  ------------------
  243|       |		/* there should be room for at least WARC/bla\r\n
  244|       |		 * must be EOF therefore */
  245|      2|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|      2|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  246|      2|	}
  247|       | 	/* looks good so far, try and find the end of the header now */
  248|  15.2k|	eoh = _warc_find_eoh(buf, nrd);
  249|  15.2k|	if (eoh == NULL) {
  ------------------
  |  Branch (249:6): [True: 98, False: 15.1k]
  ------------------
  250|       |		/* still no good, the header end might be beyond the
  251|       |		 * probe we've requested, but then again who'd cram
  252|       |		 * so much stuff into the header *and* be 28500-compliant */
  253|     98|		archive_set_error(
  254|     98|			&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     98|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  255|     98|			"Bad record header");
  256|     98|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     98|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  257|     98|	}
  258|  15.1k|	ver = _warc_rdver(buf, eoh - buf);
  259|       |	/* we currently support WARC 0.12 to 1.0 */
  260|  15.1k|	if (ver == 0U) {
  ------------------
  |  Branch (260:6): [True: 24, False: 15.1k]
  ------------------
  261|     24|		archive_set_error(
  262|     24|			&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     24|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  263|     24|			"Invalid record version");
  264|     24|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     24|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  265|  15.1k|	} else if (ver < 1200U || ver > 10000U) {
  ------------------
  |  Branch (265:13): [True: 0, False: 15.1k]
  |  Branch (265:28): [True: 0, False: 15.1k]
  ------------------
  266|      0|		archive_set_error(
  267|      0|			&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  268|      0|			"Unsupported record version: %u.%u",
  269|      0|			ver / 10000, (ver % 10000) / 100);
  270|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  271|      0|	}
  272|  15.1k|	cntlen = _warc_rdlen(buf, eoh - buf);
  273|  15.1k|	if (cntlen < 0) {
  ------------------
  |  Branch (273:6): [True: 18, False: 15.0k]
  ------------------
  274|       |		/* nightmare!  the specs say content-length is mandatory
  275|       |		 * so I don't feel overly bad stopping the reader here */
  276|     18|		archive_set_error(
  277|     18|			&a->archive, EINVAL,
  278|     18|			"Bad content length");
  279|     18|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     18|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  280|     18|	}
  281|  15.0k|	rtime = _warc_rdrtm(buf, eoh - buf);
  282|  15.0k|	if (rtime == (time_t)-1) {
  ------------------
  |  Branch (282:6): [True: 51, False: 15.0k]
  ------------------
  283|       |		/* record time is mandatory as per WARC/1.0,
  284|       |		 * so just barf here, fast and loud */
  285|     51|		archive_set_error(
  286|     51|			&a->archive, EINVAL,
  287|     51|			"Bad record time");
  288|     51|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     51|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  289|     51|	}
  290|       |
  291|       |	/* let the world know we're a WARC archive */
  292|  15.0k|	a->archive.archive_format = ARCHIVE_FORMAT_WARC;
  ------------------
  |  |  386|  15.0k|#define	ARCHIVE_FORMAT_WARC			0xF0000
  ------------------
  293|  15.0k|	if (ver != w->pver) {
  ------------------
  |  Branch (293:6): [True: 1.13k, False: 13.9k]
  ------------------
  294|       |		/* stringify this entry's version */
  295|  1.13k|		archive_string_sprintf(&w->sver,
  296|  1.13k|			"WARC/%u.%u", ver / 10000, (ver % 10000) / 100);
  297|       |		/* remember the version */
  298|  1.13k|		w->pver = ver;
  299|  1.13k|	}
  300|       |	/* start off with the type */
  301|  15.0k|	ftyp = _warc_rdtyp(buf, eoh - buf);
  302|       |	/* and let future calls know about the content */
  303|  15.0k|	w->cntlen = cntlen;
  304|  15.0k|	w->cntoff = 0U;
  305|  15.0k|	mtime = 0;/* Avoid compiling error on some platform. */
  306|       |
  307|  15.0k|	switch (ftyp) {
  308|  1.25k|	case WT_RSRC:
  ------------------
  |  Branch (308:2): [True: 1.25k, False: 13.7k]
  ------------------
  309|  10.9k|	case WT_RSP:
  ------------------
  |  Branch (309:2): [True: 9.70k, False: 5.34k]
  ------------------
  310|       |		/* only try and read the filename in the cases that are
  311|       |		 * guaranteed to have one */
  312|  10.9k|		fnam = _warc_rduri(buf, eoh - buf);
  313|       |		/* check the last character in the URI to avoid creating
  314|       |		 * directory endpoints as files, see Todo above */
  315|  10.9k|		if (fnam.len == 0 || fnam.str[fnam.len - 1] == '/') {
  ------------------
  |  Branch (315:7): [True: 3.18k, False: 7.77k]
  |  Branch (315:24): [True: 69, False: 7.70k]
  ------------------
  316|       |			/* break here for now */
  317|  3.25k|			fnam.len = 0U;
  318|  3.25k|			fnam.str = NULL;
  319|  3.25k|			break;
  320|  3.25k|		}
  321|       |		/* bang to our string pool, so we save a
  322|       |		 * malloc()+free() roundtrip */
  323|  7.70k|		if (fnam.len + 1U > w->pool.len) {
  ------------------
  |  Branch (323:7): [True: 143, False: 7.56k]
  ------------------
  324|    143|			w->pool.len = ((fnam.len + 64U) / 64U) * 64U;
  325|    143|			tmp = realloc(w->pool.str, w->pool.len);
  326|    143|			if (tmp == NULL) {
  ------------------
  |  Branch (326:8): [True: 0, False: 143]
  ------------------
  327|      0|				archive_set_error(
  328|      0|					&a->archive, ENOMEM,
  329|      0|					"Out of memory");
  330|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  331|      0|			}
  332|    143|			w->pool.str = tmp;
  333|    143|		}
  334|  7.70k|		memcpy(w->pool.str, fnam.str, fnam.len);
  335|  7.70k|		w->pool.str[fnam.len] = '\0';
  336|       |		/* let no one else know about the pool, it's a secret, shhh */
  337|  7.70k|		fnam.str = w->pool.str;
  338|       |
  339|       |		/* snarf mtime or deduce from rtime
  340|       |		 * this is a custom header added by our writer, it's quite
  341|       |		 * hard to believe anyone else would go through with it
  342|       |		 * (apart from being part of some http responses of course) */
  343|  7.70k|		if ((mtime = _warc_rdmtm(buf, eoh - buf)) == (time_t)-1) {
  ------------------
  |  Branch (343:7): [True: 7.64k, False: 63]
  ------------------
  344|  7.64k|			mtime = rtime;
  345|  7.64k|		}
  346|  7.70k|		break;
  347|  4.09k|	case WT_NONE:
  ------------------
  |  Branch (347:2): [True: 4.09k, False: 10.9k]
  ------------------
  348|  4.09k|	case WT_INFO:
  ------------------
  |  Branch (348:2): [True: 0, False: 15.0k]
  ------------------
  349|  4.09k|	case WT_META:
  ------------------
  |  Branch (349:2): [True: 0, False: 15.0k]
  ------------------
  350|  4.09k|	case WT_REQ:
  ------------------
  |  Branch (350:2): [True: 0, False: 15.0k]
  ------------------
  351|  4.09k|	case WT_RVIS:
  ------------------
  |  Branch (351:2): [True: 0, False: 15.0k]
  ------------------
  352|  4.09k|	case WT_CONV:
  ------------------
  |  Branch (352:2): [True: 0, False: 15.0k]
  ------------------
  353|  4.09k|	case WT_CONT:
  ------------------
  |  Branch (353:2): [True: 0, False: 15.0k]
  ------------------
  354|  4.09k|	case LAST_WT:
  ------------------
  |  Branch (354:2): [True: 0, False: 15.0k]
  ------------------
  355|  4.09k|	default:
  ------------------
  |  Branch (355:2): [True: 0, False: 15.0k]
  ------------------
  356|  4.09k|		fnam.len = 0U;
  357|  4.09k|		fnam.str = NULL;
  358|  4.09k|		break;
  359|  15.0k|	}
  360|       |
  361|       |	/* now eat some of those delicious buffer bits */
  362|  15.0k|	__archive_read_consume(a, eoh - buf);
  363|       |
  364|  15.0k|	switch (ftyp) {
  365|  1.25k|	case WT_RSRC:
  ------------------
  |  Branch (365:2): [True: 1.25k, False: 13.7k]
  ------------------
  366|  10.9k|	case WT_RSP:
  ------------------
  |  Branch (366:2): [True: 9.70k, False: 5.34k]
  ------------------
  367|  10.9k|		if (fnam.len > 0U) {
  ------------------
  |  Branch (367:7): [True: 7.70k, False: 3.25k]
  ------------------
  368|       |			/* populate entry object */
  369|  7.70k|			archive_entry_set_filetype(entry, AE_IFREG);
  ------------------
  |  |  216|  7.70k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
  370|  7.70k|			archive_entry_copy_pathname(entry, fnam.str);
  371|  7.70k|			archive_entry_set_size(entry, cntlen);
  372|  7.70k|			archive_entry_set_perm(entry, 0644);
  373|       |			/* rtime is the new ctime, mtime stays mtime */
  374|  7.70k|			archive_entry_set_ctime(entry, rtime, 0L);
  375|  7.70k|			archive_entry_set_mtime(entry, mtime, 0L);
  376|  7.70k|			break;
  377|  7.70k|		}
  378|       |		/* FALLTHROUGH */
  379|  7.34k|	case WT_NONE:
  ------------------
  |  Branch (379:2): [True: 4.09k, False: 10.9k]
  ------------------
  380|  7.34k|	case WT_INFO:
  ------------------
  |  Branch (380:2): [True: 0, False: 15.0k]
  ------------------
  381|  7.34k|	case WT_META:
  ------------------
  |  Branch (381:2): [True: 0, False: 15.0k]
  ------------------
  382|  7.34k|	case WT_REQ:
  ------------------
  |  Branch (382:2): [True: 0, False: 15.0k]
  ------------------
  383|  7.34k|	case WT_RVIS:
  ------------------
  |  Branch (383:2): [True: 0, False: 15.0k]
  ------------------
  384|  7.34k|	case WT_CONV:
  ------------------
  |  Branch (384:2): [True: 0, False: 15.0k]
  ------------------
  385|  7.34k|	case WT_CONT:
  ------------------
  |  Branch (385:2): [True: 0, False: 15.0k]
  ------------------
  386|  7.34k|	case LAST_WT:
  ------------------
  |  Branch (386:2): [True: 0, False: 15.0k]
  ------------------
  387|  7.34k|	default:
  ------------------
  |  Branch (387:2): [True: 0, False: 15.0k]
  ------------------
  388|       |		/* consume the content and start over */
  389|  7.34k|		if (_warc_skip(a) < 0)
  ------------------
  |  Branch (389:7): [True: 0, False: 7.34k]
  ------------------
  390|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  391|  7.34k|		goto start_over;
  392|  15.0k|	}
  393|  7.70k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  7.70k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  394|  15.0k|}
archive_read_support_format_warc.c:_warc_find_eoh:
  840|  15.2k|{
  841|  15.2k|	static const char _marker[] = "\r\n\r\n";
  842|  15.2k|	const char *hit = xmemmem(buf, bsz, _marker, sizeof(_marker) - 1U);
  843|       |
  844|  15.2k|	if (hit != NULL) {
  ------------------
  |  Branch (844:6): [True: 15.1k, False: 98]
  ------------------
  845|  15.1k|		hit += sizeof(_marker) - 1U;
  846|  15.1k|	}
  847|  15.2k|	return hit;
  848|  15.2k|}
archive_read_support_format_warc.c:xmemmem:
  462|   148k|{
  463|   148k|	const char *const eoh = hay + haysize;
  464|   148k|	const char *const eon = needle + needlesize;
  465|   148k|	const char *hp;
  466|   148k|	const char *np;
  467|   148k|	const char *cand;
  468|   148k|	unsigned int hsum;
  469|   148k|	unsigned int nsum;
  470|   148k|	unsigned int eqp;
  471|       |
  472|       |	/* trivial checks first
  473|       |         * a 0-sized needle is defined to be found anywhere in haystack
  474|       |         * then run strchr() to find a candidate in HAYSTACK (i.e. a portion
  475|       |         * that happens to begin with *NEEDLE) */
  476|   148k|	if (needlesize == 0UL) {
  ------------------
  |  Branch (476:6): [True: 0, False: 148k]
  ------------------
  477|      0|		return deconst(hay);
  478|   148k|	} else if ((hay = memchr(hay, *needle, haysize)) == NULL) {
  ------------------
  |  Branch (478:13): [True: 131, False: 148k]
  ------------------
  479|       |		/* trivial */
  480|    131|		return NULL;
  481|    131|	}
  482|       |
  483|       |	/* First characters of haystack and needle are the same now. Both are
  484|       |	 * guaranteed to be at least one character long.  Now computes the sum
  485|       |	 * of characters values of needle together with the sum of the first
  486|       |	 * needle_len characters of haystack. */
  487|   148k|	for (hp = hay + 1U, np = needle + 1U, hsum = *hay, nsum = *hay, eqp = 1U;
  488|  1.14M|	     hp < eoh && np < eon;
  ------------------
  |  Branch (488:7): [True: 1.14M, False: 277]
  |  Branch (488:19): [True: 1.00M, False: 148k]
  ------------------
  489|  1.00M|	     hsum ^= *hp, nsum ^= *np, eqp &= *hp == *np, hp++, np++);
  490|       |
  491|       |	/* HP now references the (NEEDLESIZE + 1)-th character. */
  492|   148k|	if (np < eon) {
  ------------------
  |  Branch (492:6): [True: 206, False: 148k]
  ------------------
  493|       |		/* haystack is smaller than needle, :O */
  494|    206|		return NULL;
  495|   148k|	} else if (eqp) {
  ------------------
  |  Branch (495:13): [True: 75.1k, False: 73.2k]
  ------------------
  496|       |		/* found a match */
  497|  75.1k|		return deconst(hay);
  498|  75.1k|	}
  499|       |
  500|       |	/* now loop through the rest of haystack,
  501|       |	 * updating the sum iteratively */
  502|  21.4M|	for (cand = hay; hp < eoh; hp++) {
  ------------------
  |  Branch (502:19): [True: 21.4M, False: 5.36k]
  ------------------
  503|  21.4M|		hsum ^= *cand++;
  504|  21.4M|		hsum ^= *hp;
  505|       |
  506|       |		/* Since the sum of the characters is already known to be
  507|       |		 * equal at that point, it is enough to check just NEEDLESIZE - 1
  508|       |		 * characters for equality,
  509|       |		 * also CAND is by design < HP, so no need for range checks */
  510|  21.4M|		if (hsum == nsum && memcmp(cand, needle, needlesize - 1U) == 0) {
  ------------------
  |  Branch (510:7): [True: 1.53M, False: 19.9M]
  |  Branch (510:23): [True: 67.9k, False: 1.46M]
  ------------------
  511|  67.9k|			return deconst(cand);
  512|  67.9k|		}
  513|  21.4M|	}
  514|  5.36k|	return NULL;
  515|  73.2k|}
archive_read_support_format_warc.c:deconst:
  455|   164k|{
  456|   164k|	return (void *)(uintptr_t)c;
  457|   164k|}
archive_read_support_format_warc.c:_warc_rdlen:
  752|  15.1k|{
  753|  15.1k|	static const char _key[] = "\r\nContent-Length:";
  754|  15.1k|	const char *val, *eol;
  755|  15.1k|	char *on = NULL;
  756|  15.1k|	long int len;
  757|       |
  758|  15.1k|	if ((val = xmemmem(buf, bsz, _key, sizeof(_key) - 1U)) == NULL) {
  ------------------
  |  Branch (758:6): [True: 14, False: 15.1k]
  ------------------
  759|       |		/* no bother */
  760|     14|		return -1;
  761|     14|	}
  762|  15.1k|	val += sizeof(_key) - 1U;
  763|  15.1k|	if ((eol = _warc_find_eol(val, buf + bsz - val)) == NULL) {
  ------------------
  |  Branch (763:6): [True: 0, False: 15.1k]
  ------------------
  764|       |		/* no end of line */
  765|      0|		return -1;
  766|      0|	}
  767|       |
  768|       |	/* skip leading whitespace */
  769|  17.5k|	while (val < eol && (*val == ' ' || *val == '\t'))
  ------------------
  |  Branch (769:9): [True: 17.5k, False: 0]
  |  Branch (769:23): [True: 2.41k, False: 15.1k]
  |  Branch (769:38): [True: 0, False: 15.1k]
  ------------------
  770|  2.41k|		val++;
  771|       |	/* there must be at least one digit */
  772|  15.1k|	if (!isdigit((unsigned char)*val))
  ------------------
  |  Branch (772:6): [True: 0, False: 15.1k]
  ------------------
  773|      0|		return -1;
  774|  15.1k|	errno = 0;
  775|  15.1k|	len = strtol(val, &on, 10);
  776|  15.1k|	if (errno != 0 || on != eol) {
  ------------------
  |  Branch (776:6): [True: 0, False: 15.1k]
  |  Branch (776:20): [True: 4, False: 15.0k]
  ------------------
  777|       |		/* line must end here */
  778|      4|		return -1;
  779|      4|	}
  780|       |
  781|  15.0k|	return (size_t)len;
  782|  15.1k|}
archive_read_support_format_warc.c:_warc_find_eol:
  852|  59.2k|{
  853|  59.2k|	static const char _marker[] = "\r\n";
  854|  59.2k|	const char *hit = xmemmem(buf, bsz, _marker, sizeof(_marker) - 1U);
  855|       |
  856|  59.2k|	return hit;
  857|  59.2k|}
archive_read_support_format_warc.c:_warc_rdrtm:
  786|  15.0k|{
  787|  15.0k|	static const char _key[] = "\r\nWARC-Date:";
  788|  15.0k|	const char *val, *eol;
  789|  15.0k|	char *on = NULL;
  790|  15.0k|	time_t res;
  791|       |
  792|  15.0k|	if ((val = xmemmem(buf, bsz, _key, sizeof(_key) - 1U)) == NULL) {
  ------------------
  |  Branch (792:6): [True: 18, False: 15.0k]
  ------------------
  793|       |		/* no bother */
  794|     18|		return (time_t)-1;
  795|     18|	}
  796|  15.0k|	val += sizeof(_key) - 1U;
  797|  15.0k|	if ((eol = _warc_find_eol(val, buf + bsz - val)) == NULL ) {
  ------------------
  |  Branch (797:6): [True: 0, False: 15.0k]
  ------------------
  798|       |		/* no end of line */
  799|      0|		return -1;
  800|      0|	}
  801|       |
  802|       |	/* xstrpisotime() kindly overreads whitespace for us, so use that */
  803|  15.0k|	res = xstrpisotime(val, &on);
  804|  15.0k|	if (on != eol) {
  ------------------
  |  Branch (804:6): [True: 33, False: 15.0k]
  ------------------
  805|       |		/* line must end here */
  806|     33|		return -1;
  807|     33|	}
  808|  15.0k|	return res;
  809|  15.0k|}
archive_read_support_format_warc.c:xstrpisotime:
  567|  21.2k|{
  568|       |/** like strptime() but strictly for ISO 8601 Zulu strings */
  569|  21.2k|	struct tm tm;
  570|  21.2k|	time_t res = (time_t)-1;
  571|       |
  572|       |	/* make sure tm is clean */
  573|  21.2k|	memset(&tm, 0, sizeof(tm));
  574|       |
  575|       |	/* as a courtesy to our callers, and since this is a non-standard
  576|       |	 * routine, we skip leading whitespace */
  577|  42.5k|	while (*s == ' ' || *s == '\t')
  ------------------
  |  Branch (577:9): [True: 118, False: 42.4k]
  |  Branch (577:22): [True: 21.1k, False: 21.2k]
  ------------------
  578|  21.2k|		++s;
  579|       |
  580|       |	/* read year */
  581|  21.2k|	if ((tm.tm_year = strtoi_lim(s, &s, 1583, 4095)) < 0 || *s++ != '-') {
  ------------------
  |  Branch (581:6): [True: 347, False: 20.9k]
  |  Branch (581:58): [True: 248, False: 20.6k]
  ------------------
  582|    595|		goto out;
  583|    595|	}
  584|       |	/* read month */
  585|  20.6k|	if ((tm.tm_mon = strtoi_lim(s, &s, 1, 12)) < 0 || *s++ != '-') {
  ------------------
  |  Branch (585:6): [True: 885, False: 19.7k]
  |  Branch (585:52): [True: 113, False: 19.6k]
  ------------------
  586|    998|		goto out;
  587|    998|	}
  588|       |	/* read day-of-month */
  589|  19.6k|	if ((tm.tm_mday = strtoi_lim(s, &s, 1, 31)) < 0 || *s++ != 'T') {
  ------------------
  |  Branch (589:6): [True: 1.13k, False: 18.5k]
  |  Branch (589:53): [True: 1.06k, False: 17.4k]
  ------------------
  590|  2.19k|		goto out;
  591|  2.19k|	}
  592|       |	/* read hour */
  593|  17.4k|	if ((tm.tm_hour = strtoi_lim(s, &s, 0, 23)) < 0 || *s++ != ':') {
  ------------------
  |  Branch (593:6): [True: 933, False: 16.5k]
  |  Branch (593:53): [True: 530, False: 16.0k]
  ------------------
  594|  1.46k|		goto out;
  595|  1.46k|	}
  596|       |	/* read minute */
  597|  16.0k|	if ((tm.tm_min = strtoi_lim(s, &s, 0, 59)) < 0 || *s++ != ':') {
  ------------------
  |  Branch (597:6): [True: 475, False: 15.5k]
  |  Branch (597:52): [True: 81, False: 15.4k]
  ------------------
  598|    556|		goto out;
  599|    556|	}
  600|       |	/* read second */
  601|  15.4k|	if ((tm.tm_sec = strtoi_lim(s, &s, 0, 60)) < 0 || *s++ != 'Z') {
  ------------------
  |  Branch (601:6): [True: 307, False: 15.1k]
  |  Branch (601:52): [True: 31, False: 15.1k]
  ------------------
  602|    338|		goto out;
  603|    338|	}
  604|       |
  605|       |	/* massage TM to fulfill some of POSIX' constraints */
  606|  15.1k|	tm.tm_year -= 1900;
  607|  15.1k|	tm.tm_mon--;
  608|       |
  609|       |	/* now convert our custom tm struct to a unix stamp using UTC */
  610|  15.1k|	res = time_from_tm(&tm);
  611|       |
  612|  21.2k|out:
  613|  21.2k|	if (endptr != NULL) {
  ------------------
  |  Branch (613:6): [True: 21.2k, False: 0]
  ------------------
  614|  21.2k|		*endptr = deconst(s);
  615|  21.2k|	}
  616|  21.2k|	return res;
  617|  15.1k|}
archive_read_support_format_warc.c:strtoi_lim:
  519|   110k|{
  520|   110k|	int res = 0;
  521|   110k|	const char *sp;
  522|       |	/* we keep track of the number of digits via rulim */
  523|   110k|	int rulim;
  524|       |
  525|   110k|	for (sp = str, rulim = ulim > 10 ? ulim : 10;
  ------------------
  |  Branch (525:25): [True: 110k, False: 0]
  ------------------
  526|   296k|	     res * 10 <= ulim && rulim && *sp >= '0' && *sp <= '9';
  ------------------
  |  Branch (526:7): [True: 225k, False: 70.8k]
  |  Branch (526:27): [True: 225k, False: 790]
  |  Branch (526:36): [True: 222k, False: 3.05k]
  |  Branch (526:50): [True: 186k, False: 35.8k]
  ------------------
  527|   186k|	     sp++, rulim /= 10) {
  528|   186k|		res *= 10;
  529|   186k|		res += *sp - '0';
  530|   186k|	}
  531|   110k|	if (sp == str) {
  ------------------
  |  Branch (531:6): [True: 3.28k, False: 107k]
  ------------------
  532|  3.28k|		res = -1;
  533|   107k|	} else if (res < llim || res > ulim) {
  ------------------
  |  Branch (533:13): [True: 360, False: 106k]
  |  Branch (533:27): [True: 430, False: 106k]
  ------------------
  534|    790|		res = -2;
  535|    790|	}
  536|   110k|	*ep = (const char*)sp;
  537|   110k|	return res;
  538|   110k|}
archive_read_support_format_warc.c:time_from_tm:
  542|  15.1k|{
  543|       |#if HAVE__MKGMTIME
  544|       |        return _mkgmtime(t);
  545|       |#elif HAVE_TIMEGM
  546|       |        /* Use platform timegm() if available. */
  547|  15.1k|        return (timegm(t));
  548|       |#else
  549|       |        /* Else use direct calculation using POSIX assumptions. */
  550|       |        /* First, fix up tm_yday based on the year/month/day. */
  551|       |        if (mktime(t) == (time_t)-1)
  552|       |                return ((time_t)-1);
  553|       |        /* Then we can compute timegm() from first principles. */
  554|       |        return (t->tm_sec
  555|       |            + t->tm_min * 60
  556|       |            + t->tm_hour * 3600
  557|       |            + t->tm_yday * 86400
  558|       |            + (t->tm_year - 70) * 31536000
  559|       |            + ((t->tm_year - 69) / 4) * 86400
  560|       |            - ((t->tm_year - 1) / 100) * 86400
  561|       |            + ((t->tm_year + 299) / 400) * 86400);
  562|       |#endif
  563|  15.1k|}
archive_read_support_format_warc.c:_warc_rdtyp:
  666|  15.0k|{
  667|  15.0k|	static const char _key[] = "\r\nWARC-Type:";
  668|  15.0k|	const char *val, *eol;
  669|       |
  670|  15.0k|	if ((val = xmemmem(buf, bsz, _key, sizeof(_key) - 1U)) == NULL) {
  ------------------
  |  Branch (670:6): [True: 2.59k, False: 12.4k]
  ------------------
  671|       |		/* no bother */
  672|  2.59k|		return WT_NONE;
  673|  2.59k|	}
  674|  12.4k|	val += sizeof(_key) - 1U;
  675|  12.4k|	if ((eol = _warc_find_eol(val, buf + bsz - val)) == NULL) {
  ------------------
  |  Branch (675:6): [True: 0, False: 12.4k]
  ------------------
  676|       |		/* no end of line */
  677|      0|		return WT_NONE;
  678|      0|	}
  679|       |
  680|       |	/* overread whitespace */
  681|  26.4k|	while (val < eol && (*val == ' ' || *val == '\t'))
  ------------------
  |  Branch (681:9): [True: 26.3k, False: 82]
  |  Branch (681:23): [True: 12.3k, False: 13.9k]
  |  Branch (681:38): [True: 1.61k, False: 12.3k]
  ------------------
  682|  13.9k|		++val;
  683|       |
  684|  12.4k|	if (val + 8U == eol) {
  ------------------
  |  Branch (684:6): [True: 11.5k, False: 884]
  ------------------
  685|  11.5k|		if (memcmp(val, "resource", 8U) == 0)
  ------------------
  |  Branch (685:7): [True: 1.25k, False: 10.3k]
  ------------------
  686|  1.25k|			return WT_RSRC;
  687|  10.3k|		else if (memcmp(val, "response", 8U) == 0)
  ------------------
  |  Branch (687:12): [True: 9.70k, False: 615]
  ------------------
  688|  9.70k|			return WT_RSP;
  689|  11.5k|	}
  690|  1.49k|	return WT_NONE;
  691|  12.4k|}
archive_read_support_format_warc.c:_warc_rduri:
  695|  10.9k|{
  696|  10.9k|	static const char _key[] = "\r\nWARC-Target-URI:";
  697|  10.9k|	const char *val, *uri, *eol, *p;
  698|  10.9k|	warc_string_t res = {0U, NULL};
  699|       |
  700|  10.9k|	if ((val = xmemmem(buf, bsz, _key, sizeof(_key) - 1U)) == NULL) {
  ------------------
  |  Branch (700:6): [True: 554, False: 10.4k]
  ------------------
  701|       |		/* no bother */
  702|    554|		return res;
  703|    554|	}
  704|       |	/* overread whitespace */
  705|  10.4k|	val += sizeof(_key) - 1U;
  706|  10.4k|	if ((eol = _warc_find_eol(val, buf + bsz - val)) == NULL) {
  ------------------
  |  Branch (706:6): [True: 0, False: 10.4k]
  ------------------
  707|       |		/* no end of line */
  708|      0|		return res;
  709|      0|	}
  710|       |
  711|  10.6k|	while (val < eol && (*val == ' ' || *val == '\t'))
  ------------------
  |  Branch (711:9): [True: 10.5k, False: 106]
  |  Branch (711:23): [True: 62, False: 10.4k]
  |  Branch (711:38): [True: 186, False: 10.2k]
  ------------------
  712|    248|		++val;
  713|       |
  714|       |	/* overread URL designators */
  715|  10.4k|	if ((uri = xmemmem(val, eol - val, "://", 3U)) == NULL) {
  ------------------
  |  Branch (715:6): [True: 900, False: 9.50k]
  ------------------
  716|       |		/* not touching that! */
  717|    900|		return res;
  718|    900|	}
  719|       |
  720|       |	/* spaces inside uri are not allowed, CRLF should follow */
  721|   255k|	for (p = val; p < eol; p++) {
  ------------------
  |  Branch (721:16): [True: 245k, False: 9.15k]
  ------------------
  722|   245k|		if (isspace((unsigned char)*p))
  ------------------
  |  Branch (722:7): [True: 349, False: 245k]
  ------------------
  723|    349|			return res;
  724|   245k|	}
  725|       |
  726|       |	/* there must be at least space for ftp */
  727|  9.15k|	if (uri < (val + 3U))
  ------------------
  |  Branch (727:6): [True: 925, False: 8.22k]
  ------------------
  728|    925|		return res;
  729|       |
  730|       |	/* move uri to point to after :// */
  731|  8.22k|	uri += 3U;
  732|       |
  733|       |	/* now then, inspect the URI */
  734|  8.22k|	if (memcmp(val, "file", 4U) == 0) {
  ------------------
  |  Branch (734:6): [True: 6.66k, False: 1.56k]
  ------------------
  735|       |		/* perfect, nothing left to do here */
  736|       |
  737|  6.66k|	} else if (memcmp(val, "http", 4U) == 0 ||
  ------------------
  |  Branch (737:13): [True: 1.24k, False: 322]
  ------------------
  738|  1.31k|		   memcmp(val, "ftp", 3U) == 0) {
  ------------------
  |  Branch (738:6): [True: 70, False: 252]
  ------------------
  739|       |		/* overread domain, and the first / */
  740|  7.28k|		while (uri < eol && *uri++ != '/');
  ------------------
  |  Branch (740:10): [True: 7.08k, False: 201]
  |  Branch (740:23): [True: 5.97k, False: 1.11k]
  ------------------
  741|  1.31k|	} else {
  742|       |		/* not sure what to do? best to bugger off */
  743|    252|		return res;
  744|    252|	}
  745|  7.97k|	res.str = uri;
  746|  7.97k|	res.len = eol - uri;
  747|  7.97k|	return res;
  748|  8.22k|}
archive_read_support_format_warc.c:_warc_rdmtm:
  813|  7.70k|{
  814|  7.70k|	static const char _key[] = "\r\nLast-Modified:";
  815|  7.70k|	const char *val, *eol;
  816|  7.70k|	char *on = NULL;
  817|  7.70k|	time_t res;
  818|       |
  819|  7.70k|	if ((val = xmemmem(buf, bsz, _key, sizeof(_key) - 1U)) == NULL) {
  ------------------
  |  Branch (819:6): [True: 1.52k, False: 6.17k]
  ------------------
  820|       |		/* no bother */
  821|  1.52k|		return (time_t)-1;
  822|  1.52k|	}
  823|  6.17k|	val += sizeof(_key) - 1U;
  824|  6.17k|	if ((eol = _warc_find_eol(val, buf + bsz - val)) == NULL ) {
  ------------------
  |  Branch (824:6): [True: 0, False: 6.17k]
  ------------------
  825|       |		/* no end of line */
  826|      0|		return -1;
  827|      0|	}
  828|       |
  829|       |	/* xstrpisotime() kindly overreads whitespace for us, so use that */
  830|  6.17k|	res = xstrpisotime(val, &on);
  831|  6.17k|	if (on != eol) {
  ------------------
  |  Branch (831:6): [True: 5.99k, False: 187]
  ------------------
  832|       |		/* line must end here */
  833|  5.99k|		return -1;
  834|  5.99k|	}
  835|    187|	return res;
  836|  6.17k|}
archive_read_support_format_warc.c:_warc_read:
  398|  23.1k|{
  399|  23.1k|	struct warc_s *w = a->format->data;
  400|  23.1k|	const char *rab;
  401|  23.1k|	ssize_t nrd;
  402|       |
  403|  23.1k|	if (w->cntoff >= w->cntlen) {
  ------------------
  |  Branch (403:6): [True: 15.3k, False: 7.71k]
  ------------------
  404|  15.4k|	eof:
  405|       |		/* it's our lucky day, no work, we can leave early */
  406|  15.4k|		*buf = NULL;
  407|  15.4k|		*bsz = 0U;
  408|  15.4k|		*off = w->cntoff;
  409|  15.4k|		w->unconsumed = 0U;
  410|  15.4k|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|  15.4k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  411|  15.3k|	}
  412|       |
  413|  7.71k|	if (w->unconsumed) {
  ------------------
  |  Branch (413:6): [True: 6, False: 7.70k]
  ------------------
  414|      6|		__archive_read_consume(a, w->unconsumed);
  415|      6|		w->unconsumed = 0U;
  416|      6|	}
  417|       |
  418|  7.71k|	rab = __archive_read_ahead(a, 1U, &nrd);
  419|  7.71k|	if (nrd < 0) {
  ------------------
  |  Branch (419:6): [True: 0, False: 7.71k]
  ------------------
  420|      0|		*bsz = 0U;
  421|       |		/* big catastrophe */
  422|      0|		return (int)nrd;
  423|  7.71k|	} else if (nrd == 0) {
  ------------------
  |  Branch (423:13): [True: 11, False: 7.70k]
  ------------------
  424|     11|		goto eof;
  425|  7.70k|	} else if ((size_t)nrd > w->cntlen - w->cntoff) {
  ------------------
  |  Branch (425:13): [True: 7.69k, False: 6]
  ------------------
  426|       |		/* clamp to content-length */
  427|  7.69k|		nrd = w->cntlen - w->cntoff;
  428|  7.69k|	}
  429|  7.70k|	*off = w->cntoff;
  430|  7.70k|	*bsz = nrd;
  431|  7.70k|	*buf = rab;
  432|       |
  433|  7.70k|	w->cntoff += nrd;
  434|  7.70k|	w->unconsumed = (size_t)nrd;
  435|  7.70k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  7.70k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  436|  7.71k|}
archive_read_support_format_warc.c:_warc_skip:
  440|  15.0k|{
  441|  15.0k|	struct warc_s *w = a->format->data;
  442|       |
  443|  15.0k|	if (__archive_read_consume(a, w->cntlen) < 0 ||
  ------------------
  |  Branch (443:6): [True: 6, False: 15.0k]
  ------------------
  444|  15.0k|	    __archive_read_consume(a, 4U/*\r\n\r\n separator*/) < 0)
  ------------------
  |  Branch (444:6): [True: 0, False: 15.0k]
  ------------------
  445|      6|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      6|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  446|  15.0k|	w->cntlen = 0U;
  447|  15.0k|	w->cntoff = 0U;
  448|  15.0k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  15.0k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  449|  15.0k|}

archive_read_support_format_xar:
  451|  2.49k|{
  452|  2.49k|	struct xar *xar;
  453|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
  454|  2.49k|	int r;
  455|       |
  456|  2.49k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  151|  2.49k|	do { \
  |  |  152|  2.49k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|  2.49k|			(allowed_states), (function_name)); \
  |  |  154|  2.49k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  2.49k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 2.49k]
  |  |  ------------------
  |  |  155|  2.49k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|  2.49k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 2.49k]
  |  |  ------------------
  ------------------
  457|  2.49k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_xar");
  458|       |
  459|  2.49k|	xar = calloc(1, sizeof(*xar));
  460|  2.49k|	if (xar == NULL) {
  ------------------
  |  Branch (460:6): [True: 0, False: 2.49k]
  ------------------
  461|      0|		archive_set_error(&a->archive, ENOMEM,
  462|      0|		    "Can't allocate xar data");
  463|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  464|      0|	}
  465|       |
  466|       |	/* initialize xar->file_queue */
  467|  2.49k|	xar->file_queue.allocated = 0;
  468|  2.49k|	xar->file_queue.used = 0;
  469|  2.49k|	xar->file_queue.files = NULL;
  470|       |
  471|  2.49k|	r = __archive_read_register_format(a,
  472|  2.49k|	    xar,
  473|  2.49k|	    "xar",
  474|  2.49k|	    xar_bid,
  475|  2.49k|	    NULL,
  476|  2.49k|	    xar_read_header,
  477|  2.49k|	    xar_read_data,
  478|  2.49k|	    xar_read_data_skip,
  479|  2.49k|	    NULL,
  480|  2.49k|	    xar_cleanup,
  481|  2.49k|	    NULL,
  482|  2.49k|	    NULL);
  483|  2.49k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (483:6): [True: 0, False: 2.49k]
  ------------------
  484|      0|		free(xar);
  485|  2.49k|	return (r);
  486|  2.49k|}
archive_read_support_format_xar.c:xar_bid:
  490|  2.46k|{
  491|  2.46k|	const unsigned char *b;
  492|  2.46k|	int bid;
  493|       |
  494|  2.46k|	(void)best_bid; /* UNUSED */
  495|       |
  496|  2.46k|	b = __archive_read_ahead(a, HEADER_SIZE, NULL);
  ------------------
  |  |  105|  2.46k|#define HEADER_SIZE	28
  ------------------
  497|  2.46k|	if (b == NULL)
  ------------------
  |  Branch (497:6): [True: 29, False: 2.43k]
  ------------------
  498|     29|		return (-1);
  499|       |
  500|  2.43k|	bid = 0;
  501|       |	/*
  502|       |	 * Verify magic code
  503|       |	 */
  504|  2.43k|	if (archive_be32dec(b) != HEADER_MAGIC)
  ------------------
  |  |  104|  2.43k|#define HEADER_MAGIC	0x78617221
  ------------------
  |  Branch (504:6): [True: 2.32k, False: 110]
  ------------------
  505|  2.32k|		return (0);
  506|    110|	bid += 32;
  507|       |	/*
  508|       |	 * Verify header size
  509|       |	 */
  510|    110|	if (archive_be16dec(b+4) != HEADER_SIZE)
  ------------------
  |  |  105|    110|#define HEADER_SIZE	28
  ------------------
  |  Branch (510:6): [True: 0, False: 110]
  ------------------
  511|      0|		return (0);
  512|    110|	bid += 16;
  513|       |	/*
  514|       |	 * Verify header version
  515|       |	 */
  516|    110|	if (archive_be16dec(b+6) != HEADER_VERSION)
  ------------------
  |  |  106|    110|#define HEADER_VERSION	1
  ------------------
  |  Branch (516:6): [True: 0, False: 110]
  ------------------
  517|      0|		return (0);
  518|    110|	bid += 16;
  519|       |	/*
  520|       |	 * Verify type of checksum
  521|       |	 */
  522|    110|	switch (archive_be32dec(b+24)) {
  523|      8|	case CKSUM_NONE:
  ------------------
  |  |  107|      8|#define CKSUM_NONE	0
  ------------------
  |  Branch (523:2): [True: 8, False: 102]
  ------------------
  524|    104|	case CKSUM_SHA1:
  ------------------
  |  |  108|    104|#define CKSUM_SHA1	1
  ------------------
  |  Branch (524:2): [True: 96, False: 14]
  ------------------
  525|    110|	case CKSUM_MD5:
  ------------------
  |  |  109|    110|#define CKSUM_MD5	2
  ------------------
  |  Branch (525:2): [True: 6, False: 104]
  ------------------
  526|    110|		bid += 32;
  527|    110|		break;
  528|      0|	default:
  ------------------
  |  Branch (528:2): [True: 0, False: 110]
  ------------------
  529|      0|		return (0);
  530|    110|	}
  531|       |
  532|    110|	return (bid);
  533|    110|}
archive_read_support_format_xar.c:xar_read_header:
  675|    110|{
  676|    110|	struct xar *xar;
  677|    110|	struct xar_file *file;
  678|    110|	struct xattr *xattr;
  679|    110|	int r;
  680|       |
  681|    110|	xar = (struct xar *)(a->format->data);
  682|    110|	r = ARCHIVE_OK;
  ------------------
  |  |  233|    110|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  683|       |
  684|    110|	if (xar->offset == 0) {
  ------------------
  |  Branch (684:6): [True: 110, False: 0]
  ------------------
  685|       |		/* Create a character conversion object. */
  686|    110|		if (xar->sconv == NULL) {
  ------------------
  |  Branch (686:7): [True: 110, False: 0]
  ------------------
  687|    110|			xar->sconv = archive_string_conversion_from_charset(
  688|    110|			    &(a->archive), "UTF-8", 1);
  689|    110|			if (xar->sconv == NULL)
  ------------------
  |  Branch (689:8): [True: 0, False: 110]
  ------------------
  690|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  691|    110|		}
  692|       |
  693|       |		/* Read TOC. */
  694|    110|		r = read_toc(a);
  695|    110|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    110|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (695:7): [True: 110, False: 0]
  ------------------
  696|    110|			return (r);
  697|    110|	}
  698|       |
  699|      0|	for (;;) {
  700|      0|		file = xar->file = heap_get_entry(&(xar->file_queue));
  701|      0|		if (file == NULL) {
  ------------------
  |  Branch (701:7): [True: 0, False: 0]
  ------------------
  702|      0|			xar->end_of_file = 1;
  703|      0|			return (ARCHIVE_EOF);
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  704|      0|		}
  705|      0|		if ((file->mode & AE_IFMT) != AE_IFDIR)
  ------------------
  |  |  215|      0|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              		if ((file->mode & AE_IFMT) != AE_IFDIR)
  ------------------
  |  |  221|      0|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (705:7): [True: 0, False: 0]
  ------------------
  706|      0|			break;
  707|      0|		if (file->has != (HAS_PATHNAME | HAS_TYPE))
  ------------------
  |  |  160|      0|#define HAS_PATHNAME		0x00002
  ------------------
              		if (file->has != (HAS_PATHNAME | HAS_TYPE))
  ------------------
  |  |  166|      0|#define HAS_TYPE		0x00080
  ------------------
  |  Branch (707:7): [True: 0, False: 0]
  ------------------
  708|      0|			break;
  709|       |		/*
  710|       |		 * If a file type is a directory and it does not have
  711|       |		 * any metadata, do not export.
  712|       |		 */
  713|      0|		file_free(file);
  714|      0|	}
  715|      0|        if (file->has & HAS_ATIME) {
  ------------------
  |  |  176|      0|#define HAS_ATIME		0x20000
  ------------------
  |  Branch (715:13): [True: 0, False: 0]
  ------------------
  716|      0|          archive_entry_set_atime(entry, file->atime, 0);
  717|      0|        }
  718|      0|        if (file->has & HAS_CTIME) {
  ------------------
  |  |  174|      0|#define HAS_CTIME		0x08000
  ------------------
  |  Branch (718:13): [True: 0, False: 0]
  ------------------
  719|      0|          archive_entry_set_ctime(entry, file->ctime, 0);
  720|      0|        }
  721|      0|        if (file->has & HAS_MTIME) {
  ------------------
  |  |  175|      0|#define HAS_MTIME		0x10000
  ------------------
  |  Branch (721:13): [True: 0, False: 0]
  ------------------
  722|      0|          archive_entry_set_mtime(entry, file->mtime, 0);
  723|      0|        }
  724|      0|	archive_entry_set_gid(entry, file->gid);
  725|      0|	if (file->gname.length > 0 &&
  ------------------
  |  Branch (725:6): [True: 0, False: 0]
  ------------------
  726|      0|	    archive_entry_copy_gname_l(entry, file->gname.s,
  ------------------
  |  |   71|      0|#define archive_entry_copy_gname_l	_archive_entry_copy_gname_l
  ------------------
  |  Branch (726:6): [True: 0, False: 0]
  ------------------
  727|      0|		archive_strlen(&(file->gname)), xar->sconv) != 0) {
  ------------------
  |  |  178|      0|#define	archive_strlen(a) ((a)->length)
  ------------------
  728|      0|		if (errno == ENOMEM) {
  ------------------
  |  Branch (728:7): [True: 0, False: 0]
  ------------------
  729|      0|			archive_set_error(&a->archive, ENOMEM,
  730|      0|			    "Can't allocate memory for Gname");
  731|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  732|      0|		}
  733|      0|		archive_set_error(&a->archive,
  734|      0|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  735|      0|		    "Gname cannot be converted from %s to current locale",
  736|      0|		    archive_string_conversion_charset_name(xar->sconv));
  737|      0|		r = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  738|      0|	}
  739|      0|	archive_entry_set_uid(entry, file->uid);
  740|      0|	if (file->uname.length > 0 &&
  ------------------
  |  Branch (740:6): [True: 0, False: 0]
  ------------------
  741|      0|	    archive_entry_copy_uname_l(entry, file->uname.s,
  ------------------
  |  |   86|      0|#define archive_entry_copy_uname_l	_archive_entry_copy_uname_l
  ------------------
  |  Branch (741:6): [True: 0, False: 0]
  ------------------
  742|      0|		archive_strlen(&(file->uname)), xar->sconv) != 0) {
  ------------------
  |  |  178|      0|#define	archive_strlen(a) ((a)->length)
  ------------------
  743|      0|		if (errno == ENOMEM) {
  ------------------
  |  Branch (743:7): [True: 0, False: 0]
  ------------------
  744|      0|			archive_set_error(&a->archive, ENOMEM,
  745|      0|			    "Can't allocate memory for Uname");
  746|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  747|      0|		}
  748|      0|		archive_set_error(&a->archive,
  749|      0|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  750|      0|		    "Uname cannot be converted from %s to current locale",
  751|      0|		    archive_string_conversion_charset_name(xar->sconv));
  752|      0|		r = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  753|      0|	}
  754|      0|	archive_entry_set_mode(entry, file->mode);
  755|      0|	if (archive_entry_copy_pathname_l(entry, file->pathname.s,
  ------------------
  |  |   80|      0|#define archive_entry_copy_pathname_l	_archive_entry_copy_pathname_l
  ------------------
  |  Branch (755:6): [True: 0, False: 0]
  ------------------
  756|      0|	    archive_strlen(&(file->pathname)), xar->sconv) != 0) {
  ------------------
  |  |  178|      0|#define	archive_strlen(a) ((a)->length)
  ------------------
  757|      0|		if (errno == ENOMEM) {
  ------------------
  |  Branch (757:7): [True: 0, False: 0]
  ------------------
  758|      0|			archive_set_error(&a->archive, ENOMEM,
  759|      0|			    "Can't allocate memory for Pathname");
  760|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  761|      0|		}
  762|      0|		archive_set_error(&a->archive,
  763|      0|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  764|      0|		    "Pathname cannot be converted from %s to current locale",
  765|      0|		    archive_string_conversion_charset_name(xar->sconv));
  766|      0|		r = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  767|      0|	}
  768|       |
  769|       |
  770|      0|	if (file->symlink.length > 0 &&
  ------------------
  |  Branch (770:6): [True: 0, False: 0]
  ------------------
  771|      0|	    archive_entry_copy_symlink_l(entry, file->symlink.s,
  ------------------
  |  |   83|      0|#define archive_entry_copy_symlink_l	_archive_entry_copy_symlink_l
  ------------------
  |  Branch (771:6): [True: 0, False: 0]
  ------------------
  772|      0|		archive_strlen(&(file->symlink)), xar->sconv) != 0) {
  ------------------
  |  |  178|      0|#define	archive_strlen(a) ((a)->length)
  ------------------
  773|      0|		if (errno == ENOMEM) {
  ------------------
  |  Branch (773:7): [True: 0, False: 0]
  ------------------
  774|      0|			archive_set_error(&a->archive, ENOMEM,
  775|      0|			    "Can't allocate memory for Linkname");
  776|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  777|      0|		}
  778|      0|		archive_set_error(&a->archive,
  779|      0|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  780|      0|		    "Linkname cannot be converted from %s to current locale",
  781|      0|		    archive_string_conversion_charset_name(xar->sconv));
  782|      0|		r = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  783|      0|	}
  784|       |	/* Set proper nlink. */
  785|      0|	if ((file->mode & AE_IFMT) == AE_IFDIR)
  ------------------
  |  |  215|      0|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              	if ((file->mode & AE_IFMT) == AE_IFDIR)
  ------------------
  |  |  221|      0|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (785:6): [True: 0, False: 0]
  ------------------
  786|      0|		archive_entry_set_nlink(entry, file->subdirs + 2);
  787|      0|	else
  788|      0|		archive_entry_set_nlink(entry, file->nlink);
  789|      0|	archive_entry_set_size(entry, file->size);
  790|      0|	if (archive_strlen(&(file->hardlink)) > 0)
  ------------------
  |  |  178|      0|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (790:6): [True: 0, False: 0]
  ------------------
  791|      0|		archive_entry_set_hardlink(entry, file->hardlink.s);
  792|      0|	archive_entry_set_ino64(entry, file->ino64);
  793|      0|	if (file->has & HAS_DEV)
  ------------------
  |  |  167|      0|#define HAS_DEV			0x00100
  ------------------
  |  Branch (793:6): [True: 0, False: 0]
  ------------------
  794|      0|		archive_entry_set_dev(entry, file->dev);
  795|      0|	if (file->has & HAS_DEVMAJOR)
  ------------------
  |  |  168|      0|#define HAS_DEVMAJOR		0x00200
  ------------------
  |  Branch (795:6): [True: 0, False: 0]
  ------------------
  796|      0|		archive_entry_set_devmajor(entry, file->devmajor);
  797|      0|	if (file->has & HAS_DEVMINOR)
  ------------------
  |  |  169|      0|#define HAS_DEVMINOR		0x00400
  ------------------
  |  Branch (797:6): [True: 0, False: 0]
  ------------------
  798|      0|		archive_entry_set_devminor(entry, file->devminor);
  799|      0|	if (archive_strlen(&(file->fflags_text)) > 0)
  ------------------
  |  |  178|      0|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (799:6): [True: 0, False: 0]
  ------------------
  800|      0|		archive_entry_copy_fflags_text(entry, file->fflags_text.s);
  801|       |
  802|      0|	xar->entry_init = 1;
  803|      0|	xar->entry_total = 0;
  804|      0|	xar->entry_remaining = file->length;
  805|      0|	xar->entry_size = file->size;
  806|      0|	xar->entry_encoding = file->encoding;
  807|      0|	xar->entry_a_sum = file->a_sum;
  808|      0|	xar->entry_e_sum = file->e_sum;
  809|       |	/*
  810|       |	 * Read extended attributes.
  811|       |	 */
  812|      0|	xattr = file->xattr_list;
  813|      0|	while (xattr != NULL) {
  ------------------
  |  Branch (813:9): [True: 0, False: 0]
  ------------------
  814|      0|		const void *d;
  815|      0|		size_t outbytes = 0;
  816|      0|		size_t used = 0;
  817|       |
  818|      0|		r = move_reading_point(a, xattr->offset);
  819|      0|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (819:7): [True: 0, False: 0]
  ------------------
  820|      0|			break;
  821|      0|		r = rd_contents_init(a, xattr->encoding,
  822|      0|		    xattr->a_sum.alg, xattr->e_sum.alg);
  823|      0|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (823:7): [True: 0, False: 0]
  ------------------
  824|      0|			break;
  825|      0|		d = NULL;
  826|      0|		r = rd_contents(a, &d, &outbytes, &used, xattr->length);
  827|      0|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (827:7): [True: 0, False: 0]
  ------------------
  828|      0|			break;
  829|      0|		if (outbytes != xattr->size) {
  ------------------
  |  Branch (829:7): [True: 0, False: 0]
  ------------------
  830|      0|			archive_set_error(&(a->archive), ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  831|      0|			    "Decompressed size error");
  832|      0|			r = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  833|      0|			break;
  834|      0|		}
  835|      0|		r = checksum_final(a,
  836|      0|		    xattr->a_sum.val, xattr->a_sum.len,
  837|      0|		    xattr->e_sum.val, xattr->e_sum.len);
  838|      0|		if (r != ARCHIVE_OK) {
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (838:7): [True: 0, False: 0]
  ------------------
  839|       |#ifndef DONT_FAIL_ON_CRC_ERROR
  840|       |			archive_set_error(&(a->archive), ARCHIVE_ERRNO_MISC,
  841|       |			    "Xattr checksum error");
  842|       |			r = ARCHIVE_WARN;
  843|       |			break;
  844|       |#endif
  845|      0|		}
  846|      0|		if (xattr->name.s == NULL) {
  ------------------
  |  Branch (846:7): [True: 0, False: 0]
  ------------------
  847|      0|			archive_set_error(&(a->archive), ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  848|      0|			    "Xattr name error");
  849|      0|			r = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  850|      0|			break;
  851|      0|		}
  852|      0|		archive_entry_xattr_add_entry(entry,
  853|      0|		    xattr->name.s, d, outbytes);
  854|      0|		xattr = xattr->next;
  855|      0|	}
  856|      0|	if (r != ARCHIVE_OK) {
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (856:6): [True: 0, False: 0]
  ------------------
  857|      0|		file_free(file);
  858|      0|		return (r);
  859|      0|	}
  860|       |
  861|      0|	if (xar->entry_remaining > 0)
  ------------------
  |  Branch (861:6): [True: 0, False: 0]
  ------------------
  862|       |		/* Move reading point to the beginning of current
  863|       |		 * file contents. */
  864|      0|		r = move_reading_point(a, file->offset);
  865|      0|	else
  866|      0|		r = ARCHIVE_OK;
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  867|       |
  868|      0|	file_free(file);
  869|      0|	return (r);
  870|      0|}
archive_read_support_format_xar.c:read_toc:
  537|    110|{
  538|    110|	struct xar *xar;
  539|    110|	struct xar_file *file;
  540|    110|	const unsigned char *b;
  541|    110|	uint64_t toc_compressed_size;
  542|    110|	uint64_t toc_uncompressed_size;
  543|    110|	uint32_t toc_chksum_alg;
  544|    110|	ssize_t bytes;
  545|    110|	int r;
  546|       |
  547|    110|	xar = (struct xar *)(a->format->data);
  548|       |
  549|       |	/*
  550|       |	 * Read xar header.
  551|       |	 */
  552|    110|	b = __archive_read_ahead(a, HEADER_SIZE, &bytes);
  ------------------
  |  |  105|    110|#define HEADER_SIZE	28
  ------------------
  553|    110|	if (bytes < 0)
  ------------------
  |  Branch (553:6): [True: 0, False: 110]
  ------------------
  554|      0|		return ((int)bytes);
  555|    110|	if (bytes < HEADER_SIZE) {
  ------------------
  |  |  105|    110|#define HEADER_SIZE	28
  ------------------
  |  Branch (555:6): [True: 0, False: 110]
  ------------------
  556|      0|		archive_set_error(&a->archive,
  557|      0|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  558|      0|		    "Truncated archive header");
  559|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  560|      0|	}
  561|       |
  562|    110|	if (archive_be32dec(b) != HEADER_MAGIC) {
  ------------------
  |  |  104|    110|#define HEADER_MAGIC	0x78617221
  ------------------
  |  Branch (562:6): [True: 0, False: 110]
  ------------------
  563|      0|		archive_set_error(&a->archive,
  564|      0|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  565|      0|		    "Invalid header magic");
  566|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  567|      0|	}
  568|    110|	if (archive_be16dec(b+6) != HEADER_VERSION) {
  ------------------
  |  |  106|    110|#define HEADER_VERSION	1
  ------------------
  |  Branch (568:6): [True: 0, False: 110]
  ------------------
  569|      0|		archive_set_error(&a->archive,
  570|      0|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  571|      0|		    "Unsupported header version(%d)",
  572|      0|		    archive_be16dec(b+6));
  573|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  574|      0|	}
  575|    110|	toc_compressed_size = archive_be64dec(b+8);
  576|    110|	xar->toc_remaining = toc_compressed_size;
  577|    110|	toc_uncompressed_size = archive_be64dec(b+16);
  578|    110|	toc_chksum_alg = archive_be32dec(b+24);
  579|    110|	__archive_read_consume(a, HEADER_SIZE);
  ------------------
  |  |  105|    110|#define HEADER_SIZE	28
  ------------------
  580|    110|	xar->offset += HEADER_SIZE;
  ------------------
  |  |  105|    110|#define HEADER_SIZE	28
  ------------------
  581|    110|	xar->toc_total = 0;
  582|       |
  583|       |	/*
  584|       |	 * Read TOC(Table of Contents).
  585|       |	 */
  586|       |	/* Initialize reading contents. */
  587|    110|	r = move_reading_point(a, HEADER_SIZE);
  ------------------
  |  |  105|    110|#define HEADER_SIZE	28
  ------------------
  588|    110|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    110|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (588:6): [True: 0, False: 110]
  ------------------
  589|      0|		return (r);
  590|    110|	r = rd_contents_init(a, GZIP, toc_chksum_alg, CKSUM_NONE);
  ------------------
  |  |  107|    110|#define CKSUM_NONE	0
  ------------------
  591|    110|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    110|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (591:6): [True: 0, False: 110]
  ------------------
  592|      0|		return (r);
  593|       |
  594|    110|#ifdef HAVE_LIBXML_XMLREADER_H
  595|    110|	r = xml2_read_toc(a);
  596|       |#elif defined(HAVE_BSDXML_H) || defined(HAVE_EXPAT_H)
  597|       |	r = expat_read_toc(a);
  598|       |#elif defined(HAVE_XMLLITE_H)
  599|       |	r = xmllite_read_toc(a);
  600|       |#endif
  601|    110|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    110|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (601:6): [True: 110, False: 0]
  ------------------
  602|    110|		return (r);
  603|       |
  604|       |	/* Set 'The HEAP' base. */
  605|      0|	xar->h_base = xar->offset;
  606|      0|	if (xar->toc_total != toc_uncompressed_size) {
  ------------------
  |  Branch (606:6): [True: 0, False: 0]
  ------------------
  607|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  608|      0|		    "TOC uncompressed size error");
  609|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  610|      0|	}
  611|       |
  612|       |	/*
  613|       |	 * Checksum TOC
  614|       |	 */
  615|      0|	if (toc_chksum_alg != CKSUM_NONE) {
  ------------------
  |  |  107|      0|#define CKSUM_NONE	0
  ------------------
  |  Branch (615:6): [True: 0, False: 0]
  ------------------
  616|      0|		r = move_reading_point(a, xar->toc_chksum_offset);
  617|      0|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (617:7): [True: 0, False: 0]
  ------------------
  618|      0|			return (r);
  619|      0|		b = __archive_read_ahead(a,
  620|      0|			(size_t)xar->toc_chksum_size, &bytes);
  621|      0|		if (bytes < 0)
  ------------------
  |  Branch (621:7): [True: 0, False: 0]
  ------------------
  622|      0|			return ((int)bytes);
  623|      0|		if ((uint64_t)bytes < xar->toc_chksum_size) {
  ------------------
  |  Branch (623:7): [True: 0, False: 0]
  ------------------
  624|      0|			archive_set_error(&a->archive,
  625|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  626|      0|			    "Truncated archive file");
  627|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  628|      0|		}
  629|      0|		r = checksum_final(a, b,
  630|      0|			(size_t)xar->toc_chksum_size, NULL, 0);
  631|      0|		__archive_read_consume(a, xar->toc_chksum_size);
  632|      0|		xar->offset += xar->toc_chksum_size;
  633|       |#ifndef DONT_FAIL_ON_CRC_ERROR
  634|       |		if (r != ARCHIVE_OK)
  635|       |			return (ARCHIVE_FATAL);
  636|       |#endif
  637|      0|	}
  638|       |
  639|       |	/*
  640|       |	 * Connect hardlinked files.
  641|       |	 */
  642|      0|	for (file = xar->hdlink_orgs; file != NULL; file = file->hdnext) {
  ------------------
  |  Branch (642:32): [True: 0, False: 0]
  ------------------
  643|      0|		struct hdlink **hdlink;
  644|       |
  645|      0|		for (hdlink = &(xar->hdlink_list); *hdlink != NULL;
  ------------------
  |  Branch (645:38): [True: 0, False: 0]
  ------------------
  646|      0|		    hdlink = &((*hdlink)->next)) {
  647|      0|			if ((*hdlink)->id == file->id) {
  ------------------
  |  Branch (647:8): [True: 0, False: 0]
  ------------------
  648|      0|				struct hdlink *hltmp;
  649|      0|				struct xar_file *f2;
  650|      0|				int nlink = (*hdlink)->cnt + 1;
  651|       |
  652|      0|				file->nlink = nlink;
  653|      0|				for (f2 = (*hdlink)->files; f2 != NULL;
  ------------------
  |  Branch (653:33): [True: 0, False: 0]
  ------------------
  654|      0|				    f2 = f2->hdnext) {
  655|      0|					f2->nlink = nlink;
  656|      0|					archive_string_copy(
  ------------------
  |  |  133|      0|	((dest)->length = 0, archive_string_concat((dest), (src)))
  ------------------
  657|      0|					    &(f2->hardlink), &(file->pathname));
  658|      0|				}
  659|       |				/* Remove resolved files from hdlist_list. */
  660|      0|				hltmp = *hdlink;
  661|      0|				*hdlink = hltmp->next;
  662|      0|				free(hltmp);
  663|      0|				break;
  664|      0|			}
  665|      0|		}
  666|      0|	}
  667|      0|	a->archive.archive_format = ARCHIVE_FORMAT_XAR;
  ------------------
  |  |  381|      0|#define	ARCHIVE_FORMAT_XAR			0xA0000
  ------------------
  668|      0|	a->archive.archive_format_name = "xar";
  669|       |
  670|      0|	return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  671|      0|}
archive_read_support_format_xar.c:xml2_read_toc:
 3229|    110|{
 3230|    110|	xmlTextReaderPtr reader;
 3231|    110|	struct xmlattr_list list;
 3232|    110|	int r;
 3233|       |
 3234|    110|	reader = xmlReaderForIO(xml2_read_cb, xml2_close_cb, a, NULL, NULL, 0);
 3235|    110|	if (reader == NULL) {
  ------------------
  |  Branch (3235:6): [True: 0, False: 110]
  ------------------
 3236|      0|		archive_set_error(&a->archive, ENOMEM,
 3237|      0|		    "Couldn't allocate memory for xml parser");
 3238|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3239|      0|	}
 3240|    110|	xmlTextReaderSetErrorHandler(reader, xml2_error_hdr, a);
 3241|       |
 3242|   247k|	while ((r = xmlTextReaderRead(reader)) == 1) {
  ------------------
  |  Branch (3242:9): [True: 247k, False: 110]
  ------------------
 3243|   247k|		const char *name, *value;
 3244|   247k|		int type, empty;
 3245|       |
 3246|   247k|		type = xmlTextReaderNodeType(reader);
 3247|   247k|		name = (const char *)xmlTextReaderConstLocalName(reader);
 3248|   247k|		switch (type) {
 3249|  87.2k|		case XML_READER_TYPE_ELEMENT:
  ------------------
  |  Branch (3249:3): [True: 87.2k, False: 160k]
  ------------------
 3250|  87.2k|			empty = xmlTextReaderIsEmptyElement(reader);
 3251|  87.2k|			r = xml2_xmlattr_setup(a, &list, reader);
 3252|  87.2k|			if (r == ARCHIVE_OK)
  ------------------
  |  |  233|  87.2k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3252:8): [True: 87.2k, False: 0]
  ------------------
 3253|  87.2k|				r = xml_start(a, name, &list);
 3254|  87.2k|			xmlattr_cleanup(&list);
 3255|  87.2k|			if (r != ARCHIVE_OK) {
  ------------------
  |  |  233|  87.2k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3255:8): [True: 0, False: 87.2k]
  ------------------
 3256|      0|				xmlFreeTextReader(reader);
 3257|      0|				xmlCleanupParser();
 3258|      0|				return (r);
 3259|      0|			}
 3260|  87.2k|			if (empty)
  ------------------
  |  Branch (3260:8): [True: 46.7k, False: 40.5k]
  ------------------
 3261|  46.7k|				xml_end(a, name);
 3262|  87.2k|			break;
 3263|  37.2k|		case XML_READER_TYPE_END_ELEMENT:
  ------------------
  |  Branch (3263:3): [True: 37.2k, False: 209k]
  ------------------
 3264|  37.2k|			xml_end(a, name);
 3265|  37.2k|			break;
 3266|   110k|		case XML_READER_TYPE_TEXT:
  ------------------
  |  Branch (3266:3): [True: 110k, False: 136k]
  ------------------
 3267|   110k|			value = (const char *)xmlTextReaderConstValue(reader);
 3268|   110k|			r = xml_data(a, value, strlen(value));
 3269|   110k|			if (r != ARCHIVE_OK) {
  ------------------
  |  |  233|   110k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3269:8): [True: 0, False: 110k]
  ------------------
 3270|      0|				xmlFreeTextReader(reader);
 3271|      0|				xmlCleanupParser();
 3272|      0|				return (r);
 3273|      0|			}
 3274|   110k|			break;
 3275|   110k|		case XML_READER_TYPE_SIGNIFICANT_WHITESPACE:
  ------------------
  |  Branch (3275:3): [True: 11.7k, False: 235k]
  ------------------
 3276|  11.8k|		default:
  ------------------
  |  Branch (3276:3): [True: 146, False: 247k]
  ------------------
 3277|  11.8k|			break;
 3278|   247k|		}
 3279|   247k|		if (r < 0)
  ------------------
  |  Branch (3279:7): [True: 0, False: 247k]
  ------------------
 3280|      0|			break;
 3281|   247k|	}
 3282|    110|	xmlFreeTextReader(reader);
 3283|    110|	xmlCleanupParser();
 3284|       |
 3285|    110|	return ((r == 0)?ARCHIVE_OK:ARCHIVE_FATAL);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
              	return ((r == 0)?ARCHIVE_OK:ARCHIVE_FATAL);
  ------------------
  |  |  239|    110|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (3285:10): [True: 0, False: 110]
  ------------------
 3286|    110|}
archive_read_support_format_xar.c:xml2_read_cb:
 3170|  2.64k|{
 3171|  2.64k|	struct archive_read *a;
 3172|  2.64k|	struct xar *xar;
 3173|  2.64k|	const void *d;
 3174|  2.64k|	size_t outbytes;
 3175|  2.64k|	size_t used = 0;
 3176|  2.64k|	int r;
 3177|       |
 3178|  2.64k|	a = (struct archive_read *)context;
 3179|  2.64k|	xar = (struct xar *)(a->format->data);
 3180|       |
 3181|  2.64k|	if (xar->toc_remaining <= 0)
  ------------------
  |  Branch (3181:6): [True: 0, False: 2.64k]
  ------------------
 3182|      0|		return (0);
 3183|  2.64k|	d = buffer;
 3184|  2.64k|	outbytes = len;
 3185|  2.64k|	r = rd_contents(a, &d, &outbytes, &used, xar->toc_remaining);
 3186|  2.64k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  2.64k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3186:6): [True: 60, False: 2.58k]
  ------------------
 3187|     60|		return (r);
 3188|  2.58k|	__archive_read_consume(a, used);
 3189|  2.58k|	xar->toc_remaining -= used;
 3190|  2.58k|	xar->offset += used;
 3191|  2.58k|	xar->toc_total += outbytes;
 3192|  2.58k|	PRINT_TOC(buffer, len);
 3193|       |
 3194|  2.58k|	return ((int)outbytes);
 3195|  2.64k|}
archive_read_support_format_xar.c:xml2_close_cb:
 3199|    110|{
 3200|       |
 3201|    110|	(void)context; /* UNUSED */
 3202|    110|	return (0);
 3203|    110|}
archive_read_support_format_xar.c:xml2_error_hdr:
 3208|    376|{
 3209|    376|	struct archive_read *a;
 3210|       |
 3211|    376|	(void)locator; /* UNUSED */
 3212|    376|	a = (struct archive_read *)arg;
 3213|    376|	switch (severity) {
  ------------------
  |  Branch (3213:10): [True: 376, False: 0]
  ------------------
 3214|      0|	case XML_PARSER_SEVERITY_VALIDITY_WARNING:
  ------------------
  |  Branch (3214:2): [True: 0, False: 376]
  ------------------
 3215|     96|	case XML_PARSER_SEVERITY_WARNING:
  ------------------
  |  Branch (3215:2): [True: 96, False: 280]
  ------------------
 3216|     96|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     96|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3217|     96|		    "XML Parsing error: %s", msg);
 3218|     96|		break;
 3219|      0|	case XML_PARSER_SEVERITY_VALIDITY_ERROR:
  ------------------
  |  Branch (3219:2): [True: 0, False: 376]
  ------------------
 3220|    280|	case XML_PARSER_SEVERITY_ERROR:
  ------------------
  |  Branch (3220:2): [True: 280, False: 96]
  ------------------
 3221|    280|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|    280|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3222|    280|		    "XML Parsing error: %s", msg);
 3223|    280|		break;
 3224|    376|	}
 3225|    376|}
archive_read_support_format_xar.c:xml2_xmlattr_setup:
 3132|  87.2k|{
 3133|  87.2k|	struct xmlattr *attr;
 3134|  87.2k|	int r;
 3135|       |
 3136|  87.2k|	list->first = NULL;
 3137|  87.2k|	list->last = &(list->first);
 3138|  87.2k|	r = xmlTextReaderMoveToFirstAttribute(reader);
 3139|   108k|	while (r == 1) {
  ------------------
  |  Branch (3139:9): [True: 21.3k, False: 87.2k]
  ------------------
 3140|  21.3k|		attr = malloc(sizeof*(attr));
 3141|  21.3k|		if (attr == NULL) {
  ------------------
  |  Branch (3141:7): [True: 0, False: 21.3k]
  ------------------
 3142|      0|			archive_set_error(&a->archive, ENOMEM, "Out of memory");
 3143|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3144|      0|		}
 3145|  21.3k|		attr->name = strdup(
 3146|  21.3k|		    (const char *)xmlTextReaderConstLocalName(reader));
 3147|  21.3k|		if (attr->name == NULL) {
  ------------------
  |  Branch (3147:7): [True: 0, False: 21.3k]
  ------------------
 3148|      0|			free(attr);
 3149|      0|			archive_set_error(&a->archive, ENOMEM, "Out of memory");
 3150|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3151|      0|		}
 3152|  21.3k|		attr->value = strdup(
 3153|  21.3k|		    (const char *)xmlTextReaderConstValue(reader));
 3154|  21.3k|		if (attr->value == NULL) {
  ------------------
  |  Branch (3154:7): [True: 0, False: 21.3k]
  ------------------
 3155|      0|			free(attr->name);
 3156|      0|			free(attr);
 3157|      0|			archive_set_error(&a->archive, ENOMEM, "Out of memory");
 3158|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3159|      0|		}
 3160|  21.3k|		attr->next = NULL;
 3161|  21.3k|		*list->last = attr;
 3162|  21.3k|		list->last = &(attr->next);
 3163|  21.3k|		r = xmlTextReaderMoveToNextAttribute(reader);
 3164|  21.3k|	}
 3165|  87.2k|	return (r);
 3166|  87.2k|}
archive_read_support_format_xar.c:xml_start:
 1961|  87.2k|{
 1962|  87.2k|	struct xar *xar;
 1963|  87.2k|	struct xmlattr *attr;
 1964|       |
 1965|  87.2k|	xar = (struct xar *)(a->format->data);
 1966|       |
 1967|       |#if DEBUG
 1968|       |	fprintf(stderr, "xml_sta:[%s]\n", name);
 1969|       |	for (attr = list->first; attr != NULL; attr = attr->next)
 1970|       |		fprintf(stderr, "    attr:\"%s\"=\"%s\"\n",
 1971|       |		    attr->name, attr->value);
 1972|       |#endif
 1973|  87.2k|	xar->base64text = 0;
 1974|  87.2k|	switch (xar->xmlsts) {
  ------------------
  |  Branch (1974:10): [True: 87.2k, False: 0]
  ------------------
 1975|    107|	case INIT:
  ------------------
  |  Branch (1975:2): [True: 107, False: 87.1k]
  ------------------
 1976|    107|		if (strcmp(name, "xar") == 0)
  ------------------
  |  Branch (1976:7): [True: 107, False: 0]
  ------------------
 1977|    107|			xar->xmlsts = XAR;
 1978|      0|		else
 1979|      0|			if (unknowntag_start(a, xar, name) != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1979:8): [True: 0, False: 0]
  ------------------
 1980|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1981|    107|		break;
 1982|    107|	case XAR:
  ------------------
  |  Branch (1982:2): [True: 107, False: 87.1k]
  ------------------
 1983|    107|		if (strcmp(name, "toc") == 0)
  ------------------
  |  Branch (1983:7): [True: 107, False: 0]
  ------------------
 1984|    107|			xar->xmlsts = TOC;
 1985|      0|		else
 1986|      0|			if (unknowntag_start(a, xar, name) != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1986:8): [True: 0, False: 0]
  ------------------
 1987|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1988|    107|		break;
 1989|  18.0k|	case TOC:
  ------------------
  |  Branch (1989:2): [True: 18.0k, False: 69.1k]
  ------------------
 1990|  18.0k|		if (strcmp(name, "creation-time") == 0)
  ------------------
  |  Branch (1990:7): [True: 182, False: 17.8k]
  ------------------
 1991|    182|			xar->xmlsts = TOC_CREATION_TIME;
 1992|  17.8k|		else if (strcmp(name, "checksum") == 0)
  ------------------
  |  Branch (1992:12): [True: 259, False: 17.6k]
  ------------------
 1993|    259|			xar->xmlsts = TOC_CHECKSUM;
 1994|  17.6k|		else if (strcmp(name, "file") == 0) {
  ------------------
  |  Branch (1994:12): [True: 16.3k, False: 1.32k]
  ------------------
 1995|  16.3k|			if (file_new(a, xar, list) != ARCHIVE_OK)
  ------------------
  |  |  233|  16.3k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1995:8): [True: 0, False: 16.3k]
  ------------------
 1996|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1997|  16.3k|			xar->xmlsts = TOC_FILE;
 1998|  16.3k|		}
 1999|  1.32k|		else
 2000|  1.32k|			if (unknowntag_start(a, xar, name) != ARCHIVE_OK)
  ------------------
  |  |  233|  1.32k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2000:8): [True: 0, False: 1.32k]
  ------------------
 2001|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2002|  18.0k|		break;
 2003|  18.0k|	case TOC_CHECKSUM:
  ------------------
  |  Branch (2003:2): [True: 1.74k, False: 85.4k]
  ------------------
 2004|  1.74k|		if (strcmp(name, "offset") == 0)
  ------------------
  |  Branch (2004:7): [True: 650, False: 1.09k]
  ------------------
 2005|    650|			xar->xmlsts = TOC_CHECKSUM_OFFSET;
 2006|  1.09k|		else if (strcmp(name, "size") == 0)
  ------------------
  |  Branch (2006:12): [True: 227, False: 864]
  ------------------
 2007|    227|			xar->xmlsts = TOC_CHECKSUM_SIZE;
 2008|    864|		else
 2009|    864|			if (unknowntag_start(a, xar, name) != ARCHIVE_OK)
  ------------------
  |  |  233|    864|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2009:8): [True: 0, False: 864]
  ------------------
 2010|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2011|  1.74k|		break;
 2012|  14.8k|	case TOC_FILE:
  ------------------
  |  Branch (2012:2): [True: 14.8k, False: 72.3k]
  ------------------
 2013|  14.8k|		if (strcmp(name, "file") == 0) {
  ------------------
  |  Branch (2013:7): [True: 2.98k, False: 11.8k]
  ------------------
 2014|  2.98k|			if (file_new(a, xar, list) != ARCHIVE_OK)
  ------------------
  |  |  233|  2.98k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2014:8): [True: 0, False: 2.98k]
  ------------------
 2015|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2016|  2.98k|		}
 2017|  11.8k|		else if (strcmp(name, "data") == 0)
  ------------------
  |  Branch (2017:12): [True: 1.34k, False: 10.5k]
  ------------------
 2018|  1.34k|			xar->xmlsts = FILE_DATA;
 2019|  10.5k|		else if (strcmp(name, "ea") == 0) {
  ------------------
  |  Branch (2019:12): [True: 949, False: 9.59k]
  ------------------
 2020|    949|			if (xattr_new(a, xar, list) != ARCHIVE_OK)
  ------------------
  |  |  233|    949|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2020:8): [True: 0, False: 949]
  ------------------
 2021|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2022|    949|			xar->xmlsts = FILE_EA;
 2023|    949|		}
 2024|  9.59k|		else if (strcmp(name, "ctime") == 0)
  ------------------
  |  Branch (2024:12): [True: 87, False: 9.50k]
  ------------------
 2025|     87|			xar->xmlsts = FILE_CTIME;
 2026|  9.50k|		else if (strcmp(name, "mtime") == 0)
  ------------------
  |  Branch (2026:12): [True: 88, False: 9.41k]
  ------------------
 2027|     88|			xar->xmlsts = FILE_MTIME;
 2028|  9.41k|		else if (strcmp(name, "atime") == 0)
  ------------------
  |  Branch (2028:12): [True: 87, False: 9.33k]
  ------------------
 2029|     87|			xar->xmlsts = FILE_ATIME;
 2030|  9.33k|		else if (strcmp(name, "group") == 0)
  ------------------
  |  Branch (2030:12): [True: 382, False: 8.94k]
  ------------------
 2031|    382|			xar->xmlsts = FILE_GROUP;
 2032|  8.94k|		else if (strcmp(name, "gid") == 0)
  ------------------
  |  Branch (2032:12): [True: 1.31k, False: 7.63k]
  ------------------
 2033|  1.31k|			xar->xmlsts = FILE_GID;
 2034|  7.63k|		else if (strcmp(name, "user") == 0)
  ------------------
  |  Branch (2034:12): [True: 1.31k, False: 6.31k]
  ------------------
 2035|  1.31k|			xar->xmlsts = FILE_USER;
 2036|  6.31k|		else if (strcmp(name, "uid") == 0)
  ------------------
  |  Branch (2036:12): [True: 0, False: 6.31k]
  ------------------
 2037|      0|			xar->xmlsts = FILE_UID;
 2038|  6.31k|		else if (strcmp(name, "mode") == 0)
  ------------------
  |  Branch (2038:12): [True: 0, False: 6.31k]
  ------------------
 2039|      0|			xar->xmlsts = FILE_MODE;
 2040|  6.31k|		else if (strcmp(name, "device") == 0)
  ------------------
  |  Branch (2040:12): [True: 0, False: 6.31k]
  ------------------
 2041|      0|			xar->xmlsts = FILE_DEVICE;
 2042|  6.31k|		else if (strcmp(name, "deviceno") == 0)
  ------------------
  |  Branch (2042:12): [True: 0, False: 6.31k]
  ------------------
 2043|      0|			xar->xmlsts = FILE_DEVICENO;
 2044|  6.31k|		else if (strcmp(name, "inode") == 0)
  ------------------
  |  Branch (2044:12): [True: 0, False: 6.31k]
  ------------------
 2045|      0|			xar->xmlsts = FILE_INODE;
 2046|  6.31k|		else if (strcmp(name, "link") == 0)
  ------------------
  |  Branch (2046:12): [True: 0, False: 6.31k]
  ------------------
 2047|      0|			xar->xmlsts = FILE_LINK;
 2048|  6.31k|		else if (strcmp(name, "type") == 0) {
  ------------------
  |  Branch (2048:12): [True: 0, False: 6.31k]
  ------------------
 2049|      0|			xar->xmlsts = FILE_TYPE;
 2050|      0|			for (attr = list->first; attr != NULL;
  ------------------
  |  Branch (2050:29): [True: 0, False: 0]
  ------------------
 2051|      0|			    attr = attr->next) {
 2052|      0|				if (strcmp(attr->name, "link") != 0)
  ------------------
  |  Branch (2052:9): [True: 0, False: 0]
  ------------------
 2053|      0|					continue;
 2054|      0|				if (xar->file->hdnext != NULL || xar->file->link != 0 ||
  ------------------
  |  Branch (2054:9): [True: 0, False: 0]
  |  Branch (2054:38): [True: 0, False: 0]
  ------------------
 2055|      0|				    xar->file == xar->hdlink_orgs) {
  ------------------
  |  Branch (2055:9): [True: 0, False: 0]
  ------------------
 2056|      0|					archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2057|      0|					    "File with multiple link attributes");
 2058|      0|					return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2059|      0|				}
 2060|      0|				if (strcmp(attr->value, "original") == 0) {
  ------------------
  |  Branch (2060:9): [True: 0, False: 0]
  ------------------
 2061|      0|					xar->file->hdnext = xar->hdlink_orgs;
 2062|      0|					xar->hdlink_orgs = xar->file;
 2063|      0|				} else {
 2064|      0|					uint64_t val;
 2065|      0|					int r;
 2066|      0|					r = atou64(attr->value,
 2067|      0|					    strlen(attr->value), 10, &val);
 2068|      0|					if (r != ARCHIVE_OK) {
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2068:10): [True: 0, False: 0]
  ------------------
 2069|      0|						return (r);
 2070|      0|					}
 2071|      0|					if (val > UINT_MAX) {
  ------------------
  |  Branch (2071:10): [True: 0, False: 0]
  ------------------
 2072|      0|						return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2073|      0|					}
 2074|      0|					xar->file->link = (unsigned)val;
 2075|      0|					if (xar->file->link > 0)
  ------------------
  |  Branch (2075:10): [True: 0, False: 0]
  ------------------
 2076|      0|						if (add_link(a, xar, xar->file) != ARCHIVE_OK) {
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2076:11): [True: 0, False: 0]
  ------------------
 2077|      0|							return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2078|      0|						}
 2079|      0|				}
 2080|      0|			}
 2081|      0|		}
 2082|  6.31k|		else if (strcmp(name, "name") == 0) {
  ------------------
  |  Branch (2082:12): [True: 0, False: 6.31k]
  ------------------
 2083|      0|			xar->xmlsts = FILE_NAME;
 2084|      0|			for (attr = list->first; attr != NULL;
  ------------------
  |  Branch (2084:29): [True: 0, False: 0]
  ------------------
 2085|      0|			    attr = attr->next) {
 2086|      0|				if (strcmp(attr->name, "enctype") == 0 &&
  ------------------
  |  Branch (2086:9): [True: 0, False: 0]
  ------------------
 2087|      0|				    strcmp(attr->value, "base64") == 0)
  ------------------
  |  Branch (2087:9): [True: 0, False: 0]
  ------------------
 2088|      0|					xar->base64text = 1;
 2089|      0|			}
 2090|      0|		}
 2091|  6.31k|		else if (strcmp(name, "acl") == 0)
  ------------------
  |  Branch (2091:12): [True: 0, False: 6.31k]
  ------------------
 2092|      0|			xar->xmlsts = FILE_ACL;
 2093|  6.31k|		else if (strcmp(name, "flags") == 0)
  ------------------
  |  Branch (2093:12): [True: 0, False: 6.31k]
  ------------------
 2094|      0|			xar->xmlsts = FILE_FLAGS;
 2095|  6.31k|		else if (strcmp(name, "ext2") == 0)
  ------------------
  |  Branch (2095:12): [True: 0, False: 6.31k]
  ------------------
 2096|      0|			xar->xmlsts = FILE_EXT2;
 2097|  6.31k|		else
 2098|  6.31k|			if (unknowntag_start(a, xar, name) != ARCHIVE_OK)
  ------------------
  |  |  233|  6.31k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2098:8): [True: 0, False: 6.31k]
  ------------------
 2099|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2100|  14.8k|		break;
 2101|  24.7k|	case FILE_DATA:
  ------------------
  |  Branch (2101:2): [True: 24.7k, False: 62.4k]
  ------------------
 2102|  24.7k|		if (strcmp(name, "length") == 0)
  ------------------
  |  Branch (2102:7): [True: 343, False: 24.3k]
  ------------------
 2103|    343|			xar->xmlsts = FILE_DATA_LENGTH;
 2104|  24.3k|		else if (strcmp(name, "offset") == 0)
  ------------------
  |  Branch (2104:12): [True: 938, False: 23.4k]
  ------------------
 2105|    938|			xar->xmlsts = FILE_DATA_OFFSET;
 2106|  23.4k|		else if (strcmp(name, "size") == 0)
  ------------------
  |  Branch (2106:12): [True: 1.30k, False: 22.1k]
  ------------------
 2107|  1.30k|			xar->xmlsts = FILE_DATA_SIZE;
 2108|  22.1k|		else if (strcmp(name, "encoding") == 0) {
  ------------------
  |  Branch (2108:12): [True: 2.42k, False: 19.7k]
  ------------------
 2109|  2.42k|			xar->xmlsts = FILE_DATA_ENCODING;
 2110|  2.42k|			xar->file->encoding = getencoding(list);
 2111|  2.42k|		}
 2112|  19.7k|		else if (strcmp(name, "archived-checksum") == 0) {
  ------------------
  |  Branch (2112:12): [True: 5.82k, False: 13.8k]
  ------------------
 2113|  5.82k|			xar->xmlsts = FILE_DATA_A_CHECKSUM;
 2114|  5.82k|			xar->file->a_sum.alg = getsumalgorithm(list);
 2115|  5.82k|		}
 2116|  13.8k|		else if (strcmp(name, "extracted-checksum") == 0) {
  ------------------
  |  Branch (2116:12): [True: 4.75k, False: 9.14k]
  ------------------
 2117|  4.75k|			xar->xmlsts = FILE_DATA_E_CHECKSUM;
 2118|  4.75k|			xar->file->e_sum.alg = getsumalgorithm(list);
 2119|  4.75k|		}
 2120|  9.14k|		else if (strcmp(name, "content") == 0)
  ------------------
  |  Branch (2120:12): [True: 0, False: 9.14k]
  ------------------
 2121|      0|			xar->xmlsts = FILE_DATA_CONTENT;
 2122|  9.14k|		else
 2123|  9.14k|			if (unknowntag_start(a, xar, name) != ARCHIVE_OK)
  ------------------
  |  |  233|  9.14k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2123:8): [True: 0, False: 9.14k]
  ------------------
 2124|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2125|  24.7k|		break;
 2126|  24.7k|	case FILE_DEVICE:
  ------------------
  |  Branch (2126:2): [True: 0, False: 87.2k]
  ------------------
 2127|      0|		if (strcmp(name, "major") == 0)
  ------------------
  |  Branch (2127:7): [True: 0, False: 0]
  ------------------
 2128|      0|			xar->xmlsts = FILE_DEVICE_MAJOR;
 2129|      0|		else if (strcmp(name, "minor") == 0)
  ------------------
  |  Branch (2129:12): [True: 0, False: 0]
  ------------------
 2130|      0|			xar->xmlsts = FILE_DEVICE_MINOR;
 2131|      0|		else
 2132|      0|			if (unknowntag_start(a, xar, name) != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2132:8): [True: 0, False: 0]
  ------------------
 2133|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2134|      0|		break;
 2135|      0|	case FILE_DATA_CONTENT:
  ------------------
  |  Branch (2135:2): [True: 0, False: 87.2k]
  ------------------
 2136|      0|		if (unknowntag_start(a, xar, name) != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2136:7): [True: 0, False: 0]
  ------------------
 2137|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2138|      0|		break;
 2139|  1.77k|	case FILE_EA:
  ------------------
  |  Branch (2139:2): [True: 1.77k, False: 85.4k]
  ------------------
 2140|  1.77k|		if (strcmp(name, "length") == 0)
  ------------------
  |  Branch (2140:7): [True: 0, False: 1.77k]
  ------------------
 2141|      0|			xar->xmlsts = FILE_EA_LENGTH;
 2142|  1.77k|		else if (strcmp(name, "offset") == 0)
  ------------------
  |  Branch (2142:12): [True: 280, False: 1.49k]
  ------------------
 2143|    280|			xar->xmlsts = FILE_EA_OFFSET;
 2144|  1.49k|		else if (strcmp(name, "size") == 0)
  ------------------
  |  Branch (2144:12): [True: 207, False: 1.28k]
  ------------------
 2145|    207|			xar->xmlsts = FILE_EA_SIZE;
 2146|  1.28k|		else if (strcmp(name, "encoding") == 0) {
  ------------------
  |  Branch (2146:12): [True: 156, False: 1.12k]
  ------------------
 2147|    156|			xar->xmlsts = FILE_EA_ENCODING;
 2148|    156|			xar->xattr->encoding = getencoding(list);
 2149|  1.12k|		} else if (strcmp(name, "archived-checksum") == 0)
  ------------------
  |  Branch (2149:14): [True: 814, False: 315]
  ------------------
 2150|    814|			xar->xmlsts = FILE_EA_A_CHECKSUM;
 2151|    315|		else if (strcmp(name, "extracted-checksum") == 0)
  ------------------
  |  Branch (2151:12): [True: 0, False: 315]
  ------------------
 2152|      0|			xar->xmlsts = FILE_EA_E_CHECKSUM;
 2153|    315|		else if (strcmp(name, "name") == 0)
  ------------------
  |  Branch (2153:12): [True: 0, False: 315]
  ------------------
 2154|      0|			xar->xmlsts = FILE_EA_NAME;
 2155|    315|		else if (strcmp(name, "fstype") == 0)
  ------------------
  |  Branch (2155:12): [True: 0, False: 315]
  ------------------
 2156|      0|			xar->xmlsts = FILE_EA_FSTYPE;
 2157|    315|		else
 2158|    315|			if (unknowntag_start(a, xar, name) != ARCHIVE_OK)
  ------------------
  |  |  233|    315|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2158:8): [True: 0, False: 315]
  ------------------
 2159|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2160|  1.77k|		break;
 2161|  1.77k|	case FILE_ACL:
  ------------------
  |  Branch (2161:2): [True: 0, False: 87.2k]
  ------------------
 2162|      0|		if (strcmp(name, "appleextended") == 0)
  ------------------
  |  Branch (2162:7): [True: 0, False: 0]
  ------------------
 2163|      0|			xar->xmlsts = FILE_ACL_APPLEEXTENDED;
 2164|      0|		else if (strcmp(name, "default") == 0)
  ------------------
  |  Branch (2164:12): [True: 0, False: 0]
  ------------------
 2165|      0|			xar->xmlsts = FILE_ACL_DEFAULT;
 2166|      0|		else if (strcmp(name, "access") == 0)
  ------------------
  |  Branch (2166:12): [True: 0, False: 0]
  ------------------
 2167|      0|			xar->xmlsts = FILE_ACL_ACCESS;
 2168|      0|		else
 2169|      0|			if (unknowntag_start(a, xar, name) != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2169:8): [True: 0, False: 0]
  ------------------
 2170|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2171|      0|		break;
 2172|      0|	case FILE_FLAGS:
  ------------------
  |  Branch (2172:2): [True: 0, False: 87.2k]
  ------------------
 2173|      0|		if (!xml_parse_file_flags(xar, name))
  ------------------
  |  Branch (2173:7): [True: 0, False: 0]
  ------------------
 2174|      0|			if (unknowntag_start(a, xar, name) != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2174:8): [True: 0, False: 0]
  ------------------
 2175|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2176|      0|		break;
 2177|      0|	case FILE_EXT2:
  ------------------
  |  Branch (2177:2): [True: 0, False: 87.2k]
  ------------------
 2178|      0|		if (!xml_parse_file_ext2(xar, name))
  ------------------
  |  Branch (2178:7): [True: 0, False: 0]
  ------------------
 2179|      0|			if (unknowntag_start(a, xar, name) != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2179:8): [True: 0, False: 0]
  ------------------
 2180|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2181|      0|		break;
 2182|      0|	case TOC_CREATION_TIME:
  ------------------
  |  Branch (2182:2): [True: 0, False: 87.2k]
  ------------------
 2183|    267|	case TOC_CHECKSUM_OFFSET:
  ------------------
  |  Branch (2183:2): [True: 267, False: 86.9k]
  ------------------
 2184|  5.33k|	case TOC_CHECKSUM_SIZE:
  ------------------
  |  Branch (2184:2): [True: 5.06k, False: 82.1k]
  ------------------
 2185|  5.33k|	case FILE_DATA_LENGTH:
  ------------------
  |  Branch (2185:2): [True: 0, False: 87.2k]
  ------------------
 2186|  5.33k|	case FILE_DATA_OFFSET:
  ------------------
  |  Branch (2186:2): [True: 0, False: 87.2k]
  ------------------
 2187|  5.33k|	case FILE_DATA_SIZE:
  ------------------
  |  Branch (2187:2): [True: 0, False: 87.2k]
  ------------------
 2188|  5.49k|	case FILE_DATA_ENCODING:
  ------------------
  |  Branch (2188:2): [True: 156, False: 87.0k]
  ------------------
 2189|  6.99k|	case FILE_DATA_A_CHECKSUM:
  ------------------
  |  Branch (2189:2): [True: 1.50k, False: 85.7k]
  ------------------
 2190|  8.78k|	case FILE_DATA_E_CHECKSUM:
  ------------------
  |  Branch (2190:2): [True: 1.79k, False: 85.4k]
  ------------------
 2191|  8.78k|	case FILE_EA_LENGTH:
  ------------------
  |  Branch (2191:2): [True: 0, False: 87.2k]
  ------------------
 2192|  9.02k|	case FILE_EA_OFFSET:
  ------------------
  |  Branch (2192:2): [True: 235, False: 86.9k]
  ------------------
 2193|  9.02k|	case FILE_EA_SIZE:
  ------------------
  |  Branch (2193:2): [True: 0, False: 87.2k]
  ------------------
 2194|  9.02k|	case FILE_EA_ENCODING:
  ------------------
  |  Branch (2194:2): [True: 0, False: 87.2k]
  ------------------
 2195|  16.9k|	case FILE_EA_A_CHECKSUM:
  ------------------
  |  Branch (2195:2): [True: 7.97k, False: 79.2k]
  ------------------
 2196|  16.9k|	case FILE_EA_E_CHECKSUM:
  ------------------
  |  Branch (2196:2): [True: 0, False: 87.2k]
  ------------------
 2197|  16.9k|	case FILE_EA_NAME:
  ------------------
  |  Branch (2197:2): [True: 0, False: 87.2k]
  ------------------
 2198|  16.9k|	case FILE_EA_FSTYPE:
  ------------------
  |  Branch (2198:2): [True: 0, False: 87.2k]
  ------------------
 2199|  16.9k|	case FILE_CTIME:
  ------------------
  |  Branch (2199:2): [True: 0, False: 87.2k]
  ------------------
 2200|  17.0k|	case FILE_MTIME:
  ------------------
  |  Branch (2200:2): [True: 3, False: 87.2k]
  ------------------
 2201|  18.0k|	case FILE_ATIME:
  ------------------
  |  Branch (2201:2): [True: 1.00k, False: 86.2k]
  ------------------
 2202|  18.0k|	case FILE_GROUP:
  ------------------
  |  Branch (2202:2): [True: 0, False: 87.2k]
  ------------------
 2203|  18.0k|	case FILE_GID:
  ------------------
  |  Branch (2203:2): [True: 0, False: 87.2k]
  ------------------
 2204|  18.0k|	case FILE_USER:
  ------------------
  |  Branch (2204:2): [True: 0, False: 87.2k]
  ------------------
 2205|  18.0k|	case FILE_UID:
  ------------------
  |  Branch (2205:2): [True: 0, False: 87.2k]
  ------------------
 2206|  18.0k|	case FILE_INODE:
  ------------------
  |  Branch (2206:2): [True: 0, False: 87.2k]
  ------------------
 2207|  18.0k|	case FILE_DEVICE_MAJOR:
  ------------------
  |  Branch (2207:2): [True: 0, False: 87.2k]
  ------------------
 2208|  18.0k|	case FILE_DEVICE_MINOR:
  ------------------
  |  Branch (2208:2): [True: 0, False: 87.2k]
  ------------------
 2209|  18.0k|	case FILE_DEVICENO:
  ------------------
  |  Branch (2209:2): [True: 0, False: 87.2k]
  ------------------
 2210|  18.0k|	case FILE_MODE:
  ------------------
  |  Branch (2210:2): [True: 0, False: 87.2k]
  ------------------
 2211|  18.0k|	case FILE_TYPE:
  ------------------
  |  Branch (2211:2): [True: 0, False: 87.2k]
  ------------------
 2212|  18.0k|	case FILE_LINK:
  ------------------
  |  Branch (2212:2): [True: 0, False: 87.2k]
  ------------------
 2213|  18.0k|	case FILE_NAME:
  ------------------
  |  Branch (2213:2): [True: 0, False: 87.2k]
  ------------------
 2214|  18.0k|	case FILE_ACL_DEFAULT:
  ------------------
  |  Branch (2214:2): [True: 0, False: 87.2k]
  ------------------
 2215|  18.0k|	case FILE_ACL_ACCESS:
  ------------------
  |  Branch (2215:2): [True: 0, False: 87.2k]
  ------------------
 2216|  18.0k|	case FILE_ACL_APPLEEXTENDED:
  ------------------
  |  Branch (2216:2): [True: 0, False: 87.2k]
  ------------------
 2217|  18.0k|	case FILE_FLAGS_USER_NODUMP:
  ------------------
  |  Branch (2217:2): [True: 0, False: 87.2k]
  ------------------
 2218|  18.0k|	case FILE_FLAGS_USER_IMMUTABLE:
  ------------------
  |  Branch (2218:2): [True: 0, False: 87.2k]
  ------------------
 2219|  18.0k|	case FILE_FLAGS_USER_APPEND:
  ------------------
  |  Branch (2219:2): [True: 0, False: 87.2k]
  ------------------
 2220|  18.0k|	case FILE_FLAGS_USER_OPAQUE:
  ------------------
  |  Branch (2220:2): [True: 0, False: 87.2k]
  ------------------
 2221|  18.0k|	case FILE_FLAGS_USER_NOUNLINK:
  ------------------
  |  Branch (2221:2): [True: 0, False: 87.2k]
  ------------------
 2222|  18.0k|	case FILE_FLAGS_SYS_ARCHIVED:
  ------------------
  |  Branch (2222:2): [True: 0, False: 87.2k]
  ------------------
 2223|  18.0k|	case FILE_FLAGS_SYS_IMMUTABLE:
  ------------------
  |  Branch (2223:2): [True: 0, False: 87.2k]
  ------------------
 2224|  18.0k|	case FILE_FLAGS_SYS_APPEND:
  ------------------
  |  Branch (2224:2): [True: 0, False: 87.2k]
  ------------------
 2225|  18.0k|	case FILE_FLAGS_SYS_NOUNLINK:
  ------------------
  |  Branch (2225:2): [True: 0, False: 87.2k]
  ------------------
 2226|  18.0k|	case FILE_FLAGS_SYS_SNAPSHOT:
  ------------------
  |  Branch (2226:2): [True: 0, False: 87.2k]
  ------------------
 2227|  18.0k|	case FILE_EXT2_SecureDeletion:
  ------------------
  |  Branch (2227:2): [True: 0, False: 87.2k]
  ------------------
 2228|  18.0k|	case FILE_EXT2_Undelete:
  ------------------
  |  Branch (2228:2): [True: 0, False: 87.2k]
  ------------------
 2229|  18.0k|	case FILE_EXT2_Compress:
  ------------------
  |  Branch (2229:2): [True: 0, False: 87.2k]
  ------------------
 2230|  18.0k|	case FILE_EXT2_Synchronous:
  ------------------
  |  Branch (2230:2): [True: 0, False: 87.2k]
  ------------------
 2231|  18.0k|	case FILE_EXT2_Immutable:
  ------------------
  |  Branch (2231:2): [True: 0, False: 87.2k]
  ------------------
 2232|  18.0k|	case FILE_EXT2_AppendOnly:
  ------------------
  |  Branch (2232:2): [True: 0, False: 87.2k]
  ------------------
 2233|  18.0k|	case FILE_EXT2_NoDump:
  ------------------
  |  Branch (2233:2): [True: 0, False: 87.2k]
  ------------------
 2234|  18.0k|	case FILE_EXT2_NoAtime:
  ------------------
  |  Branch (2234:2): [True: 0, False: 87.2k]
  ------------------
 2235|  18.0k|	case FILE_EXT2_CompDirty:
  ------------------
  |  Branch (2235:2): [True: 0, False: 87.2k]
  ------------------
 2236|  18.0k|	case FILE_EXT2_CompBlock:
  ------------------
  |  Branch (2236:2): [True: 0, False: 87.2k]
  ------------------
 2237|  18.0k|	case FILE_EXT2_NoCompBlock:
  ------------------
  |  Branch (2237:2): [True: 0, False: 87.2k]
  ------------------
 2238|  18.0k|	case FILE_EXT2_CompError:
  ------------------
  |  Branch (2238:2): [True: 0, False: 87.2k]
  ------------------
 2239|  18.0k|	case FILE_EXT2_BTree:
  ------------------
  |  Branch (2239:2): [True: 0, False: 87.2k]
  ------------------
 2240|  18.0k|	case FILE_EXT2_HashIndexed:
  ------------------
  |  Branch (2240:2): [True: 0, False: 87.2k]
  ------------------
 2241|  18.0k|	case FILE_EXT2_iMagic:
  ------------------
  |  Branch (2241:2): [True: 0, False: 87.2k]
  ------------------
 2242|  18.0k|	case FILE_EXT2_Journaled:
  ------------------
  |  Branch (2242:2): [True: 0, False: 87.2k]
  ------------------
 2243|  18.0k|	case FILE_EXT2_NoTail:
  ------------------
  |  Branch (2243:2): [True: 0, False: 87.2k]
  ------------------
 2244|  18.0k|	case FILE_EXT2_DirSync:
  ------------------
  |  Branch (2244:2): [True: 0, False: 87.2k]
  ------------------
 2245|  18.0k|	case FILE_EXT2_TopDir:
  ------------------
  |  Branch (2245:2): [True: 0, False: 87.2k]
  ------------------
 2246|  18.0k|	case FILE_EXT2_Reserved:
  ------------------
  |  Branch (2246:2): [True: 0, False: 87.2k]
  ------------------
 2247|  25.8k|	case UNKNOWN:
  ------------------
  |  Branch (2247:2): [True: 7.80k, False: 79.4k]
  ------------------
 2248|  25.8k|		if (unknowntag_start(a, xar, name) != ARCHIVE_OK)
  ------------------
  |  |  233|  25.8k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2248:7): [True: 0, False: 25.8k]
  ------------------
 2249|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2250|  25.8k|		break;
 2251|  87.2k|	}
 2252|  87.2k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  87.2k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2253|  87.2k|}
archive_read_support_format_xar.c:unknowntag_start:
 1916|  43.7k|{
 1917|  43.7k|	struct unknown_tag *tag;
 1918|       |
 1919|  43.7k|	tag = malloc(sizeof(*tag));
 1920|  43.7k|	if (tag == NULL) {
  ------------------
  |  Branch (1920:6): [True: 0, False: 43.7k]
  ------------------
 1921|      0|		archive_set_error(&a->archive, ENOMEM, "Out of memory");
 1922|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1923|      0|	}
 1924|  43.7k|	tag->next = xar->unknowntags;
 1925|  43.7k|	archive_string_init(&(tag->name));
  ------------------
  |  |   71|  43.7k|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 43.7k]
  |  |  ------------------
  ------------------
 1926|  43.7k|	archive_strcpy(&(tag->name), name);
  ------------------
  |  |  165|  43.7k|	archive_strncpy((as), (p), ((p) == NULL ? 0 : strlen(p)))
  |  |  ------------------
  |  |  |  |  173|  87.5k|	((as)->length=0, archive_strncat((as), (p), (l)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (173:47): [True: 0, False: 43.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1927|  43.7k|	if (xar->unknowntags == NULL) {
  ------------------
  |  Branch (1927:6): [True: 35.9k, False: 7.80k]
  ------------------
 1928|       |#if DEBUG
 1929|       |		fprintf(stderr, "UNKNOWNTAG_START:%s\n", name);
 1930|       |#endif
 1931|  35.9k|		xar->xmlsts_unknown = xar->xmlsts;
 1932|  35.9k|		xar->xmlsts = UNKNOWN;
 1933|  35.9k|	}
 1934|  43.7k|	xar->unknowntags = tag;
 1935|  43.7k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  43.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1936|  43.7k|}
archive_read_support_format_xar.c:file_new:
 1768|  19.2k|{
 1769|  19.2k|	struct xar_file *file;
 1770|  19.2k|	struct xmlattr *attr;
 1771|       |
 1772|  19.2k|	file = calloc(1, sizeof(*file));
 1773|  19.2k|	if (file == NULL) {
  ------------------
  |  Branch (1773:6): [True: 0, False: 19.2k]
  ------------------
 1774|      0|		archive_set_error(&a->archive, ENOMEM, "Out of memory");
 1775|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1776|      0|	}
 1777|  19.2k|	file->parent = xar->file;
 1778|  19.2k|	file->mode = 0777 | AE_IFREG;
  ------------------
  |  |  216|  19.2k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1779|  19.2k|	file->atime =  0;
 1780|  19.2k|	file->mtime = 0;
 1781|  19.2k|	xar->xattr = NULL;
 1782|  21.2k|	for (attr = list->first; attr != NULL; attr = attr->next) {
  ------------------
  |  Branch (1782:27): [True: 1.95k, False: 19.2k]
  ------------------
 1783|  1.95k|		if (strcmp(attr->name, "id") == 0) {
  ------------------
  |  Branch (1783:7): [True: 1.72k, False: 230]
  ------------------
 1784|  1.72k|			int r;
 1785|       |
 1786|  1.72k|			r = atou64(attr->value, strlen(attr->value),
 1787|  1.72k|			    10, &file->id);
 1788|  1.72k|			if (r != ARCHIVE_OK) {
  ------------------
  |  |  233|  1.72k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1788:8): [True: 0, False: 1.72k]
  ------------------
 1789|      0|				free(file);
 1790|      0|				return (r);
 1791|      0|			}
 1792|  1.72k|		}
 1793|  1.95k|	}
 1794|  19.2k|	xar->file = file;
 1795|  19.2k|	file->nlink = 1;
 1796|  19.2k|	if (heap_add_entry(a, &(xar->file_queue), file) != ARCHIVE_OK)
  ------------------
  |  |  233|  19.2k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1796:6): [True: 0, False: 19.2k]
  ------------------
 1797|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1798|  19.2k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  19.2k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1799|  19.2k|}
archive_read_support_format_xar.c:heap_add_entry:
 1212|  19.2k|{
 1213|  19.2k|	uint64_t file_id, parent_id;
 1214|  19.2k|	int hole, parent;
 1215|       |
 1216|       |	/* Expand our pending files list as necessary. */
 1217|  19.2k|	if (heap->used >= heap->allocated) {
  ------------------
  |  Branch (1217:6): [True: 107, False: 19.1k]
  ------------------
 1218|    107|		struct xar_file **new_pending_files;
 1219|    107|		int new_size;
 1220|       |
 1221|    107|		if (heap->allocated < 1024)
  ------------------
  |  Branch (1221:7): [True: 96, False: 11]
  ------------------
 1222|     96|			new_size = 1024;
 1223|     11|		else
 1224|     11|			new_size = heap->allocated * 2;
 1225|       |		/* Overflow might keep us from growing the list. */
 1226|    107|		if (new_size <= heap->allocated) {
  ------------------
  |  Branch (1226:7): [True: 0, False: 107]
  ------------------
 1227|      0|			archive_set_error(&a->archive,
 1228|      0|			    ENOMEM, "Out of memory");
 1229|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1230|      0|		}
 1231|    107|		new_pending_files = (struct xar_file **)
 1232|    107|		    calloc(new_size, sizeof(new_pending_files[0]));
 1233|    107|		if (new_pending_files == NULL) {
  ------------------
  |  Branch (1233:7): [True: 0, False: 107]
  ------------------
 1234|      0|			archive_set_error(&a->archive,
 1235|      0|			    ENOMEM, "Out of memory");
 1236|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1237|      0|		}
 1238|    107|		if (heap->allocated) {
  ------------------
  |  Branch (1238:7): [True: 11, False: 96]
  ------------------
 1239|     11|			memcpy(new_pending_files, heap->files,
 1240|     11|			    heap->allocated * sizeof(new_pending_files[0]));
 1241|     11|			free(heap->files);
 1242|     11|		}
 1243|    107|		heap->files = new_pending_files;
 1244|    107|		heap->allocated = new_size;
 1245|    107|	}
 1246|       |
 1247|  19.2k|	file_id = file->id;
 1248|       |
 1249|       |	/*
 1250|       |	 * Start with hole at end, walk it up tree to find insertion point.
 1251|       |	 */
 1252|  19.2k|	hole = heap->used++;
 1253|  19.5k|	while (hole > 0) {
  ------------------
  |  Branch (1253:9): [True: 19.4k, False: 102]
  ------------------
 1254|  19.4k|		parent = (hole - 1)/2;
 1255|  19.4k|		parent_id = heap->files[parent]->id;
 1256|  19.4k|		if (file_id >= parent_id) {
  ------------------
  |  Branch (1256:7): [True: 19.1k, False: 257]
  ------------------
 1257|  19.1k|			heap->files[hole] = file;
 1258|  19.1k|			return (ARCHIVE_OK);
  ------------------
  |  |  233|  19.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1259|  19.1k|		}
 1260|       |		/* Move parent into hole <==> move hole up tree. */
 1261|    257|		heap->files[hole] = heap->files[parent];
 1262|    257|		hole = parent;
 1263|    257|	}
 1264|    102|	heap->files[0] = file;
 1265|       |
 1266|    102|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    102|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1267|  19.2k|}
archive_read_support_format_xar.c:xattr_new:
 1826|    949|{
 1827|    949|	struct xattr *xattr, **nx;
 1828|    949|	struct xmlattr *attr;
 1829|       |
 1830|    949|	xattr = calloc(1, sizeof(*xattr));
 1831|    949|	if (xattr == NULL) {
  ------------------
  |  Branch (1831:6): [True: 0, False: 949]
  ------------------
 1832|      0|		archive_set_error(&a->archive, ENOMEM, "Out of memory");
 1833|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1834|      0|	}
 1835|    949|	for (attr = list->first; attr != NULL; attr = attr->next) {
  ------------------
  |  Branch (1835:27): [True: 0, False: 949]
  ------------------
 1836|      0|		if (strcmp(attr->name, "id") == 0) {
  ------------------
  |  Branch (1836:7): [True: 0, False: 0]
  ------------------
 1837|      0|			int r;
 1838|       |
 1839|      0|			r = atou64(attr->value, strlen(attr->value),
 1840|      0|			    10, &xattr->id);
 1841|      0|			if (r != ARCHIVE_OK) {
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1841:8): [True: 0, False: 0]
  ------------------
 1842|      0|				free(xattr);
 1843|      0|				return (r);
 1844|      0|			}
 1845|      0|		}
 1846|      0|	}
 1847|    949|	xar->xattr = xattr;
 1848|       |	/* Chain to xattr list. */
 1849|    949|	for (nx = &(xar->file->xattr_list);
 1850|  87.8k|	    *nx != NULL; nx = &((*nx)->next)) {
  ------------------
  |  Branch (1850:6): [True: 86.9k, False: 949]
  ------------------
 1851|  86.9k|		if (xattr->id < (*nx)->id)
  ------------------
  |  Branch (1851:7): [True: 0, False: 86.9k]
  ------------------
 1852|      0|			break;
 1853|  86.9k|	}
 1854|    949|	xattr->next = *nx;
 1855|    949|	*nx = xattr;
 1856|       |
 1857|    949|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    949|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1858|    949|}
archive_read_support_format_xar.c:atou64:
 1075|  15.9k|{
 1076|  15.9k|	uint64_t l;
 1077|       |
 1078|  15.9k|	l = 0;
 1079|  15.9k|	if (char_cnt > 0) {
  ------------------
  |  Branch (1079:6): [True: 15.7k, False: 248]
  ------------------
 1080|  15.7k|		int digit;
 1081|       |
 1082|  15.7k|		digit = *p - '0';
 1083|  45.4k|		while (digit >= 0 && digit < base && char_cnt-- > 0) {
  ------------------
  |  Branch (1083:10): [True: 36.7k, False: 8.73k]
  |  Branch (1083:24): [True: 29.7k, False: 6.98k]
  |  Branch (1083:40): [True: 29.7k, False: 0]
  ------------------
 1084|  29.7k|			if (l > UINT64_MAX / base)
  ------------------
  |  Branch (1084:8): [True: 0, False: 29.7k]
  ------------------
 1085|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1086|  29.7k|			l *= base;
 1087|  29.7k|			if (l > UINT64_MAX - digit)
  ------------------
  |  Branch (1087:8): [True: 0, False: 29.7k]
  ------------------
 1088|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1089|  29.7k|			l += digit;
 1090|  29.7k|			digit = *++p - '0';
 1091|  29.7k|		}
 1092|  15.7k|	}
 1093|       |
 1094|  15.9k|	*val = l;
 1095|  15.9k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  15.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1096|  15.9k|}
archive_read_support_format_xar.c:getencoding:
 1870|  2.58k|{
 1871|  2.58k|	struct xmlattr *attr;
 1872|  2.58k|	enum enctype encoding = NONE;
 1873|       |
 1874|  5.19k|	for (attr = list->first; attr != NULL; attr = attr->next) {
  ------------------
  |  Branch (1874:27): [True: 2.61k, False: 2.58k]
  ------------------
 1875|  2.61k|		if (strcmp(attr->name, "style") == 0) {
  ------------------
  |  Branch (1875:7): [True: 594, False: 2.01k]
  ------------------
 1876|    594|			if (strcmp(attr->value, "application/octet-stream") == 0)
  ------------------
  |  Branch (1876:8): [True: 0, False: 594]
  ------------------
 1877|      0|				encoding = NONE;
 1878|    594|			else if (strcmp(attr->value, "application/x-gzip") == 0)
  ------------------
  |  Branch (1878:13): [True: 0, False: 594]
  ------------------
 1879|      0|				encoding = GZIP;
 1880|    594|			else if (strcmp(attr->value, "application/x-bzip2") == 0)
  ------------------
  |  Branch (1880:13): [True: 0, False: 594]
  ------------------
 1881|      0|				encoding = BZIP2;
 1882|    594|			else if (strcmp(attr->value, "application/x-lzma") == 0)
  ------------------
  |  Branch (1882:13): [True: 0, False: 594]
  ------------------
 1883|      0|				encoding = LZMA;
 1884|    594|			else if (strcmp(attr->value, "application/x-xz") == 0)
  ------------------
  |  Branch (1884:13): [True: 0, False: 594]
  ------------------
 1885|      0|				encoding = XZ;
 1886|    594|		}
 1887|  2.61k|	}
 1888|  2.58k|	return (encoding);
 1889|  2.58k|}
archive_read_support_format_xar.c:getsumalgorithm:
 1893|  10.5k|{
 1894|  10.5k|	struct xmlattr *attr;
 1895|  10.5k|	int alg = CKSUM_NONE;
  ------------------
  |  |  107|  10.5k|#define CKSUM_NONE	0
  ------------------
 1896|       |
 1897|  21.0k|	for (attr = list->first; attr != NULL; attr = attr->next) {
  ------------------
  |  Branch (1897:27): [True: 10.4k, False: 10.5k]
  ------------------
 1898|  10.4k|		if (strcmp(attr->name, "style") == 0) {
  ------------------
  |  Branch (1898:7): [True: 10.2k, False: 239]
  ------------------
 1899|  10.2k|			const char *v = attr->value;
 1900|  10.2k|			if ((v[0] == 'S' || v[0] == 's') &&
  ------------------
  |  Branch (1900:9): [True: 0, False: 10.2k]
  |  Branch (1900:24): [True: 1.23k, False: 9.01k]
  ------------------
 1901|  1.23k|			    (v[1] == 'H' || v[1] == 'h') &&
  ------------------
  |  Branch (1901:9): [True: 0, False: 1.23k]
  |  Branch (1901:24): [True: 1.23k, False: 4]
  ------------------
 1902|  1.23k|			    (v[2] == 'A' || v[2] == 'a') &&
  ------------------
  |  Branch (1902:9): [True: 0, False: 1.23k]
  |  Branch (1902:24): [True: 267, False: 966]
  ------------------
 1903|    267|			    v[3] == '1' && v[4] == '\0')
  ------------------
  |  Branch (1903:8): [True: 267, False: 0]
  |  Branch (1903:23): [True: 134, False: 133]
  ------------------
 1904|    134|				alg = CKSUM_SHA1;
  ------------------
  |  |  108|    134|#define CKSUM_SHA1	1
  ------------------
 1905|  10.2k|			if ((v[0] == 'M' || v[0] == 'm') &&
  ------------------
  |  Branch (1905:9): [True: 0, False: 10.2k]
  |  Branch (1905:24): [True: 8.97k, False: 1.28k]
  ------------------
 1906|  8.97k|			    (v[1] == 'D' || v[1] == 'd') &&
  ------------------
  |  Branch (1906:9): [True: 0, False: 8.97k]
  |  Branch (1906:24): [True: 3.25k, False: 5.71k]
  ------------------
 1907|  3.25k|			    v[2] == '5' && v[3] == '\0')
  ------------------
  |  Branch (1907:8): [True: 367, False: 2.88k]
  |  Branch (1907:23): [True: 79, False: 288]
  ------------------
 1908|     79|				alg = CKSUM_MD5;
  ------------------
  |  |  109|     79|#define CKSUM_MD5	2
  ------------------
 1909|  10.2k|		}
 1910|  10.4k|	}
 1911|  10.5k|	return (alg);
 1912|  10.5k|}
archive_read_support_format_xar.c:xmlattr_cleanup:
 1751|  87.2k|{
 1752|  87.2k|	struct xmlattr *attr, *next;
 1753|       |
 1754|  87.2k|	attr = list->first;
 1755|   108k|	while (attr != NULL) {
  ------------------
  |  Branch (1755:9): [True: 21.3k, False: 87.2k]
  ------------------
 1756|  21.3k|		next = attr->next;
 1757|  21.3k|		free(attr->name);
 1758|  21.3k|		free(attr->value);
 1759|  21.3k|		free(attr);
 1760|  21.3k|		attr = next;
 1761|  21.3k|	}
 1762|       |	list->first = NULL;
 1763|  87.2k|	list->last = &(list->first);
 1764|  87.2k|}
archive_read_support_format_xar.c:xml_end:
 2257|  83.9k|{
 2258|  83.9k|	struct archive_read *a;
 2259|  83.9k|	struct xar *xar;
 2260|       |
 2261|  83.9k|	a = (struct archive_read *)userData;
 2262|  83.9k|	xar = (struct xar *)(a->format->data);
 2263|       |
 2264|       |#if DEBUG
 2265|       |	fprintf(stderr, "xml_end:[%s]\n", name);
 2266|       |#endif
 2267|  83.9k|	switch (xar->xmlsts) {
  ------------------
  |  Branch (2267:10): [True: 83.9k, False: 0]
  ------------------
 2268|      0|	case INIT:
  ------------------
  |  Branch (2268:2): [True: 0, False: 83.9k]
  ------------------
 2269|      0|		break;
 2270|      0|	case XAR:
  ------------------
  |  Branch (2270:2): [True: 0, False: 83.9k]
  ------------------
 2271|      0|		if (strcmp(name, "xar") == 0)
  ------------------
  |  Branch (2271:7): [True: 0, False: 0]
  ------------------
 2272|      0|			xar->xmlsts = INIT;
 2273|      0|		break;
 2274|      0|	case TOC:
  ------------------
  |  Branch (2274:2): [True: 0, False: 83.9k]
  ------------------
 2275|      0|		if (strcmp(name, "toc") == 0)
  ------------------
  |  Branch (2275:7): [True: 0, False: 0]
  ------------------
 2276|      0|			xar->xmlsts = XAR;
 2277|      0|		break;
 2278|    181|	case TOC_CREATION_TIME:
  ------------------
  |  Branch (2278:2): [True: 181, False: 83.7k]
  ------------------
 2279|    181|		if (strcmp(name, "creation-time") == 0)
  ------------------
  |  Branch (2279:7): [True: 181, False: 0]
  ------------------
 2280|    181|			xar->xmlsts = TOC;
 2281|    181|		break;
 2282|    252|	case TOC_CHECKSUM:
  ------------------
  |  Branch (2282:2): [True: 252, False: 83.7k]
  ------------------
 2283|    252|		if (strcmp(name, "checksum") == 0)
  ------------------
  |  Branch (2283:7): [True: 252, False: 0]
  ------------------
 2284|    252|			xar->xmlsts = TOC;
 2285|    252|		break;
 2286|    648|	case TOC_CHECKSUM_OFFSET:
  ------------------
  |  Branch (2286:2): [True: 648, False: 83.3k]
  ------------------
 2287|    648|		if (strcmp(name, "offset") == 0)
  ------------------
  |  Branch (2287:7): [True: 648, False: 0]
  ------------------
 2288|    648|			xar->xmlsts = TOC_CHECKSUM;
 2289|    648|		break;
 2290|    225|	case TOC_CHECKSUM_SIZE:
  ------------------
  |  Branch (2290:2): [True: 225, False: 83.7k]
  ------------------
 2291|    225|		if (strcmp(name, "size") == 0)
  ------------------
  |  Branch (2291:7): [True: 225, False: 0]
  ------------------
 2292|    225|			xar->xmlsts = TOC_CHECKSUM;
 2293|    225|		break;
 2294|  17.3k|	case TOC_FILE:
  ------------------
  |  Branch (2294:2): [True: 17.3k, False: 66.6k]
  ------------------
 2295|  17.3k|		if (strcmp(name, "file") == 0) {
  ------------------
  |  Branch (2295:7): [True: 17.3k, False: 0]
  ------------------
 2296|  17.3k|			if (xar->file->parent != NULL &&
  ------------------
  |  Branch (2296:8): [True: 1.09k, False: 16.2k]
  ------------------
 2297|  1.09k|			    ((xar->file->mode & AE_IFMT) == AE_IFDIR))
  ------------------
  |  |  215|  1.09k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              			    ((xar->file->mode & AE_IFMT) == AE_IFDIR))
  ------------------
  |  |  221|  1.09k|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (2297:8): [True: 0, False: 1.09k]
  ------------------
 2298|      0|				xar->file->parent->subdirs++;
 2299|  17.3k|			xar->file = xar->file->parent;
 2300|  17.3k|			if (xar->file == NULL)
  ------------------
  |  Branch (2300:8): [True: 16.2k, False: 1.09k]
  ------------------
 2301|  16.2k|				xar->xmlsts = TOC;
 2302|  17.3k|		}
 2303|  17.3k|		break;
 2304|  1.29k|	case FILE_DATA:
  ------------------
  |  Branch (2304:2): [True: 1.29k, False: 82.6k]
  ------------------
 2305|  1.29k|		if (strcmp(name, "data") == 0)
  ------------------
  |  Branch (2305:7): [True: 1.29k, False: 0]
  ------------------
 2306|  1.29k|			xar->xmlsts = TOC_FILE;
 2307|  1.29k|		break;
 2308|    343|	case FILE_DATA_LENGTH:
  ------------------
  |  Branch (2308:2): [True: 343, False: 83.6k]
  ------------------
 2309|    343|		if (strcmp(name, "length") == 0)
  ------------------
  |  Branch (2309:7): [True: 343, False: 0]
  ------------------
 2310|    343|			xar->xmlsts = FILE_DATA;
 2311|    343|		break;
 2312|    938|	case FILE_DATA_OFFSET:
  ------------------
  |  Branch (2312:2): [True: 938, False: 83.0k]
  ------------------
 2313|    938|		if (strcmp(name, "offset") == 0)
  ------------------
  |  Branch (2313:7): [True: 938, False: 0]
  ------------------
 2314|    938|			xar->xmlsts = FILE_DATA;
 2315|    938|		break;
 2316|  1.30k|	case FILE_DATA_SIZE:
  ------------------
  |  Branch (2316:2): [True: 1.30k, False: 82.6k]
  ------------------
 2317|  1.30k|		if (strcmp(name, "size") == 0)
  ------------------
  |  Branch (2317:7): [True: 1.30k, False: 0]
  ------------------
 2318|  1.30k|			xar->xmlsts = FILE_DATA;
 2319|  1.30k|		break;
 2320|  2.42k|	case FILE_DATA_ENCODING:
  ------------------
  |  Branch (2320:2): [True: 2.42k, False: 81.5k]
  ------------------
 2321|  2.42k|		if (strcmp(name, "encoding") == 0)
  ------------------
  |  Branch (2321:7): [True: 2.42k, False: 0]
  ------------------
 2322|  2.42k|			xar->xmlsts = FILE_DATA;
 2323|  2.42k|		break;
 2324|  5.81k|	case FILE_DATA_A_CHECKSUM:
  ------------------
  |  Branch (2324:2): [True: 5.81k, False: 78.1k]
  ------------------
 2325|  5.81k|		if (strcmp(name, "archived-checksum") == 0)
  ------------------
  |  Branch (2325:7): [True: 5.81k, False: 0]
  ------------------
 2326|  5.81k|			xar->xmlsts = FILE_DATA;
 2327|  5.81k|		break;
 2328|  4.74k|	case FILE_DATA_E_CHECKSUM:
  ------------------
  |  Branch (2328:2): [True: 4.74k, False: 79.2k]
  ------------------
 2329|  4.74k|		if (strcmp(name, "extracted-checksum") == 0)
  ------------------
  |  Branch (2329:7): [True: 4.74k, False: 0]
  ------------------
 2330|  4.74k|			xar->xmlsts = FILE_DATA;
 2331|  4.74k|		break;
 2332|      0|	case FILE_DATA_CONTENT:
  ------------------
  |  Branch (2332:2): [True: 0, False: 83.9k]
  ------------------
 2333|      0|		if (strcmp(name, "content") == 0)
  ------------------
  |  Branch (2333:7): [True: 0, False: 0]
  ------------------
 2334|      0|			xar->xmlsts = FILE_DATA;
 2335|      0|		break;
 2336|    926|	case FILE_EA:
  ------------------
  |  Branch (2336:2): [True: 926, False: 83.0k]
  ------------------
 2337|    926|		if (strcmp(name, "ea") == 0) {
  ------------------
  |  Branch (2337:7): [True: 926, False: 0]
  ------------------
 2338|    926|			xar->xmlsts = TOC_FILE;
 2339|    926|			xar->xattr = NULL;
 2340|    926|		}
 2341|    926|		break;
 2342|      0|	case FILE_EA_LENGTH:
  ------------------
  |  Branch (2342:2): [True: 0, False: 83.9k]
  ------------------
 2343|      0|		if (strcmp(name, "length") == 0)
  ------------------
  |  Branch (2343:7): [True: 0, False: 0]
  ------------------
 2344|      0|			xar->xmlsts = FILE_EA;
 2345|      0|		break;
 2346|    278|	case FILE_EA_OFFSET:
  ------------------
  |  Branch (2346:2): [True: 278, False: 83.6k]
  ------------------
 2347|    278|		if (strcmp(name, "offset") == 0)
  ------------------
  |  Branch (2347:7): [True: 278, False: 0]
  ------------------
 2348|    278|			xar->xmlsts = FILE_EA;
 2349|    278|		break;
 2350|    207|	case FILE_EA_SIZE:
  ------------------
  |  Branch (2350:2): [True: 207, False: 83.7k]
  ------------------
 2351|    207|		if (strcmp(name, "size") == 0)
  ------------------
  |  Branch (2351:7): [True: 207, False: 0]
  ------------------
 2352|    207|			xar->xmlsts = FILE_EA;
 2353|    207|		break;
 2354|    156|	case FILE_EA_ENCODING:
  ------------------
  |  Branch (2354:2): [True: 156, False: 83.8k]
  ------------------
 2355|    156|		if (strcmp(name, "encoding") == 0)
  ------------------
  |  Branch (2355:7): [True: 156, False: 0]
  ------------------
 2356|    156|			xar->xmlsts = FILE_EA;
 2357|    156|		break;
 2358|    807|	case FILE_EA_A_CHECKSUM:
  ------------------
  |  Branch (2358:2): [True: 807, False: 83.1k]
  ------------------
 2359|    807|		if (strcmp(name, "archived-checksum") == 0)
  ------------------
  |  Branch (2359:7): [True: 807, False: 0]
  ------------------
 2360|    807|			xar->xmlsts = FILE_EA;
 2361|    807|		break;
 2362|      0|	case FILE_EA_E_CHECKSUM:
  ------------------
  |  Branch (2362:2): [True: 0, False: 83.9k]
  ------------------
 2363|      0|		if (strcmp(name, "extracted-checksum") == 0)
  ------------------
  |  Branch (2363:7): [True: 0, False: 0]
  ------------------
 2364|      0|			xar->xmlsts = FILE_EA;
 2365|      0|		break;
 2366|      0|	case FILE_EA_NAME:
  ------------------
  |  Branch (2366:2): [True: 0, False: 83.9k]
  ------------------
 2367|      0|		if (strcmp(name, "name") == 0)
  ------------------
  |  Branch (2367:7): [True: 0, False: 0]
  ------------------
 2368|      0|			xar->xmlsts = FILE_EA;
 2369|      0|		break;
 2370|      0|	case FILE_EA_FSTYPE:
  ------------------
  |  Branch (2370:2): [True: 0, False: 83.9k]
  ------------------
 2371|      0|		if (strcmp(name, "fstype") == 0)
  ------------------
  |  Branch (2371:7): [True: 0, False: 0]
  ------------------
 2372|      0|			xar->xmlsts = FILE_EA;
 2373|      0|		break;
 2374|     87|	case FILE_CTIME:
  ------------------
  |  Branch (2374:2): [True: 87, False: 83.8k]
  ------------------
 2375|     87|		if (strcmp(name, "ctime") == 0)
  ------------------
  |  Branch (2375:7): [True: 87, False: 0]
  ------------------
 2376|     87|			xar->xmlsts = TOC_FILE;
 2377|     87|		break;
 2378|     87|	case FILE_MTIME:
  ------------------
  |  Branch (2378:2): [True: 87, False: 83.8k]
  ------------------
 2379|     87|		if (strcmp(name, "mtime") == 0)
  ------------------
  |  Branch (2379:7): [True: 87, False: 0]
  ------------------
 2380|     87|			xar->xmlsts = TOC_FILE;
 2381|     87|		break;
 2382|     83|	case FILE_ATIME:
  ------------------
  |  Branch (2382:2): [True: 83, False: 83.8k]
  ------------------
 2383|     83|		if (strcmp(name, "atime") == 0)
  ------------------
  |  Branch (2383:7): [True: 83, False: 0]
  ------------------
 2384|     83|			xar->xmlsts = TOC_FILE;
 2385|     83|		break;
 2386|    382|	case FILE_GROUP:
  ------------------
  |  Branch (2386:2): [True: 382, False: 83.5k]
  ------------------
 2387|    382|		if (strcmp(name, "group") == 0)
  ------------------
  |  Branch (2387:7): [True: 382, False: 0]
  ------------------
 2388|    382|			xar->xmlsts = TOC_FILE;
 2389|    382|		break;
 2390|  1.31k|	case FILE_GID:
  ------------------
  |  Branch (2390:2): [True: 1.31k, False: 82.6k]
  ------------------
 2391|  1.31k|		if (strcmp(name, "gid") == 0)
  ------------------
  |  Branch (2391:7): [True: 1.31k, False: 0]
  ------------------
 2392|  1.31k|			xar->xmlsts = TOC_FILE;
 2393|  1.31k|		break;
 2394|  1.31k|	case FILE_USER:
  ------------------
  |  Branch (2394:2): [True: 1.31k, False: 82.6k]
  ------------------
 2395|  1.31k|		if (strcmp(name, "user") == 0)
  ------------------
  |  Branch (2395:7): [True: 1.31k, False: 0]
  ------------------
 2396|  1.31k|			xar->xmlsts = TOC_FILE;
 2397|  1.31k|		break;
 2398|      0|	case FILE_UID:
  ------------------
  |  Branch (2398:2): [True: 0, False: 83.9k]
  ------------------
 2399|      0|		if (strcmp(name, "uid") == 0)
  ------------------
  |  Branch (2399:7): [True: 0, False: 0]
  ------------------
 2400|      0|			xar->xmlsts = TOC_FILE;
 2401|      0|		break;
 2402|      0|	case FILE_MODE:
  ------------------
  |  Branch (2402:2): [True: 0, False: 83.9k]
  ------------------
 2403|      0|		if (strcmp(name, "mode") == 0)
  ------------------
  |  Branch (2403:7): [True: 0, False: 0]
  ------------------
 2404|      0|			xar->xmlsts = TOC_FILE;
 2405|      0|		break;
 2406|      0|	case FILE_DEVICE:
  ------------------
  |  Branch (2406:2): [True: 0, False: 83.9k]
  ------------------
 2407|      0|		if (strcmp(name, "device") == 0)
  ------------------
  |  Branch (2407:7): [True: 0, False: 0]
  ------------------
 2408|      0|			xar->xmlsts = TOC_FILE;
 2409|      0|		break;
 2410|      0|	case FILE_DEVICE_MAJOR:
  ------------------
  |  Branch (2410:2): [True: 0, False: 83.9k]
  ------------------
 2411|      0|		if (strcmp(name, "major") == 0)
  ------------------
  |  Branch (2411:7): [True: 0, False: 0]
  ------------------
 2412|      0|			xar->xmlsts = FILE_DEVICE;
 2413|      0|		break;
 2414|      0|	case FILE_DEVICE_MINOR:
  ------------------
  |  Branch (2414:2): [True: 0, False: 83.9k]
  ------------------
 2415|      0|		if (strcmp(name, "minor") == 0)
  ------------------
  |  Branch (2415:7): [True: 0, False: 0]
  ------------------
 2416|      0|			xar->xmlsts = FILE_DEVICE;
 2417|      0|		break;
 2418|      0|	case FILE_DEVICENO:
  ------------------
  |  Branch (2418:2): [True: 0, False: 83.9k]
  ------------------
 2419|      0|		if (strcmp(name, "deviceno") == 0)
  ------------------
  |  Branch (2419:7): [True: 0, False: 0]
  ------------------
 2420|      0|			xar->xmlsts = TOC_FILE;
 2421|      0|		break;
 2422|      0|	case FILE_INODE:
  ------------------
  |  Branch (2422:2): [True: 0, False: 83.9k]
  ------------------
 2423|      0|		if (strcmp(name, "inode") == 0)
  ------------------
  |  Branch (2423:7): [True: 0, False: 0]
  ------------------
 2424|      0|			xar->xmlsts = TOC_FILE;
 2425|      0|		break;
 2426|      0|	case FILE_LINK:
  ------------------
  |  Branch (2426:2): [True: 0, False: 83.9k]
  ------------------
 2427|      0|		if (strcmp(name, "link") == 0)
  ------------------
  |  Branch (2427:7): [True: 0, False: 0]
  ------------------
 2428|      0|			xar->xmlsts = TOC_FILE;
 2429|      0|		break;
 2430|      0|	case FILE_TYPE:
  ------------------
  |  Branch (2430:2): [True: 0, False: 83.9k]
  ------------------
 2431|      0|		if (strcmp(name, "type") == 0)
  ------------------
  |  Branch (2431:7): [True: 0, False: 0]
  ------------------
 2432|      0|			xar->xmlsts = TOC_FILE;
 2433|      0|		break;
 2434|      0|	case FILE_NAME:
  ------------------
  |  Branch (2434:2): [True: 0, False: 83.9k]
  ------------------
 2435|      0|		if (strcmp(name, "name") == 0)
  ------------------
  |  Branch (2435:7): [True: 0, False: 0]
  ------------------
 2436|      0|			xar->xmlsts = TOC_FILE;
 2437|      0|		break;
 2438|      0|	case FILE_ACL:
  ------------------
  |  Branch (2438:2): [True: 0, False: 83.9k]
  ------------------
 2439|      0|		if (strcmp(name, "acl") == 0)
  ------------------
  |  Branch (2439:7): [True: 0, False: 0]
  ------------------
 2440|      0|			xar->xmlsts = TOC_FILE;
 2441|      0|		break;
 2442|      0|	case FILE_ACL_DEFAULT:
  ------------------
  |  Branch (2442:2): [True: 0, False: 83.9k]
  ------------------
 2443|      0|		if (strcmp(name, "default") == 0)
  ------------------
  |  Branch (2443:7): [True: 0, False: 0]
  ------------------
 2444|      0|			xar->xmlsts = FILE_ACL;
 2445|      0|		break;
 2446|      0|	case FILE_ACL_ACCESS:
  ------------------
  |  Branch (2446:2): [True: 0, False: 83.9k]
  ------------------
 2447|      0|		if (strcmp(name, "access") == 0)
  ------------------
  |  Branch (2447:7): [True: 0, False: 0]
  ------------------
 2448|      0|			xar->xmlsts = FILE_ACL;
 2449|      0|		break;
 2450|      0|	case FILE_ACL_APPLEEXTENDED:
  ------------------
  |  Branch (2450:2): [True: 0, False: 83.9k]
  ------------------
 2451|      0|		if (strcmp(name, "appleextended") == 0)
  ------------------
  |  Branch (2451:7): [True: 0, False: 0]
  ------------------
 2452|      0|			xar->xmlsts = FILE_ACL;
 2453|      0|		break;
 2454|      0|	case FILE_FLAGS:
  ------------------
  |  Branch (2454:2): [True: 0, False: 83.9k]
  ------------------
 2455|      0|		if (strcmp(name, "flags") == 0)
  ------------------
  |  Branch (2455:7): [True: 0, False: 0]
  ------------------
 2456|      0|			xar->xmlsts = TOC_FILE;
 2457|      0|		break;
 2458|      0|	case FILE_FLAGS_USER_NODUMP:
  ------------------
  |  Branch (2458:2): [True: 0, False: 83.9k]
  ------------------
 2459|      0|		if (strcmp(name, "UserNoDump") == 0)
  ------------------
  |  Branch (2459:7): [True: 0, False: 0]
  ------------------
 2460|      0|			xar->xmlsts = FILE_FLAGS;
 2461|      0|		break;
 2462|      0|	case FILE_FLAGS_USER_IMMUTABLE:
  ------------------
  |  Branch (2462:2): [True: 0, False: 83.9k]
  ------------------
 2463|      0|		if (strcmp(name, "UserImmutable") == 0)
  ------------------
  |  Branch (2463:7): [True: 0, False: 0]
  ------------------
 2464|      0|			xar->xmlsts = FILE_FLAGS;
 2465|      0|		break;
 2466|      0|	case FILE_FLAGS_USER_APPEND:
  ------------------
  |  Branch (2466:2): [True: 0, False: 83.9k]
  ------------------
 2467|      0|		if (strcmp(name, "UserAppend") == 0)
  ------------------
  |  Branch (2467:7): [True: 0, False: 0]
  ------------------
 2468|      0|			xar->xmlsts = FILE_FLAGS;
 2469|      0|		break;
 2470|      0|	case FILE_FLAGS_USER_OPAQUE:
  ------------------
  |  Branch (2470:2): [True: 0, False: 83.9k]
  ------------------
 2471|      0|		if (strcmp(name, "UserOpaque") == 0)
  ------------------
  |  Branch (2471:7): [True: 0, False: 0]
  ------------------
 2472|      0|			xar->xmlsts = FILE_FLAGS;
 2473|      0|		break;
 2474|      0|	case FILE_FLAGS_USER_NOUNLINK:
  ------------------
  |  Branch (2474:2): [True: 0, False: 83.9k]
  ------------------
 2475|      0|		if (strcmp(name, "UserNoUnlink") == 0)
  ------------------
  |  Branch (2475:7): [True: 0, False: 0]
  ------------------
 2476|      0|			xar->xmlsts = FILE_FLAGS;
 2477|      0|		break;
 2478|      0|	case FILE_FLAGS_SYS_ARCHIVED:
  ------------------
  |  Branch (2478:2): [True: 0, False: 83.9k]
  ------------------
 2479|      0|		if (strcmp(name, "SystemArchived") == 0)
  ------------------
  |  Branch (2479:7): [True: 0, False: 0]
  ------------------
 2480|      0|			xar->xmlsts = FILE_FLAGS;
 2481|      0|		break;
 2482|      0|	case FILE_FLAGS_SYS_IMMUTABLE:
  ------------------
  |  Branch (2482:2): [True: 0, False: 83.9k]
  ------------------
 2483|      0|		if (strcmp(name, "SystemImmutable") == 0)
  ------------------
  |  Branch (2483:7): [True: 0, False: 0]
  ------------------
 2484|      0|			xar->xmlsts = FILE_FLAGS;
 2485|      0|		break;
 2486|      0|	case FILE_FLAGS_SYS_APPEND:
  ------------------
  |  Branch (2486:2): [True: 0, False: 83.9k]
  ------------------
 2487|      0|		if (strcmp(name, "SystemAppend") == 0)
  ------------------
  |  Branch (2487:7): [True: 0, False: 0]
  ------------------
 2488|      0|			xar->xmlsts = FILE_FLAGS;
 2489|      0|		break;
 2490|      0|	case FILE_FLAGS_SYS_NOUNLINK:
  ------------------
  |  Branch (2490:2): [True: 0, False: 83.9k]
  ------------------
 2491|      0|		if (strcmp(name, "SystemNoUnlink") == 0)
  ------------------
  |  Branch (2491:7): [True: 0, False: 0]
  ------------------
 2492|      0|			xar->xmlsts = FILE_FLAGS;
 2493|      0|		break;
 2494|      0|	case FILE_FLAGS_SYS_SNAPSHOT:
  ------------------
  |  Branch (2494:2): [True: 0, False: 83.9k]
  ------------------
 2495|      0|		if (strcmp(name, "SystemSnapshot") == 0)
  ------------------
  |  Branch (2495:7): [True: 0, False: 0]
  ------------------
 2496|      0|			xar->xmlsts = FILE_FLAGS;
 2497|      0|		break;
 2498|      0|	case FILE_EXT2:
  ------------------
  |  Branch (2498:2): [True: 0, False: 83.9k]
  ------------------
 2499|      0|		if (strcmp(name, "ext2") == 0)
  ------------------
  |  Branch (2499:7): [True: 0, False: 0]
  ------------------
 2500|      0|			xar->xmlsts = TOC_FILE;
 2501|      0|		break;
 2502|      0|	case FILE_EXT2_SecureDeletion:
  ------------------
  |  Branch (2502:2): [True: 0, False: 83.9k]
  ------------------
 2503|      0|		if (strcmp(name, "SecureDeletion") == 0)
  ------------------
  |  Branch (2503:7): [True: 0, False: 0]
  ------------------
 2504|      0|			xar->xmlsts = FILE_EXT2;
 2505|      0|		break;
 2506|      0|	case FILE_EXT2_Undelete:
  ------------------
  |  Branch (2506:2): [True: 0, False: 83.9k]
  ------------------
 2507|      0|		if (strcmp(name, "Undelete") == 0)
  ------------------
  |  Branch (2507:7): [True: 0, False: 0]
  ------------------
 2508|      0|			xar->xmlsts = FILE_EXT2;
 2509|      0|		break;
 2510|      0|	case FILE_EXT2_Compress:
  ------------------
  |  Branch (2510:2): [True: 0, False: 83.9k]
  ------------------
 2511|      0|		if (strcmp(name, "Compress") == 0)
  ------------------
  |  Branch (2511:7): [True: 0, False: 0]
  ------------------
 2512|      0|			xar->xmlsts = FILE_EXT2;
 2513|      0|		break;
 2514|      0|	case FILE_EXT2_Synchronous:
  ------------------
  |  Branch (2514:2): [True: 0, False: 83.9k]
  ------------------
 2515|      0|		if (strcmp(name, "Synchronous") == 0)
  ------------------
  |  Branch (2515:7): [True: 0, False: 0]
  ------------------
 2516|      0|			xar->xmlsts = FILE_EXT2;
 2517|      0|		break;
 2518|      0|	case FILE_EXT2_Immutable:
  ------------------
  |  Branch (2518:2): [True: 0, False: 83.9k]
  ------------------
 2519|      0|		if (strcmp(name, "Immutable") == 0)
  ------------------
  |  Branch (2519:7): [True: 0, False: 0]
  ------------------
 2520|      0|			xar->xmlsts = FILE_EXT2;
 2521|      0|		break;
 2522|      0|	case FILE_EXT2_AppendOnly:
  ------------------
  |  Branch (2522:2): [True: 0, False: 83.9k]
  ------------------
 2523|      0|		if (strcmp(name, "AppendOnly") == 0)
  ------------------
  |  Branch (2523:7): [True: 0, False: 0]
  ------------------
 2524|      0|			xar->xmlsts = FILE_EXT2;
 2525|      0|		break;
 2526|      0|	case FILE_EXT2_NoDump:
  ------------------
  |  Branch (2526:2): [True: 0, False: 83.9k]
  ------------------
 2527|      0|		if (strcmp(name, "NoDump") == 0)
  ------------------
  |  Branch (2527:7): [True: 0, False: 0]
  ------------------
 2528|      0|			xar->xmlsts = FILE_EXT2;
 2529|      0|		break;
 2530|      0|	case FILE_EXT2_NoAtime:
  ------------------
  |  Branch (2530:2): [True: 0, False: 83.9k]
  ------------------
 2531|      0|		if (strcmp(name, "NoAtime") == 0)
  ------------------
  |  Branch (2531:7): [True: 0, False: 0]
  ------------------
 2532|      0|			xar->xmlsts = FILE_EXT2;
 2533|      0|		break;
 2534|      0|	case FILE_EXT2_CompDirty:
  ------------------
  |  Branch (2534:2): [True: 0, False: 83.9k]
  ------------------
 2535|      0|		if (strcmp(name, "CompDirty") == 0)
  ------------------
  |  Branch (2535:7): [True: 0, False: 0]
  ------------------
 2536|      0|			xar->xmlsts = FILE_EXT2;
 2537|      0|		break;
 2538|      0|	case FILE_EXT2_CompBlock:
  ------------------
  |  Branch (2538:2): [True: 0, False: 83.9k]
  ------------------
 2539|      0|		if (strcmp(name, "CompBlock") == 0)
  ------------------
  |  Branch (2539:7): [True: 0, False: 0]
  ------------------
 2540|      0|			xar->xmlsts = FILE_EXT2;
 2541|      0|		break;
 2542|      0|	case FILE_EXT2_NoCompBlock:
  ------------------
  |  Branch (2542:2): [True: 0, False: 83.9k]
  ------------------
 2543|      0|		if (strcmp(name, "NoCompBlock") == 0)
  ------------------
  |  Branch (2543:7): [True: 0, False: 0]
  ------------------
 2544|      0|			xar->xmlsts = FILE_EXT2;
 2545|      0|		break;
 2546|      0|	case FILE_EXT2_CompError:
  ------------------
  |  Branch (2546:2): [True: 0, False: 83.9k]
  ------------------
 2547|      0|		if (strcmp(name, "CompError") == 0)
  ------------------
  |  Branch (2547:7): [True: 0, False: 0]
  ------------------
 2548|      0|			xar->xmlsts = FILE_EXT2;
 2549|      0|		break;
 2550|      0|	case FILE_EXT2_BTree:
  ------------------
  |  Branch (2550:2): [True: 0, False: 83.9k]
  ------------------
 2551|      0|		if (strcmp(name, "BTree") == 0)
  ------------------
  |  Branch (2551:7): [True: 0, False: 0]
  ------------------
 2552|      0|			xar->xmlsts = FILE_EXT2;
 2553|      0|		break;
 2554|      0|	case FILE_EXT2_HashIndexed:
  ------------------
  |  Branch (2554:2): [True: 0, False: 83.9k]
  ------------------
 2555|      0|		if (strcmp(name, "HashIndexed") == 0)
  ------------------
  |  Branch (2555:7): [True: 0, False: 0]
  ------------------
 2556|      0|			xar->xmlsts = FILE_EXT2;
 2557|      0|		break;
 2558|      0|	case FILE_EXT2_iMagic:
  ------------------
  |  Branch (2558:2): [True: 0, False: 83.9k]
  ------------------
 2559|      0|		if (strcmp(name, "iMagic") == 0)
  ------------------
  |  Branch (2559:7): [True: 0, False: 0]
  ------------------
 2560|      0|			xar->xmlsts = FILE_EXT2;
 2561|      0|		break;
 2562|      0|	case FILE_EXT2_Journaled:
  ------------------
  |  Branch (2562:2): [True: 0, False: 83.9k]
  ------------------
 2563|      0|		if (strcmp(name, "Journaled") == 0)
  ------------------
  |  Branch (2563:7): [True: 0, False: 0]
  ------------------
 2564|      0|			xar->xmlsts = FILE_EXT2;
 2565|      0|		break;
 2566|      0|	case FILE_EXT2_NoTail:
  ------------------
  |  Branch (2566:2): [True: 0, False: 83.9k]
  ------------------
 2567|      0|		if (strcmp(name, "NoTail") == 0)
  ------------------
  |  Branch (2567:7): [True: 0, False: 0]
  ------------------
 2568|      0|			xar->xmlsts = FILE_EXT2;
 2569|      0|		break;
 2570|      0|	case FILE_EXT2_DirSync:
  ------------------
  |  Branch (2570:2): [True: 0, False: 83.9k]
  ------------------
 2571|      0|		if (strcmp(name, "DirSync") == 0)
  ------------------
  |  Branch (2571:7): [True: 0, False: 0]
  ------------------
 2572|      0|			xar->xmlsts = FILE_EXT2;
 2573|      0|		break;
 2574|      0|	case FILE_EXT2_TopDir:
  ------------------
  |  Branch (2574:2): [True: 0, False: 83.9k]
  ------------------
 2575|      0|		if (strcmp(name, "TopDir") == 0)
  ------------------
  |  Branch (2575:7): [True: 0, False: 0]
  ------------------
 2576|      0|			xar->xmlsts = FILE_EXT2;
 2577|      0|		break;
 2578|      0|	case FILE_EXT2_Reserved:
  ------------------
  |  Branch (2578:2): [True: 0, False: 83.9k]
  ------------------
 2579|      0|		if (strcmp(name, "Reserved") == 0)
  ------------------
  |  Branch (2579:7): [True: 0, False: 0]
  ------------------
 2580|      0|			xar->xmlsts = FILE_EXT2;
 2581|      0|		break;
 2582|  42.8k|	case UNKNOWN:
  ------------------
  |  Branch (2582:2): [True: 42.8k, False: 41.1k]
  ------------------
 2583|  42.8k|		unknowntag_end(xar, name);
 2584|  42.8k|		break;
 2585|  83.9k|	}
 2586|  83.9k|}
archive_read_support_format_xar.c:unknowntag_end:
 1940|  42.8k|{
 1941|  42.8k|	struct unknown_tag *tag;
 1942|       |
 1943|  42.8k|	tag = xar->unknowntags;
 1944|  42.8k|	if (tag == NULL || name == NULL)
  ------------------
  |  Branch (1944:6): [True: 0, False: 42.8k]
  |  Branch (1944:21): [True: 0, False: 42.8k]
  ------------------
 1945|      0|		return;
 1946|  42.8k|	if (strcmp(tag->name.s, name) == 0) {
  ------------------
  |  Branch (1946:6): [True: 42.8k, False: 0]
  ------------------
 1947|  42.8k|		xar->unknowntags = tag->next;
 1948|  42.8k|		archive_string_free(&(tag->name));
 1949|  42.8k|		free(tag);
 1950|  42.8k|		if (xar->unknowntags == NULL) {
  ------------------
  |  Branch (1950:7): [True: 35.9k, False: 6.90k]
  ------------------
 1951|       |#if DEBUG
 1952|       |			fprintf(stderr, "UNKNOWNTAG_END:%s\n", name);
 1953|       |#endif
 1954|  35.9k|			xar->xmlsts = xar->xmlsts_unknown;
 1955|  35.9k|		}
 1956|  42.8k|	}
 1957|  42.8k|}
archive_read_support_format_xar.c:xml_data:
 2683|   110k|{
 2684|   110k|	uint64_t val;
 2685|   110k|	struct archive_read *a;
 2686|   110k|	struct xar *xar;
 2687|   110k|	int r;
 2688|       |
 2689|   110k|	a = (struct archive_read *)userData;
 2690|   110k|	xar = (struct xar *)(a->format->data);
 2691|       |
 2692|       |#if DEBUG
 2693|       |	{
 2694|       |		char buff[1024];
 2695|       |		size_t dlen = len;
 2696|       |		if (dlen > sizeof(buff) - 1)
 2697|       |			dlen = sizeof(buff) - 1;
 2698|       |		strncpy(buff, s, dlen);
 2699|       |		buff[dlen] = 0;
 2700|       |		fprintf(stderr, "\tlen=%zu:\"%s\"\n", dlen, buff);
 2701|       |	}
 2702|       |#endif
 2703|   110k|	switch (xar->xmlsts) {
 2704|    915|	case TOC_CHECKSUM_OFFSET:
  ------------------
  |  Branch (2704:2): [True: 915, False: 109k]
  ------------------
 2705|    915|		r = atou64(s, len, 10, &xar->toc_chksum_offset);
 2706|    915|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    915|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2706:7): [True: 0, False: 915]
  ------------------
 2707|      0|			return (r);
 2708|    915|		break;
 2709|  5.29k|	case TOC_CHECKSUM_SIZE:
  ------------------
  |  Branch (2709:2): [True: 5.29k, False: 105k]
  ------------------
 2710|  5.29k|		r = atou64(s, len, 10, &xar->toc_chksum_size);
 2711|  5.29k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  5.29k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2711:7): [True: 0, False: 5.29k]
  ------------------
 2712|      0|			return (r);
 2713|  5.29k|		break;
 2714|   104k|	default:
  ------------------
  |  Branch (2714:2): [True: 104k, False: 6.20k]
  ------------------
 2715|   104k|		break;
 2716|   110k|	}
 2717|   110k|	if (xar->file == NULL)
  ------------------
  |  Branch (2717:6): [True: 30.0k, False: 80.8k]
  ------------------
 2718|  30.0k|		return (ARCHIVE_OK);
  ------------------
  |  |  233|  30.0k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2719|       |
 2720|  80.8k|	switch (xar->xmlsts) {
  ------------------
  |  Branch (2720:10): [True: 80.8k, False: 0]
  ------------------
 2721|      0|	case FILE_NAME:
  ------------------
  |  Branch (2721:2): [True: 0, False: 80.8k]
  ------------------
 2722|      0|		if (xar->file->has & HAS_PATHNAME)
  ------------------
  |  |  160|      0|#define HAS_PATHNAME		0x00002
  ------------------
  |  Branch (2722:7): [True: 0, False: 0]
  ------------------
 2723|      0|			break;
 2724|       |
 2725|      0|		if (xar->file->parent != NULL) {
  ------------------
  |  Branch (2725:7): [True: 0, False: 0]
  ------------------
 2726|      0|			archive_string_concat(&(xar->file->pathname),
 2727|      0|			    &(xar->file->parent->pathname));
 2728|      0|			archive_strappend_char(&(xar->file->pathname), '/');
 2729|      0|		}
 2730|      0|		xar->file->has |= HAS_PATHNAME;
  ------------------
  |  |  160|      0|#define HAS_PATHNAME		0x00002
  ------------------
 2731|      0|		if (xar->base64text) {
  ------------------
  |  Branch (2731:7): [True: 0, False: 0]
  ------------------
 2732|      0|			strappend_base64(xar,
 2733|      0|			    &(xar->file->pathname), s, len);
 2734|      0|		} else
 2735|      0|			archive_strncat(&(xar->file->pathname), s, len);
 2736|      0|		break;
 2737|      0|	case FILE_LINK:
  ------------------
  |  Branch (2737:2): [True: 0, False: 80.8k]
  ------------------
 2738|      0|		xar->file->has |= HAS_SYMLINK;
  ------------------
  |  |  161|      0|#define HAS_SYMLINK		0x00004
  ------------------
 2739|      0|		archive_strncpy(&(xar->file->symlink), s, len);
  ------------------
  |  |  173|      0|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 2740|      0|		break;
 2741|      0|	case FILE_TYPE:
  ------------------
  |  Branch (2741:2): [True: 0, False: 80.8k]
  ------------------
 2742|      0|		if (is_string("file", s, len) == 0 ||
  ------------------
  |  Branch (2742:7): [True: 0, False: 0]
  ------------------
 2743|      0|		    is_string("hardlink", s, len) == 0)
  ------------------
  |  Branch (2743:7): [True: 0, False: 0]
  ------------------
 2744|      0|			xar->file->mode =
 2745|      0|			    (xar->file->mode & ~AE_IFMT) | AE_IFREG;
  ------------------
  |  |  215|      0|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              			    (xar->file->mode & ~AE_IFMT) | AE_IFREG;
  ------------------
  |  |  216|      0|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 2746|      0|		if (is_string("directory", s, len) == 0)
  ------------------
  |  Branch (2746:7): [True: 0, False: 0]
  ------------------
 2747|      0|			xar->file->mode =
 2748|      0|			    (xar->file->mode & ~AE_IFMT) | AE_IFDIR;
  ------------------
  |  |  215|      0|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              			    (xar->file->mode & ~AE_IFMT) | AE_IFDIR;
  ------------------
  |  |  221|      0|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 2749|      0|		if (is_string("symlink", s, len) == 0)
  ------------------
  |  Branch (2749:7): [True: 0, False: 0]
  ------------------
 2750|      0|			xar->file->mode =
 2751|      0|			    (xar->file->mode & ~AE_IFMT) | AE_IFLNK;
  ------------------
  |  |  215|      0|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              			    (xar->file->mode & ~AE_IFMT) | AE_IFLNK;
  ------------------
  |  |  217|      0|#define AE_IFLNK	((__LA_MODE_T)0120000)
  ------------------
 2752|      0|		if (is_string("character special", s, len) == 0)
  ------------------
  |  Branch (2752:7): [True: 0, False: 0]
  ------------------
 2753|      0|			xar->file->mode =
 2754|      0|			    (xar->file->mode & ~AE_IFMT) | AE_IFCHR;
  ------------------
  |  |  215|      0|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              			    (xar->file->mode & ~AE_IFMT) | AE_IFCHR;
  ------------------
  |  |  219|      0|#define AE_IFCHR	((__LA_MODE_T)0020000)
  ------------------
 2755|      0|		if (is_string("block special", s, len) == 0)
  ------------------
  |  Branch (2755:7): [True: 0, False: 0]
  ------------------
 2756|      0|			xar->file->mode =
 2757|      0|			    (xar->file->mode & ~AE_IFMT) | AE_IFBLK;
  ------------------
  |  |  215|      0|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              			    (xar->file->mode & ~AE_IFMT) | AE_IFBLK;
  ------------------
  |  |  220|      0|#define AE_IFBLK	((__LA_MODE_T)0060000)
  ------------------
 2758|      0|		if (is_string("socket", s, len) == 0)
  ------------------
  |  Branch (2758:7): [True: 0, False: 0]
  ------------------
 2759|      0|			xar->file->mode =
 2760|      0|			    (xar->file->mode & ~AE_IFMT) | AE_IFSOCK;
  ------------------
  |  |  215|      0|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              			    (xar->file->mode & ~AE_IFMT) | AE_IFSOCK;
  ------------------
  |  |  218|      0|#define AE_IFSOCK	((__LA_MODE_T)0140000)
  ------------------
 2761|      0|		if (is_string("fifo", s, len) == 0)
  ------------------
  |  Branch (2761:7): [True: 0, False: 0]
  ------------------
 2762|      0|			xar->file->mode =
 2763|      0|			    (xar->file->mode & ~AE_IFMT) | AE_IFIFO;
  ------------------
  |  |  215|      0|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              			    (xar->file->mode & ~AE_IFMT) | AE_IFIFO;
  ------------------
  |  |  222|      0|#define AE_IFIFO	((__LA_MODE_T)0010000)
  ------------------
 2764|      0|		xar->file->has |= HAS_TYPE;
  ------------------
  |  |  166|      0|#define HAS_TYPE		0x00080
  ------------------
 2765|      0|		break;
 2766|      0|	case FILE_INODE:
  ------------------
  |  Branch (2766:2): [True: 0, False: 80.8k]
  ------------------
 2767|      0|		r = atou64(s, len, 10, &val);
 2768|      0|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2768:7): [True: 0, False: 0]
  ------------------
 2769|      0|			return (r);
 2770|      0|		if (val > (uint64_t)INT64_MAX)
  ------------------
  |  Branch (2770:7): [True: 0, False: 0]
  ------------------
 2771|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2772|      0|		xar->file->has |= HAS_INO;
  ------------------
  |  |  170|      0|#define HAS_INO			0x00800
  ------------------
 2773|      0|		xar->file->ino64 = (int64_t)val;
 2774|      0|		break;
 2775|      0|	case FILE_DEVICE_MAJOR:
  ------------------
  |  Branch (2775:2): [True: 0, False: 80.8k]
  ------------------
 2776|      0|		r = atou64(s, len, 10, &val);
 2777|      0|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2777:7): [True: 0, False: 0]
  ------------------
 2778|      0|			return (r);
 2779|      0|		if (val != (dev_t)val)
  ------------------
  |  Branch (2779:7): [True: 0, False: 0]
  ------------------
 2780|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2781|      0|		xar->file->has |= HAS_DEVMAJOR;
  ------------------
  |  |  168|      0|#define HAS_DEVMAJOR		0x00200
  ------------------
 2782|      0|		xar->file->devmajor = (dev_t)val;
 2783|      0|		break;
 2784|      0|	case FILE_DEVICE_MINOR:
  ------------------
  |  Branch (2784:2): [True: 0, False: 80.8k]
  ------------------
 2785|      0|		r = atou64(s, len, 10, &val);
 2786|      0|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2786:7): [True: 0, False: 0]
  ------------------
 2787|      0|			return (r);
 2788|      0|		if (val != (dev_t)val)
  ------------------
  |  Branch (2788:7): [True: 0, False: 0]
  ------------------
 2789|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2790|      0|		xar->file->has |= HAS_DEVMINOR;
  ------------------
  |  |  169|      0|#define HAS_DEVMINOR		0x00400
  ------------------
 2791|      0|		xar->file->devminor = (dev_t)val;
 2792|      0|		break;
 2793|      0|	case FILE_DEVICENO:
  ------------------
  |  Branch (2793:2): [True: 0, False: 80.8k]
  ------------------
 2794|      0|		r = atou64(s, len, 10, &val);
 2795|      0|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2795:7): [True: 0, False: 0]
  ------------------
 2796|      0|			return (r);
 2797|      0|		if (val != (dev_t)val)
  ------------------
  |  Branch (2797:7): [True: 0, False: 0]
  ------------------
 2798|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2799|      0|		xar->file->has |= HAS_DEV;
  ------------------
  |  |  167|      0|#define HAS_DEV			0x00100
  ------------------
 2800|      0|		xar->file->dev = (dev_t)val;
 2801|      0|		break;
 2802|      0|	case FILE_MODE:
  ------------------
  |  Branch (2802:2): [True: 0, False: 80.8k]
  ------------------
 2803|      0|		r = atou64(s, len, 8, &val);
 2804|      0|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2804:7): [True: 0, False: 0]
  ------------------
 2805|      0|			return (r);
 2806|      0|		if (val != (mode_t)val)
  ------------------
  |  Branch (2806:7): [True: 0, False: 0]
  ------------------
 2807|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2808|      0|		xar->file->has |= HAS_MODE;
  ------------------
  |  |  165|      0|#define HAS_MODE		0x00040
  ------------------
 2809|      0|		xar->file->mode =
 2810|      0|		    (xar->file->mode & AE_IFMT) | ((mode_t)val & ~AE_IFMT);
  ------------------
  |  |  215|      0|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              		    (xar->file->mode & AE_IFMT) | ((mode_t)val & ~AE_IFMT);
  ------------------
  |  |  215|      0|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
 2811|      0|		break;
 2812|    382|	case FILE_GROUP:
  ------------------
  |  Branch (2812:2): [True: 382, False: 80.4k]
  ------------------
 2813|    382|		xar->file->has |= HAS_GID;
  ------------------
  |  |  164|    382|#define HAS_GID			0x00020
  ------------------
 2814|    382|		archive_strncpy(&(xar->file->gname), s, len);
  ------------------
  |  |  173|    382|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 2815|    382|		break;
 2816|  1.31k|	case FILE_GID:
  ------------------
  |  Branch (2816:2): [True: 1.31k, False: 79.5k]
  ------------------
 2817|  1.31k|		r = atou64(s, len, 10, &val);
 2818|  1.31k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  1.31k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2818:7): [True: 0, False: 1.31k]
  ------------------
 2819|      0|			return (r);
 2820|  1.31k|		if (val > (uint64_t)INT64_MAX)
  ------------------
  |  Branch (2820:7): [True: 0, False: 1.31k]
  ------------------
 2821|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2822|  1.31k|		xar->file->has |= HAS_GID;
  ------------------
  |  |  164|  1.31k|#define HAS_GID			0x00020
  ------------------
 2823|  1.31k|		xar->file->gid = (int64_t)val;
 2824|  1.31k|		break;
 2825|  1.31k|	case FILE_USER:
  ------------------
  |  Branch (2825:2): [True: 1.31k, False: 79.5k]
  ------------------
 2826|  1.31k|		xar->file->has |= HAS_UID;
  ------------------
  |  |  163|  1.31k|#define HAS_UID			0x00010
  ------------------
 2827|  1.31k|		archive_strncpy(&(xar->file->uname), s, len);
  ------------------
  |  |  173|  1.31k|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 2828|  1.31k|		break;
 2829|      0|	case FILE_UID:
  ------------------
  |  Branch (2829:2): [True: 0, False: 80.8k]
  ------------------
 2830|      0|		r = atou64(s, len, 10, &val);
 2831|      0|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2831:7): [True: 0, False: 0]
  ------------------
 2832|      0|			return (r);
 2833|      0|		if (val > (uint64_t)INT64_MAX)
  ------------------
  |  Branch (2833:7): [True: 0, False: 0]
  ------------------
 2834|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2835|      0|		xar->file->has |= HAS_UID;
  ------------------
  |  |  163|      0|#define HAS_UID			0x00010
  ------------------
 2836|      0|		xar->file->uid = (int64_t)val;
 2837|      0|		break;
 2838|     87|	case FILE_CTIME:
  ------------------
  |  Branch (2838:2): [True: 87, False: 80.7k]
  ------------------
 2839|     87|		xar->file->has |= HAS_TIME | HAS_CTIME;
  ------------------
  |  |  162|     87|#define HAS_TIME		0x00008
  ------------------
              		xar->file->has |= HAS_TIME | HAS_CTIME;
  ------------------
  |  |  174|     87|#define HAS_CTIME		0x08000
  ------------------
 2840|     87|		xar->file->ctime = parse_time(s, len);
 2841|     87|		break;
 2842|     88|	case FILE_MTIME:
  ------------------
  |  Branch (2842:2): [True: 88, False: 80.7k]
  ------------------
 2843|     88|		xar->file->has |= HAS_TIME | HAS_MTIME;
  ------------------
  |  |  162|     88|#define HAS_TIME		0x00008
  ------------------
              		xar->file->has |= HAS_TIME | HAS_MTIME;
  ------------------
  |  |  175|     88|#define HAS_MTIME		0x10000
  ------------------
 2844|     88|		xar->file->mtime = parse_time(s, len);
 2845|     88|		break;
 2846|  1.08k|	case FILE_ATIME:
  ------------------
  |  Branch (2846:2): [True: 1.08k, False: 79.7k]
  ------------------
 2847|  1.08k|		xar->file->has |= HAS_TIME | HAS_ATIME;
  ------------------
  |  |  162|  1.08k|#define HAS_TIME		0x00008
  ------------------
              		xar->file->has |= HAS_TIME | HAS_ATIME;
  ------------------
  |  |  176|  1.08k|#define HAS_ATIME		0x20000
  ------------------
 2848|  1.08k|		xar->file->atime = parse_time(s, len);
 2849|  1.08k|		break;
 2850|    343|	case FILE_DATA_LENGTH:
  ------------------
  |  Branch (2850:2): [True: 343, False: 80.5k]
  ------------------
 2851|    343|		r = atou64(s, len, 10, &xar->file->length);
 2852|    343|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    343|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2852:7): [True: 0, False: 343]
  ------------------
 2853|      0|			return (r);
 2854|    343|		xar->file->has |= HAS_DATA;
  ------------------
  |  |  159|    343|#define HAS_DATA		0x00001
  ------------------
 2855|    343|		break;
 2856|    938|	case FILE_DATA_OFFSET:
  ------------------
  |  Branch (2856:2): [True: 938, False: 79.9k]
  ------------------
 2857|    938|		r = atou64(s, len, 10, &xar->file->offset);
 2858|    938|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    938|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2858:7): [True: 0, False: 938]
  ------------------
 2859|      0|			return (r);
 2860|    938|		xar->file->has |= HAS_DATA;
  ------------------
  |  |  159|    938|#define HAS_DATA		0x00001
  ------------------
 2861|    938|		break;
 2862|  1.30k|	case FILE_DATA_SIZE:
  ------------------
  |  Branch (2862:2): [True: 1.30k, False: 79.5k]
  ------------------
 2863|  1.30k|		r = atou64(s, len, 10, &xar->file->size);
 2864|  1.30k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  1.30k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2864:7): [True: 0, False: 1.30k]
  ------------------
 2865|      0|			return (r);
 2866|  1.30k|		xar->file->has |= HAS_DATA;
  ------------------
  |  |  159|  1.30k|#define HAS_DATA		0x00001
  ------------------
 2867|  1.30k|		break;
 2868|  7.32k|	case FILE_DATA_A_CHECKSUM:
  ------------------
  |  Branch (2868:2): [True: 7.32k, False: 73.5k]
  ------------------
 2869|  7.32k|		xar->file->a_sum.len = atohex(xar->file->a_sum.val,
 2870|  7.32k|		    sizeof(xar->file->a_sum.val), s, len);
 2871|  7.32k|		break;
 2872|  1.79k|	case FILE_DATA_E_CHECKSUM:
  ------------------
  |  Branch (2872:2): [True: 1.79k, False: 79.0k]
  ------------------
 2873|  1.79k|		xar->file->e_sum.len = atohex(xar->file->e_sum.val,
 2874|  1.79k|		    sizeof(xar->file->e_sum.val), s, len);
 2875|  1.79k|		break;
 2876|      0|	case FILE_EA_LENGTH:
  ------------------
  |  Branch (2876:2): [True: 0, False: 80.8k]
  ------------------
 2877|      0|		r = atou64(s, len, 10, &xar->xattr->length);
 2878|      0|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2878:7): [True: 0, False: 0]
  ------------------
 2879|      0|			return (r);
 2880|      0|		xar->file->has |= HAS_XATTR;
  ------------------
  |  |  172|      0|#define HAS_XATTR		0x02000
  ------------------
 2881|      0|		break;
 2882|    513|	case FILE_EA_OFFSET:
  ------------------
  |  Branch (2882:2): [True: 513, False: 80.3k]
  ------------------
 2883|    513|		r = atou64(s, len, 10, &xar->xattr->offset);
 2884|    513|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    513|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2884:7): [True: 0, False: 513]
  ------------------
 2885|      0|			return (r);
 2886|    513|		xar->file->has |= HAS_XATTR;
  ------------------
  |  |  172|    513|#define HAS_XATTR		0x02000
  ------------------
 2887|    513|		break;
 2888|    207|	case FILE_EA_SIZE:
  ------------------
  |  Branch (2888:2): [True: 207, False: 80.6k]
  ------------------
 2889|    207|		r = atou64(s, len, 10, &xar->xattr->size);
 2890|    207|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    207|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2890:7): [True: 0, False: 207]
  ------------------
 2891|      0|			return (r);
 2892|    207|		xar->file->has |= HAS_XATTR;
  ------------------
  |  |  172|    207|#define HAS_XATTR		0x02000
  ------------------
 2893|    207|		break;
 2894|  6.13k|	case FILE_EA_A_CHECKSUM:
  ------------------
  |  Branch (2894:2): [True: 6.13k, False: 74.7k]
  ------------------
 2895|  6.13k|		xar->file->has |= HAS_XATTR;
  ------------------
  |  |  172|  6.13k|#define HAS_XATTR		0x02000
  ------------------
 2896|  6.13k|		xar->xattr->a_sum.len = atohex(xar->xattr->a_sum.val,
 2897|  6.13k|		    sizeof(xar->xattr->a_sum.val), s, len);
 2898|  6.13k|		break;
 2899|      0|	case FILE_EA_E_CHECKSUM:
  ------------------
  |  Branch (2899:2): [True: 0, False: 80.8k]
  ------------------
 2900|      0|		xar->file->has |= HAS_XATTR;
  ------------------
  |  |  172|      0|#define HAS_XATTR		0x02000
  ------------------
 2901|      0|		xar->xattr->e_sum.len = atohex(xar->xattr->e_sum.val,
 2902|      0|		    sizeof(xar->xattr->e_sum.val), s, len);
 2903|      0|		break;
 2904|      0|	case FILE_EA_NAME:
  ------------------
  |  Branch (2904:2): [True: 0, False: 80.8k]
  ------------------
 2905|      0|		xar->file->has |= HAS_XATTR;
  ------------------
  |  |  172|      0|#define HAS_XATTR		0x02000
  ------------------
 2906|      0|		archive_strncpy(&(xar->xattr->name), s, len);
  ------------------
  |  |  173|      0|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 2907|      0|		break;
 2908|      0|	case FILE_EA_FSTYPE:
  ------------------
  |  Branch (2908:2): [True: 0, False: 80.8k]
  ------------------
 2909|      0|		xar->file->has |= HAS_XATTR;
  ------------------
  |  |  172|      0|#define HAS_XATTR		0x02000
  ------------------
 2910|      0|		archive_strncpy(&(xar->xattr->fstype), s, len);
  ------------------
  |  |  173|      0|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 2911|      0|		break;
 2912|      0|	case FILE_ACL_DEFAULT:
  ------------------
  |  Branch (2912:2): [True: 0, False: 80.8k]
  ------------------
 2913|      0|	case FILE_ACL_ACCESS:
  ------------------
  |  Branch (2913:2): [True: 0, False: 80.8k]
  ------------------
 2914|      0|	case FILE_ACL_APPLEEXTENDED:
  ------------------
  |  Branch (2914:2): [True: 0, False: 80.8k]
  ------------------
 2915|      0|		xar->file->has |= HAS_ACL;
  ------------------
  |  |  173|      0|#define HAS_ACL			0x04000
  ------------------
 2916|       |		/* TODO */
 2917|      0|		break;
 2918|      0|	case INIT:
  ------------------
  |  Branch (2918:2): [True: 0, False: 80.8k]
  ------------------
 2919|      0|	case XAR:
  ------------------
  |  Branch (2919:2): [True: 0, False: 80.8k]
  ------------------
 2920|      0|	case TOC:
  ------------------
  |  Branch (2920:2): [True: 0, False: 80.8k]
  ------------------
 2921|      0|	case TOC_CREATION_TIME:
  ------------------
  |  Branch (2921:2): [True: 0, False: 80.8k]
  ------------------
 2922|      0|	case TOC_CHECKSUM:
  ------------------
  |  Branch (2922:2): [True: 0, False: 80.8k]
  ------------------
 2923|      0|	case TOC_CHECKSUM_OFFSET:
  ------------------
  |  Branch (2923:2): [True: 0, False: 80.8k]
  ------------------
 2924|      0|	case TOC_CHECKSUM_SIZE:
  ------------------
  |  Branch (2924:2): [True: 0, False: 80.8k]
  ------------------
 2925|  7.20k|	case TOC_FILE:
  ------------------
  |  Branch (2925:2): [True: 7.20k, False: 73.6k]
  ------------------
 2926|  33.2k|	case FILE_DATA:
  ------------------
  |  Branch (2926:2): [True: 26.0k, False: 54.8k]
  ------------------
 2927|  33.3k|	case FILE_DATA_ENCODING:
  ------------------
  |  Branch (2927:2): [True: 156, False: 80.7k]
  ------------------
 2928|  33.3k|	case FILE_DATA_CONTENT:
  ------------------
  |  Branch (2928:2): [True: 0, False: 80.8k]
  ------------------
 2929|  33.3k|	case FILE_DEVICE:
  ------------------
  |  Branch (2929:2): [True: 0, False: 80.8k]
  ------------------
 2930|  36.0k|	case FILE_EA:
  ------------------
  |  Branch (2930:2): [True: 2.69k, False: 78.1k]
  ------------------
 2931|  36.0k|	case FILE_EA_ENCODING:
  ------------------
  |  Branch (2931:2): [True: 0, False: 80.8k]
  ------------------
 2932|  36.0k|	case FILE_ACL:
  ------------------
  |  Branch (2932:2): [True: 0, False: 80.8k]
  ------------------
 2933|  36.0k|	case FILE_FLAGS:
  ------------------
  |  Branch (2933:2): [True: 0, False: 80.8k]
  ------------------
 2934|  36.0k|	case FILE_FLAGS_USER_NODUMP:
  ------------------
  |  Branch (2934:2): [True: 0, False: 80.8k]
  ------------------
 2935|  36.0k|	case FILE_FLAGS_USER_IMMUTABLE:
  ------------------
  |  Branch (2935:2): [True: 0, False: 80.8k]
  ------------------
 2936|  36.0k|	case FILE_FLAGS_USER_APPEND:
  ------------------
  |  Branch (2936:2): [True: 0, False: 80.8k]
  ------------------
 2937|  36.0k|	case FILE_FLAGS_USER_OPAQUE:
  ------------------
  |  Branch (2937:2): [True: 0, False: 80.8k]
  ------------------
 2938|  36.0k|	case FILE_FLAGS_USER_NOUNLINK:
  ------------------
  |  Branch (2938:2): [True: 0, False: 80.8k]
  ------------------
 2939|  36.0k|	case FILE_FLAGS_SYS_ARCHIVED:
  ------------------
  |  Branch (2939:2): [True: 0, False: 80.8k]
  ------------------
 2940|  36.0k|	case FILE_FLAGS_SYS_IMMUTABLE:
  ------------------
  |  Branch (2940:2): [True: 0, False: 80.8k]
  ------------------
 2941|  36.0k|	case FILE_FLAGS_SYS_APPEND:
  ------------------
  |  Branch (2941:2): [True: 0, False: 80.8k]
  ------------------
 2942|  36.0k|	case FILE_FLAGS_SYS_NOUNLINK:
  ------------------
  |  Branch (2942:2): [True: 0, False: 80.8k]
  ------------------
 2943|  36.0k|	case FILE_FLAGS_SYS_SNAPSHOT:
  ------------------
  |  Branch (2943:2): [True: 0, False: 80.8k]
  ------------------
 2944|  36.0k|	case FILE_EXT2:
  ------------------
  |  Branch (2944:2): [True: 0, False: 80.8k]
  ------------------
 2945|  36.0k|	case FILE_EXT2_SecureDeletion:
  ------------------
  |  Branch (2945:2): [True: 0, False: 80.8k]
  ------------------
 2946|  36.0k|	case FILE_EXT2_Undelete:
  ------------------
  |  Branch (2946:2): [True: 0, False: 80.8k]
  ------------------
 2947|  36.0k|	case FILE_EXT2_Compress:
  ------------------
  |  Branch (2947:2): [True: 0, False: 80.8k]
  ------------------
 2948|  36.0k|	case FILE_EXT2_Synchronous:
  ------------------
  |  Branch (2948:2): [True: 0, False: 80.8k]
  ------------------
 2949|  36.0k|	case FILE_EXT2_Immutable:
  ------------------
  |  Branch (2949:2): [True: 0, False: 80.8k]
  ------------------
 2950|  36.0k|	case FILE_EXT2_AppendOnly:
  ------------------
  |  Branch (2950:2): [True: 0, False: 80.8k]
  ------------------
 2951|  36.0k|	case FILE_EXT2_NoDump:
  ------------------
  |  Branch (2951:2): [True: 0, False: 80.8k]
  ------------------
 2952|  36.0k|	case FILE_EXT2_NoAtime:
  ------------------
  |  Branch (2952:2): [True: 0, False: 80.8k]
  ------------------
 2953|  36.0k|	case FILE_EXT2_CompDirty:
  ------------------
  |  Branch (2953:2): [True: 0, False: 80.8k]
  ------------------
 2954|  36.0k|	case FILE_EXT2_CompBlock:
  ------------------
  |  Branch (2954:2): [True: 0, False: 80.8k]
  ------------------
 2955|  36.0k|	case FILE_EXT2_NoCompBlock:
  ------------------
  |  Branch (2955:2): [True: 0, False: 80.8k]
  ------------------
 2956|  36.0k|	case FILE_EXT2_CompError:
  ------------------
  |  Branch (2956:2): [True: 0, False: 80.8k]
  ------------------
 2957|  36.0k|	case FILE_EXT2_BTree:
  ------------------
  |  Branch (2957:2): [True: 0, False: 80.8k]
  ------------------
 2958|  36.0k|	case FILE_EXT2_HashIndexed:
  ------------------
  |  Branch (2958:2): [True: 0, False: 80.8k]
  ------------------
 2959|  36.0k|	case FILE_EXT2_iMagic:
  ------------------
  |  Branch (2959:2): [True: 0, False: 80.8k]
  ------------------
 2960|  36.0k|	case FILE_EXT2_Journaled:
  ------------------
  |  Branch (2960:2): [True: 0, False: 80.8k]
  ------------------
 2961|  36.0k|	case FILE_EXT2_NoTail:
  ------------------
  |  Branch (2961:2): [True: 0, False: 80.8k]
  ------------------
 2962|  36.0k|	case FILE_EXT2_DirSync:
  ------------------
  |  Branch (2962:2): [True: 0, False: 80.8k]
  ------------------
 2963|  36.0k|	case FILE_EXT2_TopDir:
  ------------------
  |  Branch (2963:2): [True: 0, False: 80.8k]
  ------------------
 2964|  36.0k|	case FILE_EXT2_Reserved:
  ------------------
  |  Branch (2964:2): [True: 0, False: 80.8k]
  ------------------
 2965|  58.0k|	case UNKNOWN:
  ------------------
  |  Branch (2965:2): [True: 21.9k, False: 58.9k]
  ------------------
 2966|  58.0k|		break;
 2967|  80.8k|	}
 2968|       |
 2969|  80.8k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  80.8k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2970|  80.8k|}
archive_read_support_format_xar.c:parse_time:
 1157|  1.25k|{
 1158|  1.25k|	struct tm tm;
 1159|  1.25k|	time_t t = 0;
 1160|  1.25k|	uint64_t data;
 1161|       |
 1162|  1.25k|	memset(&tm, 0, sizeof(tm));
 1163|  1.25k|	if (n != 20)
  ------------------
  |  Branch (1163:6): [True: 13, False: 1.24k]
  ------------------
 1164|     13|		return (t);
 1165|  1.24k|	if (atou64(p, 4, 10, &data) != ARCHIVE_OK || data < 1900)
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1165:6): [True: 0, False: 1.24k]
  |  Branch (1165:47): [True: 321, False: 925]
  ------------------
 1166|    321|		return (t);
 1167|    925|	tm.tm_year = (int)data - 1900;
 1168|    925|	p += 4;
 1169|    925|	if (*p++ != '-')
  ------------------
  |  Branch (1169:6): [True: 0, False: 925]
  ------------------
 1170|      0|		return (t);
 1171|    925|	if (atou64(p, 4, 10, &data) != ARCHIVE_OK || data < 1 || data > 12)
  ------------------
  |  |  233|  1.85k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1171:6): [True: 0, False: 925]
  |  Branch (1171:47): [True: 6, False: 919]
  |  Branch (1171:59): [True: 6, False: 913]
  ------------------
 1172|     12|		return (t);
 1173|    913|	tm.tm_mon = (int)data -1;
 1174|    913|	p += 2;
 1175|    913|	if (*p++ != '-')
  ------------------
  |  Branch (1175:6): [True: 266, False: 647]
  ------------------
 1176|    266|		return (t);
 1177|    647|	if (atou64(p, 4, 10, &data) != ARCHIVE_OK || data < 1 || data > 31)
  ------------------
  |  |  233|  1.29k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1177:6): [True: 0, False: 647]
  |  Branch (1177:47): [True: 98, False: 549]
  |  Branch (1177:59): [True: 87, False: 462]
  ------------------
 1178|    185|		return (t);
 1179|    462|	tm.tm_mday = (int)data;
 1180|    462|	p += 2;
 1181|    462|	if (*p++ != 'T')
  ------------------
  |  Branch (1181:6): [True: 84, False: 378]
  ------------------
 1182|     84|		return (t);
 1183|    378|	if (atou64(p, 4, 10, &data) != ARCHIVE_OK || data > 23)
  ------------------
  |  |  233|    756|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1183:6): [True: 0, False: 378]
  |  Branch (1183:47): [True: 0, False: 378]
  ------------------
 1184|      0|		return (t);
 1185|    378|	tm.tm_hour = (int)data;
 1186|    378|	p += 2;
 1187|    378|	if (*p++ != ':')
  ------------------
  |  Branch (1187:6): [True: 183, False: 195]
  ------------------
 1188|    183|		return (t);
 1189|    195|	if (atou64(p, 4, 10, &data) != ARCHIVE_OK || data > 59)
  ------------------
  |  |  233|    390|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1189:6): [True: 0, False: 195]
  |  Branch (1189:47): [True: 156, False: 39]
  ------------------
 1190|    156|		return (t);
 1191|     39|	tm.tm_min = (int)data;
 1192|     39|	p += 2;
 1193|     39|	if (*p++ != ':')
  ------------------
  |  Branch (1193:6): [True: 14, False: 25]
  ------------------
 1194|     14|		return (t);
 1195|     25|	if (atou64(p, 4, 10, &data) != ARCHIVE_OK || data > 60)
  ------------------
  |  |  233|     50|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1195:6): [True: 0, False: 25]
  |  Branch (1195:47): [True: 13, False: 12]
  ------------------
 1196|     13|		return (t);
 1197|     12|	tm.tm_sec = (int)data;
 1198|       |#if 0
 1199|       |	p += 2;
 1200|       |	if (*p != 'Z')
 1201|       |		return (t);
 1202|       |#endif
 1203|       |
 1204|     12|	t = time_from_tm(&tm);
 1205|       |
 1206|     12|	return (t);
 1207|     25|}
archive_read_support_format_xar.c:time_from_tm:
 1133|     12|{
 1134|       |#if HAVE__MKGMTIME
 1135|       |        return _mkgmtime(t);
 1136|       |#elif HAVE_TIMEGM
 1137|       |        /* Use platform timegm() if available. */
 1138|     12|        return (timegm(t));
 1139|       |#else
 1140|       |        /* Else use direct calculation using POSIX assumptions. */
 1141|       |        /* First, fix up tm_yday based on the year/month/day. */
 1142|       |        mktime(t);
 1143|       |        /* Then we can compute timegm() from first principles. */
 1144|       |        return (t->tm_sec
 1145|       |            + t->tm_min * 60
 1146|       |            + t->tm_hour * 3600
 1147|       |            + t->tm_yday * 86400
 1148|       |            + (t->tm_year - 70) * 31536000
 1149|       |            + ((t->tm_year - 69) / 4) * 86400
 1150|       |            - ((t->tm_year - 1) / 100) * 86400
 1151|       |            + ((t->tm_year + 299) / 400) * 86400);
 1152|       |#endif
 1153|     12|}
archive_read_support_format_xar.c:atohex:
 1100|  15.2k|{
 1101|  15.2k|	size_t fbsize = bsize;
 1102|       |
 1103|  47.4k|	while (bsize && psize > 1) {
  ------------------
  |  Branch (1103:9): [True: 47.1k, False: 343]
  |  Branch (1103:18): [True: 45.7k, False: 1.39k]
  ------------------
 1104|  45.7k|		unsigned char x;
 1105|       |
 1106|  45.7k|		if (p[0] >= 'a' && p[0] <= 'f')
  ------------------
  |  Branch (1106:7): [True: 31.0k, False: 14.6k]
  |  Branch (1106:22): [True: 30.0k, False: 1.01k]
  ------------------
 1107|  30.0k|			x = (p[0] - 'a' + 0x0a) << 4;
 1108|  15.6k|		else if (p[0] >= 'A' && p[0] <= 'F')
  ------------------
  |  Branch (1108:12): [True: 2.82k, False: 12.8k]
  |  Branch (1108:27): [True: 1.74k, False: 1.08k]
  ------------------
 1109|  1.74k|			x = (p[0] - 'A' + 0x0a) << 4;
 1110|  13.9k|		else if (p[0] >= '0' && p[0] <= '9')
  ------------------
  |  Branch (1110:12): [True: 11.8k, False: 2.09k]
  |  Branch (1110:27): [True: 8.79k, False: 3.04k]
  ------------------
 1111|  8.79k|			x = (p[0] - '0') << 4;
 1112|  5.13k|		else
 1113|  5.13k|			return (-1);
 1114|  40.6k|		if (p[1] >= 'a' && p[1] <= 'f')
  ------------------
  |  Branch (1114:7): [True: 28.7k, False: 11.8k]
  |  Branch (1114:22): [True: 26.9k, False: 1.84k]
  ------------------
 1115|  26.9k|			x |= p[1] - 'a' + 0x0a;
 1116|  13.6k|		else if (p[1] >= 'A' && p[1] <= 'F')
  ------------------
  |  Branch (1116:12): [True: 2.64k, False: 11.0k]
  |  Branch (1116:27): [True: 763, False: 1.88k]
  ------------------
 1117|    763|			x |= p[1] - 'A' + 0x0a;
 1118|  12.9k|		else if (p[1] >= '0' && p[1] <= '9')
  ------------------
  |  Branch (1118:12): [True: 6.58k, False: 6.34k]
  |  Branch (1118:27): [True: 4.55k, False: 2.03k]
  ------------------
 1119|  4.55k|			x |= p[1] - '0';
 1120|  8.37k|		else
 1121|  8.37k|			return (-1);
 1122|       |
 1123|  32.2k|		*b++ = x;
 1124|  32.2k|		bsize--;
 1125|  32.2k|		p += 2;
 1126|  32.2k|		psize -= 2;
 1127|  32.2k|	}
 1128|  1.73k|	return (fbsize - bsize);
 1129|  15.2k|}
archive_read_support_format_xar.c:file_free:
 1803|  19.2k|{
 1804|  19.2k|	struct xattr *xattr;
 1805|       |
 1806|  19.2k|	archive_string_free(&(file->pathname));
 1807|  19.2k|	archive_string_free(&(file->symlink));
 1808|  19.2k|	archive_string_free(&(file->uname));
 1809|  19.2k|	archive_string_free(&(file->gname));
 1810|  19.2k|	archive_string_free(&(file->hardlink));
 1811|  19.2k|	archive_string_free(&(file->fflags_text));
 1812|  19.2k|	xattr = file->xattr_list;
 1813|  20.2k|	while (xattr != NULL) {
  ------------------
  |  Branch (1813:9): [True: 949, False: 19.2k]
  ------------------
 1814|    949|		struct xattr *next;
 1815|       |
 1816|    949|		next = xattr->next;
 1817|    949|		xattr_free(xattr);
 1818|    949|		xattr = next;
 1819|    949|	}
 1820|       |
 1821|  19.2k|	free(file);
 1822|  19.2k|}
archive_read_support_format_xar.c:xattr_free:
 1862|    949|{
 1863|    949|	archive_string_free(&(xattr->name));
 1864|    949|	archive_string_free(&(xattr->fstype));
 1865|    949|	free(xattr);
 1866|    949|}
archive_read_support_format_xar.c:move_reading_point:
  991|    110|{
  992|    110|	struct xar *xar;
  993|       |
  994|    110|	xar = (struct xar *)(a->format->data);
  995|    110|	if (xar->offset - xar->h_base != offset) {
  ------------------
  |  Branch (995:6): [True: 0, False: 110]
  ------------------
  996|       |		/* Seek forward to the start of file contents. */
  997|      0|		int64_t step;
  998|       |
  999|      0|		step = offset - (xar->offset - xar->h_base);
 1000|      0|		if (step > 0) {
  ------------------
  |  Branch (1000:7): [True: 0, False: 0]
  ------------------
 1001|      0|			step = __archive_read_consume(a, step);
 1002|      0|			if (step < 0)
  ------------------
  |  Branch (1002:8): [True: 0, False: 0]
  ------------------
 1003|      0|				return ((int)step);
 1004|      0|			xar->offset += step;
 1005|      0|		} else {
 1006|      0|			int64_t pos = __archive_read_seek(a, xar->h_base + offset, SEEK_SET);
 1007|      0|			if (pos == ARCHIVE_FAILED) {
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (1007:8): [True: 0, False: 0]
  ------------------
 1008|      0|				archive_set_error(&(a->archive),
 1009|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1010|      0|				    "Cannot seek");
 1011|      0|				return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1012|      0|			}
 1013|      0|			xar->offset = pos;
 1014|      0|		}
 1015|      0|	}
 1016|    110|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    110|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1017|    110|}
archive_read_support_format_xar.c:rd_contents_init:
 1022|    110|{
 1023|    110|	int r;
 1024|       |
 1025|       |	/* Init decompress library. */
 1026|    110|	if ((r = decompression_init(a, encoding)) != ARCHIVE_OK)
  ------------------
  |  |  233|    110|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1026:6): [True: 0, False: 110]
  ------------------
 1027|      0|		return (r);
 1028|       |	/* Init checksum library. */
 1029|    110|	checksum_init(a, a_sum_alg, e_sum_alg);
 1030|    110|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    110|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1031|    110|}
archive_read_support_format_xar.c:decompression_init:
 1440|    110|{
 1441|    110|	struct xar *xar;
 1442|    110|	const char *detail;
 1443|    110|	int r;
 1444|       |
 1445|    110|	xar = (struct xar *)(a->format->data);
 1446|    110|	xar->rd_encoding = encoding;
 1447|    110|	switch (encoding) {
 1448|      0|	case NONE:
  ------------------
  |  Branch (1448:2): [True: 0, False: 110]
  ------------------
 1449|      0|		break;
 1450|    110|	case GZIP:
  ------------------
  |  Branch (1450:2): [True: 110, False: 0]
  ------------------
 1451|    110|		if (xar->stream_valid)
  ------------------
  |  Branch (1451:7): [True: 0, False: 110]
  ------------------
 1452|      0|			r = inflateReset(&(xar->stream));
 1453|    110|		else
 1454|    110|			r = inflateInit(&(xar->stream));
 1455|    110|		if (r != Z_OK) {
  ------------------
  |  Branch (1455:7): [True: 0, False: 110]
  ------------------
 1456|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1457|      0|			    "Couldn't initialize zlib stream");
 1458|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1459|      0|		}
 1460|    110|		xar->stream_valid = 1;
 1461|    110|		xar->stream.total_in = 0;
 1462|    110|		xar->stream.total_out = 0;
 1463|    110|		break;
 1464|      0|#if defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR)
 1465|      0|	case BZIP2:
  ------------------
  |  Branch (1465:2): [True: 0, False: 110]
  ------------------
 1466|      0|		if (xar->bzstream_valid) {
  ------------------
  |  Branch (1466:7): [True: 0, False: 0]
  ------------------
 1467|      0|			BZ2_bzDecompressEnd(&(xar->bzstream));
 1468|      0|			xar->bzstream_valid = 0;
 1469|      0|		}
 1470|      0|		r = BZ2_bzDecompressInit(&(xar->bzstream), 0, 0);
 1471|      0|		if (r == BZ_MEM_ERROR)
  ------------------
  |  Branch (1471:7): [True: 0, False: 0]
  ------------------
 1472|      0|			r = BZ2_bzDecompressInit(&(xar->bzstream), 0, 1);
 1473|      0|		if (r != BZ_OK) {
  ------------------
  |  Branch (1473:7): [True: 0, False: 0]
  ------------------
 1474|      0|			int err = ARCHIVE_ERRNO_MISC;
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1475|      0|			detail = NULL;
 1476|      0|			switch (r) {
  ------------------
  |  Branch (1476:12): [True: 0, False: 0]
  ------------------
 1477|      0|			case BZ_PARAM_ERROR:
  ------------------
  |  Branch (1477:4): [True: 0, False: 0]
  ------------------
 1478|      0|				detail = "invalid setup parameter";
 1479|      0|				break;
 1480|      0|			case BZ_MEM_ERROR:
  ------------------
  |  Branch (1480:4): [True: 0, False: 0]
  ------------------
 1481|      0|				err = ENOMEM;
 1482|      0|				detail = "out of memory";
 1483|      0|				break;
 1484|      0|			case BZ_CONFIG_ERROR:
  ------------------
  |  Branch (1484:4): [True: 0, False: 0]
  ------------------
 1485|      0|				detail = "mis-compiled library";
 1486|      0|				break;
 1487|      0|			}
 1488|      0|			archive_set_error(&a->archive, err,
 1489|      0|			    "Internal error initializing decompressor: %s",
 1490|      0|			    detail == NULL ? "??" : detail);
  ------------------
  |  Branch (1490:8): [True: 0, False: 0]
  ------------------
 1491|      0|			xar->bzstream_valid = 0;
 1492|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1493|      0|		}
 1494|      0|		xar->bzstream_valid = 1;
 1495|      0|		xar->bzstream.total_in_lo32 = 0;
 1496|      0|		xar->bzstream.total_in_hi32 = 0;
 1497|      0|		xar->bzstream.total_out_lo32 = 0;
 1498|      0|		xar->bzstream.total_out_hi32 = 0;
 1499|      0|		break;
 1500|      0|#endif
 1501|      0|#if defined(HAVE_LZMA_H) && defined(HAVE_LIBLZMA)
 1502|      0|#if LZMA_VERSION_MAJOR >= 5
 1503|       |/* Effectively disable the limiter. */
 1504|      0|#define LZMA_MEMLIMIT   UINT64_MAX
 1505|       |#else
 1506|       |/* NOTE: This needs to check memory size which running system has. */
 1507|       |#define LZMA_MEMLIMIT   (1U << 30)
 1508|       |#endif
 1509|      0|	case XZ:
  ------------------
  |  Branch (1509:2): [True: 0, False: 110]
  ------------------
 1510|      0|	case LZMA:
  ------------------
  |  Branch (1510:2): [True: 0, False: 110]
  ------------------
 1511|      0|		if (xar->lzstream_valid) {
  ------------------
  |  Branch (1511:7): [True: 0, False: 0]
  ------------------
 1512|      0|			lzma_end(&(xar->lzstream));
 1513|      0|			xar->lzstream_valid = 0;
 1514|      0|		}
 1515|      0|		if (xar->entry_encoding == XZ)
  ------------------
  |  Branch (1515:7): [True: 0, False: 0]
  ------------------
 1516|      0|			r = lzma_stream_decoder(&(xar->lzstream),
 1517|      0|			    LZMA_MEMLIMIT,/* memlimit */
  ------------------
  |  | 1504|      0|#define LZMA_MEMLIMIT   UINT64_MAX
  ------------------
 1518|      0|			    LZMA_CONCATENATED);
 1519|      0|		else
 1520|      0|			r = lzma_alone_decoder(&(xar->lzstream),
 1521|      0|			    LZMA_MEMLIMIT);/* memlimit */
  ------------------
  |  | 1504|      0|#define LZMA_MEMLIMIT   UINT64_MAX
  ------------------
 1522|      0|		if (r != LZMA_OK) {
  ------------------
  |  Branch (1522:7): [True: 0, False: 0]
  ------------------
 1523|      0|			switch (r) {
 1524|      0|			case LZMA_MEM_ERROR:
  ------------------
  |  Branch (1524:4): [True: 0, False: 0]
  ------------------
 1525|      0|				archive_set_error(&a->archive,
 1526|      0|				    ENOMEM,
 1527|      0|				    "Internal error initializing "
 1528|      0|				    "compression library: "
 1529|      0|				    "Cannot allocate memory");
 1530|      0|				break;
 1531|      0|			case LZMA_OPTIONS_ERROR:
  ------------------
  |  Branch (1531:4): [True: 0, False: 0]
  ------------------
 1532|      0|				archive_set_error(&a->archive,
 1533|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1534|      0|				    "Internal error initializing "
 1535|      0|				    "compression library: "
 1536|      0|				    "Invalid or unsupported options");
 1537|      0|				break;
 1538|      0|			default:
  ------------------
  |  Branch (1538:4): [True: 0, False: 0]
  ------------------
 1539|      0|				archive_set_error(&a->archive,
 1540|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1541|      0|				    "Internal error initializing "
 1542|      0|				    "lzma library");
 1543|      0|				break;
 1544|      0|			}
 1545|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1546|      0|		}
 1547|      0|		xar->lzstream_valid = 1;
 1548|      0|		xar->lzstream.total_in = 0;
 1549|      0|		xar->lzstream.total_out = 0;
 1550|      0|		break;
 1551|      0|#endif
 1552|       |	/*
 1553|       |	 * Unsupported compression.
 1554|       |	 */
 1555|      0|	default:
  ------------------
  |  Branch (1555:2): [True: 0, False: 110]
  ------------------
 1556|       |#if !defined(HAVE_BZLIB_H) || !defined(BZ_CONFIG_ERROR)
 1557|       |	case BZIP2:
 1558|       |#endif
 1559|       |#if !defined(HAVE_LZMA_H) || !defined(HAVE_LIBLZMA)
 1560|       |	case LZMA:
 1561|       |	case XZ:
 1562|       |#endif
 1563|      0|		switch (xar->entry_encoding) {
 1564|      0|		case BZIP2: detail = "bzip2"; break;
  ------------------
  |  Branch (1564:3): [True: 0, False: 0]
  ------------------
 1565|      0|		case LZMA: detail = "lzma"; break;
  ------------------
  |  Branch (1565:3): [True: 0, False: 0]
  ------------------
 1566|      0|		case XZ: detail = "xz"; break;
  ------------------
  |  Branch (1566:3): [True: 0, False: 0]
  ------------------
 1567|      0|		default: detail = "??"; break;
  ------------------
  |  Branch (1567:3): [True: 0, False: 0]
  ------------------
 1568|      0|		}
 1569|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1570|      0|		    "%s compression not supported on this platform",
 1571|      0|		    detail);
 1572|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1573|    110|	}
 1574|    110|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    110|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1575|    110|}
archive_read_support_format_xar.c:checksum_init:
 1402|    110|{
 1403|    110|	struct xar *xar;
 1404|       |
 1405|    110|	xar = (struct xar *)(a->format->data);
 1406|    110|	_checksum_init(&(xar->a_sumwrk), a_sum_alg);
 1407|    110|	_checksum_init(&(xar->e_sumwrk), e_sum_alg);
 1408|    110|}
archive_read_support_format_xar.c:_checksum_init:
 1345|    220|{
 1346|    220|	sumwrk->alg = sum_alg;
 1347|    220|	switch (sum_alg) {
  ------------------
  |  Branch (1347:10): [True: 220, False: 0]
  ------------------
 1348|    118|	case CKSUM_NONE:
  ------------------
  |  |  107|    118|#define CKSUM_NONE	0
  ------------------
  |  Branch (1348:2): [True: 118, False: 102]
  ------------------
 1349|    118|		break;
 1350|     96|	case CKSUM_SHA1:
  ------------------
  |  |  108|     96|#define CKSUM_SHA1	1
  ------------------
  |  Branch (1350:2): [True: 96, False: 124]
  ------------------
 1351|     96|		archive_sha1_init(&(sumwrk->sha1ctx));
  ------------------
  |  |  346|     96|  __archive_digest.sha1init(ctx)
  ------------------
 1352|     96|		break;
 1353|      6|	case CKSUM_MD5:
  ------------------
  |  |  109|      6|#define CKSUM_MD5	2
  ------------------
  |  Branch (1353:2): [True: 6, False: 214]
  ------------------
 1354|      6|		archive_md5_init(&(sumwrk->md5ctx));
  ------------------
  |  |  317|      6|  __archive_digest.md5init(ctx)
  ------------------
 1355|      6|		break;
 1356|    220|	}
 1357|    220|}
archive_read_support_format_xar.c:rd_contents:
 1036|  2.64k|{
 1037|  2.64k|	const unsigned char *b;
 1038|  2.64k|	ssize_t bytes;
 1039|       |
 1040|       |	/* Get whatever bytes are immediately available. */
 1041|  2.64k|	b = __archive_read_ahead(a, 1, &bytes);
 1042|  2.64k|	if (bytes < 0)
  ------------------
  |  Branch (1042:6): [True: 0, False: 2.64k]
  ------------------
 1043|      0|		return ((int)bytes);
 1044|  2.64k|	if (bytes == 0) {
  ------------------
  |  Branch (1044:6): [True: 55, False: 2.58k]
  ------------------
 1045|     55|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     55|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1046|     55|		    "Truncated archive file");
 1047|     55|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     55|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1048|     55|	}
 1049|  2.58k|	if ((uint64_t)bytes > remaining)
  ------------------
  |  Branch (1049:6): [True: 6, False: 2.58k]
  ------------------
 1050|      6|		bytes = (ssize_t)remaining;
 1051|       |
 1052|       |	/*
 1053|       |	 * Decompress contents of file.
 1054|       |	 */
 1055|  2.58k|	*used = bytes;
 1056|  2.58k|	if (decompress(a, buff, size, b, used) != ARCHIVE_OK)
  ------------------
  |  |  233|  2.58k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1056:6): [True: 5, False: 2.58k]
  ------------------
 1057|      5|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      5|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1058|       |
 1059|       |	/*
 1060|       |	 * Update checksum of a compressed data and a extracted data.
 1061|       |	 */
 1062|  2.58k|	checksum_update(a, b, *used, *buff, *size);
 1063|       |
 1064|  2.58k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.58k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1065|  2.58k|}
archive_read_support_format_xar.c:decompress:
 1580|  2.58k|{
 1581|  2.58k|	struct xar *xar;
 1582|  2.58k|	void *outbuff;
 1583|  2.58k|	size_t avail_in, avail_out;
 1584|  2.58k|	int r;
 1585|       |
 1586|  2.58k|	xar = (struct xar *)(a->format->data);
 1587|  2.58k|	avail_in = *used;
 1588|  2.58k|	outbuff = (void *)(uintptr_t)*buff;
 1589|  2.58k|	if (outbuff == NULL) {
  ------------------
  |  Branch (1589:6): [True: 0, False: 2.58k]
  ------------------
 1590|      0|		if (xar->outbuff == NULL) {
  ------------------
  |  Branch (1590:7): [True: 0, False: 0]
  ------------------
 1591|      0|			xar->outbuff = malloc(OUTBUFF_SIZE);
  ------------------
  |  |  313|      0|#define OUTBUFF_SIZE	(1024 * 64)
  ------------------
 1592|      0|			if (xar->outbuff == NULL) {
  ------------------
  |  Branch (1592:8): [True: 0, False: 0]
  ------------------
 1593|      0|				archive_set_error(&a->archive, ENOMEM,
 1594|      0|				    "Couldn't allocate memory for out buffer");
 1595|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1596|      0|			}
 1597|      0|		}
 1598|      0|		outbuff = xar->outbuff;
 1599|      0|		*buff = outbuff;
 1600|      0|		avail_out = OUTBUFF_SIZE;
  ------------------
  |  |  313|      0|#define OUTBUFF_SIZE	(1024 * 64)
  ------------------
 1601|      0|	} else
 1602|  2.58k|		avail_out = *outbytes;
 1603|  2.58k|	switch (xar->rd_encoding) {
 1604|  2.58k|	case GZIP:
  ------------------
  |  Branch (1604:2): [True: 2.58k, False: 0]
  ------------------
 1605|  2.58k|		xar->stream.next_in = (Bytef *)(uintptr_t)b;
 1606|  2.58k|		xar->stream.avail_in = (uInt)avail_in;
 1607|  2.58k|		xar->stream.next_out = (unsigned char *)outbuff;
 1608|  2.58k|		xar->stream.avail_out = (uInt)avail_out;
 1609|  2.58k|		r = inflate(&(xar->stream), 0);
 1610|  2.58k|		switch (r) {
 1611|  2.58k|		case Z_OK: /* Decompressor made some progress.*/
  ------------------
  |  Branch (1611:3): [True: 2.58k, False: 5]
  ------------------
 1612|  2.58k|		case Z_STREAM_END: /* Found end of stream. */
  ------------------
  |  Branch (1612:3): [True: 0, False: 2.58k]
  ------------------
 1613|  2.58k|			break;
 1614|      5|		default:
  ------------------
  |  Branch (1614:3): [True: 5, False: 2.58k]
  ------------------
 1615|      5|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      5|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1616|      5|			    "File decompression failed (%d)", r);
 1617|      5|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      5|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1618|  2.58k|		}
 1619|  2.58k|		*used = avail_in - xar->stream.avail_in;
 1620|  2.58k|		*outbytes = avail_out - xar->stream.avail_out;
 1621|  2.58k|		break;
 1622|      0|#if defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR)
 1623|      0|	case BZIP2:
  ------------------
  |  Branch (1623:2): [True: 0, False: 2.58k]
  ------------------
 1624|      0|		xar->bzstream.next_in = (char *)(uintptr_t)b;
 1625|      0|		xar->bzstream.avail_in = (unsigned int)avail_in;
 1626|      0|		xar->bzstream.next_out = (char *)outbuff;
 1627|      0|		xar->bzstream.avail_out = (unsigned int)avail_out;
 1628|      0|		r = BZ2_bzDecompress(&(xar->bzstream));
 1629|      0|		switch (r) {
 1630|      0|		case BZ_STREAM_END: /* Found end of stream. */
  ------------------
  |  Branch (1630:3): [True: 0, False: 0]
  ------------------
 1631|      0|			switch (BZ2_bzDecompressEnd(&(xar->bzstream))) {
 1632|      0|			case BZ_OK:
  ------------------
  |  Branch (1632:4): [True: 0, False: 0]
  ------------------
 1633|      0|				break;
 1634|      0|			default:
  ------------------
  |  Branch (1634:4): [True: 0, False: 0]
  ------------------
 1635|      0|				archive_set_error(&(a->archive),
 1636|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1637|      0|				    "Failed to clean up decompressor");
 1638|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1639|      0|			}
 1640|      0|			xar->bzstream_valid = 0;
 1641|       |			/* FALLTHROUGH */
 1642|      0|		case BZ_OK: /* Decompressor made some progress. */
  ------------------
  |  Branch (1642:3): [True: 0, False: 0]
  ------------------
 1643|      0|			break;
 1644|      0|		default:
  ------------------
  |  Branch (1644:3): [True: 0, False: 0]
  ------------------
 1645|      0|			archive_set_error(&(a->archive),
 1646|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1647|      0|			    "bzip decompression failed");
 1648|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1649|      0|		}
 1650|      0|		*used = avail_in - xar->bzstream.avail_in;
 1651|      0|		*outbytes = avail_out - xar->bzstream.avail_out;
 1652|      0|		break;
 1653|      0|#endif
 1654|      0|#if defined(HAVE_LZMA_H) && defined(HAVE_LIBLZMA)
 1655|      0|	case LZMA:
  ------------------
  |  Branch (1655:2): [True: 0, False: 2.58k]
  ------------------
 1656|      0|	case XZ:
  ------------------
  |  Branch (1656:2): [True: 0, False: 2.58k]
  ------------------
 1657|      0|		xar->lzstream.next_in = b;
 1658|      0|		xar->lzstream.avail_in = avail_in;
 1659|      0|		xar->lzstream.next_out = (unsigned char *)outbuff;
 1660|      0|		xar->lzstream.avail_out = avail_out;
 1661|      0|		r = lzma_code(&(xar->lzstream), LZMA_RUN);
 1662|      0|		switch (r) {
 1663|      0|		case LZMA_STREAM_END: /* Found end of stream. */
  ------------------
  |  Branch (1663:3): [True: 0, False: 0]
  ------------------
 1664|      0|			lzma_end(&(xar->lzstream));
 1665|      0|			xar->lzstream_valid = 0;
 1666|       |			/* FALLTHROUGH */
 1667|      0|		case LZMA_OK: /* Decompressor made some progress. */
  ------------------
  |  Branch (1667:3): [True: 0, False: 0]
  ------------------
 1668|      0|			break;
 1669|      0|		default:
  ------------------
  |  Branch (1669:3): [True: 0, False: 0]
  ------------------
 1670|      0|			archive_set_error(&(a->archive),
 1671|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1672|      0|			    "%s decompression failed (%d)",
 1673|      0|			    (xar->entry_encoding == XZ)?"xz":"lzma",
  ------------------
  |  Branch (1673:8): [True: 0, False: 0]
  ------------------
 1674|      0|			    r);
 1675|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1676|      0|		}
 1677|      0|		*used = avail_in - xar->lzstream.avail_in;
 1678|      0|		*outbytes = avail_out - xar->lzstream.avail_out;
 1679|      0|		break;
 1680|      0|#endif
 1681|       |#if !defined(HAVE_BZLIB_H) || !defined(BZ_CONFIG_ERROR)
 1682|       |	case BZIP2:
 1683|       |#endif
 1684|       |#if !defined(HAVE_LZMA_H) || !defined(HAVE_LIBLZMA)
 1685|       |	case LZMA:
 1686|       |	case XZ:
 1687|       |#endif
 1688|      0|	case NONE:
  ------------------
  |  Branch (1688:2): [True: 0, False: 2.58k]
  ------------------
 1689|      0|	default:
  ------------------
  |  Branch (1689:2): [True: 0, False: 2.58k]
  ------------------
 1690|      0|		if (outbuff == xar->outbuff) {
  ------------------
  |  Branch (1690:7): [True: 0, False: 0]
  ------------------
 1691|      0|			*buff = b;
 1692|      0|			*used = avail_in;
 1693|      0|			*outbytes = avail_in;
 1694|      0|		} else {
 1695|      0|			if (avail_out > avail_in)
  ------------------
  |  Branch (1695:8): [True: 0, False: 0]
  ------------------
 1696|      0|				avail_out = avail_in;
 1697|      0|			memcpy(outbuff, b, avail_out);
 1698|      0|			*used = avail_out;
 1699|      0|			*outbytes = avail_out;
 1700|      0|		}
 1701|      0|		break;
 1702|  2.58k|	}
 1703|  2.58k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.58k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1704|  2.58k|}
archive_read_support_format_xar.c:checksum_update:
 1413|  2.58k|{
 1414|  2.58k|	struct xar *xar;
 1415|       |
 1416|  2.58k|	xar = (struct xar *)(a->format->data);
 1417|  2.58k|	_checksum_update(&(xar->a_sumwrk), abuff, asize);
 1418|  2.58k|	_checksum_update(&(xar->e_sumwrk), ebuff, esize);
 1419|  2.58k|}
archive_read_support_format_xar.c:_checksum_update:
 1361|  5.16k|{
 1362|       |
 1363|  5.16k|	switch (sumwrk->alg) {
  ------------------
  |  Branch (1363:10): [True: 5.16k, False: 0]
  ------------------
 1364|  2.79k|	case CKSUM_NONE:
  ------------------
  |  |  107|  2.79k|#define CKSUM_NONE	0
  ------------------
  |  Branch (1364:2): [True: 2.79k, False: 2.36k]
  ------------------
 1365|  2.79k|		break;
 1366|  2.04k|	case CKSUM_SHA1:
  ------------------
  |  |  108|  2.04k|#define CKSUM_SHA1	1
  ------------------
  |  Branch (1366:2): [True: 2.04k, False: 3.11k]
  ------------------
 1367|  2.04k|		archive_sha1_update(&(sumwrk->sha1ctx), buff, size);
  ------------------
  |  |  350|  2.04k|  __archive_digest.sha1update(ctx, buf, n)
  ------------------
 1368|  2.04k|		break;
 1369|    320|	case CKSUM_MD5:
  ------------------
  |  |  109|    320|#define CKSUM_MD5	2
  ------------------
  |  Branch (1369:2): [True: 320, False: 4.84k]
  ------------------
 1370|    320|		archive_md5_update(&(sumwrk->md5ctx), buff, size);
  ------------------
  |  |  321|    320|  __archive_digest.md5update(ctx, buf, n)
  ------------------
 1371|    320|		break;
 1372|  5.16k|	}
 1373|  5.16k|}
archive_read_support_format_xar.c:_checksum_final:
 1377|  4.99k|{
 1378|  4.99k|	unsigned char sum[MAX_SUM_SIZE];
 1379|  4.99k|	int r = ARCHIVE_OK;
  ------------------
  |  |  233|  4.99k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1380|       |
 1381|  4.99k|	switch (sumwrk->alg) {
  ------------------
  |  Branch (1381:10): [True: 4.99k, False: 0]
  ------------------
 1382|  4.89k|	case CKSUM_NONE:
  ------------------
  |  |  107|  4.89k|#define CKSUM_NONE	0
  ------------------
  |  Branch (1382:2): [True: 4.89k, False: 102]
  ------------------
 1383|  4.89k|		break;
 1384|     96|	case CKSUM_SHA1:
  ------------------
  |  |  108|     96|#define CKSUM_SHA1	1
  ------------------
  |  Branch (1384:2): [True: 96, False: 4.90k]
  ------------------
 1385|     96|		archive_sha1_final(&(sumwrk->sha1ctx), sum);
  ------------------
  |  |  348|     96|  __archive_digest.sha1final(ctx, md)
  ------------------
 1386|     96|		if (len != SHA1_SIZE ||
  ------------------
  |  |  112|    192|#define SHA1_SIZE	20
  ------------------
  |  Branch (1386:7): [True: 96, False: 0]
  ------------------
 1387|      0|		    memcmp(val, sum, SHA1_SIZE) != 0)
  ------------------
  |  |  112|      0|#define SHA1_SIZE	20
  ------------------
  |  Branch (1387:7): [True: 0, False: 0]
  ------------------
 1388|     96|			r = ARCHIVE_FAILED;
  ------------------
  |  |  237|     96|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1389|     96|		break;
 1390|      6|	case CKSUM_MD5:
  ------------------
  |  |  109|      6|#define CKSUM_MD5	2
  ------------------
  |  Branch (1390:2): [True: 6, False: 4.99k]
  ------------------
 1391|      6|		archive_md5_final(&(sumwrk->md5ctx), sum);
  ------------------
  |  |  319|      6|  __archive_digest.md5final(ctx, md)
  ------------------
 1392|      6|		if (len != MD5_SIZE ||
  ------------------
  |  |  111|     12|#define MD5_SIZE	16
  ------------------
  |  Branch (1392:7): [True: 6, False: 0]
  ------------------
 1393|      0|		    memcmp(val, sum, MD5_SIZE) != 0)
  ------------------
  |  |  111|      0|#define MD5_SIZE	16
  ------------------
  |  Branch (1393:7): [True: 0, False: 0]
  ------------------
 1394|      6|			r = ARCHIVE_FAILED;
  ------------------
  |  |  237|      6|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1395|      6|		break;
 1396|  4.99k|	}
 1397|  4.99k|	return (r);
 1398|  4.99k|}
archive_read_support_format_xar.c:xar_cleanup:
  956|  2.49k|{
  957|  2.49k|	struct xar *xar;
  958|  2.49k|	struct hdlink *hdlink;
  959|  2.49k|	int i;
  960|  2.49k|	int r;
  961|       |
  962|  2.49k|	xar = (struct xar *)(a->format->data);
  963|  2.49k|	checksum_cleanup(a);
  964|  2.49k|	r = decompression_cleanup(a);
  965|  2.49k|	hdlink = xar->hdlink_list;
  966|  2.49k|	while (hdlink != NULL) {
  ------------------
  |  Branch (966:9): [True: 0, False: 2.49k]
  ------------------
  967|      0|		struct hdlink *next = hdlink->next;
  968|       |
  969|      0|		free(hdlink);
  970|      0|		hdlink = next;
  971|      0|	}
  972|  21.7k|	for (i = 0; i < xar->file_queue.used; i++)
  ------------------
  |  Branch (972:14): [True: 19.2k, False: 2.49k]
  ------------------
  973|  19.2k|		file_free(xar->file_queue.files[i]);
  974|  2.49k|	free(xar->file_queue.files);
  975|  3.43k|	while (xar->unknowntags != NULL) {
  ------------------
  |  Branch (975:9): [True: 939, False: 2.49k]
  ------------------
  976|    939|		struct unknown_tag *tag;
  977|       |
  978|    939|		tag = xar->unknowntags;
  979|    939|		xar->unknowntags = tag->next;
  980|    939|		archive_string_free(&(tag->name));
  981|    939|		free(tag);
  982|    939|	}
  983|  2.49k|	free(xar->outbuff);
  984|  2.49k|	free(xar);
  985|       |	a->format->data = NULL;
  986|  2.49k|	return (r);
  987|  2.49k|}
archive_read_support_format_xar.c:checksum_cleanup:
 1740|  2.49k|checksum_cleanup(struct archive_read *a) {
 1741|  2.49k|	struct xar *xar;
 1742|       |
 1743|  2.49k|	xar = (struct xar *)(a->format->data);
 1744|       |
 1745|  2.49k|	_checksum_final(&(xar->a_sumwrk), NULL, 0);
 1746|       |	_checksum_final(&(xar->e_sumwrk), NULL, 0);
 1747|  2.49k|}
archive_read_support_format_xar.c:decompression_cleanup:
 1708|  2.49k|{
 1709|  2.49k|	struct xar *xar;
 1710|  2.49k|	int r;
 1711|       |
 1712|  2.49k|	xar = (struct xar *)(a->format->data);
 1713|  2.49k|	r = ARCHIVE_OK;
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1714|  2.49k|	if (xar->stream_valid) {
  ------------------
  |  Branch (1714:6): [True: 110, False: 2.38k]
  ------------------
 1715|    110|		if (inflateEnd(&(xar->stream)) != Z_OK) {
  ------------------
  |  Branch (1715:7): [True: 0, False: 110]
  ------------------
 1716|      0|			archive_set_error(&a->archive,
 1717|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1718|      0|			    "Failed to clean up zlib decompressor");
 1719|      0|			r = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1720|      0|		}
 1721|    110|	}
 1722|  2.49k|#if defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR)
 1723|  2.49k|	if (xar->bzstream_valid) {
  ------------------
  |  Branch (1723:6): [True: 0, False: 2.49k]
  ------------------
 1724|      0|		if (BZ2_bzDecompressEnd(&(xar->bzstream)) != BZ_OK) {
  ------------------
  |  Branch (1724:7): [True: 0, False: 0]
  ------------------
 1725|      0|			archive_set_error(&a->archive,
 1726|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1727|      0|			    "Failed to clean up bzip2 decompressor");
 1728|      0|			r = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1729|      0|		}
 1730|      0|	}
 1731|  2.49k|#endif
 1732|  2.49k|#if defined(HAVE_LZMA_H) && defined(HAVE_LIBLZMA)
 1733|  2.49k|	if (xar->lzstream_valid)
  ------------------
  |  Branch (1733:6): [True: 0, False: 2.49k]
  ------------------
 1734|      0|		lzma_end(&(xar->lzstream));
 1735|  2.49k|#endif
 1736|  2.49k|	return (r);
 1737|  2.49k|}

archive_read_support_format_zip:
 3332|  2.49k|{
 3333|  2.49k|	int r;
 3334|  2.49k|	r = archive_read_support_format_zip_streamable(a);
 3335|  2.49k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3335:6): [True: 0, False: 2.49k]
  ------------------
 3336|      0|		return r;
 3337|  2.49k|	return (archive_read_support_format_zip_seekable(a));
 3338|  2.49k|}
archive_read_support_format_zip_streamable:
 3579|  2.49k|{
 3580|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
 3581|  2.49k|	struct zip *zip;
 3582|  2.49k|	int r;
 3583|       |
 3584|  2.49k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  151|  2.49k|	do { \
  |  |  152|  2.49k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|  2.49k|			(allowed_states), (function_name)); \
  |  |  154|  2.49k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  2.49k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 2.49k]
  |  |  ------------------
  |  |  155|  2.49k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|  2.49k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 2.49k]
  |  |  ------------------
  ------------------
 3585|  2.49k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_zip");
 3586|       |
 3587|  2.49k|	zip = calloc(1, sizeof(*zip));
 3588|  2.49k|	if (zip == NULL) {
  ------------------
  |  Branch (3588:6): [True: 0, False: 2.49k]
  ------------------
 3589|      0|		archive_set_error(&a->archive, ENOMEM,
 3590|      0|		    "Can't allocate zip data");
 3591|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3592|      0|	}
 3593|       |
 3594|       |	/* Streamable reader doesn't support mac extensions. */
 3595|  2.49k|	zip->process_mac_extensions = 0;
 3596|       |
 3597|       |	/*
 3598|       |	 * Until enough data has been read, we cannot tell about
 3599|       |	 * any encrypted entries yet.
 3600|       |	 */
 3601|  2.49k|	zip->has_encrypted_entries = ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW;
  ------------------
  |  |  411|  2.49k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
 3602|  2.49k|	zip->crc32func = real_crc32;
 3603|       |
 3604|  2.49k|	r = __archive_read_register_format(a,
 3605|  2.49k|	    zip,
 3606|  2.49k|	    "zip",
 3607|  2.49k|	    archive_read_format_zip_streamable_bid,
 3608|  2.49k|	    archive_read_format_zip_options,
 3609|  2.49k|	    archive_read_format_zip_streamable_read_header,
 3610|  2.49k|	    archive_read_format_zip_read_data,
 3611|  2.49k|	    archive_read_format_zip_read_data_skip_streamable,
 3612|  2.49k|	    NULL,
 3613|  2.49k|	    archive_read_format_zip_cleanup,
 3614|  2.49k|	    archive_read_support_format_zip_capabilities_streamable,
 3615|  2.49k|	    archive_read_format_zip_has_encrypted_entries);
 3616|       |
 3617|  2.49k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3617:6): [True: 0, False: 2.49k]
  ------------------
 3618|      0|		free(zip);
 3619|  2.49k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3620|  2.49k|}
archive_read_support_format_zip_seekable:
 4371|  2.49k|{
 4372|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
 4373|  2.49k|	struct zip *zip;
 4374|  2.49k|	int r;
 4375|       |
 4376|  2.49k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  151|  2.49k|	do { \
  |  |  152|  2.49k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|  2.49k|			(allowed_states), (function_name)); \
  |  |  154|  2.49k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  2.49k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 2.49k]
  |  |  ------------------
  |  |  155|  2.49k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|  2.49k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 2.49k]
  |  |  ------------------
  ------------------
 4377|  2.49k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_zip_seekable");
 4378|       |
 4379|  2.49k|	zip = calloc(1, sizeof(*zip));
 4380|  2.49k|	if (zip == NULL) {
  ------------------
  |  Branch (4380:6): [True: 0, False: 2.49k]
  ------------------
 4381|      0|		archive_set_error(&a->archive, ENOMEM,
 4382|      0|		    "Can't allocate zip data");
 4383|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4384|      0|	}
 4385|       |
 4386|       |#ifdef HAVE_COPYFILE_H
 4387|       |	/* Set this by default on Mac OS. */
 4388|       |	zip->process_mac_extensions = 1;
 4389|       |#endif
 4390|       |
 4391|       |	/*
 4392|       |	 * Until enough data has been read, we cannot tell about
 4393|       |	 * any encrypted entries yet.
 4394|       |	 */
 4395|  2.49k|	zip->has_encrypted_entries = ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW;
  ------------------
  |  |  411|  2.49k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
 4396|  2.49k|	zip->crc32func = real_crc32;
 4397|       |
 4398|  2.49k|	r = __archive_read_register_format(a,
 4399|  2.49k|	    zip,
 4400|  2.49k|	    "zip",
 4401|  2.49k|	    archive_read_format_zip_seekable_bid,
 4402|  2.49k|	    archive_read_format_zip_options,
 4403|  2.49k|	    archive_read_format_zip_seekable_read_header,
 4404|  2.49k|	    archive_read_format_zip_read_data,
 4405|  2.49k|	    archive_read_format_zip_read_data_skip_seekable,
 4406|  2.49k|	    NULL,
 4407|  2.49k|	    archive_read_format_zip_cleanup,
 4408|  2.49k|	    archive_read_support_format_zip_capabilities_seekable,
 4409|  2.49k|	    archive_read_format_zip_has_encrypted_entries);
 4410|       |
 4411|  2.49k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4411:6): [True: 0, False: 2.49k]
  ------------------
 4412|      0|		free(zip);
 4413|  2.49k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4414|  2.49k|}
archive_read_support_format_zip.c:archive_read_format_zip_streamable_bid:
 3357|  2.46k|{
 3358|  2.46k|	const char *p;
 3359|       |
 3360|  2.46k|	(void)best_bid; /* UNUSED */
 3361|       |
 3362|  2.46k|	if ((p = __archive_read_ahead(a, 4, NULL)) == NULL)
  ------------------
  |  Branch (3362:6): [True: 40, False: 2.42k]
  ------------------
 3363|     40|		return (-1);
 3364|       |
 3365|       |	/*
 3366|       |	 * Bid of 29 here comes from:
 3367|       |	 *  + 16 bits for "PK",
 3368|       |	 *  + next 16-bit field has 6 options so contributes
 3369|       |	 *    about 16 - log_2(6) ~= 16 - 2.6 ~= 13 bits
 3370|       |	 *
 3371|       |	 * So we've effectively verified ~29 total bits of check data.
 3372|       |	 */
 3373|  2.42k|	if (p[0] == 'P' && p[1] == 'K') {
  ------------------
  |  Branch (3373:6): [True: 694, False: 1.72k]
  |  Branch (3373:21): [True: 692, False: 2]
  ------------------
 3374|    692|		if ((p[2] == '\001' && p[3] == '\002')
  ------------------
  |  Branch (3374:8): [True: 0, False: 692]
  |  Branch (3374:26): [True: 0, False: 0]
  ------------------
 3375|    692|		    || (p[2] == '\003' && p[3] == '\004')
  ------------------
  |  Branch (3375:11): [True: 638, False: 54]
  |  Branch (3375:29): [True: 638, False: 0]
  ------------------
 3376|     54|		    || (p[2] == '\005' && p[3] == '\006')
  ------------------
  |  Branch (3376:11): [True: 0, False: 54]
  |  Branch (3376:29): [True: 0, False: 0]
  ------------------
 3377|     54|		    || (p[2] == '\006' && p[3] == '\006')
  ------------------
  |  Branch (3377:11): [True: 0, False: 54]
  |  Branch (3377:29): [True: 0, False: 0]
  ------------------
 3378|     54|		    || (p[2] == '\007' && p[3] == '\010')
  ------------------
  |  Branch (3378:11): [True: 51, False: 3]
  |  Branch (3378:29): [True: 51, False: 0]
  ------------------
 3379|      3|		    || (p[2] == '0' && p[3] == '0'))
  ------------------
  |  Branch (3379:11): [True: 2, False: 1]
  |  Branch (3379:26): [True: 2, False: 0]
  ------------------
 3380|    691|			return (29);
 3381|    692|	}
 3382|       |
 3383|       |	/* TODO: It's worth looking ahead a little bit for a valid
 3384|       |	 * PK signature.  In particular, that would make it possible
 3385|       |	 * to read some UUEncoded SFX files or SFX files coming from
 3386|       |	 * a network socket. */
 3387|       |
 3388|  1.72k|	return (0);
 3389|  2.42k|}
archive_read_support_format_zip.c:archive_read_format_zip_options:
 3284|  4.99k|{
 3285|  4.99k|	struct zip *zip;
 3286|  4.99k|	int ret = ARCHIVE_FAILED;
  ------------------
  |  |  237|  4.99k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3287|       |
 3288|  4.99k|	zip = (struct zip *)(a->format->data);
 3289|  4.99k|	if (strcmp(key, "compat-2x")  == 0) {
  ------------------
  |  Branch (3289:6): [True: 0, False: 4.99k]
  ------------------
 3290|       |		/* Handle filenames as libarchive 2.x */
 3291|      0|		zip->init_default_conversion = (val != NULL) ? 1 : 0;
  ------------------
  |  Branch (3291:34): [True: 0, False: 0]
  ------------------
 3292|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3293|  4.99k|	} else if (strcmp(key, "hdrcharset")  == 0) {
  ------------------
  |  Branch (3293:13): [True: 0, False: 4.99k]
  ------------------
 3294|      0|		if (val == NULL || val[0] == 0)
  ------------------
  |  Branch (3294:7): [True: 0, False: 0]
  |  Branch (3294:22): [True: 0, False: 0]
  ------------------
 3295|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3296|      0|			    "zip: hdrcharset option needs a character-set name"
 3297|      0|			);
 3298|      0|		else {
 3299|      0|			zip->sconv = archive_string_conversion_from_charset(
 3300|      0|			    &a->archive, val, 0);
 3301|      0|			if (zip->sconv != NULL) {
  ------------------
  |  Branch (3301:8): [True: 0, False: 0]
  ------------------
 3302|      0|				if (strcmp(val, "UTF-8") == 0)
  ------------------
  |  Branch (3302:9): [True: 0, False: 0]
  ------------------
 3303|      0|					zip->sconv_utf8 = zip->sconv;
 3304|      0|				ret = ARCHIVE_OK;
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3305|      0|			} else
 3306|      0|				ret = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3307|      0|		}
 3308|      0|		return (ret);
 3309|  4.99k|	} else if (strcmp(key, "ignorecrc32") == 0) {
  ------------------
  |  Branch (3309:13): [True: 4.99k, False: 0]
  ------------------
 3310|       |		/* Mostly useful for testing. */
 3311|  4.99k|		if (val == NULL || val[0] == 0) {
  ------------------
  |  Branch (3311:7): [True: 0, False: 4.99k]
  |  Branch (3311:22): [True: 0, False: 4.99k]
  ------------------
 3312|      0|			zip->crc32func = real_crc32;
 3313|      0|			zip->ignore_crc32 = 0;
 3314|  4.99k|		} else {
 3315|  4.99k|			zip->crc32func = fake_crc32;
 3316|  4.99k|			zip->ignore_crc32 = 1;
 3317|  4.99k|		}
 3318|  4.99k|		return (ARCHIVE_OK);
  ------------------
  |  |  233|  4.99k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3319|  4.99k|	} else if (strcmp(key, "mac-ext") == 0) {
  ------------------
  |  Branch (3319:13): [True: 0, False: 0]
  ------------------
 3320|      0|		zip->process_mac_extensions = (val != NULL && val[0] != 0);
  ------------------
  |  Branch (3320:34): [True: 0, False: 0]
  |  Branch (3320:49): [True: 0, False: 0]
  ------------------
 3321|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3322|      0|	}
 3323|       |
 3324|       |	/* Note: The "warn" return is just to inform the options
 3325|       |	 * supervisor that we didn't handle it.  It will generate
 3326|       |	 * a suitable error if no one used this option. */
 3327|      0|	return (ARCHIVE_WARN);
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 3328|  4.99k|}
archive_read_support_format_zip.c:fake_crc32:
  420|  51.3k|{
  421|  51.3k|	(void)crc; /* UNUSED */
  422|  51.3k|	(void)buff; /* UNUSED */
  423|  51.3k|	(void)len; /* UNUSED */
  424|  51.3k|	return 0;
  425|  51.3k|}
archive_read_support_format_zip.c:archive_read_format_zip_streamable_read_header:
 3394|  35.5k|{
 3395|  35.5k|	struct zip *zip;
 3396|       |
 3397|  35.5k|	a->archive.archive_format = ARCHIVE_FORMAT_ZIP;
  ------------------
  |  |  374|  35.5k|#define	ARCHIVE_FORMAT_ZIP			0x50000
  ------------------
 3398|  35.5k|	if (a->archive.archive_format_name == NULL)
  ------------------
  |  Branch (3398:6): [True: 662, False: 34.8k]
  ------------------
 3399|    662|		a->archive.archive_format_name = "ZIP";
 3400|       |
 3401|  35.5k|	zip = (struct zip *)(a->format->data);
 3402|       |
 3403|       |	/*
 3404|       |	 * It should be sufficient to call archive_read_next_header() for
 3405|       |	 * a reader to determine if an entry is encrypted or not. If the
 3406|       |	 * encryption of an entry is only detectable when calling
 3407|       |	 * archive_read_data(), so be it. We'll do the same check there
 3408|       |	 * as well.
 3409|       |	 */
 3410|  35.5k|	if (zip->has_encrypted_entries ==
  ------------------
  |  Branch (3410:6): [True: 662, False: 34.8k]
  ------------------
 3411|  35.5k|			ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW)
  ------------------
  |  |  411|  35.5k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
 3412|    662|		zip->has_encrypted_entries = 0;
 3413|       |
 3414|       |	/* Make sure we have a zip_entry structure to use. */
 3415|  35.5k|	if (zip->zip_entries == NULL) {
  ------------------
  |  Branch (3415:6): [True: 662, False: 34.8k]
  ------------------
 3416|    662|		zip->zip_entries = malloc(sizeof(struct zip_entry));
 3417|    662|		if (zip->zip_entries == NULL) {
  ------------------
  |  Branch (3417:7): [True: 0, False: 662]
  ------------------
 3418|      0|			archive_set_error(&a->archive, ENOMEM,
 3419|      0|			    "Out  of memory");
 3420|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3421|      0|		}
 3422|    662|	}
 3423|  35.5k|	zip->entry = zip->zip_entries;
 3424|  35.5k|	memset(zip->entry, 0, sizeof(struct zip_entry));
 3425|       |
 3426|  35.5k|	if (zip->cctx_valid)
  ------------------
  |  Branch (3426:6): [True: 2.96k, False: 32.5k]
  ------------------
 3427|  2.96k|		archive_decrypto_aes_ctr_release(&zip->cctx);
  ------------------
  |  |  166|  2.96k|  __archive_cryptor.decrypto_aes_ctr_release(ctx)
  ------------------
 3428|  35.5k|	if (zip->hctx_valid)
  ------------------
  |  Branch (3428:6): [True: 2.96k, False: 32.5k]
  ------------------
 3429|  2.96k|		archive_hmac_sha1_cleanup(&zip->hctx);
  ------------------
  |  |  105|  2.96k|	__archive_hmac.__hmac_sha1_cleanup(ctx)
  ------------------
 3430|  35.5k|	zip->tctx_valid = zip->cctx_valid = zip->hctx_valid = 0;
 3431|  35.5k|	__archive_read_reset_passphrase(a);
 3432|       |
 3433|       |	/* Search ahead for the next local file header. */
 3434|  35.5k|	__archive_read_consume(a, zip->unconsumed);
 3435|  35.5k|	zip->unconsumed = 0;
 3436|  36.1k|	for (;;) {
 3437|  36.1k|		int64_t skipped = 0;
 3438|  36.1k|		const char *p, *end;
 3439|  36.1k|		ssize_t bytes;
 3440|       |
 3441|  36.1k|		p = __archive_read_ahead(a, 4, &bytes);
 3442|  36.1k|		if (p == NULL)
  ------------------
  |  Branch (3442:7): [True: 243, False: 35.8k]
  ------------------
 3443|    243|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    243|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3444|  35.8k|		end = p + bytes;
 3445|       |
 3446|  19.3M|		while (p + 4 <= end) {
  ------------------
  |  Branch (3446:10): [True: 19.3M, False: 590]
  ------------------
 3447|  19.3M|			if (p[0] == 'P' && p[1] == 'K') {
  ------------------
  |  Branch (3447:8): [True: 86.0k, False: 19.2M]
  |  Branch (3447:23): [True: 47.0k, False: 38.9k]
  ------------------
 3448|  47.0k|				if (p[2] == '\003' && p[3] == '\004') {
  ------------------
  |  Branch (3448:9): [True: 35.5k, False: 11.4k]
  |  Branch (3448:27): [True: 35.2k, False: 287]
  ------------------
 3449|       |					/* Regular file entry. */
 3450|  35.2k|					__archive_read_consume(a, skipped);
 3451|  35.2k|					return zip_read_local_file_header(a,
 3452|  35.2k|					    entry, zip);
 3453|  35.2k|				}
 3454|       |
 3455|       |                              /*
 3456|       |                               * TODO: We cannot restore permissions
 3457|       |                               * based only on the local file headers.
 3458|       |                               * Consider scanning the central
 3459|       |                               * directory and returning additional
 3460|       |                               * entries for at least directories.
 3461|       |                               * This would allow us to properly set
 3462|       |                               * directory permissions.
 3463|       |			       *
 3464|       |			       * This won't help us fix symlinks
 3465|       |			       * and may not help with regular file
 3466|       |			       * permissions, either.  <sigh>
 3467|       |                               */
 3468|  11.7k|                              if (p[2] == '\001' && p[3] == '\002') {
  ------------------
  |  Branch (3468:35): [True: 526, False: 11.2k]
  |  Branch (3468:53): [True: 0, False: 526]
  ------------------
 3469|      0|                                      return (ARCHIVE_EOF);
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3470|      0|                              }
 3471|       |
 3472|       |                              /* End of central directory?  Must be an
 3473|       |                               * empty archive. */
 3474|  11.7k|                              if ((p[2] == '\005' && p[3] == '\006')
  ------------------
  |  Branch (3474:36): [True: 10, False: 11.7k]
  |  Branch (3474:54): [True: 7, False: 3]
  ------------------
 3475|  11.7k|                                  || (p[2] == '\006' && p[3] == '\006'))
  ------------------
  |  Branch (3475:39): [True: 498, False: 11.2k]
  |  Branch (3475:57): [True: 0, False: 498]
  ------------------
 3476|      7|                                      return (ARCHIVE_EOF);
  ------------------
  |  |  232|      7|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3477|  11.7k|			}
 3478|  19.3M|			++p;
 3479|  19.3M|			++skipped;
 3480|  19.3M|		}
 3481|    590|		__archive_read_consume(a, skipped);
 3482|    590|	}
 3483|  35.5k|}
archive_read_support_format_zip.c:zip_read_local_file_header:
  914|  35.5k|{
  915|  35.5k|	const char *p;
  916|  35.5k|	const void *h;
  917|  35.5k|	const wchar_t *wp;
  918|  35.5k|	const char *cp;
  919|  35.5k|	size_t len, filename_length, extra_length;
  920|  35.5k|	struct archive_string_conv *sconv;
  921|  35.5k|	struct zip_entry *zip_entry = zip->entry;
  922|  35.5k|	struct zip_entry zip_entry_central_dir;
  923|  35.5k|	int ret = ARCHIVE_OK;
  ------------------
  |  |  233|  35.5k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  924|  35.5k|	char version;
  925|       |
  926|       |	/* Save a copy of the original for consistency checks. */
  927|  35.5k|	zip_entry_central_dir = *zip_entry;
  928|       |
  929|  35.5k|	zip->decompress_init = 0;
  930|  35.5k|	zip->end_of_entry = 0;
  931|  35.5k|	zip->entry_uncompressed_bytes_read = 0;
  932|  35.5k|	zip->entry_compressed_bytes_read = 0;
  933|  35.5k|	zip->computed_crc32 = zip->crc32func(0, NULL, 0);
  934|       |
  935|       |	/* Setup default conversion. */
  936|  35.5k|	if (zip->sconv == NULL && !zip->init_default_conversion) {
  ------------------
  |  Branch (936:6): [True: 35.5k, False: 0]
  |  Branch (936:28): [True: 682, False: 34.8k]
  ------------------
  937|    682|		zip->sconv_default =
  938|    682|		    archive_string_default_conversion_for_read(&(a->archive));
  939|    682|		zip->init_default_conversion = 1;
  940|    682|	}
  941|       |
  942|  35.5k|	if ((p = __archive_read_ahead(a, ZIP_LOCHDR_LEN, NULL)) == NULL) {
  ------------------
  |  |   82|  35.5k|#define ZIP_LOCHDR_LEN		30U
  ------------------
  |  Branch (942:6): [True: 26, False: 35.4k]
  ------------------
  943|     26|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     26|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  944|     26|		    "Truncated ZIP file header");
  945|     26|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     26|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  946|     26|	}
  947|       |
  948|  35.4k|	if (memcmp(p, "PK\003\004", 4) != 0) {
  ------------------
  |  Branch (948:6): [True: 10, False: 35.4k]
  ------------------
  949|     10|		archive_set_error(&a->archive, -1, "Damaged Zip archive");
  950|     10|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|     10|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  951|     10|	}
  952|  35.4k|	version = p[4];
  953|  35.4k|	zip_entry->system = p[5];
  954|  35.4k|	zip_entry->zip_flags = archive_le16dec(p + 6);
  955|  35.4k|	if (zip_entry->zip_flags & (ZIP_ENCRYPTED | ZIP_STRONG_ENCRYPTED)) {
  ------------------
  |  |  127|  35.4k|#define ZIP_ENCRYPTED	(1 << 0)
  ------------------
              	if (zip_entry->zip_flags & (ZIP_ENCRYPTED | ZIP_STRONG_ENCRYPTED)) {
  ------------------
  |  |  129|  35.4k|#define ZIP_STRONG_ENCRYPTED	(1 << 6)
  ------------------
  |  Branch (955:6): [True: 11.6k, False: 23.7k]
  ------------------
  956|  11.6k|		zip->has_encrypted_entries = 1;
  957|  11.6k|		archive_entry_set_is_data_encrypted(entry, 1);
  958|  11.6k|		if (zip_entry->zip_flags & ZIP_CENTRAL_DIRECTORY_ENCRYPTED &&
  ------------------
  |  |  133|  23.3k|#define ZIP_CENTRAL_DIRECTORY_ENCRYPTED	(1 << 13)
  ------------------
  |  Branch (958:7): [True: 5.01k, False: 6.65k]
  ------------------
  959|  5.01k|			zip_entry->zip_flags & ZIP_ENCRYPTED &&
  ------------------
  |  |  127|  16.6k|#define ZIP_ENCRYPTED	(1 << 0)
  ------------------
  |  Branch (959:4): [True: 1.56k, False: 3.44k]
  ------------------
  960|  1.56k|			zip_entry->zip_flags & ZIP_STRONG_ENCRYPTED) {
  ------------------
  |  |  129|  1.56k|#define ZIP_STRONG_ENCRYPTED	(1 << 6)
  ------------------
  |  Branch (960:4): [True: 4, False: 1.56k]
  ------------------
  961|      4|			archive_entry_set_is_metadata_encrypted(entry, 1);
  962|      4|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  963|      4|		}
  964|  11.6k|	}
  965|  35.4k|	zip->init_decryption = (zip_entry->zip_flags & ZIP_ENCRYPTED);
  ------------------
  |  |  127|  35.4k|#define ZIP_ENCRYPTED	(1 << 0)
  ------------------
  966|  35.4k|	zip_entry->compression = (char)archive_le16dec(p + 8);
  967|  35.4k|	zip_entry->mtime = dos_to_unix(archive_le32dec(p + 10));
  968|  35.4k|	zip_entry->crc32 = archive_le32dec(p + 14);
  969|  35.4k|	if (zip_entry->zip_flags & ZIP_LENGTH_AT_END)
  ------------------
  |  |  128|  35.4k|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (969:6): [True: 20.6k, False: 14.8k]
  ------------------
  970|  20.6k|		zip_entry->decdat = p[11];
  971|  14.8k|	else
  972|  14.8k|		zip_entry->decdat = p[17];
  973|  35.4k|	zip_entry->compressed_size = archive_le32dec(p + 18);
  974|  35.4k|	zip_entry->uncompressed_size = archive_le32dec(p + 22);
  975|  35.4k|	filename_length = archive_le16dec(p + 26);
  976|  35.4k|	extra_length = archive_le16dec(p + 28);
  977|       |
  978|  35.4k|	__archive_read_consume(a, ZIP_LOCHDR_LEN);
  ------------------
  |  |   82|  35.4k|#define ZIP_LOCHDR_LEN		30U
  ------------------
  979|       |
  980|       |	/* Read the filename. */
  981|  35.4k|	if ((h = __archive_read_ahead(a, filename_length, NULL)) == NULL) {
  ------------------
  |  Branch (981:6): [True: 39, False: 35.4k]
  ------------------
  982|     39|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     39|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  983|     39|		    "Truncated ZIP file header");
  984|     39|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     39|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  985|     39|	}
  986|  35.4k|	if (zip_entry->zip_flags & ZIP_UTF8_NAME) {
  ------------------
  |  |  130|  35.4k|#define ZIP_UTF8_NAME	(1 << 11)
  ------------------
  |  Branch (986:6): [True: 10.3k, False: 25.0k]
  ------------------
  987|       |		/* The filename is stored to be UTF-8. */
  988|  10.3k|		if (zip->sconv_utf8 == NULL) {
  ------------------
  |  Branch (988:7): [True: 213, False: 10.1k]
  ------------------
  989|    213|			zip->sconv_utf8 =
  990|    213|			    archive_string_conversion_from_charset(
  991|    213|				&a->archive, "UTF-8", 1);
  992|    213|			if (zip->sconv_utf8 == NULL)
  ------------------
  |  Branch (992:8): [True: 0, False: 213]
  ------------------
  993|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  994|    213|		}
  995|  10.3k|		sconv = zip->sconv_utf8;
  996|  25.0k|	} else if (zip->sconv != NULL)
  ------------------
  |  Branch (996:13): [True: 0, False: 25.0k]
  ------------------
  997|      0|		sconv = zip->sconv;
  998|  25.0k|	else
  999|  25.0k|		sconv = zip->sconv_default;
 1000|       |
 1001|  35.4k|	if (archive_entry_copy_pathname_l(entry,
  ------------------
  |  |   80|  35.4k|#define archive_entry_copy_pathname_l	_archive_entry_copy_pathname_l
  ------------------
  |  Branch (1001:6): [True: 1.20k, False: 34.2k]
  ------------------
 1002|  35.4k|	    h, filename_length, sconv) != 0) {
 1003|  1.20k|		if (errno == ENOMEM) {
  ------------------
  |  Branch (1003:7): [True: 0, False: 1.20k]
  ------------------
 1004|      0|			archive_set_error(&a->archive, ENOMEM,
 1005|      0|			    "Can't allocate memory for Pathname");
 1006|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1007|      0|		}
 1008|  1.20k|		archive_set_error(&a->archive,
 1009|  1.20k|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  1.20k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1010|  1.20k|		    "Pathname cannot be converted "
 1011|  1.20k|		    "from %s to current locale",
 1012|  1.20k|		    archive_string_conversion_charset_name(sconv));
 1013|  1.20k|		ret = ARCHIVE_WARN;
  ------------------
  |  |  235|  1.20k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1014|  1.20k|	}
 1015|  35.4k|	__archive_read_consume(a, filename_length);
 1016|       |
 1017|       |	/* Read the extra data. */
 1018|  35.4k|	if ((h = __archive_read_ahead(a, extra_length, NULL)) == NULL) {
  ------------------
  |  Branch (1018:6): [True: 23, False: 35.3k]
  ------------------
 1019|     23|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     23|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1020|     23|		    "Truncated ZIP file header");
 1021|     23|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     23|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1022|     23|	}
 1023|       |
 1024|  35.3k|	if (ARCHIVE_OK != process_extra(a, entry, h, extra_length,
  ------------------
  |  |  233|  35.3k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1024:6): [True: 45, False: 35.3k]
  ------------------
 1025|  35.3k|	    zip_entry)) {
 1026|     45|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|     45|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1027|     45|	}
 1028|  35.3k|	__archive_read_consume(a, extra_length);
 1029|       |
 1030|       |	/* Work around a bug in Info-Zip: When reading from a pipe, it
 1031|       |	 * stats the pipe instead of synthesizing a file entry. */
 1032|  35.3k|	if ((zip_entry->mode & AE_IFMT) == AE_IFIFO) {
  ------------------
  |  |  215|  35.3k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              	if ((zip_entry->mode & AE_IFMT) == AE_IFIFO) {
  ------------------
  |  |  222|  35.3k|#define AE_IFIFO	((__LA_MODE_T)0010000)
  ------------------
  |  Branch (1032:6): [True: 843, False: 34.5k]
  ------------------
 1033|    843|		zip_entry->mode &= ~ AE_IFMT;
  ------------------
  |  |  215|    843|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
 1034|    843|		zip_entry->mode |= AE_IFREG;
  ------------------
  |  |  216|    843|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1035|    843|	}
 1036|       |
 1037|       |	/* If the mode is totally empty, set some sane default. */
 1038|  35.3k|	if (zip_entry->mode == 0) {
  ------------------
  |  Branch (1038:6): [True: 31.2k, False: 4.15k]
  ------------------
 1039|  31.2k|		zip_entry->mode |= 0664;
 1040|  31.2k|	}
 1041|       |
 1042|       |	/* Windows archivers sometimes use backslash as the directory
 1043|       |	 * separator. Normalize to slash. */
 1044|  35.3k|	if (zip_entry->system == 0 &&
  ------------------
  |  Branch (1044:6): [True: 16.8k, False: 18.4k]
  ------------------
 1045|  16.8k|	    (wp = archive_entry_pathname_w(entry)) != NULL) {
  ------------------
  |  Branch (1045:6): [True: 10.8k, False: 6.05k]
  ------------------
 1046|  10.8k|		if (wcschr(wp, L'/') == NULL && wcschr(wp, L'\\') != NULL) {
  ------------------
  |  Branch (1046:7): [True: 10.2k, False: 548]
  |  Branch (1046:35): [True: 497, False: 9.76k]
  ------------------
 1047|    497|			size_t i;
 1048|    497|			struct archive_wstring s;
 1049|    497|			archive_string_init(&s);
  ------------------
  |  |   71|    497|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 497]
  |  |  ------------------
  ------------------
 1050|    497|			archive_wstrcpy(&s, wp);
  ------------------
  |  |  167|    497|	archive_wstrncpy((as), (p), ((p) == NULL ? 0 : wcslen(p)))
  |  |  ------------------
  |  |  |  |  175|    994|	((as)->length = 0, archive_wstrncat((as), (p), (l)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (175:50): [True: 0, False: 497]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1051|  13.6k|			for (i = 0; i < archive_strlen(&s); i++) {
  ------------------
  |  |  178|  13.6k|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (1051:16): [True: 13.1k, False: 497]
  ------------------
 1052|  13.1k|				if (s.s[i] == '\\')
  ------------------
  |  Branch (1052:9): [True: 3.03k, False: 10.1k]
  ------------------
 1053|  3.03k|					s.s[i] = '/';
 1054|  13.1k|			}
 1055|    497|			archive_entry_copy_pathname_w(entry, s.s);
 1056|    497|			archive_wstring_free(&s);
 1057|    497|		}
 1058|  10.8k|	}
 1059|       |
 1060|       |	/* Make sure that entries with a trailing '/' are marked as directories
 1061|       |	 * even if the External File Attributes contains bogus values.  If this
 1062|       |	 * is not a directory and there is no type, assume a regular file. */
 1063|  35.3k|	if ((zip_entry->mode & AE_IFMT) != AE_IFDIR) {
  ------------------
  |  |  215|  35.3k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              	if ((zip_entry->mode & AE_IFMT) != AE_IFDIR) {
  ------------------
  |  |  221|  35.3k|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (1063:6): [True: 34.1k, False: 1.22k]
  ------------------
 1064|  34.1k|		int has_slash;
 1065|       |
 1066|  34.1k|		wp = archive_entry_pathname_w(entry);
 1067|  34.1k|		if (wp != NULL) {
  ------------------
  |  Branch (1067:7): [True: 25.1k, False: 8.94k]
  ------------------
 1068|  25.1k|			len = wcslen(wp);
 1069|  25.1k|			has_slash = len > 0 && wp[len - 1] == L'/';
  ------------------
  |  Branch (1069:16): [True: 3.74k, False: 21.4k]
  |  Branch (1069:27): [True: 270, False: 3.47k]
  ------------------
 1070|  25.1k|		} else {
 1071|  8.94k|			cp = archive_entry_pathname(entry);
 1072|  8.94k|			len = (cp != NULL)?strlen(cp):0;
  ------------------
  |  Branch (1072:10): [True: 8.04k, False: 900]
  ------------------
 1073|  8.94k|			has_slash = len > 0 && cp[len - 1] == '/';
  ------------------
  |  Branch (1073:16): [True: 8.04k, False: 900]
  |  Branch (1073:27): [True: 261, False: 7.78k]
  ------------------
 1074|  8.94k|		}
 1075|       |		/* Correct file type as needed. */
 1076|  34.1k|		if (has_slash) {
  ------------------
  |  Branch (1076:7): [True: 531, False: 33.5k]
  ------------------
 1077|    531|			zip_entry->mode &= ~AE_IFMT;
  ------------------
  |  |  215|    531|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
 1078|    531|			zip_entry->mode |= AE_IFDIR;
  ------------------
  |  |  221|    531|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 1079|    531|			zip_entry->mode |= 0111;
 1080|  33.5k|		} else if ((zip_entry->mode & AE_IFMT) == 0) {
  ------------------
  |  |  215|  33.5k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
  |  Branch (1080:14): [True: 31.0k, False: 2.56k]
  ------------------
 1081|  31.0k|			zip_entry->mode |= AE_IFREG;
  ------------------
  |  |  216|  31.0k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1082|  31.0k|		}
 1083|  34.1k|	}
 1084|       |
 1085|       |	/* Make sure directories end in '/' */
 1086|  35.3k|	if ((zip_entry->mode & AE_IFMT) == AE_IFDIR) {
  ------------------
  |  |  215|  35.3k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              	if ((zip_entry->mode & AE_IFMT) == AE_IFDIR) {
  ------------------
  |  |  221|  35.3k|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (1086:6): [True: 1.75k, False: 33.5k]
  ------------------
 1087|  1.75k|		wp = archive_entry_pathname_w(entry);
 1088|  1.75k|		if (wp != NULL) {
  ------------------
  |  Branch (1088:7): [True: 1.14k, False: 610]
  ------------------
 1089|  1.14k|			len = wcslen(wp);
 1090|  1.14k|			if (len > 0 && wp[len - 1] != L'/') {
  ------------------
  |  Branch (1090:8): [True: 478, False: 669]
  |  Branch (1090:19): [True: 104, False: 374]
  ------------------
 1091|    104|				struct archive_wstring s;
 1092|    104|				archive_string_init(&s);
  ------------------
  |  |   71|    104|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 104]
  |  |  ------------------
  ------------------
 1093|    104|				archive_wstrcat(&s, wp);
 1094|    104|				archive_wstrappend_wchar(&s, L'/');
 1095|    104|				archive_entry_copy_pathname_w(entry, s.s);
 1096|    104|				archive_wstring_free(&s);
 1097|    104|			}
 1098|  1.14k|		} else {
 1099|    610|			cp = archive_entry_pathname(entry);
 1100|    610|			len = (cp != NULL)?strlen(cp):0;
  ------------------
  |  Branch (1100:10): [True: 305, False: 305]
  ------------------
 1101|    610|			if (len > 0 && cp[len - 1] != '/') {
  ------------------
  |  Branch (1101:8): [True: 305, False: 305]
  |  Branch (1101:19): [True: 44, False: 261]
  ------------------
 1102|     44|				struct archive_string s;
 1103|     44|				archive_string_init(&s);
  ------------------
  |  |   71|     44|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 44]
  |  |  ------------------
  ------------------
 1104|     44|				archive_strcat(&s, cp);
 1105|     44|				archive_strappend_char(&s, '/');
 1106|     44|				archive_entry_set_pathname(entry, s.s);
 1107|     44|				archive_string_free(&s);
 1108|     44|			}
 1109|    610|		}
 1110|  1.75k|	}
 1111|       |
 1112|  35.3k|	if (zip_entry->flags & LA_FROM_CENTRAL_DIRECTORY) {
  ------------------
  |  |  137|  35.3k|#define LA_FROM_CENTRAL_DIRECTORY (1 << 1)
  ------------------
  |  Branch (1112:6): [True: 212, False: 35.1k]
  ------------------
 1113|       |		/* If this came from the central dir, its size info
 1114|       |		 * is definitive, so ignore the length-at-end flag. */
 1115|    212|		zip_entry->zip_flags &= ~ZIP_LENGTH_AT_END;
  ------------------
  |  |  128|    212|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
 1116|       |		/* If local header is missing a value, use the one from
 1117|       |		   the central directory.  If both have it, warn about
 1118|       |		   mismatches. */
 1119|    212|		if (zip_entry->crc32 == 0) {
  ------------------
  |  Branch (1119:7): [True: 57, False: 155]
  ------------------
 1120|     57|			zip_entry->crc32 = zip_entry_central_dir.crc32;
 1121|    155|		} else if (!zip->ignore_crc32
  ------------------
  |  Branch (1121:14): [True: 0, False: 155]
  ------------------
 1122|      0|		    && zip_entry->crc32 != zip_entry_central_dir.crc32) {
  ------------------
  |  Branch (1122:10): [True: 0, False: 0]
  ------------------
 1123|      0|			archive_set_error(&a->archive,
 1124|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1125|      0|			    "Inconsistent CRC32 values");
 1126|      0|			ret = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1127|      0|		}
 1128|    212|		if (zip_entry->compressed_size == 0
  ------------------
  |  Branch (1128:7): [True: 51, False: 161]
  ------------------
 1129|    161|		    || zip_entry->compressed_size == 0xffffffff) {
  ------------------
  |  Branch (1129:10): [True: 11, False: 150]
  ------------------
 1130|     62|			zip_entry->compressed_size
 1131|     62|			    = zip_entry_central_dir.compressed_size;
 1132|    150|		} else if (zip_entry->compressed_size
  ------------------
  |  Branch (1132:14): [True: 26, False: 124]
  ------------------
 1133|    150|		    != zip_entry_central_dir.compressed_size) {
 1134|     26|			archive_set_error(&a->archive,
 1135|     26|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     26|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1136|     26|			    "Inconsistent compressed size: "
 1137|     26|			    "%jd in central directory, %jd in local header",
 1138|     26|			    (intmax_t)zip_entry_central_dir.compressed_size,
 1139|     26|			    (intmax_t)zip_entry->compressed_size);
 1140|     26|			ret = ARCHIVE_WARN;
  ------------------
  |  |  235|     26|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1141|     26|		}
 1142|    212|		if (zip_entry->uncompressed_size == 0 ||
  ------------------
  |  Branch (1142:7): [True: 50, False: 162]
  ------------------
 1143|    162|			zip_entry->uncompressed_size == 0xffffffff) {
  ------------------
  |  Branch (1143:4): [True: 0, False: 162]
  ------------------
 1144|     50|			zip_entry->uncompressed_size
 1145|     50|			    = zip_entry_central_dir.uncompressed_size;
 1146|    162|		} else if (zip_entry->uncompressed_size
  ------------------
  |  Branch (1146:14): [True: 16, False: 146]
  ------------------
 1147|    162|		    != zip_entry_central_dir.uncompressed_size) {
 1148|     16|			archive_set_error(&a->archive,
 1149|     16|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     16|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1150|     16|			    "Inconsistent uncompressed size: "
 1151|     16|			    "%jd in central directory, %jd in local header",
 1152|     16|			    (intmax_t)zip_entry_central_dir.uncompressed_size,
 1153|     16|			    (intmax_t)zip_entry->uncompressed_size);
 1154|     16|			ret = ARCHIVE_WARN;
  ------------------
  |  |  235|     16|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1155|     16|		}
 1156|    212|	}
 1157|       |
 1158|       |	/* Populate some additional entry fields: */
 1159|  35.3k|	archive_entry_set_mode(entry, zip_entry->mode);
 1160|  35.3k|	archive_entry_set_uid(entry, zip_entry->uid);
 1161|  35.3k|	archive_entry_set_gid(entry, zip_entry->gid);
 1162|  35.3k|	archive_entry_set_mtime(entry, zip_entry->mtime, 0);
 1163|  35.3k|	archive_entry_set_ctime(entry, zip_entry->ctime, 0);
 1164|  35.3k|	archive_entry_set_atime(entry, zip_entry->atime, 0);
 1165|       |
 1166|  35.3k|	if ((zip->entry->mode & AE_IFMT) == AE_IFLNK) {
  ------------------
  |  |  215|  35.3k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              	if ((zip->entry->mode & AE_IFMT) == AE_IFLNK) {
  ------------------
  |  |  217|  35.3k|#define AE_IFLNK	((__LA_MODE_T)0120000)
  ------------------
  |  Branch (1166:6): [True: 1.44k, False: 33.9k]
  ------------------
 1167|  1.44k|		size_t linkname_length;
 1168|       |
 1169|  1.44k|		if (zip_entry->compressed_size > 64 * 1024) {
  ------------------
  |  Branch (1169:7): [True: 0, False: 1.44k]
  ------------------
 1170|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1171|      0|			    "Zip file with oversized link entry");
 1172|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1173|      0|		}
 1174|       |
 1175|  1.44k|		linkname_length = (size_t)zip_entry->compressed_size;
 1176|       |
 1177|  1.44k|		archive_entry_set_size(entry, 0);
 1178|       |
 1179|       |		// take into account link compression if any
 1180|  1.44k|		size_t linkname_full_length = linkname_length;
 1181|  1.44k|		if (zip->entry->compression != 0)
  ------------------
  |  Branch (1181:7): [True: 0, False: 1.44k]
  ------------------
 1182|      0|		{
 1183|       |			// symlink target string appeared to be compressed
 1184|      0|			int status = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1185|      0|			const void *uncompressed_buffer = NULL;
 1186|       |
 1187|      0|			switch (zip->entry->compression)
 1188|      0|			{
 1189|      0|#if HAVE_ZLIB_H
 1190|      0|				case 8: /* Deflate compression. */
  ------------------
  |  Branch (1190:5): [True: 0, False: 0]
  ------------------
 1191|      0|					zip->entry_bytes_remaining = zip_entry->compressed_size;
 1192|      0|					status = zip_read_data_deflate(a, &uncompressed_buffer,
 1193|      0|						&linkname_full_length, NULL);
 1194|      0|					break;
 1195|      0|#endif
 1196|      0|#if HAVE_LZMA_H && HAVE_LIBLZMA
 1197|      0|				case 14: /* ZIPx LZMA compression. */
  ------------------
  |  Branch (1197:5): [True: 0, False: 0]
  ------------------
 1198|       |					/*(see zip file format specification, section 4.4.5)*/
 1199|      0|					zip->entry_bytes_remaining = zip_entry->compressed_size;
 1200|      0|					status = zip_read_data_zipx_lzma_alone(a, &uncompressed_buffer,
 1201|      0|						&linkname_full_length, NULL);
 1202|      0|					break;
 1203|      0|#endif
 1204|      0|				default: /* Unsupported compression. */
  ------------------
  |  Branch (1204:5): [True: 0, False: 0]
  ------------------
 1205|      0|					break;
 1206|      0|			}
 1207|      0|			if (status == ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1207:8): [True: 0, False: 0]
  ------------------
 1208|      0|			{
 1209|      0|				p = uncompressed_buffer;
 1210|      0|			}
 1211|      0|			else
 1212|      0|			{
 1213|      0|				archive_set_error(&a->archive,
 1214|      0|					ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1215|      0|					"Unsupported ZIP compression method "
 1216|      0|					"during decompression of link entry (%d: %s)",
 1217|      0|					zip->entry->compression,
 1218|      0|					compression_name(zip->entry->compression));
 1219|      0|				return ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1220|      0|			}
 1221|      0|		}
 1222|  1.44k|		else
 1223|  1.44k|		{
 1224|  1.44k|			p = __archive_read_ahead(a, linkname_length, NULL);
 1225|  1.44k|		}
 1226|       |
 1227|  1.44k|		if (p == NULL) {
  ------------------
  |  Branch (1227:7): [True: 0, False: 1.44k]
  ------------------
 1228|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1229|      0|			    "Truncated Zip file");
 1230|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1231|      0|		}
 1232|       |
 1233|  1.44k|		sconv = zip->sconv;
 1234|  1.44k|		if (sconv == NULL && (zip->entry->zip_flags & ZIP_UTF8_NAME))
  ------------------
  |  |  130|  1.44k|#define ZIP_UTF8_NAME	(1 << 11)
  ------------------
  |  Branch (1234:7): [True: 1.44k, False: 0]
  |  Branch (1234:24): [True: 599, False: 841]
  ------------------
 1235|    599|			sconv = zip->sconv_utf8;
 1236|  1.44k|		if (sconv == NULL)
  ------------------
  |  Branch (1236:7): [True: 841, False: 599]
  ------------------
 1237|    841|			sconv = zip->sconv_default;
 1238|  1.44k|		if (archive_entry_copy_symlink_l(entry, p, linkname_full_length,
  ------------------
  |  |   83|  1.44k|#define archive_entry_copy_symlink_l	_archive_entry_copy_symlink_l
  ------------------
  |  Branch (1238:7): [True: 461, False: 979]
  ------------------
 1239|  1.44k|		    sconv) != 0) {
 1240|    461|			if (errno != ENOMEM && sconv == zip->sconv_utf8 &&
  ------------------
  |  Branch (1240:8): [True: 461, False: 0]
  |  Branch (1240:27): [True: 461, False: 0]
  ------------------
 1241|    461|			    (zip->entry->zip_flags & ZIP_UTF8_NAME))
  ------------------
  |  |  130|    461|#define ZIP_UTF8_NAME	(1 << 11)
  ------------------
  |  Branch (1241:8): [True: 461, False: 0]
  ------------------
 1242|    461|			    archive_entry_copy_symlink_l(entry, p,
  ------------------
  |  |   83|    461|#define archive_entry_copy_symlink_l	_archive_entry_copy_symlink_l
  ------------------
 1243|    461|				linkname_full_length, NULL);
 1244|    461|			if (errno == ENOMEM) {
  ------------------
  |  Branch (1244:8): [True: 0, False: 461]
  ------------------
 1245|      0|				archive_set_error(&a->archive, ENOMEM,
 1246|      0|				    "Can't allocate memory for Symlink");
 1247|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1248|      0|			}
 1249|       |			/*
 1250|       |			 * Since there is no character-set regulation for
 1251|       |			 * symlink name, do not report the conversion error
 1252|       |			 * in an automatic conversion.
 1253|       |			 */
 1254|    461|			if (sconv != zip->sconv_utf8 ||
  ------------------
  |  Branch (1254:8): [True: 0, False: 461]
  ------------------
 1255|    461|			    (zip->entry->zip_flags & ZIP_UTF8_NAME) == 0) {
  ------------------
  |  |  130|    461|#define ZIP_UTF8_NAME	(1 << 11)
  ------------------
  |  Branch (1255:8): [True: 0, False: 461]
  ------------------
 1256|      0|				archive_set_error(&a->archive,
 1257|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1258|      0|				    "Symlink cannot be converted "
 1259|      0|				    "from %s to current locale",
 1260|      0|				    archive_string_conversion_charset_name(
 1261|      0|					sconv));
 1262|      0|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1263|      0|			}
 1264|    461|		}
 1265|  1.44k|		zip_entry->uncompressed_size = zip_entry->compressed_size = 0;
 1266|       |
 1267|  1.44k|		if (__archive_read_consume(a, linkname_length) < 0) {
  ------------------
  |  Branch (1267:7): [True: 0, False: 1.44k]
  ------------------
 1268|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1269|      0|			    "Read error skipping symlink target name");
 1270|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1271|      0|		}
 1272|  33.9k|	} else if (0 == (zip_entry->zip_flags & ZIP_LENGTH_AT_END)
  ------------------
  |  |  128|  33.9k|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (1272:13): [True: 14.1k, False: 19.7k]
  ------------------
 1273|  19.7k|	   || (zip_entry->uncompressed_size > 0
  ------------------
  |  Branch (1273:9): [True: 12.7k, False: 7.01k]
  ------------------
 1274|  26.8k|	       && zip_entry->uncompressed_size != 0xffffffff)) {
  ------------------
  |  Branch (1274:12): [True: 12.7k, False: 7]
  ------------------
 1275|       |		/* Set the size only if it's meaningful. */
 1276|  26.8k|		archive_entry_set_size(entry, zip_entry->uncompressed_size);
 1277|  26.8k|	}
 1278|  35.3k|	zip->entry_bytes_remaining = zip_entry->compressed_size;
 1279|       |
 1280|       |	/* If there's no body, force read_data() to return EOF immediately. */
 1281|  35.3k|	if (0 == (zip_entry->zip_flags & ZIP_LENGTH_AT_END)
  ------------------
  |  |  128|  35.3k|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (1281:6): [True: 14.7k, False: 20.5k]
  ------------------
 1282|  14.7k|	    && zip->entry_bytes_remaining < 1)
  ------------------
  |  Branch (1282:9): [True: 2.50k, False: 12.2k]
  ------------------
 1283|  2.50k|		zip->end_of_entry = 1;
 1284|       |
 1285|       |	/* Set up a more descriptive format name. */
 1286|  35.3k|        archive_string_empty(&zip->format_name);
  ------------------
  |  |  181|  35.3k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 1287|  35.3k|	archive_string_sprintf(&zip->format_name, "ZIP %d.%d (%s)",
 1288|  35.3k|	    version / 10, version % 10,
 1289|  35.3k|	    compression_name(zip->entry->compression));
 1290|  35.3k|	a->archive.archive_format_name = zip->format_name.s;
 1291|       |
 1292|  35.3k|	return (ret);
 1293|  35.3k|}
archive_read_support_format_zip.c:process_extra:
  483|  36.4k|{
  484|  36.4k|	unsigned offset = 0;
  485|  36.4k|	struct zip *zip = (struct zip *)(a->format->data);
  486|       |
  487|  36.4k|	if (extra_length == 0) {
  ------------------
  |  Branch (487:6): [True: 22.2k, False: 14.2k]
  ------------------
  488|  22.2k|		return ARCHIVE_OK;
  ------------------
  |  |  233|  22.2k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  489|  22.2k|	}
  490|       |
  491|  14.2k|	if (extra_length < 4) {
  ------------------
  |  Branch (491:6): [True: 676, False: 13.6k]
  ------------------
  492|    676|		size_t i = 0;
  493|       |		/* Some ZIP files may have trailing 0 bytes. Let's check they
  494|       |		 * are all 0 and ignore them instead of returning an error.
  495|       |		 *
  496|       |		 * This is not technically correct, but some ZIP files look
  497|       |		 * like this and other tools support those files - so let's
  498|       |		 * also  support them.
  499|       |		 */
  500|  1.78k|		for (; i < extra_length; i++) {
  ------------------
  |  Branch (500:10): [True: 1.10k, False: 675]
  ------------------
  501|  1.10k|			if (p[i] != 0) {
  ------------------
  |  Branch (501:8): [True: 1, False: 1.10k]
  ------------------
  502|      1|				archive_set_error(&a->archive,
  503|      1|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  504|      1|				    "Too-small extra data: "
  505|      1|				    "Need at least 4 bytes, "
  506|      1|				    "but only found %d bytes",
  507|      1|				    (int)extra_length);
  508|      1|				return ARCHIVE_FAILED;
  ------------------
  |  |  237|      1|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  509|      1|			}
  510|  1.10k|		}
  511|       |
  512|    675|		return ARCHIVE_OK;
  ------------------
  |  |  233|    675|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  513|    676|	}
  514|       |
  515|  32.1k|	while (offset <= extra_length - 4) {
  ------------------
  |  Branch (515:9): [True: 18.5k, False: 13.5k]
  ------------------
  516|  18.5k|		unsigned short headerid = archive_le16dec(p + offset);
  517|  18.5k|		unsigned short datasize = archive_le16dec(p + offset + 2);
  518|       |
  519|  18.5k|		offset += 4;
  520|  18.5k|		if (offset + datasize > extra_length) {
  ------------------
  |  Branch (520:7): [True: 48, False: 18.4k]
  ------------------
  521|     48|			archive_set_error(&a->archive,
  522|     48|			    ARCHIVE_ERRNO_FILE_FORMAT, "Extra data overflow: "
  ------------------
  |  |  192|     48|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  523|     48|			    "Need %d bytes but only found %d bytes",
  524|     48|			    (int)datasize, (int)(extra_length - offset));
  525|     48|			return ARCHIVE_FAILED;
  ------------------
  |  |  237|     48|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  526|     48|		}
  527|       |#ifdef DEBUG
  528|       |		fprintf(stderr, "Header id 0x%04x, length %d\n",
  529|       |		    headerid, datasize);
  530|       |#endif
  531|  18.4k|		switch (headerid) {
  532|    622|		case 0x0001:
  ------------------
  |  Branch (532:3): [True: 622, False: 17.8k]
  ------------------
  533|       |			/* Zip64 extended information extra field. */
  534|    622|			zip_entry->flags |= LA_USED_ZIP64;
  ------------------
  |  |  136|    622|#define LA_USED_ZIP64	(1 << 0)
  ------------------
  535|    622|			if (zip_entry->uncompressed_size == 0xffffffff) {
  ------------------
  |  Branch (535:8): [True: 151, False: 471]
  ------------------
  536|    151|				uint64_t t = 0;
  537|    151|				if (datasize < 8
  ------------------
  |  Branch (537:9): [True: 0, False: 151]
  ------------------
  538|    151|				    || (t = archive_le64dec(p + offset)) >
  ------------------
  |  Branch (538:12): [True: 0, False: 151]
  ------------------
  539|    151|				    INT64_MAX) {
  540|      0|					archive_set_error(&a->archive,
  541|      0|					    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  542|      0|					    "Malformed 64-bit "
  543|      0|					    "uncompressed size");
  544|      0|					return ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  545|      0|				}
  546|    151|				zip_entry->uncompressed_size = t;
  547|    151|				offset += 8;
  548|    151|				datasize -= 8;
  549|    151|			}
  550|    622|			if (zip_entry->compressed_size == 0xffffffff) {
  ------------------
  |  Branch (550:8): [True: 224, False: 398]
  ------------------
  551|    224|				uint64_t t = 0;
  552|    224|				if (datasize < 8
  ------------------
  |  Branch (552:9): [True: 0, False: 224]
  ------------------
  553|    224|				    || (t = archive_le64dec(p + offset)) >
  ------------------
  |  Branch (553:12): [True: 0, False: 224]
  ------------------
  554|    224|				    INT64_MAX) {
  555|      0|					archive_set_error(&a->archive,
  556|      0|					    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  557|      0|					    "Malformed 64-bit "
  558|      0|					    "compressed size");
  559|      0|					return ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  560|      0|				}
  561|    224|				zip_entry->compressed_size = t;
  562|    224|				offset += 8;
  563|    224|				datasize -= 8;
  564|    224|			}
  565|    622|			if (zip_entry->local_header_offset == 0xffffffff) {
  ------------------
  |  Branch (565:8): [True: 0, False: 622]
  ------------------
  566|      0|				uint64_t t = 0;
  567|      0|				if (datasize < 8
  ------------------
  |  Branch (567:9): [True: 0, False: 0]
  ------------------
  568|      0|				    || (t = archive_le64dec(p + offset)) >
  ------------------
  |  Branch (568:12): [True: 0, False: 0]
  ------------------
  569|      0|				    INT64_MAX) {
  570|      0|					archive_set_error(&a->archive,
  571|      0|					    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  572|      0|					    "Malformed 64-bit "
  573|      0|					    "local header offset");
  574|      0|					return ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  575|      0|				}
  576|      0|				zip_entry->local_header_offset = t;
  577|      0|				offset += 8;
  578|      0|				datasize -= 8;
  579|      0|			}
  580|       |			/* archive_le32dec(p + offset) gives disk
  581|       |			 * on which file starts, but we don't handle
  582|       |			 * multi-volume Zip files. */
  583|    622|			break;
  584|       |#ifdef DEBUG
  585|       |		case 0x0017:
  586|       |		{
  587|       |			/* Strong encryption field. */
  588|       |			if (archive_le16dec(p + offset) == 2) {
  589|       |				unsigned algId =
  590|       |					archive_le16dec(p + offset + 2);
  591|       |				unsigned bitLen =
  592|       |					archive_le16dec(p + offset + 4);
  593|       |				int	 flags =
  594|       |					archive_le16dec(p + offset + 6);
  595|       |				fprintf(stderr, "algId=0x%04x, bitLen=%u, "
  596|       |				    "flgas=%d\n", algId, bitLen,flags);
  597|       |			}
  598|       |			break;
  599|       |		}
  600|       |#endif
  601|  1.90k|		case 0x5455:
  ------------------
  |  Branch (601:3): [True: 1.90k, False: 16.5k]
  ------------------
  602|  1.90k|		{
  603|       |			/* Extended time field "UT". */
  604|  1.90k|			int flags;
  605|  1.90k|			if (datasize == 0) {
  ------------------
  |  Branch (605:8): [True: 0, False: 1.90k]
  ------------------
  606|      0|				archive_set_error(&a->archive,
  607|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  608|      0|				    "Incomplete extended time field");
  609|      0|				return ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  610|      0|			}
  611|  1.90k|			flags = p[offset];
  612|  1.90k|			offset++;
  613|  1.90k|			datasize--;
  614|       |			/* Flag bits indicate which dates are present. */
  615|  1.90k|			if (flags & 0x01)
  ------------------
  |  Branch (615:8): [True: 1.26k, False: 646]
  ------------------
  616|  1.26k|			{
  617|       |#ifdef DEBUG
  618|       |				fprintf(stderr, "mtime: %lld -> %d\n",
  619|       |				    (long long)zip_entry->mtime,
  620|       |				    archive_le32dec(p + offset));
  621|       |#endif
  622|  1.26k|				if (datasize < 4)
  ------------------
  |  Branch (622:9): [True: 0, False: 1.26k]
  ------------------
  623|      0|					break;
  624|  1.26k|				zip_entry->mtime = archive_le32dec(p + offset);
  625|  1.26k|				offset += 4;
  626|  1.26k|				datasize -= 4;
  627|  1.26k|			}
  628|  1.90k|			if (flags & 0x02)
  ------------------
  |  Branch (628:8): [True: 1.14k, False: 760]
  ------------------
  629|  1.14k|			{
  630|  1.14k|				if (datasize < 4)
  ------------------
  |  Branch (630:9): [True: 423, False: 724]
  ------------------
  631|    423|					break;
  632|    724|				zip_entry->atime = archive_le32dec(p + offset);
  633|    724|				offset += 4;
  634|    724|				datasize -= 4;
  635|    724|			}
  636|  1.48k|			if (flags & 0x04)
  ------------------
  |  Branch (636:8): [True: 1.28k, False: 200]
  ------------------
  637|  1.28k|			{
  638|  1.28k|				if (datasize < 4)
  ------------------
  |  Branch (638:9): [True: 244, False: 1.04k]
  ------------------
  639|    244|					break;
  640|  1.04k|				zip_entry->ctime = archive_le32dec(p + offset);
  641|  1.04k|				offset += 4;
  642|  1.04k|				datasize -= 4;
  643|  1.04k|			}
  644|  1.24k|			break;
  645|  1.48k|		}
  646|  1.24k|		case 0x5855:
  ------------------
  |  Branch (646:3): [True: 101, False: 18.3k]
  ------------------
  647|    101|		{
  648|       |			/* Info-ZIP Unix Extra Field (old version) "UX". */
  649|    101|			if (datasize >= 8) {
  ------------------
  |  Branch (649:8): [True: 53, False: 48]
  ------------------
  650|     53|				zip_entry->atime = archive_le32dec(p + offset);
  651|     53|				zip_entry->mtime =
  652|     53|				    archive_le32dec(p + offset + 4);
  653|     53|			}
  654|    101|			if (datasize >= 12) {
  ------------------
  |  Branch (654:8): [True: 49, False: 52]
  ------------------
  655|     49|				zip_entry->uid =
  656|     49|				    archive_le16dec(p + offset + 8);
  657|     49|				zip_entry->gid =
  658|     49|				    archive_le16dec(p + offset + 10);
  659|     49|			}
  660|    101|			break;
  661|  1.48k|		}
  662|  6.83k|		case 0x6c78:
  ------------------
  |  Branch (662:3): [True: 6.83k, False: 11.6k]
  ------------------
  663|  6.83k|		{
  664|       |			/* Experimental 'xl' field */
  665|       |			/*
  666|       |			 * Introduced Dec 2013 to provide a way to
  667|       |			 * include external file attributes (and other
  668|       |			 * fields that ordinarily appear only in
  669|       |			 * central directory) in local file header.
  670|       |			 * This provides file type and permission
  671|       |			 * information necessary to support full
  672|       |			 * streaming extraction.  Currently being
  673|       |			 * discussed with other Zip developers
  674|       |			 * ... subject to change.
  675|       |			 *
  676|       |			 * Format:
  677|       |			 *  The field starts with a bitmap that specifies
  678|       |			 *  which additional fields are included.  The
  679|       |			 *  bitmap is variable length and can be extended in
  680|       |			 *  the future.
  681|       |			 *
  682|       |			 *  n bytes - feature bitmap: first byte has low-order
  683|       |			 *    7 bits.  If high-order bit is set, a subsequent
  684|       |			 *    byte holds the next 7 bits, etc.
  685|       |			 *
  686|       |			 *  if bitmap & 1, 2 byte "version made by"
  687|       |			 *  if bitmap & 2, 2 byte "internal file attributes"
  688|       |			 *  if bitmap & 4, 4 byte "external file attributes"
  689|       |			 *  if bitmap & 8, 2 byte comment length + n byte
  690|       |			 *  comment
  691|       |			 */
  692|  6.83k|			int bitmap, bitmap_last;
  693|       |
  694|  6.83k|			if (datasize < 1)
  ------------------
  |  Branch (694:8): [True: 167, False: 6.66k]
  ------------------
  695|    167|				break;
  696|  6.66k|			bitmap_last = bitmap = 0xff & p[offset];
  697|  6.66k|			offset += 1;
  698|  6.66k|			datasize -= 1;
  699|       |
  700|       |			/* We only support first 7 bits of bitmap; skip rest. */
  701|  29.8k|			while ((bitmap_last & 0x80) != 0
  ------------------
  |  Branch (701:11): [True: 23.9k, False: 5.91k]
  ------------------
  702|  23.9k|			    && datasize >= 1) {
  ------------------
  |  Branch (702:11): [True: 23.2k, False: 748]
  ------------------
  703|  23.2k|				bitmap_last = p[offset];
  704|  23.2k|				offset += 1;
  705|  23.2k|				datasize -= 1;
  706|  23.2k|			}
  707|       |
  708|  6.66k|			if (bitmap & 1) {
  ------------------
  |  Branch (708:8): [True: 5.78k, False: 881]
  ------------------
  709|       |				/* 2 byte "version made by" */
  710|  5.78k|				if (datasize < 2)
  ------------------
  |  Branch (710:9): [True: 752, False: 5.03k]
  ------------------
  711|    752|					break;
  712|  5.03k|				zip_entry->system
  713|  5.03k|				    = archive_le16dec(p + offset) >> 8;
  714|  5.03k|				offset += 2;
  715|  5.03k|				datasize -= 2;
  716|  5.03k|			}
  717|  5.91k|			if (bitmap & 2) {
  ------------------
  |  Branch (717:8): [True: 5.30k, False: 603]
  ------------------
  718|       |				/* 2 byte "internal file attributes" */
  719|  5.30k|				uint32_t internal_attributes;
  720|  5.30k|				if (datasize < 2)
  ------------------
  |  Branch (720:9): [True: 602, False: 4.70k]
  ------------------
  721|    602|					break;
  722|  4.70k|				internal_attributes
  723|  4.70k|				    = archive_le16dec(p + offset);
  724|       |				/* Not used by libarchive at present. */
  725|  4.70k|				(void)internal_attributes; /* UNUSED */
  726|  4.70k|				offset += 2;
  727|  4.70k|				datasize -= 2;
  728|  4.70k|			}
  729|  5.30k|			if (bitmap & 4) {
  ------------------
  |  Branch (729:8): [True: 4.99k, False: 310]
  ------------------
  730|       |				/* 4 byte "external file attributes" */
  731|  4.99k|				uint32_t external_attributes;
  732|  4.99k|				if (datasize < 4)
  ------------------
  |  Branch (732:9): [True: 208, False: 4.79k]
  ------------------
  733|    208|					break;
  734|  4.79k|				external_attributes
  735|  4.79k|				    = archive_le32dec(p + offset);
  736|  4.79k|				if (zip_entry->system == 3) {
  ------------------
  |  Branch (736:9): [True: 2.48k, False: 2.31k]
  ------------------
  737|  2.48k|					zip_entry->mode
  738|  2.48k|					    = external_attributes >> 16;
  739|  2.48k|				} else if (zip_entry->system == 0) {
  ------------------
  |  Branch (739:16): [True: 1.48k, False: 830]
  ------------------
  740|       |					// Interpret MSDOS directory bit
  741|  1.48k|					if (0x10 == (external_attributes &
  ------------------
  |  Branch (741:10): [True: 1.17k, False: 310]
  ------------------
  742|  1.48k|					    0x10)) {
  743|  1.17k|						zip_entry->mode =
  744|  1.17k|						    AE_IFDIR | 0775;
  ------------------
  |  |  221|  1.17k|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  745|  1.17k|					} else {
  746|    310|						zip_entry->mode =
  747|    310|						    AE_IFREG | 0664;
  ------------------
  |  |  216|    310|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
  748|    310|					}
  749|  1.48k|					if (0x01 == (external_attributes &
  ------------------
  |  Branch (749:10): [True: 257, False: 1.22k]
  ------------------
  750|  1.48k|					    0x01)) {
  751|       |						/* Read-only bit;
  752|       |						 * strip write permissions */
  753|    257|						zip_entry->mode &= 0555;
  754|    257|					}
  755|  1.48k|				} else {
  756|    830|					zip_entry->mode = 0;
  757|    830|				}
  758|  4.79k|				offset += 4;
  759|  4.79k|				datasize -= 4;
  760|  4.79k|			}
  761|  5.10k|			if (bitmap & 8) {
  ------------------
  |  Branch (761:8): [True: 4.09k, False: 1.00k]
  ------------------
  762|       |				/* 2 byte comment length + comment */
  763|  4.09k|				uint32_t comment_length;
  764|  4.09k|				if (datasize < 2)
  ------------------
  |  Branch (764:9): [True: 3.27k, False: 824]
  ------------------
  765|  3.27k|					break;
  766|    824|				comment_length
  767|    824|				    = archive_le16dec(p + offset);
  768|    824|				offset += 2;
  769|    824|				datasize -= 2;
  770|       |
  771|    824|				if (datasize < comment_length)
  ------------------
  |  Branch (771:9): [True: 783, False: 41]
  ------------------
  772|    783|					break;
  773|       |				/* Comment is not supported by libarchive */
  774|     41|				offset += comment_length;
  775|     41|				datasize -= comment_length;
  776|     41|			}
  777|  1.04k|			break;
  778|  5.10k|		}
  779|  1.04k|		case 0x7075:
  ------------------
  |  Branch (779:3): [True: 118, False: 18.3k]
  ------------------
  780|    118|		{
  781|       |			/* Info-ZIP Unicode Path Extra Field. */
  782|    118|			if (datasize < 5 || entry == NULL)
  ------------------
  |  Branch (782:8): [True: 82, False: 36]
  |  Branch (782:24): [True: 0, False: 36]
  ------------------
  783|     82|				break;
  784|     36|			offset += 5;
  785|     36|			datasize -= 5;
  786|       |
  787|       |			/* The path name in this field is always encoded
  788|       |			 * in UTF-8. */
  789|     36|			if (zip->sconv_utf8 == NULL) {
  ------------------
  |  Branch (789:8): [True: 0, False: 36]
  ------------------
  790|      0|				zip->sconv_utf8 =
  791|      0|					archive_string_conversion_from_charset(
  792|      0|					&a->archive, "UTF-8", 1);
  793|       |				/* If the converter from UTF-8 is not
  794|       |				 * available, then the path name from the main
  795|       |				 * field will more likely be correct. */
  796|      0|				if (zip->sconv_utf8 == NULL)
  ------------------
  |  Branch (796:9): [True: 0, False: 0]
  ------------------
  797|      0|					break;
  798|      0|			}
  799|       |
  800|       |			/* Make sure the CRC32 of the filename matches. */
  801|     36|			if (!zip->ignore_crc32) {
  ------------------
  |  Branch (801:8): [True: 0, False: 36]
  ------------------
  802|      0|				const char *cp = archive_entry_pathname(entry);
  803|      0|				if (cp) {
  ------------------
  |  Branch (803:9): [True: 0, False: 0]
  ------------------
  804|      0|					unsigned long file_crc =
  805|      0|					    zip->crc32func(0, cp, strlen(cp));
  806|      0|					unsigned long utf_crc =
  807|      0|					    archive_le32dec(p + offset - 4);
  808|      0|					if (file_crc != utf_crc) {
  ------------------
  |  Branch (808:10): [True: 0, False: 0]
  ------------------
  809|       |#ifdef DEBUG
  810|       |						fprintf(stderr,
  811|       |						    "CRC filename mismatch; "
  812|       |						    "CDE is %lx, but UTF8 "
  813|       |						    "is outdated with %lx\n",
  814|       |						    file_crc, utf_crc);
  815|       |#endif
  816|      0|						break;
  817|      0|					}
  818|      0|				}
  819|      0|			}
  820|       |
  821|     36|			if (archive_entry_copy_pathname_l(entry,
  ------------------
  |  |   80|     36|#define archive_entry_copy_pathname_l	_archive_entry_copy_pathname_l
  ------------------
  |  Branch (821:8): [True: 1, False: 35]
  ------------------
  822|     36|			    p + offset, datasize, zip->sconv_utf8) != 0) {
  823|       |				/* Ignore the error, and fallback to the path
  824|       |				 * name from the main field. */
  825|       |#ifdef DEBUG
  826|       |				fprintf(stderr, "Failed to read the ZIP "
  827|       |				    "0x7075 extra field path.\n");
  828|       |#endif
  829|      1|			}
  830|     36|			break;
  831|     36|		}
  832|    340|		case 0x7855:
  ------------------
  |  Branch (832:3): [True: 340, False: 18.1k]
  ------------------
  833|       |			/* Info-ZIP Unix Extra Field (type 2) "Ux". */
  834|       |#ifdef DEBUG
  835|       |			fprintf(stderr, "uid %d gid %d\n",
  836|       |			    archive_le16dec(p + offset),
  837|       |			    archive_le16dec(p + offset + 2));
  838|       |#endif
  839|    340|			if (datasize >= 2)
  ------------------
  |  Branch (839:8): [True: 114, False: 226]
  ------------------
  840|    114|				zip_entry->uid = archive_le16dec(p + offset);
  841|    340|			if (datasize >= 4)
  ------------------
  |  Branch (841:8): [True: 76, False: 264]
  ------------------
  842|     76|				zip_entry->gid =
  843|     76|				    archive_le16dec(p + offset + 2);
  844|    340|			break;
  845|  2.34k|		case 0x7875:
  ------------------
  |  Branch (845:3): [True: 2.34k, False: 16.1k]
  ------------------
  846|  2.34k|		{
  847|       |			/* Info-Zip Unix Extra Field (type 3) "ux". */
  848|  2.34k|			int uidsize = 0, gidsize = 0;
  849|       |
  850|       |			/* TODO: support arbitrary uidsize/gidsize. */
  851|  2.34k|			if (datasize >= 1 && p[offset] == 1) {/* version=1 */
  ------------------
  |  Branch (851:8): [True: 2.29k, False: 57]
  |  Branch (851:25): [True: 2.07k, False: 215]
  ------------------
  852|  2.07k|				if (datasize >= 4) {
  ------------------
  |  Branch (852:9): [True: 1.77k, False: 306]
  ------------------
  853|       |					/* get a uid size. */
  854|  1.77k|					uidsize = 0xff & (int)p[offset+1];
  855|  1.77k|					if (uidsize == 2)
  ------------------
  |  Branch (855:10): [True: 1, False: 1.77k]
  ------------------
  856|      1|						zip_entry->uid =
  857|      1|						    archive_le16dec(
  858|      1|						        p + offset + 2);
  859|  1.77k|					else if (uidsize == 4 && datasize >= 6)
  ------------------
  |  Branch (859:15): [True: 1.35k, False: 412]
  |  Branch (859:31): [True: 1.35k, False: 0]
  ------------------
  860|  1.35k|						zip_entry->uid =
  861|  1.35k|						    archive_le32dec(
  862|  1.35k|						        p + offset + 2);
  863|  1.77k|				}
  864|  2.07k|				if (datasize >= (2 + uidsize + 3)) {
  ------------------
  |  Branch (864:9): [True: 1.59k, False: 487]
  ------------------
  865|       |					/* get a gid size. */
  866|  1.59k|					gidsize = 0xff &
  867|  1.59k|					    (int)p[offset+2+uidsize];
  868|  1.59k|					if (gidsize == 2)
  ------------------
  |  Branch (868:10): [True: 57, False: 1.53k]
  ------------------
  869|     57|						zip_entry->gid =
  870|     57|						    archive_le16dec(
  871|     57|						        p+offset+2+uidsize+1);
  872|  1.53k|					else if (gidsize == 4 &&
  ------------------
  |  Branch (872:15): [True: 1.07k, False: 463]
  ------------------
  873|  1.07k|					    datasize >= (2 + uidsize + 5))
  ------------------
  |  Branch (873:10): [True: 493, False: 577]
  ------------------
  874|    493|						zip_entry->gid =
  875|    493|						    archive_le32dec(
  876|    493|						        p+offset+2+uidsize+1);
  877|  1.59k|				}
  878|  2.07k|			}
  879|  2.34k|			break;
  880|     36|		}
  881|  3.59k|		case 0x9901:
  ------------------
  |  Branch (881:3): [True: 3.59k, False: 14.8k]
  ------------------
  882|       |			/* WinZip AES extra data field. */
  883|  3.59k|			if (datasize < 6) {
  ------------------
  |  Branch (883:8): [True: 0, False: 3.59k]
  ------------------
  884|      0|				archive_set_error(&a->archive,
  885|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  886|      0|				    "Incomplete AES field");
  887|      0|				return ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  888|      0|			}
  889|  3.59k|			if (p[offset + 2] == 'A' && p[offset + 3] == 'E') {
  ------------------
  |  Branch (889:8): [True: 3.55k, False: 47]
  |  Branch (889:32): [True: 3.37k, False: 173]
  ------------------
  890|       |				/* Vendor version. */
  891|  3.37k|				zip_entry->aes_extra.vendor =
  892|  3.37k|				    archive_le16dec(p + offset);
  893|       |				/* AES encryption strength. */
  894|  3.37k|				zip_entry->aes_extra.strength = p[offset + 4];
  895|       |				/* Actual compression method. */
  896|  3.37k|				zip_entry->aes_extra.compression =
  897|  3.37k|				    p[offset + 5];
  898|  3.37k|			}
  899|  3.59k|			break;
  900|  2.63k|		default:
  ------------------
  |  Branch (900:3): [True: 2.63k, False: 15.8k]
  ------------------
  901|  2.63k|			break;
  902|  18.4k|		}
  903|  18.4k|		offset += datasize;
  904|  18.4k|	}
  905|  13.5k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  13.5k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  906|  13.6k|}
archive_read_support_format_zip.c:zip_read_data_deflate:
 2548|  4.12k|{
 2549|  4.12k|	struct zip *zip;
 2550|  4.12k|	ssize_t bytes_avail, to_consume = 0;
 2551|  4.12k|	const void *compressed_buff, *sp;
 2552|  4.12k|	int r;
 2553|       |
 2554|  4.12k|	(void)offset; /* UNUSED */
 2555|       |
 2556|  4.12k|	zip = (struct zip *)(a->format->data);
 2557|       |
 2558|       |	/* If the buffer hasn't been allocated, allocate it now. */
 2559|  4.12k|	if (zip->uncompressed_buffer == NULL) {
  ------------------
  |  Branch (2559:6): [True: 75, False: 4.05k]
  ------------------
 2560|     75|		zip->uncompressed_buffer_size = 256 * 1024;
 2561|     75|		zip->uncompressed_buffer
 2562|     75|		    = malloc(zip->uncompressed_buffer_size);
 2563|     75|		if (zip->uncompressed_buffer == NULL) {
  ------------------
  |  Branch (2563:7): [True: 0, False: 75]
  ------------------
 2564|      0|			archive_set_error(&a->archive, ENOMEM,
 2565|      0|			    "No memory for ZIP decompression");
 2566|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2567|      0|		}
 2568|     75|	}
 2569|       |
 2570|  4.12k|	r = zip_deflate_init(a, zip);
 2571|  4.12k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  4.12k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2571:6): [True: 0, False: 4.12k]
  ------------------
 2572|      0|		return (r);
 2573|       |
 2574|       |	/*
 2575|       |	 * Note: '1' here is a performance optimization.
 2576|       |	 * Recall that the decompression layer returns a count of
 2577|       |	 * available bytes; asking for more than that forces the
 2578|       |	 * decompressor to combine reads by copying data.
 2579|       |	 */
 2580|  4.12k|	compressed_buff = sp = __archive_read_ahead(a, 1, &bytes_avail);
 2581|  4.12k|	if (0 == (zip->entry->zip_flags & ZIP_LENGTH_AT_END)
  ------------------
  |  |  128|  4.12k|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (2581:6): [True: 1.05k, False: 3.07k]
  ------------------
 2582|  1.05k|	    && bytes_avail > zip->entry_bytes_remaining) {
  ------------------
  |  Branch (2582:9): [True: 302, False: 757]
  ------------------
 2583|    302|		bytes_avail = (ssize_t)zip->entry_bytes_remaining;
 2584|    302|	}
 2585|  4.12k|	if (bytes_avail < 0) {
  ------------------
  |  Branch (2585:6): [True: 0, False: 4.12k]
  ------------------
 2586|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2587|      0|		    "Truncated ZIP file body");
 2588|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2589|      0|	}
 2590|       |
 2591|  4.12k|	if (zip->tctx_valid || zip->cctx_valid) {
  ------------------
  |  Branch (2591:6): [True: 386, False: 3.74k]
  |  Branch (2591:25): [True: 2.16k, False: 1.57k]
  ------------------
 2592|  2.55k|		if (zip->decrypted_bytes_remaining < (size_t)bytes_avail) {
  ------------------
  |  Branch (2592:7): [True: 2.55k, False: 0]
  ------------------
 2593|  2.55k|			size_t buff_remaining =
 2594|  2.55k|			    (zip->decrypted_buffer +
 2595|  2.55k|			    zip->decrypted_buffer_size)
 2596|  2.55k|			    - (zip->decrypted_ptr +
 2597|  2.55k|			    zip->decrypted_bytes_remaining);
 2598|       |
 2599|  2.55k|			if (buff_remaining > (size_t)bytes_avail)
  ------------------
  |  Branch (2599:8): [True: 2.44k, False: 109]
  ------------------
 2600|  2.44k|				buff_remaining = (size_t)bytes_avail;
 2601|       |
 2602|  2.55k|			if (0 == (zip->entry->zip_flags & ZIP_LENGTH_AT_END) &&
  ------------------
  |  |  128|  2.55k|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (2602:8): [True: 502, False: 2.05k]
  ------------------
 2603|    502|			      zip->entry_bytes_remaining > 0) {
  ------------------
  |  Branch (2603:10): [True: 502, False: 0]
  ------------------
 2604|    502|				if ((int64_t)(zip->decrypted_bytes_remaining
  ------------------
  |  Branch (2604:9): [True: 0, False: 502]
  ------------------
 2605|    502|				    + buff_remaining)
 2606|    502|				      > zip->entry_bytes_remaining) {
 2607|      0|					if (zip->entry_bytes_remaining <
  ------------------
  |  Branch (2607:10): [True: 0, False: 0]
  ------------------
 2608|      0|					    (int64_t)zip->decrypted_bytes_remaining)
 2609|      0|						buff_remaining = 0;
 2610|      0|					else
 2611|      0|						buff_remaining =
 2612|      0|						    (size_t)zip->entry_bytes_remaining
 2613|      0|						    - zip->decrypted_bytes_remaining;
 2614|      0|				}
 2615|    502|			}
 2616|  2.55k|			if (buff_remaining > 0) {
  ------------------
  |  Branch (2616:8): [True: 2.55k, False: 0]
  ------------------
 2617|  2.55k|				if (zip->tctx_valid) {
  ------------------
  |  Branch (2617:9): [True: 386, False: 2.16k]
  ------------------
 2618|    386|					trad_enc_decrypt_update(&zip->tctx,
 2619|    386|					    compressed_buff, buff_remaining,
 2620|    386|					    zip->decrypted_ptr
 2621|    386|					      + zip->decrypted_bytes_remaining,
 2622|    386|					    buff_remaining);
 2623|  2.16k|				} else {
 2624|  2.16k|					size_t dsize = buff_remaining;
 2625|  2.16k|					archive_decrypto_aes_ctr_update(
  ------------------
  |  |  164|  2.16k|  __archive_cryptor.decrypto_aes_ctr_update(ctx, in, in_len, out, out_len)
  ------------------
 2626|  2.16k|					    &zip->cctx,
 2627|  2.16k|					    compressed_buff, buff_remaining,
 2628|  2.16k|					    zip->decrypted_ptr
 2629|  2.16k|					      + zip->decrypted_bytes_remaining,
 2630|  2.16k|					    &dsize);
 2631|  2.16k|				}
 2632|  2.55k|				zip->decrypted_bytes_remaining +=
 2633|  2.55k|				    buff_remaining;
 2634|  2.55k|			}
 2635|  2.55k|		}
 2636|  2.55k|		bytes_avail = zip->decrypted_bytes_remaining;
 2637|  2.55k|		compressed_buff = (const char *)zip->decrypted_ptr;
 2638|  2.55k|	}
 2639|       |
 2640|       |	/*
 2641|       |	 * A bug in zlib.h: stream.next_in should be marked 'const'
 2642|       |	 * but isn't (the library never alters data through the
 2643|       |	 * next_in pointer, only reads it).  The result: this ugly
 2644|       |	 * cast to remove 'const'.
 2645|       |	 */
 2646|  4.12k|	zip->stream.next_in = (Bytef *)(uintptr_t)(const void *)compressed_buff;
 2647|  4.12k|	zip->stream.avail_in = (uInt)bytes_avail;
 2648|  4.12k|	zip->stream.total_in = 0;
 2649|  4.12k|	zip->stream.next_out = zip->uncompressed_buffer;
 2650|  4.12k|	zip->stream.avail_out = (uInt)zip->uncompressed_buffer_size;
 2651|  4.12k|	zip->stream.total_out = 0;
 2652|       |
 2653|  4.12k|	r = inflate(&zip->stream, 0);
 2654|  4.12k|	switch (r) {
 2655|    125|	case Z_OK:
  ------------------
  |  Branch (2655:2): [True: 125, False: 4.00k]
  ------------------
 2656|    125|		break;
 2657|  3.99k|	case Z_STREAM_END:
  ------------------
  |  Branch (2657:2): [True: 3.99k, False: 132]
  ------------------
 2658|  3.99k|		zip->end_of_entry = 1;
 2659|  3.99k|		break;
 2660|      0|	case Z_MEM_ERROR:
  ------------------
  |  Branch (2660:2): [True: 0, False: 4.12k]
  ------------------
 2661|      0|		archive_set_error(&a->archive, ENOMEM,
 2662|      0|		    "Out of memory for ZIP decompression");
 2663|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2664|      7|	default:
  ------------------
  |  Branch (2664:2): [True: 7, False: 4.12k]
  ------------------
 2665|      7|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      7|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2666|      7|		    "ZIP decompression failed (%d)", r);
 2667|      7|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      7|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2668|  4.12k|	}
 2669|       |
 2670|       |	/* Consume as much as the compressor actually used. */
 2671|  4.12k|	to_consume = zip->stream.total_in;
 2672|  4.12k|	__archive_read_consume(a, to_consume);
 2673|  4.12k|	zip->entry_bytes_remaining -= to_consume;
 2674|  4.12k|	zip->entry_compressed_bytes_read += to_consume;
 2675|  4.12k|	zip->entry_uncompressed_bytes_read += zip->stream.total_out;
 2676|       |
 2677|  4.12k|	if (zip->tctx_valid || zip->cctx_valid) {
  ------------------
  |  Branch (2677:6): [True: 386, False: 3.73k]
  |  Branch (2677:25): [True: 2.16k, False: 1.56k]
  ------------------
 2678|  2.55k|		zip->decrypted_bytes_remaining -= to_consume;
 2679|  2.55k|		if (zip->decrypted_bytes_remaining == 0)
  ------------------
  |  Branch (2679:7): [True: 109, False: 2.44k]
  ------------------
 2680|    109|			zip->decrypted_ptr = zip->decrypted_buffer;
 2681|  2.44k|		else
 2682|  2.44k|			zip->decrypted_ptr += to_consume;
 2683|  2.55k|	}
 2684|  4.12k|	if (zip->hctx_valid)
  ------------------
  |  Branch (2684:6): [True: 2.16k, False: 1.95k]
  ------------------
 2685|  2.16k|		archive_hmac_sha1_update(&zip->hctx, sp, to_consume);
  ------------------
  |  |  101|  2.16k|	__archive_hmac.__hmac_sha1_update(ctx, data, data_len)
  ------------------
 2686|       |
 2687|  4.12k|	if (zip->end_of_entry) {
  ------------------
  |  Branch (2687:6): [True: 3.99k, False: 125]
  ------------------
 2688|  3.99k|		if (zip->hctx_valid) {
  ------------------
  |  Branch (2688:7): [True: 2.16k, False: 1.82k]
  ------------------
 2689|  2.16k|			r = check_authentication_code(a, NULL);
 2690|  2.16k|			if (r != ARCHIVE_OK) {
  ------------------
  |  |  233|  2.16k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2690:8): [True: 875, False: 1.29k]
  ------------------
 2691|    875|				return (r);
 2692|    875|			}
 2693|  2.16k|		}
 2694|  3.99k|	}
 2695|       |
 2696|  3.24k|	*size = zip->stream.total_out;
 2697|  3.24k|	*buff = zip->uncompressed_buffer;
 2698|       |
 2699|  3.24k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  3.24k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2700|  4.12k|}
archive_read_support_format_zip.c:zip_deflate_init:
 2522|  4.12k|{
 2523|  4.12k|	int r;
 2524|       |
 2525|       |	/* If we haven't yet read any data, initialize the decompressor. */
 2526|  4.12k|	if (!zip->decompress_init) {
  ------------------
  |  Branch (2526:6): [True: 4.00k, False: 125]
  ------------------
 2527|  4.00k|		if (zip->stream_valid)
  ------------------
  |  Branch (2527:7): [True: 3.89k, False: 105]
  ------------------
 2528|  3.89k|			r = inflateReset(&zip->stream);
 2529|    105|		else
 2530|    105|			r = inflateInit2(&zip->stream,
 2531|  4.00k|			    -15 /* Don't check for zlib header */);
 2532|  4.00k|		if (r != Z_OK) {
  ------------------
  |  Branch (2532:7): [True: 0, False: 4.00k]
  ------------------
 2533|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2534|      0|			    "Can't initialize ZIP decompression");
 2535|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2536|      0|		}
 2537|       |		/* Stream structure has been set up. */
 2538|  4.00k|		zip->stream_valid = 1;
 2539|       |		/* We've initialized decompression for this stream. */
 2540|  4.00k|		zip->decompress_init = 1;
 2541|  4.00k|	}
 2542|  4.12k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  4.12k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2543|  4.12k|}
archive_read_support_format_zip.c:trad_enc_decrypt_update:
  331|  3.32k|{
  332|  3.32k|	unsigned i, max;
  333|       |
  334|  3.32k|	max = (unsigned)((in_len < out_len)? in_len: out_len);
  ------------------
  |  Branch (334:19): [True: 0, False: 3.32k]
  ------------------
  335|       |
  336|  4.41M|	for (i = 0; i < max; i++) {
  ------------------
  |  Branch (336:14): [True: 4.41M, False: 3.32k]
  ------------------
  337|  4.41M|		uint8_t t = in[i] ^ trad_enc_decrypt_byte(ctx);
  338|  4.41M|		out[i] = t;
  339|  4.41M|		trad_enc_update_keys(ctx, t);
  340|  4.41M|	}
  341|  3.32k|}
archive_read_support_format_zip.c:trad_enc_decrypt_byte:
  323|  4.41M|{
  324|  4.41M|	unsigned temp = ctx->keys[2] | 2;
  325|  4.41M|	return (uint8_t)((temp * (temp ^ 1)) >> 8) & 0xff;
  326|  4.41M|}
archive_read_support_format_zip.c:trad_enc_update_keys:
  310|  4.42M|{
  311|  4.42M|	uint8_t t;
  312|  4.42M|#define CRC32(c, b) (crc32(c ^ 0xffffffffUL, &b, 1) ^ 0xffffffffUL)
  313|       |
  314|  4.42M|	ctx->keys[0] = CRC32(ctx->keys[0], c);
  ------------------
  |  |  312|  4.42M|#define CRC32(c, b) (crc32(c ^ 0xffffffffUL, &b, 1) ^ 0xffffffffUL)
  ------------------
  315|  4.42M|	ctx->keys[1] = (ctx->keys[1] + (ctx->keys[0] & 0xff)) * 134775813L + 1;
  316|  4.42M|	t = (ctx->keys[1] >> 24) & 0xff;
  317|  4.42M|	ctx->keys[2] = CRC32(ctx->keys[2], t);
  ------------------
  |  |  312|  4.42M|#define CRC32(c, b) (crc32(c ^ 0xffffffffUL, &b, 1) ^ 0xffffffffUL)
  ------------------
  318|  4.42M|#undef CRC32
  319|  4.42M|}
archive_read_support_format_zip.c:check_authentication_code:
 1297|  2.89k|{
 1298|  2.89k|	struct zip *zip = (struct zip *)(a->format->data);
 1299|       |
 1300|       |	/* Check authentication code. */
 1301|  2.89k|	if (zip->hctx_valid) {
  ------------------
  |  Branch (1301:6): [True: 2.89k, False: 0]
  ------------------
 1302|  2.89k|		const void *p;
 1303|  2.89k|		uint8_t hmac[20];
 1304|  2.89k|		size_t hmac_len = 20;
 1305|  2.89k|		int cmp;
 1306|       |
 1307|  2.89k|		archive_hmac_sha1_final(&zip->hctx, hmac, &hmac_len);
  ------------------
  |  |  103|  2.89k|  	__archive_hmac.__hmac_sha1_final(ctx, out, out_len)
  ------------------
 1308|  2.89k|		if (_p == NULL) {
  ------------------
  |  Branch (1308:7): [True: 2.36k, False: 531]
  ------------------
 1309|       |			/* Read authentication code. */
 1310|  2.36k|			p = __archive_read_ahead(a, AUTH_CODE_SIZE, NULL);
  ------------------
  |  |  146|  2.36k|#define AUTH_CODE_SIZE	10
  ------------------
 1311|  2.36k|			if (p == NULL) {
  ------------------
  |  Branch (1311:8): [True: 0, False: 2.36k]
  ------------------
 1312|      0|				archive_set_error(&a->archive,
 1313|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1314|      0|				    "Truncated ZIP file data");
 1315|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1316|      0|			}
 1317|  2.36k|		} else {
 1318|    531|			p = _p;
 1319|    531|		}
 1320|  2.89k|		cmp = memcmp(hmac, p, AUTH_CODE_SIZE);
  ------------------
  |  |  146|  2.89k|#define AUTH_CODE_SIZE	10
  ------------------
 1321|  2.89k|		__archive_read_consume(a, AUTH_CODE_SIZE);
  ------------------
  |  |  146|  2.89k|#define AUTH_CODE_SIZE	10
  ------------------
 1322|  2.89k|		if (cmp != 0) {
  ------------------
  |  Branch (1322:7): [True: 1.53k, False: 1.35k]
  ------------------
 1323|  1.53k|			archive_set_error(&a->archive,
 1324|  1.53k|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|  1.53k|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1325|  1.53k|			    "ZIP bad Authentication code");
 1326|  1.53k|			return (ARCHIVE_WARN);
  ------------------
  |  |  235|  1.53k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1327|  1.53k|		}
 1328|  2.89k|	}
 1329|  1.35k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.35k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1330|  2.89k|}
archive_read_support_format_zip.c:zip_read_data_zipx_lzma_alone:
 1973|    482|{
 1974|    482|	struct zip* zip = (struct zip *)(a->format->data);
 1975|    482|	int ret;
 1976|    482|	lzma_ret lz_ret;
 1977|    482|	const void* compressed_buf;
 1978|    482|	ssize_t bytes_avail, in_bytes, to_consume;
 1979|       |
 1980|    482|	(void) offset; /* UNUSED */
 1981|       |
 1982|       |	/* Initialize decompressor if not yet initialized. */
 1983|    482|	if (!zip->decompress_init) {
  ------------------
  |  Branch (1983:6): [True: 419, False: 63]
  ------------------
 1984|    419|		ret = zipx_lzma_alone_init(a, zip);
 1985|    419|		if (ret != ARCHIVE_OK)
  ------------------
  |  |  233|    419|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1985:7): [True: 1, False: 418]
  ------------------
 1986|      1|			return (ret);
 1987|    419|	}
 1988|       |
 1989|       |	/* Fetch more compressed data. The same note as in deflate handler
 1990|       |	 * applies here as well:
 1991|       |	 *
 1992|       |	 * Note: '1' here is a performance optimization. Recall that the
 1993|       |	 * decompression layer returns a count of available bytes; asking for
 1994|       |	 * more than that forces the decompressor to combine reads by copying
 1995|       |	 * data.
 1996|       |	 */
 1997|    481|	compressed_buf = __archive_read_ahead(a, 1, &bytes_avail);
 1998|    481|	if (bytes_avail < 0) {
  ------------------
  |  Branch (1998:6): [True: 0, False: 481]
  ------------------
 1999|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2000|      0|		    "Truncated lzma file body");
 2001|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2002|      0|	}
 2003|       |
 2004|       |	/* Set decompressor parameters. */
 2005|    481|	in_bytes = (ssize_t)zipmin(zip->entry_bytes_remaining, bytes_avail);
  ------------------
  |  |  262|    481|#define	zipmin(a,b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (262:22): [True: 410, False: 71]
  |  |  ------------------
  ------------------
 2006|       |
 2007|    481|	zip->zipx_lzma_stream.next_in = compressed_buf;
 2008|    481|	zip->zipx_lzma_stream.avail_in = in_bytes;
 2009|    481|	zip->zipx_lzma_stream.total_in = 0;
 2010|    481|	zip->zipx_lzma_stream.next_out = zip->uncompressed_buffer;
 2011|    481|	zip->zipx_lzma_stream.avail_out =
 2012|       |		/* These lzma_alone streams lack end of stream marker, so let's
 2013|       |		 * make sure the unpacker won't try to unpack more than it's
 2014|       |		 * supposed to. */
 2015|    481|		(size_t)zipmin((int64_t) zip->uncompressed_buffer_size,
  ------------------
  |  |  262|    481|#define	zipmin(a,b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (262:22): [True: 210, False: 271]
  |  |  ------------------
  ------------------
 2016|    481|		    zip->entry->uncompressed_size -
 2017|    481|		    zip->entry_uncompressed_bytes_read);
 2018|    481|	zip->zipx_lzma_stream.total_out = 0;
 2019|       |
 2020|       |	/* Perform the decompression. */
 2021|    481|	lz_ret = lzma_code(&zip->zipx_lzma_stream, LZMA_RUN);
 2022|    481|	switch(lz_ret) {
 2023|      0|		case LZMA_DATA_ERROR:
  ------------------
  |  Branch (2023:3): [True: 0, False: 481]
  ------------------
 2024|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2025|      0|			    "lzma data error (%d)", (int) lz_ret);
 2026|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2027|       |
 2028|       |		/* This case is optional in lzma alone format. It can happen,
 2029|       |		 * but most of the files don't have it. (GitHub #1257) */
 2030|    188|		case LZMA_STREAM_END:
  ------------------
  |  Branch (2030:3): [True: 188, False: 293]
  ------------------
 2031|    188|			if((int64_t) zip->zipx_lzma_stream.total_in !=
  ------------------
  |  Branch (2031:7): [True: 0, False: 188]
  ------------------
 2032|    188|			    zip->entry_bytes_remaining)
 2033|      0|			{
 2034|      0|				archive_set_error(&a->archive,
 2035|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2036|      0|				    "lzma alone premature end of stream");
 2037|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2038|      0|			}
 2039|       |
 2040|    188|			zip->end_of_entry = 1;
 2041|    188|			break;
 2042|       |
 2043|    285|		case LZMA_OK:
  ------------------
  |  Branch (2043:3): [True: 285, False: 196]
  ------------------
 2044|    285|			break;
 2045|       |
 2046|      8|		default:
  ------------------
  |  Branch (2046:3): [True: 8, False: 473]
  ------------------
 2047|      8|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      8|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2048|      8|			    "lzma unknown error (%d)", (int) lz_ret);
 2049|      8|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      8|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2050|    481|	}
 2051|       |
 2052|    473|	to_consume = (ssize_t)zip->zipx_lzma_stream.total_in;
 2053|       |
 2054|       |	/* Update pointers. */
 2055|    473|	__archive_read_consume(a, to_consume);
 2056|    473|	zip->entry_bytes_remaining -= to_consume;
 2057|    473|	zip->entry_compressed_bytes_read += to_consume;
 2058|    473|	zip->entry_uncompressed_bytes_read += zip->zipx_lzma_stream.total_out;
 2059|       |
 2060|    473|	if(zip->entry_bytes_remaining == 0) {
  ------------------
  |  Branch (2060:5): [True: 410, False: 63]
  ------------------
 2061|    410|		zip->end_of_entry = 1;
 2062|    410|	}
 2063|       |
 2064|       |	/* Free lzma decoder handle because we'll no longer need it. */
 2065|       |	/* This cannot be folded into LZMA_STREAM_END handling above
 2066|       |	 * because the stream end marker is not required in this format. */
 2067|    473|	if(zip->end_of_entry) {
  ------------------
  |  Branch (2067:5): [True: 410, False: 63]
  ------------------
 2068|    410|		lzma_end(&zip->zipx_lzma_stream);
 2069|    410|		zip->zipx_lzma_valid = 0;
 2070|    410|	}
 2071|       |
 2072|       |	/* Return values. */
 2073|    473|	*size = (size_t)zip->zipx_lzma_stream.total_out;
 2074|    473|	*buff = zip->uncompressed_buffer;
 2075|       |
 2076|       |	/* If we're here, then we're good! */
 2077|    473|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    473|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2078|    481|}
archive_read_support_format_zip.c:zipx_lzma_alone_init:
 1753|    419|{
 1754|    419|	lzma_ret r;
 1755|    419|	const uint8_t* p;
 1756|       |
 1757|    419|#pragma pack(push)
 1758|    419|#pragma pack(1)
 1759|    419|	struct _alone_header {
 1760|    419|	    uint8_t bytes[5];
 1761|    419|	    uint64_t uncompressed_size;
 1762|    419|	} alone_header;
 1763|    419|#pragma pack(pop)
 1764|       |
 1765|    419|	if(zip->zipx_lzma_valid) {
  ------------------
  |  Branch (1765:5): [True: 0, False: 419]
  ------------------
 1766|      0|		lzma_end(&zip->zipx_lzma_stream);
 1767|      0|		zip->zipx_lzma_valid = 0;
 1768|      0|	}
 1769|       |
 1770|       |	/* To unpack ZIPX's "LZMA" (id 14) stream we can use standard liblzma
 1771|       |	 * that is a part of XZ Utils. The stream format stored inside ZIPX
 1772|       |	 * file is a modified "lzma alone" file format, that was used by the
 1773|       |	 * `lzma` utility which was later deprecated in favour of `xz` utility.
 1774|       | 	 * Since those formats are nearly the same, we can use a standard
 1775|       |	 * "lzma alone" decoder from XZ Utils. */
 1776|       |
 1777|    419|	memset(&zip->zipx_lzma_stream, 0, sizeof(zip->zipx_lzma_stream));
 1778|    419|	r = lzma_alone_decoder(&zip->zipx_lzma_stream, 576 * ((uint64_t)1 << 20));
 1779|    419|	if (r != LZMA_OK) {
  ------------------
  |  Branch (1779:6): [True: 0, False: 419]
  ------------------
 1780|      0|		archive_set_error(&(a->archive), ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1781|      0|		    "lzma initialization failed (%d)", r);
 1782|       |
 1783|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1784|      0|	}
 1785|       |
 1786|       |	/* Flag the cleanup function that we want our lzma-related structures
 1787|       |	 * to be freed later. */
 1788|    419|	zip->zipx_lzma_valid = 1;
 1789|       |
 1790|       |	/* The "lzma alone" file format and the stream format inside ZIPx are
 1791|       |	 * almost the same. Here's an example of a structure of "lzma alone"
 1792|       |	 * format:
 1793|       |	 *
 1794|       |	 * $ cat /bin/ls | lzma | xxd | head -n 1
 1795|       |	 * 00000000: 5d00 0080 00ff ffff ffff ffff ff00 2814
 1796|       |	 *
 1797|       |	 *    5 bytes        8 bytes        n bytes
 1798|       |	 * <lzma_params><uncompressed_size><data...>
 1799|       |	 *
 1800|       |	 * lzma_params is a 5-byte blob that has to be decoded to extract
 1801|       |	 * parameters of this LZMA stream. The uncompressed_size field is an
 1802|       |	 * uint64_t value that contains information about the size of the
 1803|       |	 * uncompressed file, or UINT64_MAX if this value is unknown.
 1804|       |	 * The <data...> part is the actual lzma-compressed data stream.
 1805|       |	 *
 1806|       |	 * Now here's the structure of the stream inside the ZIPX file:
 1807|       |	 *
 1808|       |	 * $ cat stream_inside_zipx | xxd | head -n 1
 1809|       |	 * 00000000: 0914 0500 5d00 8000 0000 2814 .... ....
 1810|       |	 *
 1811|       |	 *  2byte   2byte    5 bytes     n bytes
 1812|       |	 * <magic1><magic2><lzma_params><data...>
 1813|       |	 *
 1814|       |	 * This means that the ZIPX file contains an additional magic1 and
 1815|       |	 * magic2 headers, the lzma_params field contains the same parameter
 1816|       |	 * set as in the "lzma alone" format, and the <data...> field is the
 1817|       |	 * same as in the "lzma alone" format as well. Note that also the zipx
 1818|       |	 * format is missing the uncompressed_size field.
 1819|       |	 *
 1820|       |	 * So, in order to use the "lzma alone" decoder for the zipx lzma
 1821|       |	 * stream, we simply need to shuffle around some fields, prepare a new
 1822|       |	 * lzma alone header, feed it into lzma alone decoder so it will
 1823|       |	 * initialize itself properly, and then we can start feeding normal
 1824|       |	 * zipx lzma stream into the decoder.
 1825|       |	 */
 1826|       |
 1827|       |	/* Read magic1,magic2,lzma_params from the ZIPX stream. */
 1828|    419|	if(zip->entry_bytes_remaining < 9 || (p = __archive_read_ahead(a, 9, NULL)) == NULL) {
  ------------------
  |  Branch (1828:5): [True: 1, False: 418]
  |  Branch (1828:39): [True: 0, False: 418]
  ------------------
 1829|      1|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1830|      1|		    "Truncated lzma data");
 1831|      1|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1832|      1|	}
 1833|       |
 1834|    418|	if(p[2] != 0x05 || p[3] != 0x00) {
  ------------------
  |  Branch (1834:5): [True: 0, False: 418]
  |  Branch (1834:21): [True: 0, False: 418]
  ------------------
 1835|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1836|      0|		    "Invalid lzma data");
 1837|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1838|      0|	}
 1839|       |
 1840|       |	/* Prepare an lzma alone header: copy the lzma_params blob into
 1841|       |	 * a proper place into the lzma alone header. */
 1842|    418|	memcpy(&alone_header.bytes[0], p + 4, 5);
 1843|       |
 1844|       |	/* Initialize the 'uncompressed size' field to unknown; we'll manually
 1845|       |	 * monitor how many bytes there are still to be uncompressed. */
 1846|    418|	alone_header.uncompressed_size = UINT64_MAX;
 1847|       |
 1848|    418|	if(!zip->uncompressed_buffer) {
  ------------------
  |  Branch (1848:5): [True: 15, False: 403]
  ------------------
 1849|     15|		zip->uncompressed_buffer_size = 256 * 1024;
 1850|     15|		zip->uncompressed_buffer = malloc(zip->uncompressed_buffer_size);
 1851|       |
 1852|     15|		if (zip->uncompressed_buffer == NULL) {
  ------------------
  |  Branch (1852:7): [True: 0, False: 15]
  ------------------
 1853|      0|			archive_set_error(&a->archive, ENOMEM,
 1854|      0|			    "No memory for lzma decompression");
 1855|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1856|      0|		}
 1857|     15|	}
 1858|       |
 1859|    418|	zip->zipx_lzma_stream.next_in = (void*) &alone_header;
 1860|    418|	zip->zipx_lzma_stream.avail_in = sizeof(alone_header);
 1861|    418|	zip->zipx_lzma_stream.total_in = 0;
 1862|    418|	zip->zipx_lzma_stream.next_out = zip->uncompressed_buffer;
 1863|    418|	zip->zipx_lzma_stream.avail_out = zip->uncompressed_buffer_size;
 1864|    418|	zip->zipx_lzma_stream.total_out = 0;
 1865|       |
 1866|       |	/* Feed only the header into the lzma alone decoder. This will
 1867|       |	 * effectively initialize the decoder, and will not produce any
 1868|       |	 * output bytes yet. */
 1869|    418|	r = lzma_code(&zip->zipx_lzma_stream, LZMA_RUN);
 1870|    418|	if (r != LZMA_OK) {
  ------------------
  |  Branch (1870:6): [True: 0, False: 418]
  ------------------
 1871|      0|		if (r == LZMA_MEMLIMIT_ERROR)
  ------------------
  |  Branch (1871:7): [True: 0, False: 0]
  ------------------
 1872|      0|			archive_set_error(&a->archive, ENOMEM,
 1873|      0|			    "lzma stream requires too much memory");
 1874|      0|		else
 1875|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1876|      0|			    "lzma stream initialization error");
 1877|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1878|      0|	}
 1879|       |
 1880|       |	/* We've already consumed some bytes, so take this into account. */
 1881|    418|	__archive_read_consume(a, 9);
 1882|    418|	zip->entry_bytes_remaining -= 9;
 1883|    418|	zip->entry_compressed_bytes_read += 9;
 1884|       |
 1885|    418|	zip->decompress_init = 1;
 1886|    418|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    418|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1887|    418|}
archive_read_support_format_zip.c:compression_name:
  462|  40.0k|{
  463|  40.0k|	static const int num_compression_methods =
  464|  40.0k|		sizeof(compression_methods)/sizeof(compression_methods[0]);
  465|  40.0k|	int i=0;
  466|       |
  467|   727k|	while(compression >= 0 && i < num_compression_methods) {
  ------------------
  |  Branch (467:8): [True: 727k, False: 0]
  |  Branch (467:28): [True: 724k, False: 2.40k]
  ------------------
  468|   724k|		if (compression_methods[i].id == compression)
  ------------------
  |  Branch (468:7): [True: 37.6k, False: 687k]
  ------------------
  469|  37.6k|			return compression_methods[i].name;
  470|   687k|		i++;
  471|   687k|	}
  472|  2.40k|	return "??";
  473|  40.0k|}
archive_read_support_format_zip.c:archive_read_format_zip_read_data:
 3084|  40.5k|{
 3085|  40.5k|	int r;
 3086|  40.5k|	struct zip *zip = (struct zip *)(a->format->data);
 3087|       |
 3088|  40.5k|	if (zip->has_encrypted_entries ==
  ------------------
  |  Branch (3088:6): [True: 0, False: 40.5k]
  ------------------
 3089|  40.5k|			ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW) {
  ------------------
  |  |  411|  40.5k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
 3090|      0|		zip->has_encrypted_entries = 0;
 3091|      0|	}
 3092|       |
 3093|  40.5k|	*offset = zip->entry_uncompressed_bytes_read;
 3094|  40.5k|	*size = 0;
 3095|  40.5k|	*buff = NULL;
 3096|       |
 3097|       |	/* If we hit end-of-entry last time, return ARCHIVE_EOF. */
 3098|  40.5k|	if (zip->end_of_entry)
  ------------------
  |  Branch (3098:6): [True: 4.23k, False: 36.2k]
  ------------------
 3099|  4.23k|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|  4.23k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3100|       |
 3101|       |	/* Return EOF immediately if this is a non-regular file. */
 3102|  36.2k|	if (AE_IFREG != (zip->entry->mode & AE_IFMT))
  ------------------
  |  |  216|  36.2k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
              	if (AE_IFREG != (zip->entry->mode & AE_IFMT))
  ------------------
  |  |  215|  36.2k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
  |  Branch (3102:6): [True: 2.11k, False: 34.1k]
  ------------------
 3103|  2.11k|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|  2.11k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3104|       |
 3105|  34.1k|	__archive_read_consume(a, zip->unconsumed);
 3106|  34.1k|	zip->unconsumed = 0;
 3107|       |
 3108|  34.1k|	if (zip->init_decryption) {
  ------------------
  |  Branch (3108:6): [True: 6.82k, False: 27.3k]
  ------------------
 3109|  6.82k|		zip->has_encrypted_entries = 1;
 3110|  6.82k|		if (zip->entry->zip_flags & ZIP_STRONG_ENCRYPTED)
  ------------------
  |  |  129|  6.82k|#define ZIP_STRONG_ENCRYPTED	(1 << 6)
  ------------------
  |  Branch (3110:7): [True: 1.34k, False: 5.48k]
  ------------------
 3111|  1.34k|			r = read_decryption_header(a);
 3112|  5.48k|		else if (zip->entry->compression == WINZIP_AES_ENCRYPTION)
  ------------------
  |  |  144|  5.48k|#define WINZIP_AES_ENCRYPTION	99
  ------------------
  |  Branch (3112:12): [True: 3.38k, False: 2.09k]
  ------------------
 3113|  3.38k|			r = init_WinZip_AES_decryption(a);
 3114|  2.09k|		else
 3115|  2.09k|			r = init_traditional_PKWARE_decryption(a);
 3116|  6.82k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  6.82k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3116:7): [True: 3.47k, False: 3.35k]
  ------------------
 3117|  3.47k|			return (r);
 3118|  3.35k|		zip->init_decryption = 0;
 3119|  3.35k|	}
 3120|       |
 3121|  30.6k|	switch(zip->entry->compression) {
 3122|  6.81k|	case 0:  /* No compression. */
  ------------------
  |  Branch (3122:2): [True: 6.81k, False: 23.8k]
  ------------------
 3123|  6.81k|		r =  zip_read_data_none(a, buff, size, offset);
 3124|  6.81k|		break;
 3125|      0|#ifdef HAVE_BZLIB_H
 3126|      0|	case 12: /* ZIPx bzip2 compression. */
  ------------------
  |  Branch (3126:2): [True: 0, False: 30.6k]
  ------------------
 3127|      0|		r = zip_read_data_zipx_bzip2(a, buff, size, offset);
 3128|      0|		break;
 3129|      0|#endif
 3130|      0|#if HAVE_LZMA_H && HAVE_LIBLZMA
 3131|    482|	case 14: /* ZIPx LZMA compression. */
  ------------------
  |  Branch (3131:2): [True: 482, False: 30.2k]
  ------------------
 3132|    482|		r = zip_read_data_zipx_lzma_alone(a, buff, size, offset);
 3133|    482|		break;
 3134|      0|	case 95: /* ZIPx XZ compression. */
  ------------------
  |  Branch (3134:2): [True: 0, False: 30.6k]
  ------------------
 3135|      0|		r = zip_read_data_zipx_xz(a, buff, size, offset);
 3136|      0|		break;
 3137|      0|#endif
 3138|       |#if HAVE_ZSTD_H && HAVE_LIBZSTD
 3139|       |	case 93: /* ZIPx Zstd compression. */
 3140|       |		r = zip_read_data_zipx_zstd(a, buff, size, offset);
 3141|       |		break;
 3142|       |#endif
 3143|       |	/* PPMd support is built-in, so we don't need any #if guards. */
 3144|  14.5k|	case 98: /* ZIPx PPMd compression. */
  ------------------
  |  Branch (3144:2): [True: 14.5k, False: 16.1k]
  ------------------
 3145|  14.5k|		r = zip_read_data_zipx_ppmd(a, buff, size, offset);
 3146|  14.5k|		break;
 3147|       |
 3148|      0|#ifdef HAVE_ZLIB_H
 3149|  4.12k|	case 8: /* Deflate compression. */
  ------------------
  |  Branch (3149:2): [True: 4.12k, False: 26.5k]
  ------------------
 3150|  4.12k|		r =  zip_read_data_deflate(a, buff, size, offset);
 3151|  4.12k|		break;
 3152|      0|#endif
 3153|  4.74k|	default: /* Unsupported compression. */
  ------------------
  |  Branch (3153:2): [True: 4.74k, False: 25.9k]
  ------------------
 3154|       |		/* Return a warning. */
 3155|  4.74k|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  4.74k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3156|  4.74k|		    "Unsupported ZIP compression method (%d: %s)",
 3157|  4.74k|		    zip->entry->compression, compression_name(zip->entry->compression));
 3158|       |		/* We can't decompress this entry, but we will
 3159|       |		 * be able to skip() it and try the next entry. */
 3160|  4.74k|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|  4.74k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3161|  30.6k|	}
 3162|  25.9k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  25.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3162:6): [True: 4.86k, False: 21.0k]
  ------------------
 3163|  4.86k|		return (r);
 3164|  21.0k|	if (*size > 0) {
  ------------------
  |  Branch (3164:6): [True: 15.8k, False: 5.28k]
  ------------------
 3165|  15.8k|		zip->computed_crc32 = zip->crc32func(zip->computed_crc32, *buff,
 3166|  15.8k|						     (unsigned)*size);
 3167|  15.8k|	}
 3168|       |	/* If we hit the end, swallow any end-of-data marker and
 3169|       |	 * verify the final check values. */
 3170|  21.0k|	if (zip->end_of_entry) {
  ------------------
  |  Branch (3170:6): [True: 17.6k, False: 3.43k]
  ------------------
 3171|  17.6k|		consume_end_of_file_marker(a, zip);
 3172|       |
 3173|       |		/* Check computed CRC against header */
 3174|  17.6k|		if ((!zip->hctx_valid ||
  ------------------
  |  Branch (3174:8): [True: 16.2k, False: 1.35k]
  ------------------
 3175|  1.35k|		      zip->entry->aes_extra.vendor != AES_VENDOR_AE_2) &&
  ------------------
  |  |  113|  1.35k|#define AES_VENDOR_AE_2	0x0002
  ------------------
  |  Branch (3175:9): [True: 1.29k, False: 64]
  ------------------
 3176|  17.5k|		   zip->entry->crc32 != zip->computed_crc32
  ------------------
  |  Branch (3176:6): [True: 16.4k, False: 1.17k]
  ------------------
 3177|  16.4k|		    && !zip->ignore_crc32) {
  ------------------
  |  Branch (3177:10): [True: 0, False: 16.4k]
  ------------------
 3178|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3179|      0|			    "ZIP bad CRC: 0x%lx should be 0x%lx",
 3180|      0|			    (unsigned long)zip->computed_crc32,
 3181|      0|			    (unsigned long)zip->entry->crc32);
 3182|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3183|      0|		}
 3184|       |		/* Check file size against header. */
 3185|  17.6k|		if (zip->entry->compressed_size !=
  ------------------
  |  Branch (3185:7): [True: 13.7k, False: 3.94k]
  ------------------
 3186|  17.6k|		    zip->entry_compressed_bytes_read) {
 3187|  13.7k|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|  13.7k|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3188|  13.7k|			    "ZIP compressed data is wrong size "
 3189|  13.7k|			    "(read %jd, expected %jd)",
 3190|  13.7k|			    (intmax_t)zip->entry_compressed_bytes_read,
 3191|  13.7k|			    (intmax_t)zip->entry->compressed_size);
 3192|  13.7k|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|  13.7k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3193|  13.7k|		}
 3194|       |		/* Size field only stores the lower 32 bits of the actual
 3195|       |		 * size. */
 3196|  3.94k|		if ((zip->entry->uncompressed_size & UINT32_MAX)
  ------------------
  |  Branch (3196:7): [True: 2.59k, False: 1.34k]
  ------------------
 3197|  3.94k|		    != (zip->entry_uncompressed_bytes_read & UINT32_MAX)) {
 3198|  2.59k|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|  2.59k|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3199|  2.59k|			    "ZIP uncompressed data is wrong size "
 3200|  2.59k|			    "(read %jd, expected %jd)",
 3201|  2.59k|			    (intmax_t)zip->entry_uncompressed_bytes_read,
 3202|  2.59k|			    (intmax_t)zip->entry->uncompressed_size);
 3203|  2.59k|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|  2.59k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3204|  2.59k|		}
 3205|  3.94k|	}
 3206|       |
 3207|  4.78k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  4.78k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3208|  21.0k|}
archive_read_support_format_zip.c:read_decryption_header:
 2705|  1.45k|{
 2706|  1.45k|	struct zip *zip = (struct zip *)(a->format->data);
 2707|  1.45k|	const char *p;
 2708|  1.45k|	unsigned int remaining_size;
 2709|  1.45k|	unsigned int ts;
 2710|       |
 2711|       |	/*
 2712|       |	 * Read an initialization vector data field.
 2713|       |	 */
 2714|  1.45k|	p = __archive_read_ahead(a, 2, NULL);
 2715|  1.45k|	if (p == NULL)
  ------------------
  |  Branch (2715:6): [True: 0, False: 1.45k]
  ------------------
 2716|      0|		goto truncated;
 2717|  1.45k|	ts = zip->iv_size;
 2718|  1.45k|	zip->iv_size = archive_le16dec(p);
 2719|  1.45k|	__archive_read_consume(a, 2);
 2720|  1.45k|	if (ts < zip->iv_size) {
  ------------------
  |  Branch (2720:6): [True: 152, False: 1.29k]
  ------------------
 2721|    152|		free(zip->iv);
 2722|    152|		zip->iv = NULL;
 2723|    152|	}
 2724|  1.45k|	p = __archive_read_ahead(a, zip->iv_size, NULL);
 2725|  1.45k|	if (p == NULL)
  ------------------
  |  Branch (2725:6): [True: 0, False: 1.45k]
  ------------------
 2726|      0|		goto truncated;
 2727|  1.45k|	if (zip->iv == NULL) {
  ------------------
  |  Branch (2727:6): [True: 155, False: 1.29k]
  ------------------
 2728|    155|		zip->iv = malloc(zip->iv_size);
 2729|    155|		if (zip->iv == NULL)
  ------------------
  |  Branch (2729:7): [True: 0, False: 155]
  ------------------
 2730|      0|			goto nomem;
 2731|    155|	}
 2732|  1.45k|	memcpy(zip->iv, p, zip->iv_size);
 2733|  1.45k|	__archive_read_consume(a, zip->iv_size);
 2734|       |
 2735|       |	/*
 2736|       |	 * Read a size of remaining decryption header field.
 2737|       |	 */
 2738|  1.45k|	p = __archive_read_ahead(a, 14, NULL);
 2739|  1.45k|	if (p == NULL)
  ------------------
  |  Branch (2739:6): [True: 0, False: 1.45k]
  ------------------
 2740|      0|		goto truncated;
 2741|  1.45k|	remaining_size = archive_le32dec(p);
 2742|  1.45k|	if (remaining_size < 16 || remaining_size > (1 << 18))
  ------------------
  |  Branch (2742:6): [True: 3, False: 1.44k]
  |  Branch (2742:29): [True: 5, False: 1.44k]
  ------------------
 2743|      8|		goto corrupted;
 2744|       |
 2745|       |	/* Check if format version is supported. */
 2746|  1.44k|	if (archive_le16dec(p+4) != 3) {
  ------------------
  |  Branch (2746:6): [True: 207, False: 1.23k]
  ------------------
 2747|    207|		archive_set_error(&a->archive,
 2748|    207|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    207|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2749|    207|		    "Unsupported encryption format version: %u",
 2750|    207|		    archive_le16dec(p+4));
 2751|    207|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|    207|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2752|    207|	}
 2753|       |
 2754|       |	/*
 2755|       |	 * Read an encryption algorithm field.
 2756|       |	 */
 2757|  1.23k|	zip->alg_id = archive_le16dec(p+6);
 2758|  1.23k|	switch (zip->alg_id) {
 2759|     52|	case 0x6601:/* DES */
  ------------------
  |  Branch (2759:2): [True: 52, False: 1.18k]
  ------------------
 2760|    239|	case 0x6602:/* RC2 */
  ------------------
  |  Branch (2760:2): [True: 187, False: 1.04k]
  ------------------
 2761|    423|	case 0x6603:/* 3DES 168 */
  ------------------
  |  Branch (2761:2): [True: 184, False: 1.05k]
  ------------------
 2762|    498|	case 0x6609:/* 3DES 112 */
  ------------------
  |  Branch (2762:2): [True: 75, False: 1.16k]
  ------------------
 2763|    514|	case 0x660E:/* AES 128 */
  ------------------
  |  Branch (2763:2): [True: 16, False: 1.22k]
  ------------------
 2764|    580|	case 0x660F:/* AES 192 */
  ------------------
  |  Branch (2764:2): [True: 66, False: 1.17k]
  ------------------
 2765|    639|	case 0x6610:/* AES 256 */
  ------------------
  |  Branch (2765:2): [True: 59, False: 1.17k]
  ------------------
 2766|    657|	case 0x6702:/* RC2 (version >= 5.2) */
  ------------------
  |  Branch (2766:2): [True: 18, False: 1.21k]
  ------------------
 2767|    862|	case 0x6720:/* Blowfish */
  ------------------
  |  Branch (2767:2): [True: 205, False: 1.03k]
  ------------------
 2768|    920|	case 0x6721:/* Twofish */
  ------------------
  |  Branch (2768:2): [True: 58, False: 1.17k]
  ------------------
 2769|  1.18k|	case 0x6801:/* RC4 */
  ------------------
  |  Branch (2769:2): [True: 260, False: 976]
  ------------------
 2770|       |		/* Supported encryption algorithm. */
 2771|  1.18k|		break;
 2772|     56|	default:
  ------------------
  |  Branch (2772:2): [True: 56, False: 1.18k]
  ------------------
 2773|     56|		archive_set_error(&a->archive,
 2774|     56|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     56|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2775|     56|		    "Unknown encryption algorithm: %u", zip->alg_id);
 2776|     56|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|     56|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2777|  1.23k|	}
 2778|       |
 2779|       |	/*
 2780|       |	 * Read a bit length field.
 2781|       |	 */
 2782|  1.18k|	zip->bit_len = archive_le16dec(p+8);
 2783|       |
 2784|       |	/*
 2785|       |	 * Read a flags field.
 2786|       |	 */
 2787|  1.18k|	zip->flags = archive_le16dec(p+10);
 2788|  1.18k|	switch (zip->flags & 0xf000) {
 2789|      0|	case 0x0001: /* Password is required to decrypt. */
  ------------------
  |  Branch (2789:2): [True: 0, False: 1.18k]
  ------------------
 2790|      0|	case 0x0002: /* Certificates only. */
  ------------------
  |  Branch (2790:2): [True: 0, False: 1.18k]
  ------------------
 2791|      0|	case 0x0003: /* Password or certificate required to decrypt. */
  ------------------
  |  Branch (2791:2): [True: 0, False: 1.18k]
  ------------------
 2792|      0|		break;
 2793|  1.18k|	default:
  ------------------
  |  Branch (2793:2): [True: 1.18k, False: 0]
  ------------------
 2794|  1.18k|		archive_set_error(&a->archive,
 2795|  1.18k|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  1.18k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2796|  1.18k|		    "Unknown encryption flag: %u", zip->flags);
 2797|  1.18k|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|  1.18k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2798|  1.18k|	}
 2799|      0|	if ((zip->flags & 0xf000) == 0 ||
  ------------------
  |  Branch (2799:6): [True: 0, False: 0]
  ------------------
 2800|      0|	    (zip->flags & 0xf000) == 0x4000) {
  ------------------
  |  Branch (2800:6): [True: 0, False: 0]
  ------------------
 2801|      0|		archive_set_error(&a->archive,
 2802|      0|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2803|      0|		    "Unknown encryption flag: %u", zip->flags);
 2804|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2805|      0|	}
 2806|       |
 2807|       |	/*
 2808|       |	 * Read an encrypted random data field.
 2809|       |	 */
 2810|      0|	ts = zip->erd_size;
 2811|      0|	zip->erd_size = archive_le16dec(p+12);
 2812|      0|	__archive_read_consume(a, 14);
 2813|      0|	if ((zip->erd_size & 0xf) != 0 ||
  ------------------
  |  Branch (2813:6): [True: 0, False: 0]
  ------------------
 2814|      0|	    (zip->erd_size + 16) > remaining_size ||
  ------------------
  |  Branch (2814:6): [True: 0, False: 0]
  ------------------
 2815|      0|	    (zip->erd_size + 16) < zip->erd_size)
  ------------------
  |  Branch (2815:6): [True: 0, False: 0]
  ------------------
 2816|      0|		goto corrupted;
 2817|       |
 2818|      0|	if (ts < zip->erd_size) {
  ------------------
  |  Branch (2818:6): [True: 0, False: 0]
  ------------------
 2819|      0|		free(zip->erd);
 2820|      0|		zip->erd = NULL;
 2821|      0|	}
 2822|      0|	p = __archive_read_ahead(a, zip->erd_size, NULL);
 2823|      0|	if (p == NULL)
  ------------------
  |  Branch (2823:6): [True: 0, False: 0]
  ------------------
 2824|      0|		goto truncated;
 2825|      0|	if (zip->erd == NULL) {
  ------------------
  |  Branch (2825:6): [True: 0, False: 0]
  ------------------
 2826|      0|		zip->erd = malloc(zip->erd_size);
 2827|      0|		if (zip->erd == NULL)
  ------------------
  |  Branch (2827:7): [True: 0, False: 0]
  ------------------
 2828|      0|			goto nomem;
 2829|      0|	}
 2830|      0|	memcpy(zip->erd, p, zip->erd_size);
 2831|      0|	__archive_read_consume(a, zip->erd_size);
 2832|       |
 2833|       |	/*
 2834|       |	 * Read a reserved data field.
 2835|       |	 */
 2836|      0|	p = __archive_read_ahead(a, 4, NULL);
 2837|      0|	if (p == NULL)
  ------------------
  |  Branch (2837:6): [True: 0, False: 0]
  ------------------
 2838|      0|		goto truncated;
 2839|       |	/* Reserved data size should be zero. */
 2840|      0|	if (archive_le32dec(p) != 0)
  ------------------
  |  Branch (2840:6): [True: 0, False: 0]
  ------------------
 2841|      0|		goto corrupted;
 2842|      0|	__archive_read_consume(a, 4);
 2843|       |
 2844|       |	/*
 2845|       |	 * Read a password validation data field.
 2846|       |	 */
 2847|      0|	p = __archive_read_ahead(a, 2, NULL);
 2848|      0|	if (p == NULL)
  ------------------
  |  Branch (2848:6): [True: 0, False: 0]
  ------------------
 2849|      0|		goto truncated;
 2850|      0|	ts = zip->v_size;
 2851|      0|	zip->v_size = archive_le16dec(p);
 2852|      0|	__archive_read_consume(a, 2);
 2853|      0|	if ((zip->v_size & 0x0f) != 0 ||
  ------------------
  |  Branch (2853:6): [True: 0, False: 0]
  ------------------
 2854|      0|	    (zip->erd_size + zip->v_size + 16) > remaining_size ||
  ------------------
  |  Branch (2854:6): [True: 0, False: 0]
  ------------------
 2855|      0|	    (zip->erd_size + zip->v_size + 16) < (zip->erd_size + zip->v_size))
  ------------------
  |  Branch (2855:6): [True: 0, False: 0]
  ------------------
 2856|      0|		goto corrupted;
 2857|      0|	if (ts < zip->v_size) {
  ------------------
  |  Branch (2857:6): [True: 0, False: 0]
  ------------------
 2858|      0|		free(zip->v_data);
 2859|      0|		zip->v_data = NULL;
 2860|      0|	}
 2861|      0|	p = __archive_read_ahead(a, zip->v_size, NULL);
 2862|      0|	if (p == NULL)
  ------------------
  |  Branch (2862:6): [True: 0, False: 0]
  ------------------
 2863|      0|		goto truncated;
 2864|      0|	if (zip->v_data == NULL) {
  ------------------
  |  Branch (2864:6): [True: 0, False: 0]
  ------------------
 2865|      0|		zip->v_data = malloc(zip->v_size);
 2866|      0|		if (zip->v_data == NULL)
  ------------------
  |  Branch (2866:7): [True: 0, False: 0]
  ------------------
 2867|      0|			goto nomem;
 2868|      0|	}
 2869|      0|	memcpy(zip->v_data, p, zip->v_size);
 2870|      0|	__archive_read_consume(a, zip->v_size);
 2871|       |
 2872|      0|	p = __archive_read_ahead(a, 4, NULL);
 2873|      0|	if (p == NULL)
  ------------------
  |  Branch (2873:6): [True: 0, False: 0]
  ------------------
 2874|      0|		goto truncated;
 2875|      0|	zip->v_crc32 = archive_le32dec(p);
 2876|      0|	__archive_read_consume(a, 4);
 2877|       |
 2878|       |	/*return (ARCHIVE_OK);
 2879|       |	 * This is not fully implemented yet.*/
 2880|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2881|      0|	    "Encrypted file is unsupported");
 2882|      0|	return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2883|      0|truncated:
 2884|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2885|      0|	    "Truncated ZIP file data");
 2886|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2887|      8|corrupted:
 2888|      8|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      8|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2889|      8|	    "Corrupted ZIP file data");
 2890|      8|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      8|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2891|      0|nomem:
 2892|      0|	archive_set_error(&a->archive, ENOMEM,
 2893|      0|	    "No memory for ZIP decryption");
 2894|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2895|      0|}
archive_read_support_format_zip.c:init_WinZip_AES_decryption:
 2990|  3.48k|{
 2991|  3.48k|	struct zip *zip = (struct zip *)(a->format->data);
 2992|  3.48k|	const void *p;
 2993|  3.48k|	const uint8_t *pv;
 2994|  3.48k|	size_t key_len, salt_len;
 2995|  3.48k|	uint8_t derived_key[MAX_DERIVED_KEY_BUF_SIZE];
 2996|  3.48k|	int retry;
 2997|  3.48k|	int r;
 2998|       |
 2999|  3.48k|	if (zip->cctx_valid || zip->hctx_valid)
  ------------------
  |  Branch (2999:6): [True: 0, False: 3.48k]
  |  Branch (2999:25): [True: 0, False: 3.48k]
  ------------------
 3000|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3001|       |
 3002|  3.48k|	switch (zip->entry->aes_extra.strength) {
 3003|    267|	case 1: salt_len = 8;  key_len = 16; break;
  ------------------
  |  Branch (3003:2): [True: 267, False: 3.21k]
  ------------------
 3004|  2.90k|	case 2: salt_len = 12; key_len = 24; break;
  ------------------
  |  Branch (3004:2): [True: 2.90k, False: 578]
  ------------------
 3005|    303|	case 3: salt_len = 16; key_len = 32; break;
  ------------------
  |  Branch (3005:2): [True: 303, False: 3.18k]
  ------------------
 3006|      8|	default: goto corrupted;
  ------------------
  |  Branch (3006:2): [True: 8, False: 3.47k]
  ------------------
 3007|  3.48k|	}
 3008|  3.47k|	p = __archive_read_ahead(a, salt_len + 2, NULL);
 3009|  3.47k|	if (p == NULL)
  ------------------
  |  Branch (3009:6): [True: 0, False: 3.47k]
  ------------------
 3010|      0|		goto truncated;
 3011|       |
 3012|  3.88k|	for (retry = 0;; retry++) {
 3013|  3.88k|		const char *passphrase;
 3014|       |
 3015|  3.88k|		passphrase = __archive_read_next_passphrase(a);
 3016|  3.88k|		if (passphrase == NULL) {
  ------------------
  |  Branch (3016:7): [True: 511, False: 3.37k]
  ------------------
 3017|    511|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|    511|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3018|    511|			    (retry > 0)?
  ------------------
  |  Branch (3018:8): [True: 413, False: 98]
  ------------------
 3019|    413|				"Incorrect passphrase":
 3020|    511|				"Passphrase required for this entry");
 3021|    511|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|    511|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3022|    511|		}
 3023|  3.37k|		memset(derived_key, 0, sizeof(derived_key));
 3024|  3.37k|		r = archive_pbkdf2_sha1(passphrase, strlen(passphrase),
  ------------------
  |  |  159|  3.37k|  __archive_cryptor.pbkdf2sha1(pw, pw_len, salt, salt_len, rounds, dk, dk_len)
  ------------------
 3025|  3.37k|		    p, salt_len, 1000, derived_key, key_len * 2 + 2);
 3026|  3.37k|		if (r != 0) {
  ------------------
  |  Branch (3026:7): [True: 0, False: 3.37k]
  ------------------
 3027|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3028|      0|			    r == CRYPTOR_STUB_FUNCTION ? "Decryption is unsupported due "
  ------------------
  |  |  176|      0|#define CRYPTOR_STUB_FUNCTION	-2
  ------------------
  |  Branch (3028:8): [True: 0, False: 0]
  ------------------
 3029|      0|				"to lack of crypto library" : "Failed to process passphrase");
 3030|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3031|      0|		}
 3032|       |
 3033|       |		/* Check password verification value. */
 3034|  3.37k|		pv = ((const uint8_t *)p) + salt_len;
 3035|  3.37k|		if (derived_key[key_len * 2] == pv[0] &&
  ------------------
  |  Branch (3035:7): [True: 3.22k, False: 156]
  ------------------
 3036|  3.22k|		    derived_key[key_len * 2 + 1] == pv[1])
  ------------------
  |  Branch (3036:7): [True: 2.96k, False: 257]
  ------------------
 3037|  2.96k|			break;/* The passphrase is OK. */
 3038|    413|		if (retry > 10000) {
  ------------------
  |  Branch (3038:7): [True: 0, False: 413]
  ------------------
 3039|       |			/* Avoid infinity loop. */
 3040|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3041|      0|			    "Too many incorrect passphrases");
 3042|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3043|      0|		}
 3044|    413|	}
 3045|       |
 3046|  2.96k|	r = archive_decrypto_aes_ctr_init(&zip->cctx, derived_key, key_len);
  ------------------
  |  |  162|  2.96k|  __archive_cryptor.decrypto_aes_ctr_init(ctx, key, key_len)
  ------------------
 3047|  2.96k|	if (r != 0) {
  ------------------
  |  Branch (3047:6): [True: 0, False: 2.96k]
  ------------------
 3048|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3049|      0|		    "Decryption is unsupported due to lack of crypto library");
 3050|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3051|      0|	}
 3052|  2.96k|	r = archive_hmac_sha1_init(&zip->hctx, derived_key + key_len, key_len);
  ------------------
  |  |   99|  2.96k|	__archive_hmac.__hmac_sha1_init(ctx, key, key_len)
  ------------------
 3053|  2.96k|	if (r != 0) {
  ------------------
  |  Branch (3053:6): [True: 0, False: 2.96k]
  ------------------
 3054|      0|		archive_decrypto_aes_ctr_release(&zip->cctx);
  ------------------
  |  |  166|      0|  __archive_cryptor.decrypto_aes_ctr_release(ctx)
  ------------------
 3055|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3056|      0|		    "Failed to initialize HMAC-SHA1");
 3057|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3058|      0|	}
 3059|  2.96k|	zip->cctx_valid = zip->hctx_valid = 1;
 3060|  2.96k|	__archive_read_consume(a, salt_len + 2);
 3061|  2.96k|	zip->entry_bytes_remaining -= salt_len + 2 + AUTH_CODE_SIZE;
  ------------------
  |  |  146|  2.96k|#define AUTH_CODE_SIZE	10
  ------------------
 3062|  2.96k|	if (0 == (zip->entry->zip_flags & ZIP_LENGTH_AT_END)
  ------------------
  |  |  128|  2.96k|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (3062:6): [True: 310, False: 2.65k]
  ------------------
 3063|    310|	    && zip->entry_bytes_remaining < 0)
  ------------------
  |  Branch (3063:9): [True: 0, False: 310]
  ------------------
 3064|      0|		goto corrupted;
 3065|  2.96k|	zip->entry_compressed_bytes_read += salt_len + 2 + AUTH_CODE_SIZE;
  ------------------
  |  |  146|  2.96k|#define AUTH_CODE_SIZE	10
  ------------------
 3066|  2.96k|	zip->decrypted_bytes_remaining = 0;
 3067|       |
 3068|  2.96k|	zip->entry->compression = zip->entry->aes_extra.compression;
 3069|  2.96k|	return (zip_alloc_decryption_buffer(a));
 3070|       |
 3071|      0|truncated:
 3072|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3073|      0|	    "Truncated ZIP file data");
 3074|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3075|      8|corrupted:
 3076|      8|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      8|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3077|      8|	    "Corrupted ZIP file data");
 3078|      8|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      8|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3079|  2.96k|}
archive_read_support_format_zip.c:zip_alloc_decryption_buffer:
 2899|  4.12k|{
 2900|  4.12k|	struct zip *zip = (struct zip *)(a->format->data);
 2901|  4.12k|	size_t bs = 256 * 1024;
 2902|       |
 2903|  4.12k|	if (zip->decrypted_buffer == NULL) {
  ------------------
  |  Branch (2903:6): [True: 97, False: 4.03k]
  ------------------
 2904|     97|		zip->decrypted_buffer_size = bs;
 2905|     97|		zip->decrypted_buffer = malloc(bs);
 2906|     97|		if (zip->decrypted_buffer == NULL) {
  ------------------
  |  Branch (2906:7): [True: 0, False: 97]
  ------------------
 2907|      0|			archive_set_error(&a->archive, ENOMEM,
 2908|      0|			    "No memory for ZIP decryption");
 2909|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2910|      0|		}
 2911|     97|	}
 2912|  4.12k|	zip->decrypted_ptr = zip->decrypted_buffer;
 2913|  4.12k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  4.12k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2914|  4.12k|}
archive_read_support_format_zip.c:init_traditional_PKWARE_decryption:
 2918|  4.23k|{
 2919|  4.23k|	struct zip *zip = (struct zip *)(a->format->data);
 2920|  4.23k|	const void *p;
 2921|  4.23k|	int retry;
 2922|  4.23k|	int r;
 2923|       |
 2924|  4.23k|	if (zip->tctx_valid)
  ------------------
  |  Branch (2924:6): [True: 0, False: 4.23k]
  ------------------
 2925|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2926|       |
 2927|       |	/*
 2928|       |	   Read the 12 bytes encryption header stored at
 2929|       |	   the start of the data area.
 2930|       |	 */
 2931|  4.23k|#define ENC_HEADER_SIZE	12
 2932|  4.23k|	if (0 == (zip->entry->zip_flags & ZIP_LENGTH_AT_END)
  ------------------
  |  |  128|  4.23k|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (2932:6): [True: 617, False: 3.61k]
  ------------------
 2933|    617|	    && zip->entry_bytes_remaining < ENC_HEADER_SIZE) {
  ------------------
  |  | 2931|    617|#define ENC_HEADER_SIZE	12
  ------------------
  |  Branch (2933:9): [True: 0, False: 617]
  ------------------
 2934|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2935|      0|		    "Truncated Zip encrypted body: only %jd bytes available",
 2936|      0|		    (intmax_t)zip->entry_bytes_remaining);
 2937|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2938|      0|	}
 2939|       |
 2940|  4.23k|	p = __archive_read_ahead(a, ENC_HEADER_SIZE, NULL);
  ------------------
  |  | 2931|  4.23k|#define ENC_HEADER_SIZE	12
  ------------------
 2941|  4.23k|	if (p == NULL) {
  ------------------
  |  Branch (2941:6): [True: 1, False: 4.23k]
  ------------------
 2942|      1|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2943|      1|		    "Truncated ZIP file data");
 2944|      1|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2945|      1|	}
 2946|       |
 2947|  6.00k|	for (retry = 0;; retry++) {
 2948|  6.00k|		const char *passphrase;
 2949|  6.00k|		uint8_t crcchk;
 2950|       |
 2951|  6.00k|		passphrase = __archive_read_next_passphrase(a);
 2952|  6.00k|		if (passphrase == NULL) {
  ------------------
  |  Branch (2952:7): [True: 3.06k, False: 2.93k]
  ------------------
 2953|  3.06k|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|  3.06k|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2954|  3.06k|			    (retry > 0)?
  ------------------
  |  Branch (2954:8): [True: 1.77k, False: 1.29k]
  ------------------
 2955|  1.77k|				"Incorrect passphrase":
 2956|  3.06k|				"Passphrase required for this entry");
 2957|  3.06k|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|  3.06k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2958|  3.06k|		}
 2959|       |
 2960|       |		/*
 2961|       |		 * Initialize ctx for Traditional PKWARE Decryption.
 2962|       |		 */
 2963|  2.93k|		r = trad_enc_init(&zip->tctx, passphrase, strlen(passphrase),
 2964|  2.93k|			p, ENC_HEADER_SIZE, &crcchk);
  ------------------
  |  | 2931|  2.93k|#define ENC_HEADER_SIZE	12
  ------------------
 2965|  2.93k|		if (r == 0 && crcchk == zip->entry->decdat)
  ------------------
  |  Branch (2965:7): [True: 2.93k, False: 0]
  |  Branch (2965:17): [True: 1.16k, False: 1.77k]
  ------------------
 2966|  1.16k|			break;/* The passphrase is OK. */
 2967|  1.77k|		if (retry > 10000) {
  ------------------
  |  Branch (2967:7): [True: 0, False: 1.77k]
  ------------------
 2968|       |			/* Avoid infinity loop. */
 2969|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2970|      0|			    "Too many incorrect passphrases");
 2971|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2972|      0|		}
 2973|  1.77k|	}
 2974|       |
 2975|  1.16k|	__archive_read_consume(a, ENC_HEADER_SIZE);
  ------------------
  |  | 2931|  1.16k|#define ENC_HEADER_SIZE	12
  ------------------
 2976|  1.16k|	zip->tctx_valid = 1;
 2977|  1.16k|	if (0 == (zip->entry->zip_flags & ZIP_LENGTH_AT_END)) {
  ------------------
  |  |  128|  1.16k|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (2977:6): [True: 386, False: 777]
  ------------------
 2978|    386|	    zip->entry_bytes_remaining -= ENC_HEADER_SIZE;
  ------------------
  |  | 2931|    386|#define ENC_HEADER_SIZE	12
  ------------------
 2979|    386|	}
 2980|       |	/*zip->entry_uncompressed_bytes_read += ENC_HEADER_SIZE;*/
 2981|  1.16k|	zip->entry_compressed_bytes_read += ENC_HEADER_SIZE;
  ------------------
  |  | 2931|  1.16k|#define ENC_HEADER_SIZE	12
  ------------------
 2982|  1.16k|	zip->decrypted_bytes_remaining = 0;
 2983|       |
 2984|  1.16k|	return (zip_alloc_decryption_buffer(a));
 2985|  4.23k|#undef ENC_HEADER_SIZE
 2986|  4.23k|}
archive_read_support_format_zip.c:trad_enc_init:
  346|  2.93k|{
  347|  2.93k|	uint8_t header[12];
  348|       |
  349|  2.93k|	if (key_len < 12) {
  ------------------
  |  Branch (349:6): [True: 0, False: 2.93k]
  ------------------
  350|      0|		*crcchk = 0xff;
  351|      0|		return -1;
  352|      0|	}
  353|       |
  354|  2.93k|	ctx->keys[0] = 305419896L;
  355|  2.93k|	ctx->keys[1] = 591751049L;
  356|  2.93k|	ctx->keys[2] = 878082192L;
  357|       |
  358|  20.5k|	for (;pw_len; --pw_len)
  ------------------
  |  Branch (358:8): [True: 17.6k, False: 2.93k]
  ------------------
  359|  17.6k|		trad_enc_update_keys(ctx, *pw++);
  360|       |
  361|  2.93k|	trad_enc_decrypt_update(ctx, key, 12, header, 12);
  362|       |	/* Return the last byte for CRC check. */
  363|  2.93k|	*crcchk = header[11];
  364|  2.93k|	return 0;
  365|  2.93k|}
archive_read_support_format_zip.c:zip_read_data_none:
 1601|  6.81k|{
 1602|  6.81k|	struct zip *zip;
 1603|  6.81k|	const char *buff;
 1604|  6.81k|	ssize_t bytes_avail;
 1605|  6.81k|	ssize_t trailing_extra;
 1606|  6.81k|	int r;
 1607|       |
 1608|  6.81k|	(void)offset; /* UNUSED */
 1609|       |
 1610|  6.81k|	zip = (struct zip *)(a->format->data);
 1611|  6.81k|	trailing_extra = zip->hctx_valid ? AUTH_CODE_SIZE : 0;
  ------------------
  |  |  146|  1.45k|#define AUTH_CODE_SIZE	10
  ------------------
  |  Branch (1611:19): [True: 1.45k, False: 5.36k]
  ------------------
 1612|       |
 1613|  6.81k|	if (zip->entry->zip_flags & ZIP_LENGTH_AT_END) {
  ------------------
  |  |  128|  6.81k|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (1613:6): [True: 3.63k, False: 3.18k]
  ------------------
 1614|  3.63k|		const char *p;
 1615|  3.63k|		ssize_t grabbing_bytes = 24 + trailing_extra;
 1616|       |
 1617|       |		/* Grab at least 24 bytes. */
 1618|  3.63k|		buff = __archive_read_ahead(a, grabbing_bytes, &bytes_avail);
 1619|  3.63k|		if (bytes_avail < grabbing_bytes) {
  ------------------
  |  Branch (1619:7): [True: 17, False: 3.61k]
  ------------------
 1620|       |			/* Zip archives have end-of-archive markers
 1621|       |			   that are longer than this, so a failure to get at
 1622|       |			   least 24 bytes really does indicate a truncated
 1623|       |			   file. */
 1624|     17|			archive_set_error(&a->archive,
 1625|     17|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     17|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1626|     17|			    "Truncated ZIP file data");
 1627|     17|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     17|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1628|     17|		}
 1629|       |		/* Check for a complete PK\007\010 signature, followed
 1630|       |		 * by the correct 4-byte CRC. */
 1631|  3.61k|		p = buff + trailing_extra;
 1632|  3.61k|		if (p[0] == 'P' && p[1] == 'K'
  ------------------
  |  Branch (1632:7): [True: 2.56k, False: 1.05k]
  |  Branch (1632:22): [True: 2.36k, False: 200]
  ------------------
 1633|  2.36k|		    && p[2] == '\007' && p[3] == '\010'
  ------------------
  |  Branch (1633:10): [True: 2.08k, False: 275]
  |  Branch (1633:28): [True: 2.05k, False: 35]
  ------------------
 1634|  2.05k|		    && (archive_le32dec(p + 4) == zip->computed_crc32
  ------------------
  |  Branch (1634:11): [True: 153, False: 1.89k]
  ------------------
 1635|  1.89k|			|| zip->ignore_crc32
  ------------------
  |  Branch (1635:7): [True: 1.89k, False: 0]
  ------------------
 1636|      0|			|| (zip->hctx_valid
  ------------------
  |  Branch (1636:8): [True: 0, False: 0]
  ------------------
 1637|  2.05k|			 && zip->entry->aes_extra.vendor == AES_VENDOR_AE_2))) {
  ------------------
  |  |  113|      0|#define AES_VENDOR_AE_2	0x0002
  ------------------
  |  Branch (1637:8): [True: 0, False: 0]
  ------------------
 1638|  2.05k|			zip->end_of_entry = 1;
 1639|  2.05k|			if (zip->hctx_valid) {
  ------------------
  |  Branch (1639:8): [True: 531, False: 1.52k]
  ------------------
 1640|    531|				r = check_authentication_code(a, buff);
 1641|    531|				if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    531|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1641:9): [True: 531, False: 0]
  ------------------
 1642|    531|					return (r);
 1643|    531|			}
 1644|  1.52k|			return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.52k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1645|  2.05k|		}
 1646|       |		/* If not at EOF, ensure we consume at least one byte. */
 1647|  1.56k|		++p;
 1648|       |
 1649|       |		/* Scan forward until we see where a PK\007\010 signature
 1650|       |		 * might be. */
 1651|       |		/* Return bytes up until that point.  On the next call,
 1652|       |		 * the code above will verify the data descriptor. */
 1653|  2.87M|		while (p < buff + bytes_avail - 4) {
  ------------------
  |  Branch (1653:10): [True: 2.87M, False: 216]
  ------------------
 1654|  2.87M|			if (p[3] == 'P') { p += 3; }
  ------------------
  |  Branch (1654:8): [True: 5.02k, False: 2.87M]
  ------------------
 1655|  2.87M|			else if (p[3] == 'K') { p += 2; }
  ------------------
  |  Branch (1655:13): [True: 3.44k, False: 2.87M]
  ------------------
 1656|  2.87M|			else if (p[3] == '\007') { p += 1; }
  ------------------
  |  Branch (1656:13): [True: 17.5k, False: 2.85M]
  ------------------
 1657|  2.85M|			else if (p[3] == '\010' && p[2] == '\007'
  ------------------
  |  Branch (1657:13): [True: 22.7k, False: 2.83M]
  |  Branch (1657:31): [True: 1.38k, False: 21.4k]
  ------------------
 1658|  1.38k|			    && p[1] == 'K' && p[0] == 'P') {
  ------------------
  |  Branch (1658:11): [True: 1.35k, False: 30]
  |  Branch (1658:26): [True: 1.35k, False: 3]
  ------------------
 1659|  1.35k|				break;
 1660|  2.85M|			} else { p += 4; }
 1661|  2.87M|		}
 1662|  1.56k|		p -= trailing_extra;
 1663|  1.56k|		bytes_avail = p - buff;
 1664|  3.18k|	} else {
 1665|  3.18k|		if (zip->entry_bytes_remaining == 0) {
  ------------------
  |  Branch (1665:7): [True: 1.55k, False: 1.62k]
  ------------------
 1666|  1.55k|			zip->end_of_entry = 1;
 1667|  1.55k|			if (zip->hctx_valid) {
  ------------------
  |  Branch (1667:8): [True: 193, False: 1.36k]
  ------------------
 1668|    193|				r = check_authentication_code(a, NULL);
 1669|    193|				if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    193|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1669:9): [True: 129, False: 64]
  ------------------
 1670|    129|					return (r);
 1671|    193|			}
 1672|  1.42k|			return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.42k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1673|  1.55k|		}
 1674|       |		/* Grab a bunch of bytes. */
 1675|  1.62k|		buff = __archive_read_ahead(a, 1, &bytes_avail);
 1676|  1.62k|		if (bytes_avail <= 0) {
  ------------------
  |  Branch (1676:7): [True: 5, False: 1.62k]
  ------------------
 1677|      5|			archive_set_error(&a->archive,
 1678|      5|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      5|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1679|      5|			    "Truncated ZIP file data");
 1680|      5|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      5|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1681|      5|		}
 1682|  1.62k|		if (bytes_avail > zip->entry_bytes_remaining)
  ------------------
  |  Branch (1682:7): [True: 1.55k, False: 69]
  ------------------
 1683|  1.55k|			bytes_avail = (ssize_t)zip->entry_bytes_remaining;
 1684|  1.62k|	}
 1685|  3.18k|	if (zip->tctx_valid || zip->cctx_valid) {
  ------------------
  |  Branch (1685:6): [True: 7, False: 3.18k]
  |  Branch (1685:25): [True: 729, False: 2.45k]
  ------------------
 1686|    736|		size_t dec_size = bytes_avail;
 1687|       |
 1688|    736|		if (dec_size > zip->decrypted_buffer_size)
  ------------------
  |  Branch (1688:7): [True: 6, False: 730]
  ------------------
 1689|      6|			dec_size = zip->decrypted_buffer_size;
 1690|    736|		if (zip->tctx_valid) {
  ------------------
  |  Branch (1690:7): [True: 7, False: 729]
  ------------------
 1691|      7|			trad_enc_decrypt_update(&zip->tctx,
 1692|      7|			    (const uint8_t *)buff, dec_size,
 1693|      7|			    zip->decrypted_buffer, dec_size);
 1694|    729|		} else {
 1695|    729|			size_t dsize = dec_size;
 1696|    729|			archive_hmac_sha1_update(&zip->hctx,
  ------------------
  |  |  101|    729|	__archive_hmac.__hmac_sha1_update(ctx, data, data_len)
  ------------------
 1697|    729|			    (const uint8_t *)buff, dec_size);
 1698|    729|			archive_decrypto_aes_ctr_update(&zip->cctx,
  ------------------
  |  |  164|    729|  __archive_cryptor.decrypto_aes_ctr_update(ctx, in, in_len, out, out_len)
  ------------------
 1699|    729|			    (const uint8_t *)buff, dec_size,
 1700|    729|			    zip->decrypted_buffer, &dsize);
 1701|    729|		}
 1702|    736|		bytes_avail = dec_size;
 1703|    736|		buff = (const char *)zip->decrypted_buffer;
 1704|    736|	}
 1705|  3.18k|	zip->entry_bytes_remaining -= bytes_avail;
 1706|  3.18k|	zip->entry_uncompressed_bytes_read += bytes_avail;
 1707|  3.18k|	zip->entry_compressed_bytes_read += bytes_avail;
 1708|  3.18k|	zip->unconsumed += bytes_avail;
 1709|  3.18k|	*size = bytes_avail;
 1710|  3.18k|	*_buff = buff;
 1711|  3.18k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  3.18k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1712|  6.81k|}
archive_read_support_format_zip.c:zip_read_data_zipx_ppmd:
 2181|  14.5k|{
 2182|  14.5k|	struct zip* zip = (struct zip *)(a->format->data);
 2183|  14.5k|	int ret;
 2184|  14.5k|	size_t consumed_bytes = 0;
 2185|  14.5k|	ssize_t bytes_avail = 0;
 2186|       |
 2187|  14.5k|	(void) offset; /* UNUSED */
 2188|       |
 2189|       |	/* If we're here for the first time, initialize Ppmd8 decompression
 2190|       |	 * context first. */
 2191|  14.5k|	if(!zip->decompress_init) {
  ------------------
  |  Branch (2191:5): [True: 14.4k, False: 57]
  ------------------
 2192|  14.4k|		ret = zipx_ppmd8_init(a, zip);
 2193|  14.4k|		if(ret != ARCHIVE_OK)
  ------------------
  |  |  233|  14.4k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2193:6): [True: 3.11k, False: 11.3k]
  ------------------
 2194|  3.11k|			return ret;
 2195|  14.4k|	}
 2196|       |
 2197|       |	/* Fetch for more data. We're reading 1 byte here, but libarchive
 2198|       |	 * should prefetch more bytes. */
 2199|  11.4k|	(void) __archive_read_ahead(a, 1, &bytes_avail);
 2200|  11.4k|	if(bytes_avail < 0) {
  ------------------
  |  Branch (2200:5): [True: 0, False: 11.4k]
  ------------------
 2201|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2202|      0|		    "Truncated PPMd8 file body");
 2203|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2204|      0|	}
 2205|       |
 2206|       |	/* This counter will be updated inside ppmd_read(), which at one
 2207|       |	 * point will be called by Ppmd8_DecodeSymbol. */
 2208|  11.4k|	zip->zipx_ppmd_read_compressed = 0;
 2209|       |
 2210|       |	/* Decompression loop. */
 2211|  79.7M|	do {
 2212|  79.7M|		int sym = __archive_ppmd8_functions.Ppmd8_DecodeSymbol(
 2213|  79.7M|		    &zip->ppmd8);
 2214|  79.7M|		if(sym < 0) {
  ------------------
  |  Branch (2214:6): [True: 11.1k, False: 79.7M]
  ------------------
 2215|  11.1k|			zip->end_of_entry = 1;
 2216|  11.1k|			break;
 2217|  11.1k|		}
 2218|       |
 2219|       |		/* This field is set by ppmd_read() when there was no more data
 2220|       |		 * to be read. */
 2221|  79.7M|		if(zip->ppmd8_stream_failed) {
  ------------------
  |  Branch (2221:6): [True: 176, False: 79.7M]
  ------------------
 2222|    176|			archive_set_error(&a->archive,
 2223|    176|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    176|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2224|    176|			    "Truncated PPMd8 file body");
 2225|    176|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    176|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2226|    176|		}
 2227|       |
 2228|  79.7M|		zip->uncompressed_buffer[consumed_bytes] = (uint8_t) sym;
 2229|  79.7M|		++consumed_bytes;
 2230|  79.7M|	} while(consumed_bytes < zip->uncompressed_buffer_size);
  ------------------
  |  Branch (2230:10): [True: 79.7M, False: 57]
  ------------------
 2231|       |
 2232|       |	/* Update pointers so we can continue decompression in another call. */
 2233|  11.2k|	zip->entry_bytes_remaining -= zip->zipx_ppmd_read_compressed;
 2234|  11.2k|	zip->entry_compressed_bytes_read += zip->zipx_ppmd_read_compressed;
 2235|  11.2k|	zip->entry_uncompressed_bytes_read += consumed_bytes;
 2236|       |
 2237|       |	/* If we're at the end of stream, deinitialize Ppmd8 context. */
 2238|  11.2k|	if(zip->end_of_entry) {
  ------------------
  |  Branch (2238:5): [True: 11.1k, False: 57]
  ------------------
 2239|  11.1k|		__archive_ppmd8_functions.Ppmd8_Free(&zip->ppmd8);
 2240|  11.1k|		zip->ppmd8_valid = 0;
 2241|  11.1k|	}
 2242|       |
 2243|       |	/* Update pointers for libarchive. */
 2244|  11.2k|	*buff = zip->uncompressed_buffer;
 2245|  11.2k|	*size = consumed_bytes;
 2246|       |
 2247|  11.2k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  11.2k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2248|  11.4k|}
archive_read_support_format_zip.c:zipx_ppmd8_init:
 2083|  14.4k|{
 2084|  14.4k|	const void* p;
 2085|  14.4k|	uint32_t val;
 2086|  14.4k|	uint32_t order;
 2087|  14.4k|	uint32_t mem;
 2088|  14.4k|	uint32_t restore_method;
 2089|       |
 2090|       |	/* Remove previous decompression context if it exists. */
 2091|  14.4k|	if(zip->ppmd8_valid) {
  ------------------
  |  Branch (2091:5): [True: 0, False: 14.4k]
  ------------------
 2092|      0|		__archive_ppmd8_functions.Ppmd8_Free(&zip->ppmd8);
 2093|      0|		zip->ppmd8_valid = 0;
 2094|      0|	}
 2095|       |
 2096|       |	/* Create a new decompression context. */
 2097|  14.4k|	__archive_ppmd8_functions.Ppmd8_Construct(&zip->ppmd8);
 2098|  14.4k|	zip->ppmd8_stream_failed = 0;
 2099|       |
 2100|       |	/* Setup function pointers required by Ppmd8 decompressor. The
 2101|       |	 * 'ppmd_read' function will feed new bytes to the decompressor,
 2102|       |	 * and will increment the 'zip->zipx_ppmd_read_compressed' counter. */
 2103|  14.4k|	zip->ppmd8.Stream.In = &zip->zipx_ppmd_stream;
 2104|  14.4k|	zip->zipx_ppmd_stream.a = a;
 2105|  14.4k|	zip->zipx_ppmd_stream.Read = &ppmd_read;
 2106|       |
 2107|       |	/* Reset number of read bytes to 0. */
 2108|  14.4k|	zip->zipx_ppmd_read_compressed = 0;
 2109|       |
 2110|       |	/* Read Ppmd8 header (2 bytes). */
 2111|  14.4k|	p = __archive_read_ahead(a, 2, NULL);
 2112|  14.4k|	if(!p) {
  ------------------
  |  Branch (2112:5): [True: 1, False: 14.4k]
  ------------------
 2113|      1|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2114|      1|		    "Truncated file data in PPMd8 stream");
 2115|      1|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2116|      1|	}
 2117|  14.4k|	__archive_read_consume(a, 2);
 2118|       |
 2119|       |	/* Decode the stream's compression parameters. */
 2120|  14.4k|	val = archive_le16dec(p);
 2121|  14.4k|	order = (val & 15) + 1;
 2122|  14.4k|	mem = ((val >> 4) & 0xff) + 1;
 2123|  14.4k|	restore_method = (val >> 12);
 2124|       |
 2125|  14.4k|	if(order < 2 || restore_method > 2) {
  ------------------
  |  Branch (2125:5): [True: 779, False: 13.6k]
  |  Branch (2125:18): [True: 2.33k, False: 11.3k]
  ------------------
 2126|  3.11k|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  3.11k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2127|  3.11k|		    "Invalid parameter set in PPMd8 stream (order=%" PRIu32 ", "
 2128|  3.11k|		    "restore=%" PRIu32 ")", order, restore_method);
 2129|  3.11k|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|  3.11k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2130|  3.11k|	}
 2131|       |
 2132|       |	/* Allocate the memory needed to properly decompress the file. */
 2133|  11.3k|	if(!__archive_ppmd8_functions.Ppmd8_Alloc(&zip->ppmd8, mem << 20)) {
  ------------------
  |  Branch (2133:5): [True: 0, False: 11.3k]
  ------------------
 2134|      0|		archive_set_error(&a->archive, ENOMEM,
 2135|      0|		    "Unable to allocate memory for PPMd8 stream: %" PRIu32 " bytes",
 2136|      0|		    mem << 20);
 2137|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2138|      0|	}
 2139|       |
 2140|       |	/* Signal the cleanup function to release Ppmd8 context in the
 2141|       |	 * cleanup phase. */
 2142|  11.3k|	zip->ppmd8_valid = 1;
 2143|       |
 2144|       |	/* Perform further Ppmd8 initialization. */
 2145|  11.3k|	if(!__archive_ppmd8_functions.Ppmd8_RangeDec_Init(&zip->ppmd8)) {
  ------------------
  |  Branch (2145:5): [True: 0, False: 11.3k]
  ------------------
 2146|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 2147|      0|		    "PPMd8 stream range decoder initialization error");
 2148|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2149|      0|	}
 2150|       |
 2151|  11.3k|	__archive_ppmd8_functions.Ppmd8_Init(&zip->ppmd8, order,
 2152|  11.3k|	    restore_method);
 2153|       |
 2154|       |	/* Allocate the buffer that will hold uncompressed data. */
 2155|  11.3k|	free(zip->uncompressed_buffer);
 2156|       |
 2157|  11.3k|	zip->uncompressed_buffer_size = 256 * 1024;
 2158|  11.3k|	zip->uncompressed_buffer = malloc(zip->uncompressed_buffer_size);
 2159|       |
 2160|  11.3k|	if(zip->uncompressed_buffer == NULL) {
  ------------------
  |  Branch (2160:5): [True: 0, False: 11.3k]
  ------------------
 2161|      0|		archive_set_error(&a->archive, ENOMEM,
 2162|      0|		    "No memory for PPMd8 decompression");
 2163|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2164|      0|	}
 2165|       |
 2166|       |	/* Ppmd8 initialization is done. */
 2167|  11.3k|	zip->decompress_init = 1;
 2168|       |
 2169|       |	/* We've already read 2 bytes in the output stream. Additionally,
 2170|       |	 * Ppmd8 initialization code could read some data as well. So we
 2171|       |	 * are advancing the stream by 2 bytes plus whatever number of
 2172|       |	 * bytes Ppmd8 init function used. */
 2173|  11.3k|	zip->entry_compressed_bytes_read += 2 + zip->zipx_ppmd_read_compressed;
 2174|       |
 2175|  11.3k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  11.3k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2176|  11.3k|}
archive_read_support_format_zip.c:ppmd_read:
  280|  11.4M|ppmd_read(void* p) {
  281|       |	/* Get the handle to current decompression context. */
  282|  11.4M|	struct archive_read *a = ((IByteIn*)p)->a;
  283|  11.4M|	struct zip *zip = (struct zip*) a->format->data;
  284|  11.4M|	ssize_t bytes_avail = 0;
  285|       |
  286|       |	/* Fetch next byte. */
  287|  11.4M|	const uint8_t* data = __archive_read_ahead(a, 1, &bytes_avail);
  288|  11.4M|	if(bytes_avail < 1) {
  ------------------
  |  Branch (288:5): [True: 183, False: 11.4M]
  ------------------
  289|    183|		zip->ppmd8_stream_failed = 1;
  290|    183|		return 0;
  291|    183|	}
  292|       |
  293|  11.4M|	__archive_read_consume(a, 1);
  294|       |
  295|       |	/* Increment the counter. */
  296|  11.4M|	++zip->zipx_ppmd_read_compressed;
  297|       |
  298|       |	/* Return the next compressed byte. */
  299|  11.4M|	return data[0];
  300|  11.4M|}
archive_read_support_format_zip.c:consume_end_of_file_marker:
 1402|  17.6k|{
 1403|  17.6k|	const char *marker;
 1404|  17.6k|	const char *p;
 1405|  17.6k|	uint64_t compressed32, uncompressed32;
 1406|  17.6k|	uint64_t compressed64, uncompressed64;
 1407|  17.6k|	uint64_t compressed_actual, uncompressed_actual;
 1408|  17.6k|	uint32_t crc32_actual;
 1409|  17.6k|	const uint32_t PK78 = 0x08074B50ULL;
 1410|  17.6k|	uint8_t crc32_ignored, crc32_may_be_zero;
 1411|       |
 1412|       |	/* If there shouldn't be a marker, don't consume it. */
 1413|  17.6k|	if ((zip->entry->zip_flags & ZIP_LENGTH_AT_END) == 0) {
  ------------------
  |  |  128|  17.6k|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (1413:6): [True: 6.53k, False: 11.1k]
  ------------------
 1414|  6.53k|		return;
 1415|  6.53k|	}
 1416|       |
 1417|       |	/* The longest Zip end-of-file record is 24 bytes.  Since an
 1418|       |	 * end-of-file record can never appear at the end of the
 1419|       |	 * archive, we know 24 bytes will be available unless
 1420|       |	 * the archive is severely truncated. */
 1421|  11.1k|	if (NULL == (marker = __archive_read_ahead(a, 24, NULL))) {
  ------------------
  |  Branch (1421:6): [True: 11, False: 11.1k]
  ------------------
 1422|     11|		return;
 1423|     11|	}
 1424|  11.1k|	p = marker;
 1425|       |
 1426|       |	/* The end-of-file record comprises:
 1427|       |	 * = Optional PK\007\010 marker
 1428|       |	 * = 4-byte CRC32
 1429|       |	 * = Compressed size
 1430|       |	 * = Uncompressed size
 1431|       |	 *
 1432|       |	 * The last two fields are either both 32 bits or both 64
 1433|       |	 * bits.  We check all possible layouts and accept any one
 1434|       |	 * that gives us a complete match, else we make a best-effort
 1435|       |	 * attempt to parse out the pieces.
 1436|       |	 */
 1437|       |
 1438|       |	/* CRC32 checking can be tricky:
 1439|       |	 * * Test suites sometimes ignore the CRC32
 1440|       |	 * * AES AE-2 always writes zero for the CRC32
 1441|       |	 * * AES AE-1 sometimes writes zero for the CRC32
 1442|       |	 */
 1443|  11.1k|	crc32_ignored = zip->ignore_crc32;
 1444|  11.1k|	crc32_may_be_zero = 0;
 1445|  11.1k|	crc32_actual = zip->computed_crc32;
 1446|  11.1k|	if (zip->hctx_valid) {
  ------------------
  |  Branch (1446:6): [True: 1.29k, False: 9.80k]
  ------------------
 1447|  1.29k|	  switch (zip->entry->aes_extra.vendor) {
 1448|      0|	  case AES_VENDOR_AE_2:
  ------------------
  |  |  113|      0|#define AES_VENDOR_AE_2	0x0002
  ------------------
  |  Branch (1448:4): [True: 0, False: 1.29k]
  ------------------
 1449|      0|	    crc32_actual = 0;
 1450|      0|	    break;
 1451|      0|	  case AES_VENDOR_AE_1:
  ------------------
  |  |  112|      0|#define AES_VENDOR_AE_1	0x0001
  ------------------
  |  Branch (1451:4): [True: 0, False: 1.29k]
  ------------------
 1452|  1.29k|	  default:
  ------------------
  |  Branch (1452:4): [True: 1.29k, False: 0]
  ------------------
 1453|  1.29k|	    crc32_may_be_zero = 1;
 1454|  1.29k|	    break;
 1455|  1.29k|	  }
 1456|  1.29k|	}
 1457|       |
 1458|       |	/* Values computed from the actual data in the archive. */
 1459|  11.1k|	compressed_actual = (uint64_t)zip->entry_compressed_bytes_read;
 1460|  11.1k|	uncompressed_actual = (uint64_t)zip->entry_uncompressed_bytes_read;
 1461|       |
 1462|       |
 1463|       |	/* Longest: PK78 marker, all 64-bit fields (24 bytes total) */
 1464|  11.1k|	if (archive_le32dec(p) == PK78
  ------------------
  |  Branch (1464:6): [True: 1.99k, False: 9.10k]
  ------------------
 1465|  1.99k|	    && ((archive_le32dec(p + 4) == crc32_actual)
  ------------------
  |  Branch (1465:10): [True: 153, False: 1.84k]
  ------------------
 1466|  1.84k|		|| (crc32_may_be_zero && (archive_le32dec(p + 4) == 0))
  ------------------
  |  Branch (1466:7): [True: 418, False: 1.42k]
  |  Branch (1466:28): [True: 0, False: 418]
  ------------------
 1467|  1.84k|		|| crc32_ignored)
  ------------------
  |  Branch (1467:6): [True: 1.84k, False: 0]
  ------------------
 1468|  1.99k|	    && (archive_le64dec(p + 8) == compressed_actual)
  ------------------
  |  Branch (1468:9): [True: 654, False: 1.34k]
  ------------------
 1469|    654|	    && (archive_le64dec(p + 16) == uncompressed_actual)) {
  ------------------
  |  Branch (1469:9): [True: 165, False: 489]
  ------------------
 1470|    165|		if (!crc32_ignored) {
  ------------------
  |  Branch (1470:7): [True: 0, False: 165]
  ------------------
 1471|      0|			zip->entry->crc32 = crc32_actual;
 1472|      0|		}
 1473|    165|		zip->entry->compressed_size = compressed_actual;
 1474|    165|		zip->entry->uncompressed_size = uncompressed_actual;
 1475|    165|		zip->unconsumed += 24;
 1476|    165|		return;
 1477|    165|	}
 1478|       |
 1479|       |	/* No PK78 marker, 64-bit fields (20 bytes total) */
 1480|  10.9k|	if (((archive_le32dec(p) == crc32_actual)
  ------------------
  |  Branch (1480:7): [True: 843, False: 10.0k]
  ------------------
 1481|  10.0k|	     || (crc32_may_be_zero && (archive_le32dec(p + 4) == 0))
  ------------------
  |  Branch (1481:11): [True: 1.29k, False: 8.80k]
  |  Branch (1481:32): [True: 868, False: 425]
  ------------------
 1482|  9.22k|	     || crc32_ignored)
  ------------------
  |  Branch (1482:10): [True: 9.22k, False: 0]
  ------------------
 1483|  10.9k|	    && (archive_le64dec(p + 4) == compressed_actual)
  ------------------
  |  Branch (1483:9): [True: 1.15k, False: 9.78k]
  ------------------
 1484|  1.15k|	    && (archive_le64dec(p + 12) == uncompressed_actual)) {
  ------------------
  |  Branch (1484:9): [True: 223, False: 930]
  ------------------
 1485|    223|	        if (!crc32_ignored) {
  ------------------
  |  Branch (1485:14): [True: 0, False: 223]
  ------------------
 1486|      0|			zip->entry->crc32 = crc32_actual;
 1487|      0|		}
 1488|    223|		zip->entry->compressed_size = compressed_actual;
 1489|    223|		zip->entry->uncompressed_size = uncompressed_actual;
 1490|    223|		zip->unconsumed += 20;
 1491|    223|		return;
 1492|    223|	}
 1493|       |
 1494|       |	/* PK78 marker and 32-bit fields (16 bytes total) */
 1495|  10.7k|	if (archive_le32dec(p) == PK78
  ------------------
  |  Branch (1495:6): [True: 1.83k, False: 8.88k]
  ------------------
 1496|  1.83k|	    && ((archive_le32dec(p + 4) == crc32_actual)
  ------------------
  |  Branch (1496:10): [True: 153, False: 1.67k]
  ------------------
 1497|  1.67k|		|| (crc32_may_be_zero && (archive_le32dec(p + 4) == 0))
  ------------------
  |  Branch (1497:7): [True: 418, False: 1.26k]
  |  Branch (1497:28): [True: 0, False: 418]
  ------------------
 1498|  1.67k|		|| crc32_ignored)
  ------------------
  |  Branch (1498:6): [True: 1.67k, False: 0]
  ------------------
 1499|  1.83k|	    && (archive_le32dec(p + 8) == compressed_actual)
  ------------------
  |  Branch (1499:9): [True: 595, False: 1.23k]
  ------------------
 1500|    595|	    && (archive_le32dec(p + 12) == uncompressed_actual)) {
  ------------------
  |  Branch (1500:9): [True: 430, False: 165]
  ------------------
 1501|    430|		if (!crc32_ignored) {
  ------------------
  |  Branch (1501:7): [True: 0, False: 430]
  ------------------
 1502|      0|			zip->entry->crc32 = crc32_actual;
 1503|      0|		}
 1504|    430|		zip->entry->compressed_size = compressed_actual;
 1505|    430|		zip->entry->uncompressed_size = uncompressed_actual;
 1506|    430|		zip->unconsumed += 16;
 1507|    430|		return;
 1508|    430|	}
 1509|       |
 1510|       |	/* Shortest: No PK78 marker, all 32-bit fields (12 bytes total) */
 1511|  10.2k|	if (((archive_le32dec(p) == crc32_actual)
  ------------------
  |  Branch (1511:7): [True: 843, False: 9.44k]
  ------------------
 1512|  9.44k|	     || (crc32_may_be_zero && (archive_le32dec(p + 4) == 0))
  ------------------
  |  Branch (1512:11): [True: 1.29k, False: 8.14k]
  |  Branch (1512:32): [True: 868, False: 425]
  ------------------
 1513|  8.57k|	     || crc32_ignored)
  ------------------
  |  Branch (1513:10): [True: 8.57k, False: 0]
  ------------------
 1514|  10.2k|	    && (archive_le32dec(p + 4) == compressed_actual)
  ------------------
  |  Branch (1514:9): [True: 1.23k, False: 9.04k]
  ------------------
 1515|  1.23k|	    && (archive_le32dec(p + 8) == uncompressed_actual)) {
  ------------------
  |  Branch (1515:9): [True: 145, False: 1.09k]
  ------------------
 1516|    145|		if (!crc32_ignored) {
  ------------------
  |  Branch (1516:7): [True: 0, False: 145]
  ------------------
 1517|      0|			zip->entry->crc32 = crc32_actual;
 1518|      0|		}
 1519|    145|		zip->entry->compressed_size = compressed_actual;
 1520|    145|		zip->entry->uncompressed_size = uncompressed_actual;
 1521|    145|		zip->unconsumed += 12;
 1522|    145|		return;
 1523|    145|	}
 1524|       |
 1525|       |	/* If none of the above patterns gives us a full exact match,
 1526|       |	 * then there's something definitely amiss.  The fallback code
 1527|       |	 * below will parse out some plausible values for error
 1528|       |	 * reporting purposes.  Note that this won't actually
 1529|       |	 * consume anything:
 1530|       |	 *
 1531|       |	 * = If there really is a marker here, the logic to resync to
 1532|       |	 *   the next entry will suffice to skip it.
 1533|       |	 *
 1534|       |	 * = There might not really be a marker: Corruption or bugs
 1535|       |	 *   may have set the length-at-end bit without a marker ever
 1536|       |	 *   having actually been written. In this case, we
 1537|       |	 *   explicitly should not consume any bytes, since that would
 1538|       |	 *   prevent us from correctly reading the next entry.
 1539|       |	 */
 1540|  10.1k|	if (archive_le32dec(p) == PK78) {
  ------------------
  |  Branch (1540:6): [True: 1.32k, False: 8.81k]
  ------------------
 1541|  1.32k|		p += 4; /* Ignore PK78 if it appears to be present */
 1542|  1.32k|	}
 1543|  10.1k|	zip->entry->crc32 = archive_le32dec(p);  /* Parse CRC32 */
 1544|  10.1k|	p += 4;
 1545|       |
 1546|       |	/* Consider both 32- and 64-bit interpretations */
 1547|  10.1k|	compressed32 = archive_le32dec(p);
 1548|  10.1k|	uncompressed32 = archive_le32dec(p + 4);
 1549|  10.1k|	compressed64 = archive_le64dec(p);
 1550|  10.1k|	uncompressed64 = archive_le64dec(p + 8);
 1551|       |
 1552|       |	/* The earlier patterns may have failed because of CRC32
 1553|       |	 * mismatch, so it's still possible that both sizes match.
 1554|       |	 * Try to match as many as we can...
 1555|       |	 */
 1556|  10.1k|	if (compressed32 == compressed_actual
  ------------------
  |  Branch (1556:6): [True: 1.17k, False: 8.96k]
  ------------------
 1557|  1.17k|	    && uncompressed32 == uncompressed_actual) {
  ------------------
  |  Branch (1557:9): [True: 0, False: 1.17k]
  ------------------
 1558|       |		/* Both 32-bit fields match */
 1559|      0|		zip->entry->compressed_size = compressed32;
 1560|      0|		zip->entry->uncompressed_size = uncompressed32;
 1561|  10.1k|	} else if (compressed64 == compressed_actual
  ------------------
  |  Branch (1561:13): [True: 775, False: 9.36k]
  ------------------
 1562|  9.36k|		   || uncompressed64 == uncompressed_actual) {
  ------------------
  |  Branch (1562:9): [True: 189, False: 9.17k]
  ------------------
 1563|       |		/* One or both 64-bit fields match */
 1564|    964|		zip->entry->compressed_size = compressed64;
 1565|    964|		zip->entry->uncompressed_size = uncompressed64;
 1566|  9.17k|	} else {
 1567|       |		/* Zero or one 32-bit fields match */
 1568|  9.17k|		zip->entry->compressed_size = compressed32;
 1569|  9.17k|		zip->entry->uncompressed_size = uncompressed32;
 1570|  9.17k|	}
 1571|  10.1k|}
archive_read_support_format_zip.c:archive_read_format_zip_read_data_skip_streamable:
 3487|  34.9k|{
 3488|  34.9k|	struct zip *zip;
 3489|  34.9k|	int64_t bytes_skipped;
 3490|       |
 3491|  34.9k|	zip = (struct zip *)(a->format->data);
 3492|  34.9k|	bytes_skipped = __archive_read_consume(a, zip->unconsumed);
 3493|  34.9k|	zip->unconsumed = 0;
 3494|  34.9k|	if (bytes_skipped < 0)
  ------------------
  |  Branch (3494:6): [True: 0, False: 34.9k]
  ------------------
 3495|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3496|       |
 3497|       |	/* If we've already read to end of data, we're done. */
 3498|  34.9k|	if (zip->end_of_entry)
  ------------------
  |  Branch (3498:6): [True: 21.4k, False: 13.4k]
  ------------------
 3499|  21.4k|		return (ARCHIVE_OK);
  ------------------
  |  |  233|  21.4k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3500|       |
 3501|       |	/* So we know we're streaming... */
 3502|  13.4k|	if (0 == (zip->entry->zip_flags & ZIP_LENGTH_AT_END)
  ------------------
  |  |  128|  13.4k|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (3502:6): [True: 5.28k, False: 8.14k]
  ------------------
 3503|  10.3k|	    || zip->entry->compressed_size > 0) {
  ------------------
  |  Branch (3503:9): [True: 5.07k, False: 3.06k]
  ------------------
 3504|       |		/* We know the compressed length, so we can just skip. */
 3505|  10.3k|		bytes_skipped = __archive_read_consume(a,
 3506|  10.3k|					zip->entry_bytes_remaining);
 3507|  10.3k|		if (bytes_skipped < 0)
  ------------------
  |  Branch (3507:7): [True: 42, False: 10.3k]
  ------------------
 3508|     42|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     42|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3509|  10.3k|		return (ARCHIVE_OK);
  ------------------
  |  |  233|  10.3k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3510|  10.3k|	}
 3511|       |
 3512|  3.06k|	if (zip->init_decryption) {
  ------------------
  |  Branch (3512:6): [True: 2.33k, False: 730]
  ------------------
 3513|  2.33k|		int r;
 3514|       |
 3515|  2.33k|		zip->has_encrypted_entries = 1;
 3516|  2.33k|		if (zip->entry->zip_flags & ZIP_STRONG_ENCRYPTED)
  ------------------
  |  |  129|  2.33k|#define ZIP_STRONG_ENCRYPTED	(1 << 6)
  ------------------
  |  Branch (3516:7): [True: 103, False: 2.23k]
  ------------------
 3517|    103|			r = read_decryption_header(a);
 3518|  2.23k|		else if (zip->entry->compression == WINZIP_AES_ENCRYPTION)
  ------------------
  |  |  144|  2.23k|#define WINZIP_AES_ENCRYPTION	99
  ------------------
  |  Branch (3518:12): [True: 98, False: 2.13k]
  ------------------
 3519|     98|			r = init_WinZip_AES_decryption(a);
 3520|  2.13k|		else
 3521|  2.13k|			r = init_traditional_PKWARE_decryption(a);
 3522|  2.33k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  2.33k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3522:7): [True: 1.56k, False: 773]
  ------------------
 3523|  1.56k|			return (r);
 3524|    773|		zip->init_decryption = 0;
 3525|    773|	}
 3526|       |
 3527|       |	/* We're streaming and we don't know the length. */
 3528|       |	/* If the body is compressed and we know the format, we can
 3529|       |	 * find an exact end-of-entry by decompressing it. */
 3530|  1.50k|	switch (zip->entry->compression) {
 3531|      0|#ifdef HAVE_ZLIB_H
 3532|      0|	case 8: /* Deflate compression. */
  ------------------
  |  Branch (3532:2): [True: 0, False: 1.50k]
  ------------------
 3533|      0|		while (!zip->end_of_entry) {
  ------------------
  |  Branch (3533:10): [True: 0, False: 0]
  ------------------
 3534|      0|			int64_t offset = 0;
 3535|      0|			const void *buff = NULL;
 3536|      0|			size_t size = 0;
 3537|      0|			int r;
 3538|      0|			r =  zip_read_data_deflate(a, &buff, &size, &offset);
 3539|      0|			if (r != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3539:8): [True: 0, False: 0]
  ------------------
 3540|      0|				return (r);
 3541|      0|		}
 3542|      0|		return ARCHIVE_OK;
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3543|      0|#endif
 3544|  1.50k|	default: /* Uncompressed or unknown. */
  ------------------
  |  Branch (3544:2): [True: 1.50k, False: 0]
  ------------------
 3545|       |		/* Scan for a PK\007\010 signature. */
 3546|  1.71k|		for (;;) {
 3547|  1.71k|			const char *p, *buff;
 3548|  1.71k|			ssize_t bytes_avail;
 3549|  1.71k|			buff = __archive_read_ahead(a, 16, &bytes_avail);
 3550|  1.71k|			if (bytes_avail < 16) {
  ------------------
  |  Branch (3550:8): [True: 7, False: 1.71k]
  ------------------
 3551|      7|				archive_set_error(&a->archive,
 3552|      7|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      7|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3553|      7|				    "Truncated ZIP file data");
 3554|      7|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      7|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3555|      7|			}
 3556|  1.71k|			p = buff;
 3557|   805k|			while (p <= buff + bytes_avail - 16) {
  ------------------
  |  Branch (3557:11): [True: 805k, False: 215]
  ------------------
 3558|   805k|				if (p[3] == 'P') { p += 3; }
  ------------------
  |  Branch (3558:9): [True: 1.91k, False: 803k]
  ------------------
 3559|   803k|				else if (p[3] == 'K') { p += 2; }
  ------------------
  |  Branch (3559:14): [True: 17.1k, False: 786k]
  ------------------
 3560|   786k|				else if (p[3] == '\007') { p += 1; }
  ------------------
  |  Branch (3560:14): [True: 5.37k, False: 780k]
  ------------------
 3561|   780k|				else if (p[3] == '\010' && p[2] == '\007'
  ------------------
  |  Branch (3561:14): [True: 8.74k, False: 772k]
  |  Branch (3561:32): [True: 1.54k, False: 7.19k]
  ------------------
 3562|  1.54k|				    && p[1] == 'K' && p[0] == 'P') {
  ------------------
  |  Branch (3562:12): [True: 1.52k, False: 18]
  |  Branch (3562:27): [True: 1.49k, False: 33]
  ------------------
 3563|  1.49k|					if (zip->entry->flags & LA_USED_ZIP64)
  ------------------
  |  |  136|  1.49k|#define LA_USED_ZIP64	(1 << 0)
  ------------------
  |  Branch (3563:10): [True: 232, False: 1.26k]
  ------------------
 3564|    232|						__archive_read_consume(a,
 3565|    232|						    p - buff + 24);
 3566|  1.26k|					else
 3567|  1.26k|						__archive_read_consume(a,
 3568|  1.26k|						    p - buff + 16);
 3569|  1.49k|					return ARCHIVE_OK;
  ------------------
  |  |  233|  1.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3570|   779k|				} else { p += 4; }
 3571|   805k|			}
 3572|    215|			__archive_read_consume(a, p - buff);
 3573|    215|		}
 3574|  1.50k|	}
 3575|  1.50k|}
archive_read_support_format_zip.c:archive_read_format_zip_cleanup:
 3212|  4.99k|{
 3213|  4.99k|	struct zip *zip;
 3214|  4.99k|	struct zip_entry *zip_entry, *next_zip_entry;
 3215|       |
 3216|  4.99k|	zip = (struct zip *)(a->format->data);
 3217|       |
 3218|  4.99k|#ifdef HAVE_ZLIB_H
 3219|  4.99k|	if (zip->stream_valid)
  ------------------
  |  Branch (3219:6): [True: 105, False: 4.89k]
  ------------------
 3220|    105|		inflateEnd(&zip->stream);
 3221|  4.99k|#endif
 3222|       |
 3223|  4.99k|#if HAVE_LZMA_H && HAVE_LIBLZMA
 3224|  4.99k|    if (zip->zipx_lzma_valid) {
  ------------------
  |  Branch (3224:9): [True: 9, False: 4.98k]
  ------------------
 3225|      9|		lzma_end(&zip->zipx_lzma_stream);
 3226|      9|	}
 3227|  4.99k|#endif
 3228|       |
 3229|  4.99k|#ifdef HAVE_BZLIB_H
 3230|  4.99k|	if (zip->bzstream_valid) {
  ------------------
  |  Branch (3230:6): [True: 0, False: 4.99k]
  ------------------
 3231|      0|		BZ2_bzDecompressEnd(&zip->bzstream);
 3232|      0|	}
 3233|  4.99k|#endif
 3234|       |
 3235|       |#if HAVE_ZSTD_H && HAVE_LIBZSTD
 3236|       |	if (zip->zstdstream_valid) {
 3237|       |		ZSTD_freeDStream(zip->zstdstream);
 3238|       |	}
 3239|       |#endif
 3240|       |
 3241|  4.99k|	free(zip->uncompressed_buffer);
 3242|       |
 3243|  4.99k|	if (zip->ppmd8_valid)
  ------------------
  |  Branch (3243:6): [True: 176, False: 4.82k]
  ------------------
 3244|    176|		__archive_ppmd8_functions.Ppmd8_Free(&zip->ppmd8);
 3245|       |
 3246|  4.99k|	if (zip->zip_entries) {
  ------------------
  |  Branch (3246:6): [True: 698, False: 4.30k]
  ------------------
 3247|    698|		zip_entry = zip->zip_entries;
 3248|  2.44k|		while (zip_entry != NULL) {
  ------------------
  |  Branch (3248:10): [True: 1.74k, False: 698]
  ------------------
 3249|  1.74k|			next_zip_entry = zip_entry->next;
 3250|  1.74k|			archive_string_free(&zip_entry->rsrcname);
 3251|  1.74k|			free(zip_entry);
 3252|  1.74k|			zip_entry = next_zip_entry;
 3253|  1.74k|		}
 3254|    698|	}
 3255|  4.99k|	free(zip->decrypted_buffer);
 3256|  4.99k|	if (zip->cctx_valid)
  ------------------
  |  Branch (3256:6): [True: 2, False: 4.99k]
  ------------------
 3257|      2|		archive_decrypto_aes_ctr_release(&zip->cctx);
  ------------------
  |  |  166|      2|  __archive_cryptor.decrypto_aes_ctr_release(ctx)
  ------------------
 3258|  4.99k|	if (zip->hctx_valid)
  ------------------
  |  Branch (3258:6): [True: 2, False: 4.99k]
  ------------------
 3259|      2|		archive_hmac_sha1_cleanup(&zip->hctx);
  ------------------
  |  |  105|      2|	__archive_hmac.__hmac_sha1_cleanup(ctx)
  ------------------
 3260|  4.99k|	free(zip->iv);
 3261|  4.99k|	free(zip->erd);
 3262|  4.99k|	free(zip->v_data);
 3263|  4.99k|	archive_string_free(&zip->format_name);
 3264|  4.99k|	free(zip);
 3265|  4.99k|	(a->format->data) = NULL;
 3266|  4.99k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  4.99k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3267|  4.99k|}
archive_read_support_format_zip.c:archive_read_support_format_zip_capabilities_streamable:
 3349|  1.32k|{
 3350|  1.32k|	(void)a; /* UNUSED */
 3351|  1.32k|	return (ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA |
  ------------------
  |  |  398|  1.32k|#define ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA (1<<0)  /* reader can detect encrypted data */
  ------------------
 3352|  1.32k|		ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA);
  ------------------
  |  |  399|  1.32k|#define ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA (1<<1)  /* reader can detect encryptable metadata (pathname, mtime, etc.) */
  ------------------
 3353|  1.32k|}
archive_read_support_format_zip.c:archive_read_format_zip_has_encrypted_entries:
 3271|    701|{
 3272|    701|	if (_a && _a->format) {
  ------------------
  |  Branch (3272:6): [True: 701, False: 0]
  |  Branch (3272:12): [True: 701, False: 0]
  ------------------
 3273|    701|		struct zip * zip = (struct zip *)_a->format->data;
 3274|    701|		if (zip) {
  ------------------
  |  Branch (3274:7): [True: 701, False: 0]
  ------------------
 3275|    701|			return zip->has_encrypted_entries;
 3276|    701|		}
 3277|    701|	}
 3278|      0|	return ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW;
  ------------------
  |  |  411|      0|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
 3279|    701|}
archive_read_support_format_zip.c:archive_read_format_zip_seekable_bid:
 3732|  2.46k|{
 3733|  2.46k|	struct zip *zip = (struct zip *)a->format->data;
 3734|  2.46k|	int64_t file_size, current_offset;
 3735|  2.46k|	const char *p;
 3736|  2.46k|	int i, tail;
 3737|       |
 3738|       |	/* If someone has already bid more than 32, then avoid
 3739|       |	   trashing the look-ahead buffers with a seek. */
 3740|  2.46k|	if (best_bid > 32)
  ------------------
  |  Branch (3740:6): [True: 1.13k, False: 1.32k]
  ------------------
 3741|  1.13k|		return (-1);
 3742|       |
 3743|  1.32k|	file_size = __archive_read_seek(a, 0, SEEK_END);
 3744|  1.32k|	if (file_size <= 0)
  ------------------
  |  Branch (3744:6): [True: 77, False: 1.24k]
  ------------------
 3745|     77|		return 0;
 3746|       |
 3747|       |	/* Search last 16k of file for end-of-central-directory
 3748|       |	 * record (which starts with PK\005\006) */
 3749|  1.24k|	tail = (int)zipmin(1024 * 16, file_size);
  ------------------
  |  |  262|  1.24k|#define	zipmin(a,b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (262:22): [True: 544, False: 700]
  |  |  ------------------
  ------------------
 3750|  1.24k|	current_offset = __archive_read_seek(a, -tail, SEEK_END);
 3751|  1.24k|	if (current_offset < 0)
  ------------------
  |  Branch (3751:6): [True: 0, False: 1.24k]
  ------------------
 3752|      0|		return 0;
 3753|  1.24k|	if ((p = __archive_read_ahead(a, (size_t)tail, NULL)) == NULL)
  ------------------
  |  Branch (3753:6): [True: 0, False: 1.24k]
  ------------------
 3754|      0|		return 0;
 3755|       |	/* Boyer-Moore search backwards from the end, since we want
 3756|       |	 * to match the last EOCD in the file (there can be more than
 3757|       |	 * one if there is an uncompressed Zip archive as a member
 3758|       |	 * within this Zip archive). */
 3759|  3.37M|	for (i = tail - 22; i > 0;) {
  ------------------
  |  Branch (3759:22): [True: 3.37M, False: 1.17k]
  ------------------
 3760|  3.37M|		switch (p[i]) {
 3761|  34.6k|		case 'P':
  ------------------
  |  Branch (3761:3): [True: 34.6k, False: 3.33M]
  ------------------
 3762|  34.6k|			if (memcmp(p + i, "PK\005\006", 4) == 0) {
  ------------------
  |  Branch (3762:8): [True: 71, False: 34.5k]
  ------------------
 3763|     71|				int ret = read_eocd(zip, p + i,
 3764|     71|				    current_offset + i);
 3765|       |				/* Zip64 EOCD locator precedes
 3766|       |				 * regular EOCD if present. */
 3767|     71|				if (i >= 20 && memcmp(p + i - 20, "PK\006\007", 4) == 0) {
  ------------------
  |  Branch (3767:9): [True: 71, False: 0]
  |  Branch (3767:20): [True: 4, False: 67]
  ------------------
 3768|      4|					int ret_zip64 = read_zip64_eocd(a, zip, p + i - 20);
 3769|      4|					if (ret_zip64 > ret)
  ------------------
  |  Branch (3769:10): [True: 2, False: 2]
  ------------------
 3770|      2|						ret = ret_zip64;
 3771|      4|				}
 3772|     71|				return (ret);
 3773|     71|			}
 3774|  34.5k|			i -= 4;
 3775|  34.5k|			break;
 3776|  11.2k|		case 'K': i -= 1; break;
  ------------------
  |  Branch (3776:3): [True: 11.2k, False: 3.35M]
  ------------------
 3777|   217k|		case 005: i -= 2; break;
  ------------------
  |  Branch (3777:3): [True: 217k, False: 3.15M]
  ------------------
 3778|  12.0k|		case 006: i -= 3; break;
  ------------------
  |  Branch (3778:3): [True: 12.0k, False: 3.35M]
  ------------------
 3779|  3.09M|		default: i -= 4; break;
  ------------------
  |  Branch (3779:3): [True: 3.09M, False: 275k]
  ------------------
 3780|  3.37M|		}
 3781|  3.37M|	}
 3782|  1.17k|	return 0;
 3783|  1.24k|}
archive_read_support_format_zip.c:read_eocd:
 3647|     71|{
 3648|     71|	uint16_t disk_num;
 3649|     71|	uint32_t cd_size, cd_offset;
 3650|       |
 3651|     71|	disk_num = archive_le16dec(p + 4);
 3652|     71|	cd_size = archive_le32dec(p + 12);
 3653|     71|	cd_offset = archive_le32dec(p + 16);
 3654|       |
 3655|       |	/* Sanity-check the EOCD we've found. */
 3656|       |
 3657|       |	/* This must be the first volume. */
 3658|     71|	if (disk_num != 0)
  ------------------
  |  Branch (3658:6): [True: 23, False: 48]
  ------------------
 3659|     23|		return 0;
 3660|       |	/* Central directory must be on this volume. */
 3661|     48|	if (disk_num != archive_le16dec(p + 6))
  ------------------
  |  Branch (3661:6): [True: 9, False: 39]
  ------------------
 3662|      9|		return 0;
 3663|       |	/* All central directory entries must be on this volume. */
 3664|     39|	if (archive_le16dec(p + 10) != archive_le16dec(p + 8))
  ------------------
  |  Branch (3664:6): [True: 0, False: 39]
  ------------------
 3665|      0|		return 0;
 3666|       |	/* Central directory can't extend beyond start of EOCD record. */
 3667|     39|	if ((int64_t)cd_offset + cd_size > current_offset)
  ------------------
  |  Branch (3667:6): [True: 2, False: 37]
  ------------------
 3668|      2|		return 0;
 3669|       |
 3670|       |	/* Save the central directory location for later use. */
 3671|     37|	zip->central_directory_offset = cd_offset;
 3672|     37|	zip->central_directory_offset_adjusted = current_offset - cd_size;
 3673|       |
 3674|       |	/* This is just a tiny bit higher than the maximum
 3675|       |	   returned by the streaming Zip bidder.  This ensures
 3676|       |	   that the more accurate seeking Zip parser wins
 3677|       |	   whenever seek is available. */
 3678|     37|	return 32;
 3679|     39|}
archive_read_support_format_zip.c:read_zip64_eocd:
 3687|      4|{
 3688|      4|	int64_t eocd64_offset;
 3689|      4|	int64_t eocd64_size;
 3690|       |
 3691|       |	/* Sanity-check the locator record. */
 3692|       |
 3693|       |	/* Central dir must be on first volume. */
 3694|      4|	if (archive_le32dec(p + 4) != 0)
  ------------------
  |  Branch (3694:6): [True: 1, False: 3]
  ------------------
 3695|      1|		return 0;
 3696|       |	/* Must be only a single volume. */
 3697|      3|	if (archive_le32dec(p + 16) != 1)
  ------------------
  |  Branch (3697:6): [True: 0, False: 3]
  ------------------
 3698|      0|		return 0;
 3699|       |
 3700|       |	/* Find the Zip64 EOCD record. */
 3701|      3|	eocd64_offset = archive_le64dec(p + 8);
 3702|      3|	if (__archive_read_seek(a, eocd64_offset, SEEK_SET) < 0)
  ------------------
  |  Branch (3702:6): [True: 0, False: 3]
  ------------------
 3703|      0|		return 0;
 3704|      3|	if ((p = __archive_read_ahead(a, 56, NULL)) == NULL)
  ------------------
  |  Branch (3704:6): [True: 0, False: 3]
  ------------------
 3705|      0|		return 0;
 3706|       |	/* Make sure we can read all of it. */
 3707|      3|	eocd64_size = archive_le64dec(p + 4) + 12;
 3708|      3|	if (eocd64_size < 56 || eocd64_size > 16384)
  ------------------
  |  Branch (3708:6): [True: 0, False: 3]
  |  Branch (3708:26): [True: 1, False: 2]
  ------------------
 3709|      1|		return 0;
 3710|      2|	if ((p = __archive_read_ahead(a, (size_t)eocd64_size, NULL)) == NULL)
  ------------------
  |  Branch (3710:6): [True: 0, False: 2]
  ------------------
 3711|      0|		return 0;
 3712|       |
 3713|       |	/* Sanity-check the EOCD64 */
 3714|      2|	if (archive_le32dec(p + 16) != 0) /* Must be disk #0 */
  ------------------
  |  Branch (3714:6): [True: 0, False: 2]
  ------------------
 3715|      0|		return 0;
 3716|      2|	if (archive_le32dec(p + 20) != 0) /* CD must be on disk #0 */
  ------------------
  |  Branch (3716:6): [True: 0, False: 2]
  ------------------
 3717|      0|		return 0;
 3718|       |	/* CD can't be split. */
 3719|      2|	if (archive_le64dec(p + 24) != archive_le64dec(p + 32))
  ------------------
  |  Branch (3719:6): [True: 0, False: 2]
  ------------------
 3720|      0|		return 0;
 3721|       |
 3722|       |	/* Save the central directory offset for later use. */
 3723|      2|	zip->central_directory_offset = archive_le64dec(p + 48);
 3724|       |	/* TODO: Needs scanning backwards to find the eocd64 instead of assuming */
 3725|      2|	zip->central_directory_offset_adjusted = zip->central_directory_offset;
 3726|       |
 3727|      2|	return 32;
 3728|      2|}
archive_read_support_format_zip.c:archive_read_format_zip_seekable_read_header:
 4281|    247|{
 4282|    247|	struct zip *zip = (struct zip *)a->format->data;
 4283|    247|	struct zip_entry *rsrc;
 4284|    247|	int64_t offset;
 4285|    247|	int r, ret = ARCHIVE_OK;
  ------------------
  |  |  233|    247|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4286|       |
 4287|       |	/*
 4288|       |	 * It should be sufficient to call archive_read_next_header() for
 4289|       |	 * a reader to determine if an entry is encrypted or not. If the
 4290|       |	 * encryption of an entry is only detectable when calling
 4291|       |	 * archive_read_data(), so be it. We'll do the same check there
 4292|       |	 * as well.
 4293|       |	 */
 4294|    247|	if (zip->has_encrypted_entries ==
  ------------------
  |  Branch (4294:6): [True: 39, False: 208]
  ------------------
 4295|    247|			ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW)
  ------------------
  |  |  411|    247|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
 4296|     39|		zip->has_encrypted_entries = 0;
 4297|       |
 4298|    247|	a->archive.archive_format = ARCHIVE_FORMAT_ZIP;
  ------------------
  |  |  374|    247|#define	ARCHIVE_FORMAT_ZIP			0x50000
  ------------------
 4299|    247|	if (a->archive.archive_format_name == NULL)
  ------------------
  |  Branch (4299:6): [True: 39, False: 208]
  ------------------
 4300|     39|		a->archive.archive_format_name = "ZIP";
 4301|       |
 4302|    247|	if (zip->zip_entries == NULL) {
  ------------------
  |  Branch (4302:6): [True: 39, False: 208]
  ------------------
 4303|     39|		r = slurp_central_directory(a, entry, zip);
 4304|     39|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|     39|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4304:7): [True: 16, False: 23]
  ------------------
 4305|     16|			return r;
 4306|       |		/* Get first entry whose local header offset is lower than
 4307|       |		 * other entries in the archive file. */
 4308|     23|		zip->entry =
 4309|     23|		    (struct zip_entry *)ARCHIVE_RB_TREE_MIN(&zip->tree);
  ------------------
  |  |   49|     23|    __archive_rb_tree_iterate((T), NULL, ARCHIVE_RB_DIR_LEFT)
  |  |  ------------------
  |  |  |  |   45|     23|#define	ARCHIVE_RB_DIR_LEFT		0
  |  |  ------------------
  ------------------
 4310|    208|	} else if (zip->entry != NULL) {
  ------------------
  |  Branch (4310:13): [True: 208, False: 0]
  ------------------
 4311|       |		/* Get next entry in local header offset order. */
 4312|    208|		zip->entry = (struct zip_entry *)__archive_rb_tree_iterate(
 4313|    208|		    &zip->tree, &zip->entry->node, ARCHIVE_RB_DIR_RIGHT);
  ------------------
  |  |   46|    208|#define	ARCHIVE_RB_DIR_RIGHT		1
  ------------------
 4314|    208|	}
 4315|       |
 4316|    231|	if (zip->entry == NULL)
  ------------------
  |  Branch (4316:6): [True: 7, False: 224]
  ------------------
 4317|      7|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      7|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 4318|       |
 4319|    224|	if (zip->entry->rsrcname.s)
  ------------------
  |  Branch (4319:6): [True: 0, False: 224]
  ------------------
 4320|      0|		rsrc = (struct zip_entry *)__archive_rb_tree_find_node(
 4321|      0|		    &zip->tree_rsrc, zip->entry->rsrcname.s);
 4322|    224|	else
 4323|    224|		rsrc = NULL;
 4324|       |
 4325|    224|	if (zip->cctx_valid)
  ------------------
  |  Branch (4325:6): [True: 0, False: 224]
  ------------------
 4326|      0|		archive_decrypto_aes_ctr_release(&zip->cctx);
  ------------------
  |  |  166|      0|  __archive_cryptor.decrypto_aes_ctr_release(ctx)
  ------------------
 4327|    224|	if (zip->hctx_valid)
  ------------------
  |  Branch (4327:6): [True: 0, False: 224]
  ------------------
 4328|      0|		archive_hmac_sha1_cleanup(&zip->hctx);
  ------------------
  |  |  105|      0|	__archive_hmac.__hmac_sha1_cleanup(ctx)
  ------------------
 4329|    224|	zip->tctx_valid = zip->cctx_valid = zip->hctx_valid = 0;
 4330|    224|	__archive_read_reset_passphrase(a);
 4331|       |
 4332|       |	/* File entries are sorted by the header offset, we should mostly
 4333|       |	 * use __archive_read_consume to advance a read point to avoid
 4334|       |	 * redundant data reading.  */
 4335|    224|	offset = archive_filter_bytes(&a->archive, 0);
 4336|    224|	if (offset < zip->entry->local_header_offset)
  ------------------
  |  Branch (4336:6): [True: 21, False: 203]
  ------------------
 4337|     21|		__archive_read_consume(a,
 4338|     21|		    zip->entry->local_header_offset - offset);
 4339|    203|	else if (offset != zip->entry->local_header_offset) {
  ------------------
  |  Branch (4339:11): [True: 25, False: 178]
  ------------------
 4340|     25|		__archive_read_seek(a, zip->entry->local_header_offset,
 4341|     25|		    SEEK_SET);
 4342|     25|	}
 4343|    224|	zip->unconsumed = 0;
 4344|    224|	r = zip_read_local_file_header(a, entry, zip);
 4345|    224|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    224|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4345:6): [True: 54, False: 170]
  ------------------
 4346|     54|		return r;
 4347|    170|	if (rsrc) {
  ------------------
  |  Branch (4347:6): [True: 0, False: 170]
  ------------------
 4348|      0|		int ret2 = zip_read_mac_metadata(a, entry, rsrc);
 4349|      0|		if (ret2 < ret)
  ------------------
  |  Branch (4349:7): [True: 0, False: 0]
  ------------------
 4350|      0|			ret = ret2;
 4351|      0|	}
 4352|    170|	return (ret);
 4353|    224|}
archive_read_support_format_zip.c:slurp_central_directory:
 3880|     39|{
 3881|     39|	ssize_t i;
 3882|     39|	unsigned found;
 3883|     39|	int64_t correction;
 3884|     39|	ssize_t bytes_avail;
 3885|     39|	const char *p;
 3886|       |
 3887|       |	/*
 3888|       |	 * Find the start of the central directory.  The end-of-CD
 3889|       |	 * record has our starting point, but there are lots of
 3890|       |	 * Zip archives which have had other data prepended to the
 3891|       |	 * file, which makes the recorded offsets all too small.
 3892|       |	 * So we search forward from the specified offset until we
 3893|       |	 * find the real start of the central directory.  Then we
 3894|       |	 * know the correction we need to apply to account for leading
 3895|       |	 * padding.
 3896|       |	 */
 3897|     39|	if (__archive_read_seek(a, zip->central_directory_offset_adjusted, SEEK_SET)
  ------------------
  |  Branch (3897:6): [True: 0, False: 39]
  ------------------
 3898|     39|		< 0)
 3899|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3900|       |
 3901|     39|	found = 0;
 3902|     78|	while (!found) {
  ------------------
  |  Branch (3902:9): [True: 39, False: 39]
  ------------------
 3903|     39|		if ((p = __archive_read_ahead(a, 20, &bytes_avail)) == NULL)
  ------------------
  |  Branch (3903:7): [True: 0, False: 39]
  ------------------
 3904|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3905|  38.0k|		for (found = 0, i = 0; !found && i < bytes_avail - 4;) {
  ------------------
  |  Branch (3905:26): [True: 38.0k, False: 39]
  |  Branch (3905:36): [True: 38.0k, False: 0]
  ------------------
 3906|  38.0k|			switch (p[i + 3]) {
 3907|    294|			case 'P': i += 3; break;
  ------------------
  |  Branch (3907:4): [True: 294, False: 37.7k]
  ------------------
 3908|    202|			case 'K': i += 2; break;
  ------------------
  |  Branch (3908:4): [True: 202, False: 37.8k]
  ------------------
 3909|    457|			case 001: i += 1; break;
  ------------------
  |  Branch (3909:4): [True: 457, False: 37.5k]
  ------------------
 3910|    708|			case 002:
  ------------------
  |  Branch (3910:4): [True: 708, False: 37.3k]
  ------------------
 3911|    708|				if (memcmp(p + i, "PK\001\002", 4) == 0) {
  ------------------
  |  Branch (3911:9): [True: 36, False: 672]
  ------------------
 3912|     36|					p += i;
 3913|     36|					found = 1;
 3914|     36|				} else
 3915|    672|					i += 4;
 3916|    708|				break;
 3917|    227|			case 005: i += 1; break;
  ------------------
  |  Branch (3917:4): [True: 227, False: 37.8k]
  ------------------
 3918|    221|			case 006:
  ------------------
  |  Branch (3918:4): [True: 221, False: 37.8k]
  ------------------
 3919|    221|				if (memcmp(p + i, "PK\005\006", 4) == 0) {
  ------------------
  |  Branch (3919:9): [True: 3, False: 218]
  ------------------
 3920|      3|					p += i;
 3921|      3|					found = 1;
 3922|    218|				} else if (memcmp(p + i, "PK\006\006", 4) == 0) {
  ------------------
  |  Branch (3922:16): [True: 0, False: 218]
  ------------------
 3923|      0|					p += i;
 3924|      0|					found = 1;
 3925|      0|				} else
 3926|    218|					i += 1;
 3927|    221|				break;
 3928|  35.9k|			default: i += 4; break;
  ------------------
  |  Branch (3928:4): [True: 35.9k, False: 2.10k]
  ------------------
 3929|  38.0k|			}
 3930|  38.0k|		}
 3931|     39|		__archive_read_consume(a, i);
 3932|     39|	}
 3933|     39|	correction = archive_filter_bytes(&a->archive, 0)
 3934|     39|			- zip->central_directory_offset;
 3935|       |
 3936|     39|	__archive_rb_tree_init(&zip->tree, &rb_ops);
 3937|     39|	__archive_rb_tree_init(&zip->tree_rsrc, &rb_rsrc_ops);
 3938|       |
 3939|     39|	zip->central_directory_entries_total = 0;
 3940|  1.12k|	while (1) {
  ------------------
  |  Branch (3940:9): [True: 1.12k, Folded]
  ------------------
 3941|  1.12k|		struct zip_entry *zip_entry;
 3942|  1.12k|		size_t filename_length, extra_length, comment_length;
 3943|  1.12k|		uint32_t external_attributes;
 3944|  1.12k|		const char *name, *r;
 3945|       |
 3946|  1.12k|		if ((p = __archive_read_ahead(a, 4, NULL)) == NULL)
  ------------------
  |  Branch (3946:7): [True: 0, False: 1.12k]
  ------------------
 3947|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3948|  1.12k|		if (memcmp(p, "PK\006\006", 4) == 0
  ------------------
  |  Branch (3948:7): [True: 0, False: 1.12k]
  ------------------
 3949|  1.12k|		    || memcmp(p, "PK\005\006", 4) == 0) {
  ------------------
  |  Branch (3949:10): [True: 23, False: 1.09k]
  ------------------
 3950|     23|			break;
 3951|  1.09k|		} else if (memcmp(p, "PK\001\002", 4) != 0) {
  ------------------
  |  Branch (3951:14): [True: 11, False: 1.08k]
  ------------------
 3952|     11|			archive_set_error(&a->archive,
 3953|     11|			    -1, "Invalid central directory signature");
 3954|     11|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|     11|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3955|     11|		}
 3956|  1.08k|		if ((p = __archive_read_ahead(a, 46, NULL)) == NULL)
  ------------------
  |  Branch (3956:7): [True: 0, False: 1.08k]
  ------------------
 3957|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3958|       |
 3959|  1.08k|		zip_entry = calloc(1, sizeof(struct zip_entry));
 3960|  1.08k|		if (zip_entry == NULL) {
  ------------------
  |  Branch (3960:7): [True: 0, False: 1.08k]
  ------------------
 3961|      0|			archive_set_error(&a->archive, ENOMEM,
 3962|      0|				"Can't allocate zip entry");
 3963|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3964|      0|		}
 3965|  1.08k|		zip_entry->next = zip->zip_entries;
 3966|  1.08k|		zip_entry->flags |= LA_FROM_CENTRAL_DIRECTORY;
  ------------------
  |  |  137|  1.08k|#define LA_FROM_CENTRAL_DIRECTORY (1 << 1)
  ------------------
 3967|  1.08k|		zip->zip_entries = zip_entry;
 3968|  1.08k|		zip->central_directory_entries_total++;
 3969|       |
 3970|       |		/* version = p[4]; */
 3971|  1.08k|		zip_entry->system = p[5];
 3972|       |		/* version_required = archive_le16dec(p + 6); */
 3973|  1.08k|		zip_entry->zip_flags = archive_le16dec(p + 8);
 3974|  1.08k|		if (zip_entry->zip_flags
  ------------------
  |  Branch (3974:7): [True: 2, False: 1.08k]
  ------------------
 3975|  1.08k|		      & (ZIP_ENCRYPTED | ZIP_STRONG_ENCRYPTED)){
  ------------------
  |  |  127|  1.08k|#define ZIP_ENCRYPTED	(1 << 0)
  ------------------
              		      & (ZIP_ENCRYPTED | ZIP_STRONG_ENCRYPTED)){
  ------------------
  |  |  129|  1.08k|#define ZIP_STRONG_ENCRYPTED	(1 << 6)
  ------------------
 3976|      2|			zip->has_encrypted_entries = 1;
 3977|      2|		}
 3978|  1.08k|		zip_entry->compression = (char)archive_le16dec(p + 10);
 3979|  1.08k|		zip_entry->mtime = dos_to_unix(archive_le32dec(p + 12));
 3980|  1.08k|		zip_entry->crc32 = archive_le32dec(p + 16);
 3981|  1.08k|		if (zip_entry->zip_flags & ZIP_LENGTH_AT_END)
  ------------------
  |  |  128|  1.08k|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (3981:7): [True: 34, False: 1.05k]
  ------------------
 3982|     34|			zip_entry->decdat = p[13];
 3983|  1.05k|		else
 3984|  1.05k|			zip_entry->decdat = p[19];
 3985|  1.08k|		zip_entry->compressed_size = archive_le32dec(p + 20);
 3986|  1.08k|		zip_entry->uncompressed_size = archive_le32dec(p + 24);
 3987|  1.08k|		filename_length = archive_le16dec(p + 28);
 3988|  1.08k|		extra_length = archive_le16dec(p + 30);
 3989|  1.08k|		comment_length = archive_le16dec(p + 32);
 3990|       |		/* disk_start = archive_le16dec(p + 34);
 3991|       |		 *   Better be zero.
 3992|       |		 * internal_attributes = archive_le16dec(p + 36);
 3993|       |		 *   text bit */
 3994|  1.08k|		external_attributes = archive_le32dec(p + 38);
 3995|  1.08k|		zip_entry->local_header_offset =
 3996|  1.08k|		    archive_le32dec(p + 42) + correction;
 3997|       |
 3998|       |		/* If we can't guess the mode, leave it zero here;
 3999|       |		   when we read the local file header we might get
 4000|       |		   more information. */
 4001|  1.08k|		if (zip_entry->system == 3) {
  ------------------
  |  Branch (4001:7): [True: 429, False: 657]
  ------------------
 4002|    429|			zip_entry->mode = external_attributes >> 16;
 4003|    657|		} else if (zip_entry->system == 0) {
  ------------------
  |  Branch (4003:14): [True: 657, False: 0]
  ------------------
 4004|       |			// Interpret MSDOS directory bit
 4005|    657|			if (0x10 == (external_attributes & 0x10)) {
  ------------------
  |  Branch (4005:8): [True: 104, False: 553]
  ------------------
 4006|    104|				zip_entry->mode = AE_IFDIR | 0775;
  ------------------
  |  |  221|    104|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 4007|    553|			} else {
 4008|    553|				zip_entry->mode = AE_IFREG | 0664;
  ------------------
  |  |  216|    553|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 4009|    553|			}
 4010|    657|			if (0x01 == (external_attributes & 0x01)) {
  ------------------
  |  Branch (4010:8): [True: 0, False: 657]
  ------------------
 4011|       |				// Read-only bit; strip write permissions
 4012|      0|				zip_entry->mode &= 0555;
 4013|      0|			}
 4014|    657|		} else {
 4015|      0|			zip_entry->mode = 0;
 4016|      0|		}
 4017|       |
 4018|       |		/* We're done with the regular data; get the filename and
 4019|       |		 * extra data. */
 4020|  1.08k|		__archive_read_consume(a, 46);
 4021|  1.08k|		p = __archive_read_ahead(a, filename_length + extra_length,
 4022|  1.08k|			NULL);
 4023|  1.08k|		if (p == NULL) {
  ------------------
  |  Branch (4023:7): [True: 1, False: 1.08k]
  ------------------
 4024|      1|			archive_set_error(&a->archive,
 4025|      1|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 4026|      1|			    "Truncated ZIP file header");
 4027|      1|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4028|      1|		}
 4029|  1.08k|		if (ARCHIVE_OK != process_extra(a, entry, p + filename_length,
  ------------------
  |  |  233|  1.08k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4029:7): [True: 4, False: 1.08k]
  ------------------
 4030|  1.08k|		    extra_length, zip_entry)) {
 4031|      4|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4032|      4|		}
 4033|       |
 4034|       |		/*
 4035|       |		 * Mac resource fork files are stored under the
 4036|       |		 * "__MACOSX/" directory, so we should check if
 4037|       |		 * it is.
 4038|       |		 */
 4039|  1.08k|		if (!zip->process_mac_extensions) {
  ------------------
  |  Branch (4039:7): [True: 1.08k, False: 0]
  ------------------
 4040|       |			/* Treat every entry as a regular entry. */
 4041|  1.08k|			__archive_rb_tree_insert_node(&zip->tree,
 4042|  1.08k|			    &zip_entry->node);
 4043|  1.08k|		} else {
 4044|      0|			name = p;
 4045|      0|			r = rsrc_basename(name, filename_length);
 4046|      0|			if (filename_length >= 9 &&
  ------------------
  |  Branch (4046:8): [True: 0, False: 0]
  ------------------
 4047|      0|			    strncmp("__MACOSX/", name, 9) == 0) {
  ------------------
  |  Branch (4047:8): [True: 0, False: 0]
  ------------------
 4048|       |				/* If this file is not a resource fork nor
 4049|       |				 * a directory. We should treat it as a non
 4050|       |				 * resource fork file to expose it. */
 4051|      0|				if (name[filename_length-1] != '/' &&
  ------------------
  |  Branch (4051:9): [True: 0, False: 0]
  ------------------
 4052|      0|				    (r - name < 3 || r[0] != '.' ||
  ------------------
  |  Branch (4052:10): [True: 0, False: 0]
  |  Branch (4052:26): [True: 0, False: 0]
  ------------------
 4053|      0|				     r[1] != '_')) {
  ------------------
  |  Branch (4053:10): [True: 0, False: 0]
  ------------------
 4054|      0|					__archive_rb_tree_insert_node(
 4055|      0|					    &zip->tree, &zip_entry->node);
 4056|       |					/* Expose its parent directories. */
 4057|      0|					expose_parent_dirs(zip, name,
 4058|      0|					    filename_length);
 4059|      0|				} else {
 4060|       |					/* This file is a resource fork file or
 4061|       |					 * a directory. */
 4062|      0|					archive_strncpy(&(zip_entry->rsrcname),
  ------------------
  |  |  173|      0|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 4063|      0|					     name, filename_length);
 4064|      0|					__archive_rb_tree_insert_node(
 4065|      0|					    &zip->tree_rsrc, &zip_entry->node);
 4066|      0|				}
 4067|      0|			} else {
 4068|       |				/* Generate resource fork name to find its
 4069|       |				 * resource file at zip->tree_rsrc. */
 4070|       |
 4071|       |				/* If this is an entry ending with slash,
 4072|       |				 * make the resource for name slash-less
 4073|       |				 * as the actual resource fork doesn't end with '/'.
 4074|       |				 */
 4075|      0|				size_t tmp_length = filename_length;
 4076|      0|				if (tmp_length > 0 && name[tmp_length - 1] == '/') {
  ------------------
  |  Branch (4076:9): [True: 0, False: 0]
  |  Branch (4076:27): [True: 0, False: 0]
  ------------------
 4077|      0|					tmp_length--;
 4078|      0|					r = rsrc_basename(name, tmp_length);
 4079|      0|				}
 4080|       |
 4081|      0|				archive_strcpy(&(zip_entry->rsrcname),
  ------------------
  |  |  165|      0|	archive_strncpy((as), (p), ((p) == NULL ? 0 : strlen(p)))
  |  |  ------------------
  |  |  |  |  173|      0|	((as)->length=0, archive_strncat((as), (p), (l)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (173:47): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4082|      0|				    "__MACOSX/");
 4083|      0|				archive_strncat(&(zip_entry->rsrcname),
 4084|      0|				    name, r - name);
 4085|      0|				archive_strcat(&(zip_entry->rsrcname), "._");
 4086|      0|				archive_strncat(&(zip_entry->rsrcname),
 4087|      0|				    name + (r - name),
 4088|      0|				    tmp_length - (r - name));
 4089|       |				/* Register an entry to RB tree to sort it by
 4090|       |				 * file offset. */
 4091|      0|				__archive_rb_tree_insert_node(&zip->tree,
 4092|      0|				    &zip_entry->node);
 4093|      0|			}
 4094|      0|		}
 4095|       |
 4096|       |		/* Skip the comment too ... */
 4097|  1.08k|		__archive_read_consume(a,
 4098|  1.08k|		    filename_length + extra_length + comment_length);
 4099|  1.08k|	}
 4100|       |
 4101|     23|	return ARCHIVE_OK;
  ------------------
  |  |  233|     23|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4102|     39|}
archive_read_support_format_zip.c:cmp_node:
 3790|  6.83k|{
 3791|  6.83k|	const struct zip_entry *e1 = (const struct zip_entry *)n1;
 3792|  6.83k|	const struct zip_entry *e2 = (const struct zip_entry *)n2;
 3793|       |
 3794|  6.83k|	if (e1->local_header_offset > e2->local_header_offset)
  ------------------
  |  Branch (3794:6): [True: 701, False: 6.13k]
  ------------------
 3795|    701|		return -1;
 3796|  6.13k|	if (e1->local_header_offset < e2->local_header_offset)
  ------------------
  |  Branch (3796:6): [True: 6.13k, False: 0]
  ------------------
 3797|  6.13k|		return 1;
 3798|      0|	return 0;
 3799|  6.13k|}
archive_read_support_format_zip.c:archive_read_format_zip_read_data_skip_seekable:
 4361|    208|{
 4362|    208|	struct zip *zip;
 4363|    208|	zip = (struct zip *)(a->format->data);
 4364|       |
 4365|    208|	zip->unconsumed = 0;
 4366|    208|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    208|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4367|    208|}
archive_read_support_format_zip.c:archive_read_support_format_zip_capabilities_seekable:
 3630|     78|{
 3631|     78|	(void)a; /* UNUSED */
 3632|     78|	return (ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA |
  ------------------
  |  |  398|     78|#define ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA (1<<0)  /* reader can detect encrypted data */
  ------------------
 3633|     78|		ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA);
  ------------------
  |  |  399|     78|#define ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA (1<<1)  /* reader can detect encryptable metadata (pathname, mtime, etc.) */
  ------------------
 3634|     78|}

archive_string_concat:
  256|    682|{
  257|    682|	if (archive_string_append(dest, src->s, src->length) == NULL)
  ------------------
  |  Branch (257:6): [True: 0, False: 682]
  ------------------
  258|      0|		__archive_errx(1, "Out of memory");
  259|    682|}
archive_wstring_concat:
  264|  5.71k|{
  265|  5.71k|	if (archive_wstring_append(dest, src->s, src->length) == NULL)
  ------------------
  |  Branch (265:6): [True: 0, False: 5.71k]
  ------------------
  266|      0|		__archive_errx(1, "Out of memory");
  267|  5.71k|}
archive_string_free:
  271|  7.04M|{
  272|  7.04M|	as->length = 0;
  273|  7.04M|	as->buffer_length = 0;
  274|  7.04M|	free(as->s);
  275|       |	as->s = NULL;
  276|  7.04M|}
archive_wstring_free:
  280|  2.24M|{
  281|  2.24M|	as->length = 0;
  282|  2.24M|	as->buffer_length = 0;
  283|  2.24M|	free(as->s);
  284|       |	as->s = NULL;
  285|  2.24M|}
archive_wstring_ensure:
  289|   125k|{
  290|   125k|	return (struct archive_wstring *)
  291|   125k|		archive_string_ensure((struct archive_string *)as,
  292|   125k|					s * sizeof(wchar_t));
  293|   125k|}
archive_string_ensure:
  298|  13.1M|{
  299|  13.1M|	char *p;
  300|  13.1M|	size_t new_length;
  301|       |
  302|       |	/* If buffer is already big enough, don't reallocate. */
  303|  13.1M|	if (as->s && (s <= as->buffer_length))
  ------------------
  |  Branch (303:6): [True: 12.7M, False: 448k]
  |  Branch (303:15): [True: 12.7M, False: 20.6k]
  ------------------
  304|  12.7M|		return (as);
  305|       |
  306|       |	/*
  307|       |	 * Growing the buffer at least exponentially ensures that
  308|       |	 * append operations are always linear in the number of
  309|       |	 * characters appended.  Using a smaller growth rate for
  310|       |	 * larger buffers reduces memory waste somewhat at the cost of
  311|       |	 * a larger constant factor.
  312|       |	 */
  313|   468k|	if (as->buffer_length < 32)
  ------------------
  |  Branch (313:6): [True: 448k, False: 20.6k]
  ------------------
  314|       |		/* Start with a minimum 32-character buffer. */
  315|   448k|		new_length = 32;
  316|  20.6k|	else if (as->buffer_length < 8192)
  ------------------
  |  Branch (316:11): [True: 19.4k, False: 1.22k]
  ------------------
  317|       |		/* Buffers under 8k are doubled for speed. */
  318|  19.4k|		new_length = as->buffer_length + as->buffer_length;
  319|  1.22k|	else {
  320|       |		/* Buffers 8k and over grow by at least 25% each time. */
  321|  1.22k|		new_length = as->buffer_length + as->buffer_length / 4;
  322|       |		/* Be safe: If size wraps, fail. */
  323|  1.22k|		if (new_length < as->buffer_length) {
  ------------------
  |  Branch (323:7): [True: 0, False: 1.22k]
  ------------------
  324|       |			/* On failure, wipe the string and return NULL. */
  325|      0|			archive_string_free(as);
  326|      0|			errno = ENOMEM;/* Make sure errno has ENOMEM. */
  327|      0|			return (NULL);
  328|      0|		}
  329|  1.22k|	}
  330|       |	/*
  331|       |	 * The computation above is a lower limit to how much we'll
  332|       |	 * grow the buffer.  In any case, we have to grow it enough to
  333|       |	 * hold the request.
  334|       |	 */
  335|   468k|	if (new_length < s)
  ------------------
  |  Branch (335:6): [True: 95.1k, False: 373k]
  ------------------
  336|  95.1k|		new_length = s;
  337|       |	/* Now we can reallocate the buffer. */
  338|   468k|	p = realloc(as->s, new_length);
  339|   468k|	if (p == NULL) {
  ------------------
  |  Branch (339:6): [True: 0, False: 468k]
  ------------------
  340|       |		/* On failure, wipe the string and return NULL. */
  341|      0|		archive_string_free(as);
  342|      0|		errno = ENOMEM;/* Make sure errno has ENOMEM. */
  343|      0|		return (NULL);
  344|      0|	}
  345|       |
  346|   468k|	as->s = p;
  347|   468k|	as->buffer_length = new_length;
  348|   468k|	return (as);
  349|   468k|}
archive_strncat:
  360|   208k|{
  361|   208k|	size_t s;
  362|   208k|	const char *p, *pp;
  363|       |
  364|   208k|	p = (const char *)_p;
  365|       |
  366|       |	/* Like strlen(p), except won't examine positions beyond p[n]. */
  367|   208k|	s = 0;
  368|   208k|	pp = p;
  369|  62.4M|	while (s < n && *pp) {
  ------------------
  |  Branch (369:9): [True: 62.2M, False: 114k]
  |  Branch (369:18): [True: 62.2M, False: 93.9k]
  ------------------
  370|  62.2M|		pp++;
  371|  62.2M|		s++;
  372|  62.2M|	}
  373|   208k|	if ((as = archive_string_append(as, p, s)) == NULL)
  ------------------
  |  Branch (373:6): [True: 0, False: 208k]
  ------------------
  374|      0|		__archive_errx(1, "Out of memory");
  375|   208k|	return (as);
  376|   208k|}
archive_wstrncat:
  380|  4.05k|{
  381|  4.05k|	size_t s;
  382|  4.05k|	const wchar_t *pp;
  383|       |
  384|       |	/* Like strlen(p), except won't examine positions beyond p[n]. */
  385|  4.05k|	s = 0;
  386|  4.05k|	pp = p;
  387|  42.4k|	while (s < n && *pp) {
  ------------------
  |  Branch (387:9): [True: 38.4k, False: 3.95k]
  |  Branch (387:18): [True: 38.3k, False: 104]
  ------------------
  388|  38.3k|		pp++;
  389|  38.3k|		s++;
  390|  38.3k|	}
  391|  4.05k|	if ((as = archive_wstring_append(as, p, s)) == NULL)
  ------------------
  |  Branch (391:6): [True: 0, False: 4.05k]
  ------------------
  392|      0|		__archive_errx(1, "Out of memory");
  393|  4.05k|	return (as);
  394|  4.05k|}
archive_strcat:
  398|  75.3k|{
  399|       |	/* strcat is just strncat without an effective limit. 
  400|       |	 * Assert that we'll never get called with a source
  401|       |	 * string over 16MB.
  402|       |	 * TODO: Review all uses of strcat in the source
  403|       |	 * and try to replace them with strncat().
  404|       |	 */
  405|  75.3k|	return archive_strncat(as, p, 0x1000000);
  406|  75.3k|}
archive_wstrcat:
  410|    104|{
  411|       |	/* Ditto. */
  412|    104|	return archive_wstrncat(as, p, 0x1000000);
  413|    104|}
archive_strappend_char:
  417|  12.2M|{
  418|  12.2M|	if ((as = archive_string_append(as, &c, 1)) == NULL)
  ------------------
  |  Branch (418:6): [True: 0, False: 12.2M]
  ------------------
  419|      0|		__archive_errx(1, "Out of memory");
  420|  12.2M|	return (as);
  421|  12.2M|}
archive_wstrappend_wchar:
  425|    104|{
  426|    104|	if ((as = archive_wstring_append(as, &c, 1)) == NULL)
  ------------------
  |  Branch (426:6): [True: 0, False: 104]
  ------------------
  427|      0|		__archive_errx(1, "Out of memory");
  428|    104|	return (as);
  429|    104|}
archive_wstring_append_from_mbs:
  621|   112k|{
  622|   112k|	size_t r;
  623|   112k|	int ret_val = 0;
  624|       |	/*
  625|       |	 * No single byte will be more than one wide character,
  626|       |	 * so this length estimate will always be big enough.
  627|       |	 */
  628|       |	// size_t wcs_length = len;
  629|   112k|	size_t mbs_length = len;
  630|   112k|	const char *mbs = p;
  631|   112k|	wchar_t *wcs;
  632|   112k|#if HAVE_MBRTOWC
  633|   112k|	mbstate_t shift_state;
  634|       |
  635|   112k|	memset(&shift_state, 0, sizeof(shift_state));
  636|   112k|#endif
  637|       |	/*
  638|       |	 * As we decided to have wcs_length == mbs_length == len
  639|       |	 * we can use len here instead of wcs_length
  640|       |	 */
  641|   112k|	if (NULL == archive_wstring_ensure(dest, dest->length + len + 1))
  ------------------
  |  Branch (641:6): [True: 0, False: 112k]
  ------------------
  642|      0|		return (-1);
  643|   112k|	wcs = dest->s + dest->length;
  644|       |	/*
  645|       |	 * We cannot use mbsrtowcs/mbstowcs here because those may convert
  646|       |	 * extra MBS when strlen(p) > len and one wide character consists of
  647|       |	 * multi bytes.
  648|       |	 */
  649|  24.7M|	while (*mbs && mbs_length > 0) {
  ------------------
  |  Branch (649:9): [True: 24.6M, False: 80.6k]
  |  Branch (649:17): [True: 24.6M, False: 0]
  ------------------
  650|       |		/*
  651|       |		 * The buffer we allocated is always big enough.
  652|       |		 * Keep this code path in a comment if we decide to choose
  653|       |		 * smaller wcs_length in the future
  654|       |		 */
  655|       |/*
  656|       |		if (wcs_length == 0) {
  657|       |			dest->length = wcs - dest->s;
  658|       |			dest->s[dest->length] = L'\0';
  659|       |			wcs_length = mbs_length;
  660|       |			if (NULL == archive_wstring_ensure(dest,
  661|       |			    dest->length + wcs_length + 1))
  662|       |				return (-1);
  663|       |			wcs = dest->s + dest->length;
  664|       |		}
  665|       |*/
  666|  24.6M|#if HAVE_MBRTOWC
  667|  24.6M|		r = mbrtowc(wcs, mbs, mbs_length, &shift_state);
  668|       |#else
  669|       |		r = mbtowc(wcs, mbs, mbs_length);
  670|       |#endif
  671|  24.6M|		if (r == (size_t)-1 || r == (size_t)-2) {
  ------------------
  |  Branch (671:7): [True: 31.9k, False: 24.6M]
  |  Branch (671:26): [True: 0, False: 24.6M]
  ------------------
  672|  31.9k|			ret_val = -1;
  673|  31.9k|			break;
  674|  31.9k|		}
  675|  24.6M|		if (r == 0 || r > mbs_length)
  ------------------
  |  Branch (675:7): [True: 0, False: 24.6M]
  |  Branch (675:17): [True: 0, False: 24.6M]
  ------------------
  676|      0|			break;
  677|  24.6M|		wcs++;
  678|       |		// wcs_length--;
  679|  24.6M|		mbs += r;
  680|  24.6M|		mbs_length -= r;
  681|  24.6M|	}
  682|   112k|	dest->length = wcs - dest->s;
  683|   112k|	dest->s[dest->length] = L'\0';
  684|   112k|	return (ret_val);
  685|   112k|}
archive_string_append_from_wcs:
  815|  3.35k|{
  816|       |	/* We cannot use the standard wcstombs() here because it
  817|       |	 * cannot tell us how big the output buffer should be.  So
  818|       |	 * I've built a loop around wcrtomb() or wctomb() that
  819|       |	 * converts a character at a time and resizes the string as
  820|       |	 * needed.  We prefer wcrtomb() when it's available because
  821|       |	 * it's thread-safe. */
  822|  3.35k|	int n, ret_val = 0;
  823|  3.35k|	char *p;
  824|  3.35k|	char *end;
  825|  3.35k|#if HAVE_WCRTOMB
  826|  3.35k|	mbstate_t shift_state;
  827|       |
  828|  3.35k|	memset(&shift_state, 0, sizeof(shift_state));
  829|       |#else
  830|       |	/* Clear the shift state before starting. */
  831|       |	wctomb(NULL, L'\0');
  832|       |#endif
  833|       |	/*
  834|       |	 * Allocate buffer for MBS.
  835|       |	 * We need this allocation here since it is possible that
  836|       |	 * as->s is still NULL.
  837|       |	 */
  838|  3.35k|	if (archive_string_ensure(as, as->length + len + 1) == NULL)
  ------------------
  |  Branch (838:6): [True: 0, False: 3.35k]
  ------------------
  839|      0|		return (-1);
  840|       |
  841|  3.35k|	p = as->s + as->length;
  842|  3.35k|	end = as->s + as->buffer_length - MB_CUR_MAX -1;
  843|  27.6k|	while (*w != L'\0' && len > 0) {
  ------------------
  |  Branch (843:9): [True: 24.3k, False: 3.35k]
  |  Branch (843:24): [True: 24.3k, False: 0]
  ------------------
  844|  24.3k|		if (p >= end) {
  ------------------
  |  Branch (844:7): [True: 274, False: 24.0k]
  ------------------
  845|    274|			as->length = p - as->s;
  846|    274|			as->s[as->length] = '\0';
  847|       |			/* Re-allocate buffer for MBS. */
  848|    274|			if (archive_string_ensure(as,
  ------------------
  |  Branch (848:8): [True: 0, False: 274]
  ------------------
  849|    274|			    as->length + max(len * 2,
  ------------------
  |  |   78|    274|#define max(a, b)       ((a)>(b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (78:26): [True: 274, False: 0]
  |  |  ------------------
  ------------------
  850|    274|			    (size_t)MB_CUR_MAX) + 1) == NULL)
  851|      0|				return (-1);
  852|    274|			p = as->s + as->length;
  853|    274|			end = as->s + as->buffer_length - MB_CUR_MAX -1;
  854|    274|		}
  855|  24.3k|#if HAVE_WCRTOMB
  856|  24.3k|		n = wcrtomb(p, *w++, &shift_state);
  857|       |#else
  858|       |		n = wctomb(p, *w++);
  859|       |#endif
  860|  24.3k|		if (n == -1) {
  ------------------
  |  Branch (860:7): [True: 0, False: 24.3k]
  ------------------
  861|      0|			if (errno == EILSEQ) {
  ------------------
  |  Branch (861:8): [True: 0, False: 0]
  ------------------
  862|       |				/* Skip an illegal wide char. */
  863|      0|				*p++ = '?';
  864|      0|				ret_val = -1;
  865|      0|			} else {
  866|      0|				ret_val = -1;
  867|      0|				break;
  868|      0|			}
  869|      0|		} else
  870|  24.3k|			p += n;
  871|  24.3k|		len--;
  872|  24.3k|	}
  873|  3.35k|	as->length = p - as->s;
  874|  3.35k|	as->s[as->length] = '\0';
  875|  3.35k|	return (ret_val);
  876|  3.35k|}
archive_string_conversion_to_charset:
 1776|  82.3k|{
 1777|  82.3k|	int flag = SCONV_TO_CHARSET;
  ------------------
  |  |   89|  82.3k|#define SCONV_TO_CHARSET	1	/* MBS is being converted to specified
  ------------------
 1778|       |
 1779|  82.3k|	if (best_effort)
  ------------------
  |  Branch (1779:6): [True: 82.3k, False: 0]
  ------------------
 1780|  82.3k|		flag |= SCONV_BEST_EFFORT;
  ------------------
  |  |   93|  82.3k|#define SCONV_BEST_EFFORT 	(1<<2)	/* Copy at least ASCII code. */
  ------------------
 1781|  82.3k|	return (get_sconv_object(a, get_current_charset(a), charset, flag));
 1782|  82.3k|}
archive_string_conversion_from_charset:
 1787|  28.3k|{
 1788|  28.3k|	int flag = SCONV_FROM_CHARSET;
  ------------------
  |  |   91|  28.3k|#define SCONV_FROM_CHARSET	(1<<1)	/* MBS is being converted from
  ------------------
 1789|       |
 1790|  28.3k|	if (best_effort)
  ------------------
  |  Branch (1790:6): [True: 28.3k, False: 0]
  ------------------
 1791|  28.3k|		flag |= SCONV_BEST_EFFORT;
  ------------------
  |  |   93|  28.3k|#define SCONV_BEST_EFFORT 	(1<<2)	/* Copy at least ASCII code. */
  ------------------
 1792|  28.3k|	return (get_sconv_object(a, charset, get_current_charset(a), flag));
 1793|  28.3k|}
archive_string_default_conversion_for_read:
 1849|  1.36k|{
 1850|  1.36k|	(void)a; /* UNUSED */
 1851|       |	return (NULL);
 1852|  1.36k|}
archive_string_conversion_free:
 1867|  2.49k|{
 1868|  2.49k|	struct archive_string_conv *sc; 
 1869|  2.49k|	struct archive_string_conv *sc_next; 
 1870|       |
 1871|  2.96k|	for (sc = a->sconv; sc != NULL; sc = sc_next) {
  ------------------
  |  Branch (1871:22): [True: 461, False: 2.49k]
  ------------------
 1872|    461|		sc_next = sc->next;
 1873|    461|		free_sconv_object(sc);
 1874|    461|	}
 1875|  2.49k|	a->sconv = NULL;
 1876|  2.49k|	free(a->current_code);
 1877|       |	a->current_code = NULL;
 1878|  2.49k|}
archive_string_conversion_charset_name:
 1885|  1.80k|{
 1886|  1.80k|	if (sc == NULL) {
  ------------------
  |  Branch (1886:6): [True: 0, False: 1.80k]
  ------------------
 1887|      0|		return "current locale";
 1888|      0|	}
 1889|  1.80k|	if (sc->flag & SCONV_TO_CHARSET)
  ------------------
  |  |   89|  1.80k|#define SCONV_TO_CHARSET	1	/* MBS is being converted to specified
  ------------------
  |  Branch (1889:6): [True: 0, False: 1.80k]
  ------------------
 1890|      0|		return (sc->to_charset);
 1891|  1.80k|	else
 1892|  1.80k|		return (sc->from_charset);
 1893|  1.80k|}
archive_strncpy_l:
 2008|   203k|{
 2009|   203k|	as->length = 0;
 2010|   203k|	return (archive_strncat_l(as, _p, n, sc));
 2011|   203k|}
archive_strncat_l:
 2016|   203k|{
 2017|   203k|	const void *s;
 2018|   203k|	size_t length = 0;
 2019|   203k|	int i, r = 0, r2;
 2020|       |
 2021|   203k|	if (_p != NULL && n > 0) {
  ------------------
  |  Branch (2021:6): [True: 203k, False: 0]
  |  Branch (2021:20): [True: 131k, False: 72.2k]
  ------------------
 2022|   131k|		if (sc != NULL && (sc->flag & SCONV_FROM_UTF16))
  ------------------
  |  |  112|  69.9k|#define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  108|  69.9k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  110|  69.9k|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (2022:7): [True: 69.9k, False: 61.3k]
  |  Branch (2022:21): [True: 670, False: 69.2k]
  ------------------
 2023|    670|			length = utf16nbytes(_p, n);
 2024|   130k|		else
 2025|   130k|			length = mbsnbytes(_p, n);
 2026|   131k|	}
 2027|       |
 2028|       |	/* We must allocate memory even if there is no data for conversion
 2029|       |	 * or copy. This simulates archive_string_append behavior. */
 2030|   203k|	if (length == 0) {
  ------------------
  |  Branch (2030:6): [True: 85.5k, False: 117k]
  ------------------
 2031|  85.5k|		size_t tn = 1;
 2032|  85.5k|		if (sc != NULL && (sc->flag & SCONV_TO_UTF16))
  ------------------
  |  |  111|  54.0k|#define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  107|  54.0k|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  109|  54.0k|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (2032:7): [True: 54.0k, False: 31.4k]
  |  Branch (2032:21): [True: 0, False: 54.0k]
  ------------------
 2033|      0|			tn = 2;
 2034|  85.5k|		if (archive_string_ensure(as, as->length + tn) == NULL)
  ------------------
  |  Branch (2034:7): [True: 0, False: 85.5k]
  ------------------
 2035|      0|			return (-1);
 2036|  85.5k|		as->s[as->length] = 0;
 2037|  85.5k|		if (tn == 2)
  ------------------
  |  Branch (2037:7): [True: 0, False: 85.5k]
  ------------------
 2038|      0|			as->s[as->length+1] = 0;
 2039|  85.5k|		return (0);
 2040|  85.5k|	}
 2041|       |
 2042|       |	/*
 2043|       |	 * If sc is NULL, we just make a copy.
 2044|       |	 */
 2045|   117k|	if (sc == NULL) {
  ------------------
  |  Branch (2045:6): [True: 48.2k, False: 69.7k]
  ------------------
 2046|  48.2k|		if (archive_string_append(as, _p, length) == NULL)
  ------------------
  |  Branch (2046:7): [True: 0, False: 48.2k]
  ------------------
 2047|      0|			return (-1);/* No memory */
 2048|  48.2k|		return (0);
 2049|  48.2k|	}
 2050|       |
 2051|  69.7k|	s = _p;
 2052|  69.7k|	i = 0;
 2053|  69.7k|	if (sc->nconverter > 1) {
  ------------------
  |  Branch (2053:6): [True: 22.7k, False: 47.0k]
  ------------------
 2054|  22.7k|		sc->utftmp.length = 0;
 2055|  22.7k|		r2 = sc->converter[0](&(sc->utftmp), s, length, sc);
 2056|  22.7k|		if (r2 != 0 && errno == ENOMEM)
  ------------------
  |  Branch (2056:7): [True: 15.0k, False: 7.61k]
  |  Branch (2056:18): [True: 0, False: 15.0k]
  ------------------
 2057|      0|			return (r2);
 2058|  22.7k|		if (r > r2)
  ------------------
  |  Branch (2058:7): [True: 15.0k, False: 7.61k]
  ------------------
 2059|  15.0k|			r = r2;
 2060|  22.7k|		s = sc->utftmp.s;
 2061|  22.7k|		length = sc->utftmp.length;
 2062|  22.7k|		++i;
 2063|  22.7k|	}
 2064|  69.7k|	r2 = sc->converter[i](as, s, length, sc);
 2065|  69.7k|	if (r > r2)
  ------------------
  |  Branch (2065:6): [True: 17.8k, False: 51.8k]
  ------------------
 2066|  17.8k|		r = r2;
 2067|  69.7k|	return (r);
 2068|  69.7k|}
archive_mstring_clean:
 3921|  2.23M|{
 3922|  2.23M|	archive_wstring_free(&(aes->aes_wcs));
 3923|  2.23M|	archive_string_free(&(aes->aes_mbs));
 3924|  2.23M|	archive_string_free(&(aes->aes_utf8));
 3925|  2.23M|	archive_string_free(&(aes->aes_mbs_in_locale));
 3926|  2.23M|	aes->aes_set = 0;
 3927|  2.23M|}
archive_mstring_get_utf8:
 3941|  95.7k|{
 3942|  95.7k|	struct archive_string_conv *sc;
 3943|  95.7k|	int r;
 3944|       |
 3945|       |	/* If we already have a UTF8 form, return that immediately. */
 3946|  95.7k|	if (aes->aes_set & AES_SET_UTF8) {
  ------------------
  |  |  221|  95.7k|#define	AES_SET_UTF8 2
  ------------------
  |  Branch (3946:6): [True: 11.3k, False: 84.3k]
  ------------------
 3947|  11.3k|		*p = aes->aes_utf8.s;
 3948|  11.3k|		return (0);
 3949|  11.3k|	}
 3950|       |
 3951|  84.3k|	*p = NULL;
 3952|       |#if defined(_WIN32) && !defined(__CYGWIN__)
 3953|       |	/*
 3954|       |	 * On Windows, first try converting from WCS because (1) there's no
 3955|       |	 * guarantee that the conversion to MBS will succeed, e.g. when using
 3956|       |	 * CP_ACP, and (2) that's more efficient than converting to MBS, just to
 3957|       |	 * convert back to WCS again before finally converting to UTF-8
 3958|       |	 */
 3959|       |	if ((aes->aes_set & AES_SET_WCS) != 0) {
 3960|       |		sc = archive_string_conversion_to_charset(a, "UTF-8", 1);
 3961|       |		if (sc == NULL)
 3962|       |			return (-1);/* Couldn't allocate memory for sc. */
 3963|       |		archive_string_empty(&(aes->aes_utf8));
 3964|       |		r = archive_string_append_from_wcs_in_codepage(&(aes->aes_utf8),
 3965|       |			aes->aes_wcs.s, aes->aes_wcs.length, sc);
 3966|       |		if (a == NULL)
 3967|       |			free_sconv_object(sc);
 3968|       |		if (r == 0) {
 3969|       |			aes->aes_set |= AES_SET_UTF8;
 3970|       |			*p = aes->aes_utf8.s;
 3971|       |			return (0);/* success. */
 3972|       |		} else
 3973|       |			return (-1);/* failure. */
 3974|       |	}
 3975|       |#endif
 3976|       |	/* Try converting WCS to MBS first if MBS does not exist yet. */
 3977|  84.3k|	if ((aes->aes_set & AES_SET_MBS) == 0) {
  ------------------
  |  |  220|  84.3k|#define	AES_SET_MBS 1
  ------------------
  |  Branch (3977:6): [True: 2.01k, False: 82.3k]
  ------------------
 3978|  2.01k|		const char *pm; /* unused */
 3979|  2.01k|		archive_mstring_get_mbs(a, aes, &pm); /* ignore errors, we'll handle it later */
 3980|  2.01k|	}
 3981|  84.3k|	if (aes->aes_set & AES_SET_MBS) {
  ------------------
  |  |  220|  84.3k|#define	AES_SET_MBS 1
  ------------------
  |  Branch (3981:6): [True: 82.3k, False: 2.01k]
  ------------------
 3982|  82.3k|		sc = archive_string_conversion_to_charset(a, "UTF-8", 1);
 3983|  82.3k|		if (sc == NULL)
  ------------------
  |  Branch (3983:7): [True: 0, False: 82.3k]
  ------------------
 3984|      0|			return (-1);/* Couldn't allocate memory for sc. */
 3985|  82.3k|		r = archive_strncpy_l(&(aes->aes_utf8), aes->aes_mbs.s,
 3986|  82.3k|		    aes->aes_mbs.length, sc);
 3987|  82.3k|		if (a == NULL)
  ------------------
  |  Branch (3987:7): [True: 82.3k, False: 0]
  ------------------
 3988|  82.3k|			free_sconv_object(sc);
 3989|  82.3k|		if (r == 0) {
  ------------------
  |  Branch (3989:7): [True: 65.1k, False: 17.1k]
  ------------------
 3990|  65.1k|			aes->aes_set |= AES_SET_UTF8;
  ------------------
  |  |  221|  65.1k|#define	AES_SET_UTF8 2
  ------------------
 3991|  65.1k|			*p = aes->aes_utf8.s;
 3992|  65.1k|			return (0);/* success. */
 3993|  65.1k|		} else
 3994|  17.1k|			return (-1);/* failure. */
 3995|  82.3k|	}
 3996|  2.01k|	return (0);/* success. */
 3997|  84.3k|}
archive_mstring_get_mbs:
 4002|   181k|{
 4003|   181k|	struct archive_string_conv *sc;
 4004|   181k|	int r, ret = 0;
 4005|       |
 4006|       |	/* If we already have an MBS form, return that immediately. */
 4007|   181k|	if (aes->aes_set & AES_SET_MBS) {
  ------------------
  |  |  220|   181k|#define	AES_SET_MBS 1
  ------------------
  |  Branch (4007:6): [True: 91.4k, False: 89.6k]
  ------------------
 4008|  91.4k|		*p = aes->aes_mbs.s;
 4009|  91.4k|		return (ret);
 4010|  91.4k|	}
 4011|       |
 4012|  89.6k|	*p = NULL;
 4013|       |	/* If there's a WCS form, try converting with the native locale. */
 4014|  89.6k|	if (aes->aes_set & AES_SET_WCS) {
  ------------------
  |  |  222|  89.6k|#define	AES_SET_WCS 4
  ------------------
  |  Branch (4014:6): [True: 3.35k, False: 86.2k]
  ------------------
 4015|  3.35k|		archive_string_empty(&(aes->aes_mbs));
  ------------------
  |  |  181|  3.35k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4016|  3.35k|		r = archive_string_append_from_wcs(&(aes->aes_mbs),
 4017|  3.35k|		    aes->aes_wcs.s, aes->aes_wcs.length);
 4018|  3.35k|		*p = aes->aes_mbs.s;
 4019|  3.35k|		if (r == 0) {
  ------------------
  |  Branch (4019:7): [True: 3.35k, False: 0]
  ------------------
 4020|  3.35k|			aes->aes_set |= AES_SET_MBS;
  ------------------
  |  |  220|  3.35k|#define	AES_SET_MBS 1
  ------------------
 4021|  3.35k|			return (ret);
 4022|  3.35k|		} else
 4023|      0|			ret = -1;
 4024|  3.35k|	}
 4025|       |
 4026|       |	/* If there's a UTF-8 form, try converting with the native locale. */
 4027|  86.2k|	if (aes->aes_set & AES_SET_UTF8) {
  ------------------
  |  |  221|  86.2k|#define	AES_SET_UTF8 2
  ------------------
  |  Branch (4027:6): [True: 2.87k, False: 83.3k]
  ------------------
 4028|  2.87k|		archive_string_empty(&(aes->aes_mbs));
  ------------------
  |  |  181|  2.87k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4029|  2.87k|		sc = archive_string_conversion_from_charset(a, "UTF-8", 1);
 4030|  2.87k|		if (sc == NULL)
  ------------------
  |  Branch (4030:7): [True: 0, False: 2.87k]
  ------------------
 4031|      0|			return (-1);/* Couldn't allocate memory for sc. */
 4032|  2.87k|		r = archive_strncpy_l(&(aes->aes_mbs),
 4033|  2.87k|			aes->aes_utf8.s, aes->aes_utf8.length, sc);
 4034|  2.87k|		if (a == NULL)
  ------------------
  |  Branch (4034:7): [True: 2.87k, False: 0]
  ------------------
 4035|  2.87k|			free_sconv_object(sc);
 4036|  2.87k|		*p = aes->aes_mbs.s;
 4037|  2.87k|		if (r == 0) {
  ------------------
  |  Branch (4037:7): [True: 0, False: 2.87k]
  ------------------
 4038|      0|			aes->aes_set |= AES_SET_MBS;
  ------------------
  |  |  220|      0|#define	AES_SET_MBS 1
  ------------------
 4039|      0|			ret = 0;/* success; overwrite previous error. */
 4040|      0|		} else
 4041|  2.87k|			ret = -1;/* failure. */
 4042|  2.87k|	}
 4043|  86.2k|	return (ret);
 4044|  86.2k|}
archive_mstring_get_wcs:
 4049|   213k|{
 4050|   213k|	int r, ret = 0;
 4051|       |
 4052|   213k|	(void)a;/* UNUSED */
 4053|       |	/* Return WCS form if we already have it. */
 4054|   213k|	if (aes->aes_set & AES_SET_WCS) {
  ------------------
  |  |  222|   213k|#define	AES_SET_WCS 4
  ------------------
  |  Branch (4054:6): [True: 80.4k, False: 133k]
  ------------------
 4055|  80.4k|		*wp = aes->aes_wcs.s;
 4056|  80.4k|		return (ret);
 4057|  80.4k|	}
 4058|       |
 4059|   133k|	*wp = NULL;
 4060|       |#if defined(_WIN32) && !defined(__CYGWIN__)
 4061|       |	/*
 4062|       |	 * On Windows, prefer converting from UTF-8 directly to WCS because:
 4063|       |	 * (1) there's no guarantee that the string can be represented in MBS (e.g.
 4064|       |	 * with CP_ACP), and (2) in order to convert from UTF-8 to MBS, we're going
 4065|       |	 * to need to convert from UTF-8 to WCS anyway and its wasteful to throw
 4066|       |	 * away that intermediate result
 4067|       |	 */
 4068|       |	if (aes->aes_set & AES_SET_UTF8) {
 4069|       |		struct archive_string_conv *sc;
 4070|       |
 4071|       |		sc = archive_string_conversion_from_charset(a, "UTF-8", 1);
 4072|       |		if (sc != NULL) {
 4073|       |			archive_wstring_empty((&aes->aes_wcs));
 4074|       |			r = archive_wstring_append_from_mbs_in_codepage(&(aes->aes_wcs),
 4075|       |			    aes->aes_utf8.s, aes->aes_utf8.length, sc);
 4076|       |			if (a == NULL)
 4077|       |				free_sconv_object(sc);
 4078|       |			if (r == 0) {
 4079|       |				aes->aes_set |= AES_SET_WCS;
 4080|       |				*wp = aes->aes_wcs.s;
 4081|       |				return (0);
 4082|       |			}
 4083|       |		}
 4084|       |	}
 4085|       |#endif
 4086|       |	/* Try converting UTF8 to MBS first if MBS does not exist yet. */
 4087|   133k|	if ((aes->aes_set & AES_SET_MBS) == 0) {
  ------------------
  |  |  220|   133k|#define	AES_SET_MBS 1
  ------------------
  |  Branch (4087:6): [True: 35.9k, False: 97.1k]
  ------------------
 4088|  35.9k|		const char *p; /* unused */
 4089|  35.9k|		archive_mstring_get_mbs(a, aes, &p); /* ignore errors, we'll handle it later */
 4090|  35.9k|	}
 4091|       |	/* Try converting MBS to WCS using native locale. */
 4092|   133k|	if (aes->aes_set & AES_SET_MBS) {
  ------------------
  |  |  220|   133k|#define	AES_SET_MBS 1
  ------------------
  |  Branch (4092:6): [True: 97.1k, False: 35.9k]
  ------------------
 4093|  97.1k|		archive_wstring_empty(&(aes->aes_wcs));
  ------------------
  |  |  182|  97.1k|#define	archive_wstring_empty(a) ((a)->length = 0)
  ------------------
 4094|  97.1k|		r = archive_wstring_append_from_mbs(&(aes->aes_wcs),
 4095|  97.1k|		    aes->aes_mbs.s, aes->aes_mbs.length);
 4096|  97.1k|		if (r == 0) {
  ------------------
  |  Branch (4096:7): [True: 65.1k, False: 31.9k]
  ------------------
 4097|  65.1k|			aes->aes_set |= AES_SET_WCS;
  ------------------
  |  |  222|  65.1k|#define	AES_SET_WCS 4
  ------------------
 4098|  65.1k|			*wp = aes->aes_wcs.s;
 4099|  65.1k|		} else
 4100|  31.9k|			ret = -1;/* failure. */
 4101|  97.1k|	}
 4102|   133k|	return (ret);
 4103|   213k|}
archive_mstring_copy_mbs:
 4173|  25.5k|{
 4174|  25.5k|	if (mbs == NULL) {
  ------------------
  |  Branch (4174:6): [True: 2.85k, False: 22.6k]
  ------------------
 4175|  2.85k|		aes->aes_set = 0;
 4176|  2.85k|		return (0);
 4177|  2.85k|	}
 4178|  22.6k|	return (archive_mstring_copy_mbs_len(aes, mbs, strlen(mbs)));
 4179|  25.5k|}
archive_mstring_copy_mbs_len:
 4184|  38.8k|{
 4185|  38.8k|	if (mbs == NULL) {
  ------------------
  |  Branch (4185:6): [True: 0, False: 38.8k]
  ------------------
 4186|      0|		aes->aes_set = 0;
 4187|      0|		return (0);
 4188|      0|	}
 4189|  38.8k|	aes->aes_set = AES_SET_MBS; /* Only MBS form is set now. */
  ------------------
  |  |  220|  38.8k|#define	AES_SET_MBS 1
  ------------------
 4190|  38.8k|	archive_strncpy(&(aes->aes_mbs), mbs, len);
  ------------------
  |  |  173|  38.8k|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 4191|  38.8k|	archive_string_empty(&(aes->aes_utf8));
  ------------------
  |  |  181|  38.8k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4192|  38.8k|	archive_wstring_empty(&(aes->aes_wcs));
  ------------------
  |  |  182|  38.8k|#define	archive_wstring_empty(a) ((a)->length = 0)
  ------------------
 4193|  38.8k|	return (0);
 4194|  38.8k|}
archive_mstring_copy_wcs:
 4198|  3.45k|{
 4199|  3.45k|	return archive_mstring_copy_wcs_len(aes, wcs,
 4200|  3.45k|				wcs == NULL ? 0 : wcslen(wcs));
  ------------------
  |  Branch (4200:5): [True: 0, False: 3.45k]
  ------------------
 4201|  3.45k|}
archive_mstring_copy_wcs_len:
 4220|  3.45k|{
 4221|  3.45k|	if (wcs == NULL) {
  ------------------
  |  Branch (4221:6): [True: 0, False: 3.45k]
  ------------------
 4222|      0|		aes->aes_set = 0;
 4223|      0|		return (0);
 4224|      0|	}
 4225|  3.45k|	aes->aes_set = AES_SET_WCS; /* Only WCS form set. */
  ------------------
  |  |  222|  3.45k|#define	AES_SET_WCS 4
  ------------------
 4226|  3.45k|	archive_string_empty(&(aes->aes_mbs));
  ------------------
  |  |  181|  3.45k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4227|  3.45k|	archive_string_empty(&(aes->aes_utf8));
  ------------------
  |  |  181|  3.45k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4228|  3.45k|	archive_wstrncpy(&(aes->aes_wcs), wcs, len);
  ------------------
  |  |  175|  3.45k|	((as)->length = 0, archive_wstrncat((as), (p), (l)))
  ------------------
 4229|  3.45k|	return (0);
 4230|  3.45k|}
archive_mstring_copy_mbs_len_l:
 4235|  96.2k|{
 4236|  96.2k|	int r;
 4237|       |
 4238|  96.2k|	if (mbs == NULL) {
  ------------------
  |  Branch (4238:6): [True: 2.89k, False: 93.3k]
  ------------------
 4239|  2.89k|		aes->aes_set = 0;
 4240|  2.89k|		return (0);
 4241|  2.89k|	}
 4242|  93.3k|	archive_string_empty(&(aes->aes_mbs));
  ------------------
  |  |  181|  93.3k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4243|  93.3k|	archive_wstring_empty(&(aes->aes_wcs));
  ------------------
  |  |  182|  93.3k|#define	archive_wstring_empty(a) ((a)->length = 0)
  ------------------
 4244|  93.3k|	archive_string_empty(&(aes->aes_utf8));
  ------------------
  |  |  181|  93.3k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4245|       |#if defined(_WIN32) && !defined(__CYGWIN__)
 4246|       |	/*
 4247|       |	 * Internationalization programming on Windows must use Wide
 4248|       |	 * characters because Windows platform cannot make locale UTF-8.
 4249|       |	 */
 4250|       |	if (sc == NULL) {
 4251|       |		if (archive_string_append(&(aes->aes_mbs),
 4252|       |			mbs, mbsnbytes(mbs, len)) == NULL) {
 4253|       |			aes->aes_set = 0;
 4254|       |			r = -1;
 4255|       |		} else {
 4256|       |			aes->aes_set = AES_SET_MBS;
 4257|       |			r = 0;
 4258|       |		}
 4259|       |#if defined(HAVE_ICONV)
 4260|       |	} else if (sc != NULL && sc->cd_w != (iconv_t)-1) {
 4261|       |		/*
 4262|       |		 * This case happens only when MultiByteToWideChar() cannot
 4263|       |		 * handle sc->from_cp, and we have to iconv in order to
 4264|       |		 * translate character-set to wchar_t,UTF-16.
 4265|       |		 */
 4266|       |		iconv_t cd = sc->cd;
 4267|       |		unsigned from_cp;
 4268|       |		int flag;
 4269|       |
 4270|       |		/*
 4271|       |		 * Translate multi-bytes from some character-set to UTF-8.
 4272|       |		 */ 
 4273|       |		sc->cd = sc->cd_w;
 4274|       |		r = archive_strncpy_l(&(aes->aes_utf8), mbs, len, sc);
 4275|       |		sc->cd = cd;
 4276|       |		if (r != 0) {
 4277|       |			aes->aes_set = 0;
 4278|       |			return (r);
 4279|       |		}
 4280|       |		aes->aes_set = AES_SET_UTF8;
 4281|       |
 4282|       |		/*
 4283|       |		 * Append the UTF-8 string into wstring.
 4284|       |		 */ 
 4285|       |		flag = sc->flag;
 4286|       |		sc->flag &= ~(SCONV_NORMALIZATION_C
 4287|       |				| SCONV_TO_UTF16| SCONV_FROM_UTF16);
 4288|       |		from_cp = sc->from_cp;
 4289|       |		sc->from_cp = CP_UTF8;
 4290|       |		r = archive_wstring_append_from_mbs_in_codepage(&(aes->aes_wcs),
 4291|       |			aes->aes_utf8.s, aes->aes_utf8.length, sc);
 4292|       |		sc->flag = flag;
 4293|       |		sc->from_cp = from_cp;
 4294|       |		if (r == 0)
 4295|       |			aes->aes_set |= AES_SET_WCS;
 4296|       |#endif
 4297|       |	} else {
 4298|       |		r = archive_wstring_append_from_mbs_in_codepage(
 4299|       |		    &(aes->aes_wcs), mbs, len, sc);
 4300|       |		if (r == 0)
 4301|       |			aes->aes_set = AES_SET_WCS;
 4302|       |		else
 4303|       |			aes->aes_set = 0;
 4304|       |	}
 4305|       |#else
 4306|  93.3k|	r = archive_strncpy_l(&(aes->aes_mbs), mbs, len, sc);
 4307|  93.3k|	if (r == 0)
  ------------------
  |  Branch (4307:6): [True: 89.9k, False: 3.43k]
  ------------------
 4308|  89.9k|		aes->aes_set = AES_SET_MBS; /* Only MBS form is set now. */
  ------------------
  |  |  220|  89.9k|#define	AES_SET_MBS 1
  ------------------
 4309|  3.43k|	else
 4310|  3.43k|		aes->aes_set = 0;
 4311|  93.3k|#endif
 4312|  93.3k|	return (r);
 4313|  96.2k|}
archive_mstring_update_utf8:
 4328|  24.9k|{
 4329|  24.9k|	struct archive_string_conv *sc;
 4330|  24.9k|	int r;
 4331|       |
 4332|  24.9k|	if (utf8 == NULL) {
  ------------------
  |  Branch (4332:6): [True: 0, False: 24.9k]
  ------------------
 4333|      0|		aes->aes_set = 0;
 4334|      0|		return (0); /* Succeeded in clearing everything. */
 4335|      0|	}
 4336|       |
 4337|       |	/* Save the UTF8 string. */
 4338|  24.9k|	archive_strcpy(&(aes->aes_utf8), utf8);
  ------------------
  |  |  165|  24.9k|	archive_strncpy((as), (p), ((p) == NULL ? 0 : strlen(p)))
  |  |  ------------------
  |  |  |  |  173|  49.9k|	((as)->length=0, archive_strncat((as), (p), (l)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (173:47): [True: 0, False: 24.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4339|       |
 4340|       |	/* Empty the mbs and wcs strings. */
 4341|  24.9k|	archive_string_empty(&(aes->aes_mbs));
  ------------------
  |  |  181|  24.9k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4342|  24.9k|	archive_wstring_empty(&(aes->aes_wcs));
  ------------------
  |  |  182|  24.9k|#define	archive_wstring_empty(a) ((a)->length = 0)
  ------------------
 4343|       |
 4344|  24.9k|	aes->aes_set = AES_SET_UTF8;	/* Only UTF8 is set now. */
  ------------------
  |  |  221|  24.9k|#define	AES_SET_UTF8 2
  ------------------
 4345|       |
 4346|  24.9k|	sc = archive_string_conversion_from_charset(a, "UTF-8", 1);
 4347|  24.9k|	if (sc == NULL)
  ------------------
  |  Branch (4347:6): [True: 0, False: 24.9k]
  ------------------
 4348|      0|		return (-1);/* Couldn't allocate memory for sc. */
 4349|       |
 4350|       |#if defined(_WIN32) && !defined(__CYGWIN__)
 4351|       |	/* On Windows, there's no good way to convert from UTF8 -> MBS directly, so
 4352|       |	 * prefer to first convert to WCS as (1) it's wasteful to throw away the
 4353|       |	 * intermediate result, and (2) WCS will still be set even if we fail to
 4354|       |	 * convert to MBS (e.g. with ACP that can't represent the characters) */
 4355|       |	r = archive_wstring_append_from_mbs_in_codepage(&(aes->aes_wcs),
 4356|       |		aes->aes_utf8.s, aes->aes_utf8.length, sc);
 4357|       |
 4358|       |	if (a == NULL)
 4359|       |		free_sconv_object(sc);
 4360|       |	if (r != 0)
 4361|       |		return (-1); /* This will guarantee we can't convert to MBS */
 4362|       |	aes->aes_set = AES_SET_UTF8 | AES_SET_WCS; /* Both UTF8 and WCS set. */
 4363|       |
 4364|       |	/* Try converting WCS to MBS, return false on failure. */
 4365|       |	if (archive_string_append_from_wcs(&(aes->aes_mbs), aes->aes_wcs.s,
 4366|       |	    aes->aes_wcs.length))
 4367|       |		return (-1);
 4368|       |#else
 4369|       |	/* Try converting UTF-8 to MBS, return false on failure. */
 4370|  24.9k|	r = archive_strcpy_l(&(aes->aes_mbs), utf8, sc);
  ------------------
  |  |  169|  24.9k|	archive_strncpy_l((as), (p), ((p) == NULL ? 0 : strlen(p)), (lo))
  |  |  ------------------
  |  |  |  Branch (169:32): [True: 0, False: 24.9k]
  |  |  ------------------
  ------------------
 4371|       |
 4372|  24.9k|	if (a == NULL)
  ------------------
  |  Branch (4372:6): [True: 24.9k, False: 0]
  ------------------
 4373|  24.9k|		free_sconv_object(sc);
 4374|  24.9k|	if (r != 0)
  ------------------
  |  Branch (4374:6): [True: 9.51k, False: 15.4k]
  ------------------
 4375|  9.51k|		return (-1);
 4376|  15.4k|	aes->aes_set = AES_SET_UTF8 | AES_SET_MBS; /* Both UTF8 and MBS set. */
  ------------------
  |  |  221|  15.4k|#define	AES_SET_UTF8 2
  ------------------
              	aes->aes_set = AES_SET_UTF8 | AES_SET_MBS; /* Both UTF8 and MBS set. */
  ------------------
  |  |  220|  15.4k|#define	AES_SET_MBS 1
  ------------------
 4377|       |
 4378|       |	/* Try converting MBS to WCS, return false on failure. */
 4379|  15.4k|	if (archive_wstring_append_from_mbs(&(aes->aes_wcs), aes->aes_mbs.s,
  ------------------
  |  Branch (4379:6): [True: 0, False: 15.4k]
  ------------------
 4380|  15.4k|	    aes->aes_mbs.length))
 4381|      0|		return (-1);
 4382|  15.4k|#endif
 4383|       |
 4384|       |	/* All conversions succeeded. */
 4385|  15.4k|	aes->aes_set = AES_SET_UTF8 | AES_SET_WCS | AES_SET_MBS;
  ------------------
  |  |  221|  15.4k|#define	AES_SET_UTF8 2
  ------------------
              	aes->aes_set = AES_SET_UTF8 | AES_SET_WCS | AES_SET_MBS;
  ------------------
  |  |  222|  15.4k|#define	AES_SET_WCS 4
  ------------------
              	aes->aes_set = AES_SET_UTF8 | AES_SET_WCS | AES_SET_MBS;
  ------------------
  |  |  220|  15.4k|#define	AES_SET_MBS 1
  ------------------
 4386|       |
 4387|  15.4k|	return (0);
 4388|  15.4k|}
archive_string.c:archive_string_append:
  226|  12.5M|{
  227|  12.5M|	if (archive_string_ensure(as, as->length + s + 1) == NULL)
  ------------------
  |  Branch (227:6): [True: 0, False: 12.5M]
  ------------------
  228|      0|		return (NULL);
  229|  12.5M|	if (s)
  ------------------
  |  Branch (229:6): [True: 12.5M, False: 21.4k]
  ------------------
  230|  12.5M|		memmove(as->s + as->length, p, s);
  231|  12.5M|	as->length += s;
  232|  12.5M|	as->s[as->length] = 0;
  233|  12.5M|	return (as);
  234|  12.5M|}
archive_string.c:archive_wstring_append:
  238|  9.87k|{
  239|  9.87k|	if (archive_wstring_ensure(as, as->length + s + 1) == NULL)
  ------------------
  |  Branch (239:6): [True: 0, False: 9.87k]
  ------------------
  240|      0|		return (NULL);
  241|  9.87k|	if (s)
  ------------------
  |  Branch (241:6): [True: 7.01k, False: 2.85k]
  ------------------
  242|  7.01k|		wmemmove(as->s + as->length, p, s);
  243|  9.87k|	as->length += s;
  244|  9.87k|	as->s[as->length] = 0;
  245|  9.87k|	return (as);
  246|  9.87k|}
archive_string.c:get_sconv_object:
 1694|   110k|{
 1695|   110k|	struct archive_string_conv *sc;
 1696|   110k|	unsigned current_codepage;
 1697|       |
 1698|       |	/* Check if we have made the sconv object. */
 1699|   110k|	sc = find_sconv_object(a, fc, tc);
 1700|   110k|	if (sc != NULL)
  ------------------
  |  Branch (1700:6): [True: 0, False: 110k]
  ------------------
 1701|      0|		return (sc);
 1702|       |
 1703|   110k|	if (a == NULL)
  ------------------
  |  Branch (1703:6): [True: 110k, False: 461]
  ------------------
 1704|   110k|		current_codepage = get_current_codepage();
 1705|    461|	else
 1706|    461|		current_codepage = a->current_codepage;
 1707|       |
 1708|   110k|	sc = create_sconv_object(canonical_charset_name(fc),
 1709|   110k|	    canonical_charset_name(tc), current_codepage, flag);
 1710|   110k|	if (sc == NULL) {
  ------------------
  |  Branch (1710:6): [True: 0, False: 110k]
  ------------------
 1711|      0|		if (a != NULL)
  ------------------
  |  Branch (1711:7): [True: 0, False: 0]
  ------------------
 1712|      0|			archive_set_error(a, ENOMEM,
 1713|      0|			    "Could not allocate memory for "
 1714|      0|			    "a string conversion object");
 1715|      0|		return (NULL);
 1716|      0|	}
 1717|       |
 1718|       |	/*
 1719|       |	 * If there is no converter for current string conversion object,
 1720|       |	 * we cannot handle this conversion.
 1721|       |	 */
 1722|   110k|	if (sc->nconverter == 0) {
  ------------------
  |  Branch (1722:6): [True: 0, False: 110k]
  ------------------
 1723|      0|		if (a != NULL) {
  ------------------
  |  Branch (1723:7): [True: 0, False: 0]
  ------------------
 1724|      0|#if HAVE_ICONV
 1725|      0|			archive_set_error(a, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1726|      0|			    "iconv_open failed: Cannot handle ``%s''",
 1727|      0|			    (flag & SCONV_TO_CHARSET)?tc:fc);
  ------------------
  |  |   89|      0|#define SCONV_TO_CHARSET	1	/* MBS is being converted to specified
  ------------------
  |  Branch (1727:8): [True: 0, False: 0]
  ------------------
 1728|       |#else
 1729|       |			archive_set_error(a, ARCHIVE_ERRNO_MISC,
 1730|       |			    "A character-set conversion not fully supported "
 1731|       |			    "on this platform");
 1732|       |#endif
 1733|      0|		}
 1734|       |		/* Failed; free a sconv object. */
 1735|      0|		free_sconv_object(sc);
 1736|      0|		return (NULL);
 1737|      0|	}
 1738|       |
 1739|       |	/*
 1740|       |	 * Success!
 1741|       |	 */
 1742|   110k|	if (a != NULL)
  ------------------
  |  Branch (1742:6): [True: 461, False: 110k]
  ------------------
 1743|    461|		add_sconv_object(a, sc);
 1744|   110k|	return (sc);
 1745|   110k|}
archive_string.c:find_sconv_object:
  906|   110k|{
  907|   110k|	struct archive_string_conv *sc; 
  908|       |
  909|   110k|	if (a == NULL)
  ------------------
  |  Branch (909:6): [True: 110k, False: 461]
  ------------------
  910|   110k|		return (NULL);
  911|       |
  912|    461|	for (sc = a->sconv; sc != NULL; sc = sc->next) {
  ------------------
  |  Branch (912:22): [True: 0, False: 461]
  ------------------
  913|      0|		if (strcmp(sc->from_charset, fc) == 0 &&
  ------------------
  |  Branch (913:7): [True: 0, False: 0]
  ------------------
  914|      0|		    strcmp(sc->to_charset, tc) == 0)
  ------------------
  |  Branch (914:7): [True: 0, False: 0]
  ------------------
  915|      0|			break;
  916|      0|	}
  917|    461|	return (sc);
  918|   110k|}
archive_string.c:get_current_codepage:
 1672|   110k|{
 1673|   110k|	return (-1);/* Unknown */
 1674|   110k|}
archive_string.c:create_sconv_object:
 1167|   110k|{
 1168|   110k|	struct archive_string_conv *sc; 
 1169|       |
 1170|   110k|	sc = calloc(1, sizeof(*sc));
 1171|   110k|	if (sc == NULL)
  ------------------
  |  Branch (1171:6): [True: 0, False: 110k]
  ------------------
 1172|      0|		return (NULL);
 1173|   110k|	sc->next = NULL;
 1174|   110k|	sc->from_charset = strdup(fc);
 1175|   110k|	if (sc->from_charset == NULL) {
  ------------------
  |  Branch (1175:6): [True: 0, False: 110k]
  ------------------
 1176|      0|		free(sc);
 1177|      0|		return (NULL);
 1178|      0|	}
 1179|   110k|	sc->to_charset = strdup(tc);
 1180|   110k|	if (sc->to_charset == NULL) {
  ------------------
  |  Branch (1180:6): [True: 0, False: 110k]
  ------------------
 1181|      0|		free(sc->from_charset);
 1182|      0|		free(sc);
 1183|      0|		return (NULL);
 1184|      0|	}
 1185|   110k|	archive_string_init(&sc->utftmp);
  ------------------
  |  |   71|   110k|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 110k]
  |  |  ------------------
  ------------------
 1186|       |
 1187|   110k|	if (flag & SCONV_TO_CHARSET) {
  ------------------
  |  |   89|   110k|#define SCONV_TO_CHARSET	1	/* MBS is being converted to specified
  ------------------
  |  Branch (1187:6): [True: 82.3k, False: 28.3k]
  ------------------
 1188|       |		/*
 1189|       |		 * Convert characters from the current locale charset to
 1190|       |		 * a specified charset.
 1191|       |		 */
 1192|  82.3k|		sc->from_cp = current_codepage;
 1193|  82.3k|		sc->to_cp = make_codepage_from_charset(tc);
 1194|       |#if defined(_WIN32) && !defined(__CYGWIN__)
 1195|       |		if (IsValidCodePage(sc->to_cp))
 1196|       |			flag |= SCONV_WIN_CP;
 1197|       |#endif
 1198|  82.3k|	} else if (flag & SCONV_FROM_CHARSET) {
  ------------------
  |  |   91|  28.3k|#define SCONV_FROM_CHARSET	(1<<1)	/* MBS is being converted from
  ------------------
  |  Branch (1198:13): [True: 28.3k, False: 0]
  ------------------
 1199|       |		/*
 1200|       |		 * Convert characters from a specified charset to
 1201|       |		 * the current locale charset.
 1202|       |		 */
 1203|  28.3k|		sc->to_cp = current_codepage;
 1204|  28.3k|		sc->from_cp = make_codepage_from_charset(fc);
 1205|       |#if defined(_WIN32) && !defined(__CYGWIN__)
 1206|       |		if (IsValidCodePage(sc->from_cp))
 1207|       |			flag |= SCONV_WIN_CP;
 1208|       |#endif
 1209|  28.3k|	}
 1210|       |
 1211|       |	/*
 1212|       |	 * Check if "from charset" and "to charset" are the same.
 1213|       |	 */
 1214|   110k|	if (strcmp(fc, tc) == 0 ||
  ------------------
  |  Branch (1214:6): [True: 0, False: 110k]
  ------------------
 1215|   110k|	    (sc->from_cp != (unsigned)-1 && sc->from_cp == sc->to_cp))
  ------------------
  |  Branch (1215:7): [True: 0, False: 110k]
  |  Branch (1215:38): [True: 0, False: 0]
  ------------------
 1216|      0|		sc->same = 1;
 1217|   110k|	else
 1218|   110k|		sc->same = 0;
 1219|       |
 1220|       |	/*
 1221|       |	 * Mark if "from charset" or "to charset" are UTF-8 or UTF-16BE/LE.
 1222|       |	 */
 1223|   110k|	if (strcmp(tc, "UTF-8") == 0)
  ------------------
  |  Branch (1223:6): [True: 82.3k, False: 28.3k]
  ------------------
 1224|  82.3k|		flag |= SCONV_TO_UTF8;
  ------------------
  |  |  105|  82.3k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
 1225|  28.3k|	else if (strcmp(tc, "UTF-16BE") == 0)
  ------------------
  |  Branch (1225:11): [True: 0, False: 28.3k]
  ------------------
 1226|      0|		flag |= SCONV_TO_UTF16BE;
  ------------------
  |  |  107|      0|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  ------------------
 1227|  28.3k|	else if (strcmp(tc, "UTF-16LE") == 0)
  ------------------
  |  Branch (1227:11): [True: 0, False: 28.3k]
  ------------------
 1228|      0|		flag |= SCONV_TO_UTF16LE;
  ------------------
  |  |  109|      0|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  ------------------
 1229|   110k|	if (strcmp(fc, "UTF-8") == 0)
  ------------------
  |  Branch (1229:6): [True: 28.2k, False: 82.3k]
  ------------------
 1230|  28.2k|		flag |= SCONV_FROM_UTF8;
  ------------------
  |  |  106|  28.2k|#define SCONV_FROM_UTF8		(1<<9)	/* "from charset" side is UTF-8. */
  ------------------
 1231|  82.3k|	else if (strcmp(fc, "UTF-16BE") == 0)
  ------------------
  |  Branch (1231:11): [True: 29, False: 82.3k]
  ------------------
 1232|     29|		flag |= SCONV_FROM_UTF16BE;
  ------------------
  |  |  108|     29|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  ------------------
 1233|  82.3k|	else if (strcmp(fc, "UTF-16LE") == 0)
  ------------------
  |  Branch (1233:11): [True: 19, False: 82.3k]
  ------------------
 1234|     19|		flag |= SCONV_FROM_UTF16LE;
  ------------------
  |  |  110|     19|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  ------------------
 1235|       |#if defined(_WIN32) && !defined(__CYGWIN__)
 1236|       |	if (sc->to_cp == CP_UTF8)
 1237|       |		flag |= SCONV_TO_UTF8;
 1238|       |	else if (sc->to_cp == CP_UTF16BE)
 1239|       |		flag |= SCONV_TO_UTF16BE | SCONV_WIN_CP;
 1240|       |	else if (sc->to_cp == CP_UTF16LE)
 1241|       |		flag |= SCONV_TO_UTF16LE | SCONV_WIN_CP;
 1242|       |	if (sc->from_cp == CP_UTF8)
 1243|       |		flag |= SCONV_FROM_UTF8;
 1244|       |	else if (sc->from_cp == CP_UTF16BE)
 1245|       |		flag |= SCONV_FROM_UTF16BE | SCONV_WIN_CP;
 1246|       |	else if (sc->from_cp == CP_UTF16LE)
 1247|       |		flag |= SCONV_FROM_UTF16LE | SCONV_WIN_CP;
 1248|       |#endif
 1249|       |
 1250|       |	/*
 1251|       |	 * Set a flag for Unicode NFD. Usually iconv cannot correctly
 1252|       |	 * handle it. So we have to translate NFD characters to NFC ones
 1253|       |	 * ourselves before iconv handles. Another reason is to prevent
 1254|       |	 * that the same sight of two filenames, one is NFC and other
 1255|       |	 * is NFD, would be in its directory.
 1256|       |	 * On Mac OS X, although its filesystem layer automatically
 1257|       |	 * convert filenames to NFD, it would be useful for filename
 1258|       |	 * comparing to find out the same filenames that we normalize
 1259|       |	 * that to be NFD ourselves.
 1260|       |	 */
 1261|   110k|	if ((flag & SCONV_FROM_CHARSET) &&
  ------------------
  |  |   91|   110k|#define SCONV_FROM_CHARSET	(1<<1)	/* MBS is being converted from
  ------------------
  |  Branch (1261:6): [True: 28.3k, False: 82.3k]
  ------------------
 1262|  28.3k|	    (flag & (SCONV_FROM_UTF16 | SCONV_FROM_UTF8))) {
  ------------------
  |  |  112|  28.3k|#define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  108|  28.3k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  110|  28.3k|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
              	    (flag & (SCONV_FROM_UTF16 | SCONV_FROM_UTF8))) {
  ------------------
  |  |  106|  28.3k|#define SCONV_FROM_UTF8		(1<<9)	/* "from charset" side is UTF-8. */
  ------------------
  |  Branch (1262:6): [True: 28.3k, False: 0]
  ------------------
 1263|       |#if defined(__APPLE__)
 1264|       |		if (flag & SCONV_TO_UTF8)
 1265|       |			flag |= SCONV_NORMALIZATION_D;
 1266|       |		else
 1267|       |#endif
 1268|  28.3k|			flag |= SCONV_NORMALIZATION_C;
  ------------------
  |  |   98|  28.3k|#define SCONV_NORMALIZATION_C	(1<<6)	/* Need normalization to be Form C.
  ------------------
 1269|  28.3k|	}
 1270|       |#if defined(__APPLE__)
 1271|       |	/*
 1272|       |	 * In case writing an archive file, make sure that a filename
 1273|       |	 * going to be passed to iconv is a Unicode NFC string since
 1274|       |	 * a filename in HFS Plus filesystem is a Unicode NFD one and
 1275|       |	 * iconv cannot handle it with "UTF-8" charset. It is simpler
 1276|       |	 * than a use of "UTF-8-MAC" charset.
 1277|       |	 */
 1278|       |	if ((flag & SCONV_TO_CHARSET) &&
 1279|       |	    (flag & (SCONV_FROM_UTF16 | SCONV_FROM_UTF8)) &&
 1280|       |	    !(flag & (SCONV_TO_UTF16 | SCONV_TO_UTF8)))
 1281|       |		flag |= SCONV_NORMALIZATION_C;
 1282|       |	/*
 1283|       |	 * In case reading an archive file. make sure that a filename
 1284|       |	 * will be passed to users is a Unicode NFD string in order to
 1285|       |	 * correctly compare the filename with other one which comes
 1286|       |	 * from HFS Plus filesystem.
 1287|       |	 */
 1288|       |	if ((flag & SCONV_FROM_CHARSET) &&
 1289|       |	   !(flag & (SCONV_FROM_UTF16 | SCONV_FROM_UTF8)) &&
 1290|       |	    (flag & SCONV_TO_UTF8))
 1291|       |		flag |= SCONV_NORMALIZATION_D;
 1292|       |#endif
 1293|       |
 1294|   110k|#if defined(HAVE_ICONV)
 1295|   110k|	sc->cd_w = (iconv_t)-1;
 1296|       |	/*
 1297|       |	 * Create an iconv object.
 1298|       |	 */
 1299|   110k|	if (((flag & (SCONV_TO_UTF8 | SCONV_TO_UTF16)) &&
  ------------------
  |  |  105|   110k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
              	if (((flag & (SCONV_TO_UTF8 | SCONV_TO_UTF16)) &&
  ------------------
  |  |  111|   110k|#define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  107|   110k|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  109|   110k|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (1299:7): [True: 82.3k, False: 28.3k]
  ------------------
 1300|  82.3k|	    (flag & (SCONV_FROM_UTF8 | SCONV_FROM_UTF16))) ||
  ------------------
  |  |  106|  82.3k|#define SCONV_FROM_UTF8		(1<<9)	/* "from charset" side is UTF-8. */
  ------------------
              	    (flag & (SCONV_FROM_UTF8 | SCONV_FROM_UTF16))) ||
  ------------------
  |  |  112|  82.3k|#define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  108|  82.3k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  110|  82.3k|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (1300:6): [True: 0, False: 82.3k]
  ------------------
 1301|   110k|	    (flag & SCONV_WIN_CP)) {
  ------------------
  |  |   94|   110k|#define SCONV_WIN_CP	 	(1<<3)	/* Use Windows API for converting
  ------------------
  |  Branch (1301:6): [True: 0, False: 110k]
  ------------------
 1302|       |		/* This case we won't use iconv. */
 1303|      0|		sc->cd = (iconv_t)-1;
 1304|   110k|	} else {
 1305|   110k|		sc->cd = iconv_open(tc, fc);
 1306|   110k|		if (sc->cd == (iconv_t)-1 && (sc->flag & SCONV_BEST_EFFORT)) {
  ------------------
  |  |   93|      0|#define SCONV_BEST_EFFORT 	(1<<2)	/* Copy at least ASCII code. */
  ------------------
  |  Branch (1306:7): [True: 0, False: 110k]
  |  Branch (1306:32): [True: 0, False: 0]
  ------------------
 1307|       |			/*
 1308|       |			 * Unfortunately, all of iconv implements do support
 1309|       |			 * "CP932" character-set, so we should use "SJIS"
 1310|       |			 * instead if iconv_open failed.
 1311|       |			 */
 1312|      0|			if (strcmp(tc, "CP932") == 0)
  ------------------
  |  Branch (1312:8): [True: 0, False: 0]
  ------------------
 1313|      0|				sc->cd = iconv_open("SJIS", fc);
 1314|      0|			else if (strcmp(fc, "CP932") == 0)
  ------------------
  |  Branch (1314:13): [True: 0, False: 0]
  ------------------
 1315|      0|				sc->cd = iconv_open(tc, "SJIS");
 1316|      0|		}
 1317|       |#if defined(__FreeBSD__) && !defined(HAVE_LIBICONV)
 1318|       |		/*
 1319|       |		 * FreeBSD's native iconv() by default returns the number of
 1320|       |		 * invalid characters in the input string, as specified by
 1321|       |		 * POSIX, but iconv_strncat_in_locale() assumes GNU iconv
 1322|       |		 * semantics.
 1323|       |		 */
 1324|       |		int v = 1;
 1325|       |
 1326|       |		(void)iconvctl(sc->cd, ICONV_SET_ILSEQ_INVALID, &v);
 1327|       |#elif defined(_WIN32) && !defined(__CYGWIN__)
 1328|       |		/*
 1329|       |		 * archive_mstring on Windows directly convert multi-bytes
 1330|       |		 * into archive_wstring in order not to depend on locale
 1331|       |		 * so that you can do a I18N programming. This will be
 1332|       |		 * used only in archive_mstring_copy_mbs_len_l so far.
 1333|       |		 */
 1334|       |		if (flag & SCONV_FROM_CHARSET) {
 1335|       |			sc->cd_w = iconv_open("UTF-8", fc);
 1336|       |			if (sc->cd_w == (iconv_t)-1 &&
 1337|       |			    (sc->flag & SCONV_BEST_EFFORT)) {
 1338|       |				if (strcmp(fc, "CP932") == 0)
 1339|       |					sc->cd_w = iconv_open("UTF-8", "SJIS");
 1340|       |			}
 1341|       |		}
 1342|       |#endif /* _WIN32 && !__CYGWIN__ */
 1343|   110k|	}
 1344|   110k|#endif	/* HAVE_ICONV */
 1345|       |
 1346|   110k|	sc->flag = flag;
 1347|       |
 1348|       |	/*
 1349|       |	 * Set up converters.
 1350|       |	 */
 1351|   110k|	setup_converter(sc);
 1352|       |
 1353|   110k|	return (sc);
 1354|   110k|}
archive_string.c:make_codepage_from_charset:
 1677|   110k|{
 1678|   110k|	(void)charset; /* UNUSED */
 1679|   110k|	return (-1);/* Unknown */
 1680|   110k|}
archive_string.c:canonical_charset_name:
 1127|   221k|{
 1128|   221k|	char cs[16];
 1129|   221k|	char *p;
 1130|   221k|	const char *s;
 1131|       |
 1132|   221k|	if (charset == NULL || charset[0] == '\0'
  ------------------
  |  Branch (1132:6): [True: 0, False: 221k]
  |  Branch (1132:25): [True: 0, False: 221k]
  ------------------
 1133|   221k|	    || strlen(charset) > 15)
  ------------------
  |  Branch (1133:9): [True: 0, False: 221k]
  ------------------
 1134|      0|		return (charset);
 1135|       |
 1136|       |	/* Copy name to uppercase. */
 1137|   221k|	p = cs;
 1138|   221k|	s = charset;
 1139|  2.32M|	while (*s) {
  ------------------
  |  Branch (1139:9): [True: 2.10M, False: 221k]
  ------------------
 1140|  2.10M|		char c = *s++;
 1141|  2.10M|		if (c >= 'a' && c <= 'z')
  ------------------
  |  Branch (1141:7): [True: 0, False: 2.10M]
  |  Branch (1141:19): [True: 0, False: 0]
  ------------------
 1142|      0|			c -= 'a' - 'A';
 1143|  2.10M|		*p++ = c;
 1144|  2.10M|	}
 1145|   221k|	*p++ = '\0';
 1146|       |
 1147|   221k|	if (strcmp(cs, "UTF-8") == 0 ||
  ------------------
  |  Branch (1147:6): [True: 110k, False: 110k]
  ------------------
 1148|   110k|	    strcmp(cs, "UTF8") == 0)
  ------------------
  |  Branch (1148:6): [True: 0, False: 110k]
  ------------------
 1149|   110k|		return ("UTF-8");
 1150|   110k|	if (strcmp(cs, "UTF-16BE") == 0 ||
  ------------------
  |  Branch (1150:6): [True: 29, False: 110k]
  ------------------
 1151|   110k|	    strcmp(cs, "UTF16BE") == 0)
  ------------------
  |  Branch (1151:6): [True: 0, False: 110k]
  ------------------
 1152|     29|		return ("UTF-16BE");
 1153|   110k|	if (strcmp(cs, "UTF-16LE") == 0 ||
  ------------------
  |  Branch (1153:6): [True: 19, False: 110k]
  ------------------
 1154|   110k|	    strcmp(cs, "UTF16LE") == 0)
  ------------------
  |  Branch (1154:6): [True: 0, False: 110k]
  ------------------
 1155|     19|		return ("UTF-16LE");
 1156|   110k|	if (strcmp(cs, "CP932") == 0)
  ------------------
  |  Branch (1156:6): [True: 0, False: 110k]
  ------------------
 1157|      0|		return ("CP932");
 1158|   110k|	return (charset);
 1159|   110k|}
archive_string.c:add_sconv_object:
  925|    461|{
  926|    461|	struct archive_string_conv **psc; 
  927|       |
  928|       |	/* Add a new sconv to sconv list. */
  929|    461|	psc = &(a->sconv);
  930|    461|	while (*psc != NULL)
  ------------------
  |  Branch (930:9): [True: 0, False: 461]
  ------------------
  931|      0|		psc = &((*psc)->next);
  932|    461|	*psc = sc;
  933|    461|}
archive_string.c:get_current_charset:
 1749|   110k|{
 1750|   110k|	const char *cur_charset;
 1751|       |
 1752|   110k|	if (a == NULL)
  ------------------
  |  Branch (1752:6): [True: 110k, False: 461]
  ------------------
 1753|   110k|		cur_charset = default_iconv_charset("");
 1754|    461|	else {
 1755|    461|		cur_charset = default_iconv_charset(a->current_code);
 1756|    461|		if (a->current_code == NULL) {
  ------------------
  |  Branch (1756:7): [True: 461, False: 0]
  ------------------
 1757|    461|			a->current_code = strdup(cur_charset);
 1758|    461|			a->current_codepage = get_current_codepage();
 1759|    461|			a->current_oemcp = get_current_oemcp();
 1760|    461|		}
 1761|    461|	}
 1762|   110k|	return (cur_charset);
 1763|   110k|}
archive_string.c:default_iconv_charset:
  445|   110k|default_iconv_charset(const char *charset) {
  446|   110k|	if (charset != NULL && charset[0] != '\0')
  ------------------
  |  Branch (446:6): [True: 110k, False: 461]
  |  Branch (446:25): [True: 0, False: 110k]
  ------------------
  447|      0|		return charset;
  448|       |#if HAVE_LOCALE_CHARSET && !defined(__APPLE__)
  449|       |	/* locale_charset() is broken on Mac OS */
  450|       |	return locale_charset();
  451|       |#elif HAVE_NL_LANGINFO
  452|   110k|	return nl_langinfo(CODESET);
  453|       |#else
  454|       |	return "";
  455|       |#endif
  456|   110k|}
archive_string.c:get_current_oemcp:
 1683|    461|{
 1684|    461|	return (-1);/* Unknown */
 1685|    461|}
archive_string.c:free_sconv_object:
 1361|   110k|{
 1362|   110k|	free(sc->from_charset);
 1363|   110k|	free(sc->to_charset);
 1364|   110k|	archive_string_free(&sc->utftmp);
 1365|   110k|#if HAVE_ICONV
 1366|   110k|	if (sc->cd != (iconv_t)-1)
  ------------------
  |  Branch (1366:6): [True: 110k, False: 0]
  ------------------
 1367|   110k|		iconv_close(sc->cd);
 1368|   110k|	if (sc->cd_w != (iconv_t)-1)
  ------------------
  |  Branch (1368:6): [True: 0, False: 110k]
  ------------------
 1369|      0|		iconv_close(sc->cd_w);
 1370|   110k|#endif
 1371|   110k|	free(sc);
 1372|   110k|}
archive_string.c:setup_converter:
  947|   110k|{
  948|       |
  949|       |	/* Reset. */
  950|   110k|	sc->nconverter = 0;
  951|       |
  952|       |	/*
  953|       |	 * Perform special sequence for the incorrect UTF-8 filenames
  954|       |	 * made by libarchive2.x.
  955|       |	 */
  956|   110k|	if (sc->flag & SCONV_UTF8_LIBARCHIVE_2) {
  ------------------
  |  |   96|   110k|#define SCONV_UTF8_LIBARCHIVE_2 (1<<4)	/* Incorrect UTF-8 made by libarchive
  ------------------
  |  Branch (956:6): [True: 0, False: 110k]
  ------------------
  957|      0|		add_converter(sc, strncat_from_utf8_libarchive2);
  958|      0|		return;
  959|      0|	}
  960|       |
  961|       |	/*
  962|       |	 * Convert a string to UTF-16BE/LE.
  963|       |	 */
  964|   110k|	if (sc->flag & SCONV_TO_UTF16) {
  ------------------
  |  |  111|   110k|#define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  107|   110k|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  109|   110k|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (964:6): [True: 0, False: 110k]
  ------------------
  965|       |		/*
  966|       |		 * If the current locale is UTF-8, we can translate
  967|       |		 * a UTF-8 string into a UTF-16BE string.
  968|       |		 */
  969|      0|		if (sc->flag & SCONV_FROM_UTF8) {
  ------------------
  |  |  106|      0|#define SCONV_FROM_UTF8		(1<<9)	/* "from charset" side is UTF-8. */
  ------------------
  |  Branch (969:7): [True: 0, False: 0]
  ------------------
  970|      0|			add_converter(sc, archive_string_append_unicode);
  971|      0|			return;
  972|      0|		}
  973|       |
  974|       |#if defined(_WIN32) && !defined(__CYGWIN__)
  975|       |		if (sc->flag & SCONV_WIN_CP) {
  976|       |			if (sc->flag & SCONV_TO_UTF16BE)
  977|       |				add_converter(sc, win_strncat_to_utf16be);
  978|       |			else
  979|       |				add_converter(sc, win_strncat_to_utf16le);
  980|       |			return;
  981|       |		}
  982|       |#endif
  983|       |
  984|      0|#if defined(HAVE_ICONV)
  985|      0|		if (sc->cd != (iconv_t)-1) {
  ------------------
  |  Branch (985:7): [True: 0, False: 0]
  ------------------
  986|      0|			add_converter(sc, iconv_strncat_in_locale);
  987|      0|			return;
  988|      0|		}
  989|      0|#endif
  990|       |
  991|      0|		if (sc->flag & SCONV_BEST_EFFORT) {
  ------------------
  |  |   93|      0|#define SCONV_BEST_EFFORT 	(1<<2)	/* Copy at least ASCII code. */
  ------------------
  |  Branch (991:7): [True: 0, False: 0]
  ------------------
  992|      0|			if (sc->flag & SCONV_TO_UTF16BE)
  ------------------
  |  |  107|      0|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  ------------------
  |  Branch (992:8): [True: 0, False: 0]
  ------------------
  993|      0|				add_converter(sc,
  994|      0|					best_effort_strncat_to_utf16be);
  995|      0|			else
  996|      0|				add_converter(sc,
  997|      0|					best_effort_strncat_to_utf16le);
  998|      0|		} else
  999|       |			/* Make sure we have no converter. */
 1000|      0|			sc->nconverter = 0;
 1001|      0|		return;
 1002|      0|	}
 1003|       |
 1004|       |	/*
 1005|       |	 * Convert a string from UTF-16BE/LE.
 1006|       |	 */
 1007|   110k|	if (sc->flag & SCONV_FROM_UTF16) {
  ------------------
  |  |  112|   110k|#define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  108|   110k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  110|   110k|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (1007:6): [True: 48, False: 110k]
  ------------------
 1008|       |		/*
 1009|       |		 * At least we should normalize a UTF-16BE string.
 1010|       |		 */
 1011|     48|		if (sc->flag & SCONV_NORMALIZATION_D)
  ------------------
  |  |  101|     48|#define SCONV_NORMALIZATION_D	(1<<7)	/* Need normalization to be Form D.
  ------------------
  |  Branch (1011:7): [True: 0, False: 48]
  ------------------
 1012|      0|			add_converter(sc,archive_string_normalize_D);
 1013|     48|		else if (sc->flag & SCONV_NORMALIZATION_C)
  ------------------
  |  |   98|     48|#define SCONV_NORMALIZATION_C	(1<<6)	/* Need normalization to be Form C.
  ------------------
  |  Branch (1013:12): [True: 48, False: 0]
  ------------------
 1014|     48|			add_converter(sc, archive_string_normalize_C);
 1015|       |
 1016|     48|		if (sc->flag & SCONV_TO_UTF8) {
  ------------------
  |  |  105|     48|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
  |  Branch (1016:7): [True: 0, False: 48]
  ------------------
 1017|       |			/*
 1018|       |			 * If the current locale is UTF-8, we can translate
 1019|       |			 * a UTF-16BE/LE string into a UTF-8 string directly.
 1020|       |			 */
 1021|      0|			if (!(sc->flag &
  ------------------
  |  Branch (1021:8): [True: 0, False: 0]
  ------------------
 1022|      0|			    (SCONV_NORMALIZATION_D |SCONV_NORMALIZATION_C)))
  ------------------
  |  |  101|      0|#define SCONV_NORMALIZATION_D	(1<<7)	/* Need normalization to be Form D.
  ------------------
              			    (SCONV_NORMALIZATION_D |SCONV_NORMALIZATION_C)))
  ------------------
  |  |   98|      0|#define SCONV_NORMALIZATION_C	(1<<6)	/* Need normalization to be Form C.
  ------------------
 1023|      0|				add_converter(sc,
 1024|      0|				    archive_string_append_unicode);
 1025|      0|			return;
 1026|      0|		}
 1027|       |
 1028|       |#if defined(_WIN32) && !defined(__CYGWIN__)
 1029|       |		if (sc->flag & SCONV_WIN_CP) {
 1030|       |			if (sc->flag & SCONV_FROM_UTF16BE)
 1031|       |				add_converter(sc, win_strncat_from_utf16be);
 1032|       |			else
 1033|       |				add_converter(sc, win_strncat_from_utf16le);
 1034|       |			return;
 1035|       |		}
 1036|       |#endif
 1037|       |
 1038|     48|#if defined(HAVE_ICONV)
 1039|     48|		if (sc->cd != (iconv_t)-1) {
  ------------------
  |  Branch (1039:7): [True: 48, False: 0]
  ------------------
 1040|     48|			add_converter(sc, iconv_strncat_in_locale);
 1041|     48|			return;
 1042|     48|		}
 1043|      0|#endif
 1044|       |
 1045|      0|		if ((sc->flag & (SCONV_BEST_EFFORT | SCONV_FROM_UTF16BE))
  ------------------
  |  |   93|      0|#define SCONV_BEST_EFFORT 	(1<<2)	/* Copy at least ASCII code. */
  ------------------
              		if ((sc->flag & (SCONV_BEST_EFFORT | SCONV_FROM_UTF16BE))
  ------------------
  |  |  108|      0|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  ------------------
  |  Branch (1045:7): [True: 0, False: 0]
  ------------------
 1046|      0|		    == (SCONV_BEST_EFFORT | SCONV_FROM_UTF16BE))
  ------------------
  |  |   93|      0|#define SCONV_BEST_EFFORT 	(1<<2)	/* Copy at least ASCII code. */
  ------------------
              		    == (SCONV_BEST_EFFORT | SCONV_FROM_UTF16BE))
  ------------------
  |  |  108|      0|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  ------------------
 1047|      0|			add_converter(sc, best_effort_strncat_from_utf16be);
 1048|      0|		else if ((sc->flag & (SCONV_BEST_EFFORT | SCONV_FROM_UTF16LE))
  ------------------
  |  |   93|      0|#define SCONV_BEST_EFFORT 	(1<<2)	/* Copy at least ASCII code. */
  ------------------
              		else if ((sc->flag & (SCONV_BEST_EFFORT | SCONV_FROM_UTF16LE))
  ------------------
  |  |  110|      0|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  ------------------
  |  Branch (1048:12): [True: 0, False: 0]
  ------------------
 1049|      0|		    == (SCONV_BEST_EFFORT | SCONV_FROM_UTF16LE))
  ------------------
  |  |   93|      0|#define SCONV_BEST_EFFORT 	(1<<2)	/* Copy at least ASCII code. */
  ------------------
              		    == (SCONV_BEST_EFFORT | SCONV_FROM_UTF16LE))
  ------------------
  |  |  110|      0|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  ------------------
 1050|      0|			add_converter(sc, best_effort_strncat_from_utf16le);
 1051|      0|		else
 1052|       |			/* Make sure we have no converter. */
 1053|      0|			sc->nconverter = 0;
 1054|      0|		return;
 1055|     48|	}
 1056|       |
 1057|   110k|	if (sc->flag & SCONV_FROM_UTF8) {
  ------------------
  |  |  106|   110k|#define SCONV_FROM_UTF8		(1<<9)	/* "from charset" side is UTF-8. */
  ------------------
  |  Branch (1057:6): [True: 28.2k, False: 82.3k]
  ------------------
 1058|       |		/*
 1059|       |		 * At least we should normalize a UTF-8 string.
 1060|       |		 */
 1061|  28.2k|		if (sc->flag & SCONV_NORMALIZATION_D)
  ------------------
  |  |  101|  28.2k|#define SCONV_NORMALIZATION_D	(1<<7)	/* Need normalization to be Form D.
  ------------------
  |  Branch (1061:7): [True: 0, False: 28.2k]
  ------------------
 1062|      0|			add_converter(sc,archive_string_normalize_D);
 1063|  28.2k|		else if (sc->flag & SCONV_NORMALIZATION_C)
  ------------------
  |  |   98|  28.2k|#define SCONV_NORMALIZATION_C	(1<<6)	/* Need normalization to be Form C.
  ------------------
  |  Branch (1063:12): [True: 28.2k, False: 0]
  ------------------
 1064|  28.2k|			add_converter(sc, archive_string_normalize_C);
 1065|       |
 1066|       |		/*
 1067|       |		 * Copy UTF-8 string with a check of CESU-8.
 1068|       |		 * Apparently, iconv does not check surrogate pairs in UTF-8
 1069|       |		 * when both from-charset and to-charset are UTF-8, and then
 1070|       |		 * we use our UTF-8 copy code.
 1071|       |		 */
 1072|  28.2k|		if (sc->flag & SCONV_TO_UTF8) {
  ------------------
  |  |  105|  28.2k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
  |  Branch (1072:7): [True: 0, False: 28.2k]
  ------------------
 1073|       |			/*
 1074|       |			 * If the current locale is UTF-8, we can translate
 1075|       |			 * a UTF-16BE string into a UTF-8 string directly.
 1076|       |			 */
 1077|      0|			if (!(sc->flag &
  ------------------
  |  Branch (1077:8): [True: 0, False: 0]
  ------------------
 1078|      0|			    (SCONV_NORMALIZATION_D |SCONV_NORMALIZATION_C)))
  ------------------
  |  |  101|      0|#define SCONV_NORMALIZATION_D	(1<<7)	/* Need normalization to be Form D.
  ------------------
              			    (SCONV_NORMALIZATION_D |SCONV_NORMALIZATION_C)))
  ------------------
  |  |   98|      0|#define SCONV_NORMALIZATION_C	(1<<6)	/* Need normalization to be Form C.
  ------------------
 1079|      0|				add_converter(sc, strncat_from_utf8_to_utf8);
 1080|      0|			return;
 1081|      0|		}
 1082|  28.2k|	}
 1083|       |
 1084|       |#if defined(_WIN32) && !defined(__CYGWIN__)
 1085|       |	/*
 1086|       |	 * On Windows we can use Windows API for a string conversion.
 1087|       |	 */
 1088|       |	if (sc->flag & SCONV_WIN_CP) {
 1089|       |		add_converter(sc, strncat_in_codepage);
 1090|       |		return;
 1091|       |	}
 1092|       |#endif
 1093|       |
 1094|   110k|#if HAVE_ICONV
 1095|   110k|	if (sc->cd != (iconv_t)-1) {
  ------------------
  |  Branch (1095:6): [True: 110k, False: 0]
  ------------------
 1096|   110k|		add_converter(sc, iconv_strncat_in_locale);
 1097|       |		/*
 1098|       |		 * iconv generally does not support UTF-8-MAC and so
 1099|       |		 * we have to the output of iconv from NFC to NFD if
 1100|       |		 * need.
 1101|       |		 */
 1102|   110k|		if ((sc->flag & SCONV_FROM_CHARSET) &&
  ------------------
  |  |   91|   110k|#define SCONV_FROM_CHARSET	(1<<1)	/* MBS is being converted from
  ------------------
  |  Branch (1102:7): [True: 28.2k, False: 82.3k]
  ------------------
 1103|  28.2k|		    (sc->flag & SCONV_TO_UTF8)) {
  ------------------
  |  |  105|  28.2k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
  |  Branch (1103:7): [True: 0, False: 28.2k]
  ------------------
 1104|      0|			if (sc->flag & SCONV_NORMALIZATION_D)
  ------------------
  |  |  101|      0|#define SCONV_NORMALIZATION_D	(1<<7)	/* Need normalization to be Form D.
  ------------------
  |  Branch (1104:8): [True: 0, False: 0]
  ------------------
 1105|      0|				add_converter(sc, archive_string_normalize_D);
 1106|      0|		}
 1107|   110k|		return;
 1108|   110k|	}
 1109|      0|#endif
 1110|       |
 1111|       |	/*
 1112|       |	 * Try conversion in the best effort or no conversion.
 1113|       |	 */
 1114|      0|	if ((sc->flag & SCONV_BEST_EFFORT) || sc->same)
  ------------------
  |  |   93|      0|#define SCONV_BEST_EFFORT 	(1<<2)	/* Copy at least ASCII code. */
  ------------------
  |  Branch (1114:6): [True: 0, False: 0]
  |  Branch (1114:40): [True: 0, False: 0]
  ------------------
 1115|      0|		add_converter(sc, best_effort_strncat_in_locale);
 1116|      0|	else
 1117|       |		/* Make sure we have no converter. */
 1118|      0|		sc->nconverter = 0;
 1119|      0|}
archive_string.c:add_converter:
  939|   138k|{
  940|   138k|	if (sc == NULL || sc->nconverter >= 2)
  ------------------
  |  Branch (940:6): [True: 0, False: 138k]
  |  Branch (940:20): [True: 0, False: 138k]
  ------------------
  941|      0|		__archive_errx(1, "Programming error");
  942|   138k|	sc->converter[sc->nconverter++] = converter;
  943|   138k|}
archive_string.c:_utf8_to_unicode:
 2367|  30.3M|{
 2368|  30.3M|	static const char utf8_count[256] = {
 2369|  30.3M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 00 - 0F */
 2370|  30.3M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 10 - 1F */
 2371|  30.3M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 20 - 2F */
 2372|  30.3M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 30 - 3F */
 2373|  30.3M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 40 - 4F */
 2374|  30.3M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 50 - 5F */
 2375|  30.3M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 60 - 6F */
 2376|  30.3M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 70 - 7F */
 2377|  30.3M|		 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* 80 - 8F */
 2378|  30.3M|		 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* 90 - 9F */
 2379|  30.3M|		 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* A0 - AF */
 2380|  30.3M|		 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* B0 - BF */
 2381|  30.3M|		 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,/* C0 - CF */
 2382|  30.3M|		 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,/* D0 - DF */
 2383|  30.3M|		 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,/* E0 - EF */
 2384|  30.3M|		 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 /* F0 - FF */
 2385|  30.3M|	};
 2386|  30.3M|	int ch, i;
 2387|  30.3M|	int cnt;
 2388|  30.3M|	uint32_t wc;
 2389|       |
 2390|       |	/* Sanity check. */
 2391|  30.3M|	if (n == 0)
  ------------------
  |  Branch (2391:6): [True: 22.1k, False: 30.3M]
  ------------------
 2392|  22.1k|		return (0);
 2393|       |	/*
 2394|       |	 * Decode 1-4 bytes depending on the value of the first byte.
 2395|       |	 */
 2396|  30.3M|	ch = (unsigned char)*s;
 2397|  30.3M|	if (ch == 0)
  ------------------
  |  Branch (2397:6): [True: 0, False: 30.3M]
  ------------------
 2398|      0|		return (0); /* Standard:  return 0 for end-of-string. */
 2399|  30.3M|	cnt = utf8_count[ch];
 2400|       |
 2401|       |	/* Invalid sequence or there are not plenty bytes. */
 2402|  30.3M|	if (n < (size_t)cnt) {
  ------------------
  |  Branch (2402:6): [True: 713, False: 30.3M]
  ------------------
 2403|    713|		cnt = (int)n;
 2404|    713|		for (i = 1; i < cnt; i++) {
  ------------------
  |  Branch (2404:15): [True: 1, False: 712]
  ------------------
 2405|      1|			if ((s[i] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2405:8): [True: 1, False: 0]
  ------------------
 2406|      1|				cnt = i;
 2407|      1|				break;
 2408|      1|			}
 2409|      1|		}
 2410|    713|		goto invalid_sequence;
 2411|    713|	}
 2412|       |
 2413|       |	/* Make a Unicode code point from a single UTF-8 sequence. */
 2414|  30.3M|	switch (cnt) {
 2415|  30.1M|	case 1:	/* 1 byte sequence. */
  ------------------
  |  Branch (2415:2): [True: 30.1M, False: 181k]
  ------------------
 2416|  30.1M|		*pwc = ch & 0x7f;
 2417|  30.1M|		return (cnt);
 2418|  24.3k|	case 2:	/* 2 bytes sequence. */
  ------------------
  |  Branch (2418:2): [True: 24.3k, False: 30.3M]
  ------------------
 2419|  24.3k|		if ((s[1] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2419:7): [True: 9.55k, False: 14.7k]
  ------------------
 2420|  9.55k|			cnt = 1;
 2421|  9.55k|			goto invalid_sequence;
 2422|  9.55k|		}
 2423|  14.7k|		*pwc = ((ch & 0x1f) << 6) | (s[1] & 0x3f);
 2424|  14.7k|		return (cnt);
 2425|  15.0k|	case 3:	/* 3 bytes sequence. */
  ------------------
  |  Branch (2425:2): [True: 15.0k, False: 30.3M]
  ------------------
 2426|  15.0k|		if ((s[1] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2426:7): [True: 3.86k, False: 11.2k]
  ------------------
 2427|  3.86k|			cnt = 1;
 2428|  3.86k|			goto invalid_sequence;
 2429|  3.86k|		}
 2430|  11.2k|		if ((s[2] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2430:7): [True: 3.07k, False: 8.13k]
  ------------------
 2431|  3.07k|			cnt = 2;
 2432|  3.07k|			goto invalid_sequence;
 2433|  3.07k|		}
 2434|  8.13k|		wc = ((ch & 0x0f) << 12)
 2435|  8.13k|		    | ((s[1] & 0x3f) << 6)
 2436|  8.13k|		    | (s[2] & 0x3f);
 2437|  8.13k|		if (wc < 0x800)
  ------------------
  |  Branch (2437:7): [True: 4, False: 8.13k]
  ------------------
 2438|      4|			goto invalid_sequence;/* Overlong sequence. */
 2439|  8.13k|		break;
 2440|  8.13k|	case 4:	/* 4 bytes sequence. */
  ------------------
  |  Branch (2440:2): [True: 894, False: 30.3M]
  ------------------
 2441|    894|		if ((s[1] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2441:7): [True: 83, False: 811]
  ------------------
 2442|     83|			cnt = 1;
 2443|     83|			goto invalid_sequence;
 2444|     83|		}
 2445|    811|		if ((s[2] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2445:7): [True: 171, False: 640]
  ------------------
 2446|    171|			cnt = 2;
 2447|    171|			goto invalid_sequence;
 2448|    171|		}
 2449|    640|		if ((s[3] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2449:7): [True: 0, False: 640]
  ------------------
 2450|      0|			cnt = 3;
 2451|      0|			goto invalid_sequence;
 2452|      0|		}
 2453|    640|		wc = ((ch & 0x07) << 18)
 2454|    640|		    | ((s[1] & 0x3f) << 12)
 2455|    640|		    | ((s[2] & 0x3f) << 6)
 2456|    640|		    | (s[3] & 0x3f);
 2457|    640|		if (wc < 0x10000)
  ------------------
  |  Branch (2457:7): [True: 0, False: 640]
  ------------------
 2458|      0|			goto invalid_sequence;/* Overlong sequence. */
 2459|    640|		break;
 2460|   141k|	default: /* Others are all invalid sequence. */
  ------------------
  |  Branch (2460:2): [True: 141k, False: 30.2M]
  ------------------
 2461|   141k|		if (ch == 0xc0 || ch == 0xc1)
  ------------------
  |  Branch (2461:7): [True: 8, False: 141k]
  |  Branch (2461:21): [True: 1, False: 141k]
  ------------------
 2462|      9|			cnt = 2;
 2463|   141k|		else if (ch >= 0xf5 && ch <= 0xf7)
  ------------------
  |  Branch (2463:12): [True: 39.4k, False: 101k]
  |  Branch (2463:26): [True: 1.75k, False: 37.7k]
  ------------------
 2464|  1.75k|			cnt = 4;
 2465|   139k|		else if (ch >= 0xf8 && ch <= 0xfb)
  ------------------
  |  Branch (2465:12): [True: 37.7k, False: 101k]
  |  Branch (2465:26): [True: 1.16k, False: 36.5k]
  ------------------
 2466|  1.16k|			cnt = 5;
 2467|   138k|		else if (ch == 0xfc || ch == 0xfd)
  ------------------
  |  Branch (2467:12): [True: 649, False: 137k]
  |  Branch (2467:26): [True: 5.06k, False: 132k]
  ------------------
 2468|  5.71k|			cnt = 6;
 2469|   132k|		else
 2470|   132k|			cnt = 1;
 2471|   141k|		if (n < (size_t)cnt)
  ------------------
  |  Branch (2471:7): [True: 2.38k, False: 138k]
  ------------------
 2472|  2.38k|			cnt = (int)n;
 2473|   153k|		for (i = 1; i < cnt; i++) {
  ------------------
  |  Branch (2473:15): [True: 19.5k, False: 133k]
  ------------------
 2474|  19.5k|			if ((s[i] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2474:8): [True: 7.59k, False: 11.9k]
  ------------------
 2475|  7.59k|				cnt = i;
 2476|  7.59k|				break;
 2477|  7.59k|			}
 2478|  19.5k|		}
 2479|   141k|		goto invalid_sequence;
 2480|  30.3M|	}
 2481|       |
 2482|       |	/* The code point larger than 0x10FFFF is not legal
 2483|       |	 * Unicode values. */
 2484|  8.77k|	if (wc > UNICODE_MAX)
  ------------------
  |  |  133|  8.77k|#define UNICODE_MAX		0x10FFFF
  ------------------
  |  Branch (2484:6): [True: 0, False: 8.77k]
  ------------------
 2485|      0|		goto invalid_sequence;
 2486|       |	/* Correctly gets a Unicode, returns used bytes. */
 2487|  8.77k|	*pwc = wc;
 2488|  8.77k|	return (cnt);
 2489|   158k|invalid_sequence:
 2490|   158k|	*pwc = UNICODE_R_CHAR;/* set the Replacement Character instead. */
  ------------------
  |  |  134|   158k|#define UNICODE_R_CHAR		0xFFFD	/* Replacement character. */
  ------------------
 2491|   158k|	return (cnt * -1);
 2492|  8.77k|}
archive_string.c:unicode_to_utf16le:
 2694|  5.92k|{
 2695|  5.92k|	char *utf16 = p;
 2696|       |
 2697|  5.92k|	if (uc > 0xffff) {
  ------------------
  |  Branch (2697:6): [True: 78, False: 5.85k]
  ------------------
 2698|       |		/* We have a code point that won't fit into a
 2699|       |		 * wchar_t; convert it to a surrogate pair. */
 2700|     78|		if (remaining < 4)
  ------------------
  |  Branch (2700:7): [True: 0, False: 78]
  ------------------
 2701|      0|			return (0);
 2702|     78|		uc -= 0x10000;
 2703|     78|		archive_le16enc(utf16, ((uc >> 10) & 0x3ff) + 0xD800);
 2704|     78|		archive_le16enc(utf16+2, (uc & 0x3ff) + 0xDC00);
 2705|     78|		return (4);
 2706|  5.85k|	} else {
 2707|  5.85k|		if (remaining < 2)
  ------------------
  |  Branch (2707:7): [True: 0, False: 5.85k]
  ------------------
 2708|      0|			return (0);
 2709|  5.85k|		archive_le16enc(utf16, (uint16_t)uc);
 2710|  5.85k|		return (2);
 2711|  5.85k|	}
 2712|  5.92k|}
archive_string.c:unicode_to_utf8:
 2566|   171k|{
 2567|   171k|	char *_p = p;
 2568|       |
 2569|       |	/* Invalid Unicode char maps to Replacement character */
 2570|   171k|	if (uc > UNICODE_MAX)
  ------------------
  |  |  133|   171k|#define UNICODE_MAX		0x10FFFF
  ------------------
  |  Branch (2570:6): [True: 0, False: 171k]
  ------------------
 2571|      0|		uc = UNICODE_R_CHAR;
  ------------------
  |  |  134|      0|#define UNICODE_R_CHAR		0xFFFD	/* Replacement character. */
  ------------------
 2572|       |	/* Translate code point to UTF8 */
 2573|   171k|	if (uc <= 0x7f) {
  ------------------
  |  Branch (2573:6): [True: 0, False: 171k]
  ------------------
 2574|      0|		if (remaining == 0)
  ------------------
  |  Branch (2574:7): [True: 0, False: 0]
  ------------------
 2575|      0|			return (0);
 2576|      0|		*p++ = (char)uc;
 2577|   171k|	} else if (uc <= 0x7ff) {
  ------------------
  |  Branch (2577:13): [True: 7.53k, False: 164k]
  ------------------
 2578|  7.53k|		if (remaining < 2)
  ------------------
  |  Branch (2578:7): [True: 1, False: 7.53k]
  ------------------
 2579|      1|			return (0);
 2580|  7.53k|		*p++ = 0xc0 | ((uc >> 6) & 0x1f);
 2581|  7.53k|		*p++ = 0x80 | (uc & 0x3f);
 2582|   164k|	} else if (uc <= 0xffff) {
  ------------------
  |  Branch (2582:13): [True: 164k, False: 166]
  ------------------
 2583|   164k|		if (remaining < 3)
  ------------------
  |  Branch (2583:7): [True: 5.27k, False: 158k]
  ------------------
 2584|  5.27k|			return (0);
 2585|   158k|		*p++ = 0xe0 | ((uc >> 12) & 0x0f);
 2586|   158k|		*p++ = 0x80 | ((uc >> 6) & 0x3f);
 2587|   158k|		*p++ = 0x80 | (uc & 0x3f);
 2588|   158k|	} else {
 2589|    166|		if (remaining < 4)
  ------------------
  |  Branch (2589:7): [True: 2, False: 164]
  ------------------
 2590|      2|			return (0);
 2591|    164|		*p++ = 0xf0 | ((uc >> 18) & 0x07);
 2592|    164|		*p++ = 0x80 | ((uc >> 12) & 0x3f);
 2593|    164|		*p++ = 0x80 | ((uc >> 6) & 0x3f);
 2594|    164|		*p++ = 0x80 | (uc & 0x3f);
 2595|    164|	}
 2596|   166k|	return (p - _p);
 2597|   171k|}
archive_string.c:utf16be_to_unicode:
 2601|    798|{
 2602|    798|	return (utf16_to_unicode(pwc, s, n, 1));
 2603|    798|}
archive_string.c:utf16_to_unicode:
 2613|  39.7k|{
 2614|  39.7k|	const char *utf16 = s;
 2615|  39.7k|	unsigned uc;
 2616|       |
 2617|  39.7k|	if (n == 0)
  ------------------
  |  Branch (2617:6): [True: 597, False: 39.1k]
  ------------------
 2618|    597|		return (0);
 2619|  39.1k|	if (n == 1) {
  ------------------
  |  Branch (2619:6): [True: 0, False: 39.1k]
  ------------------
 2620|       |		/* set the Replacement Character instead. */
 2621|      0|		*pwc = UNICODE_R_CHAR;
  ------------------
  |  |  134|      0|#define UNICODE_R_CHAR		0xFFFD	/* Replacement character. */
  ------------------
 2622|      0|		return (-1);
 2623|      0|	}
 2624|       |
 2625|  39.1k|	if (be)
  ------------------
  |  Branch (2625:6): [True: 658, False: 38.5k]
  ------------------
 2626|    658|		uc = archive_be16dec(utf16);
 2627|  38.5k|	else
 2628|  38.5k|		uc = archive_le16dec(utf16);
 2629|  39.1k|	utf16 += 2;
 2630|       |		
 2631|       |	/* If this is a surrogate pair, assemble the full code point.*/
 2632|  39.1k|	if (IS_HIGH_SURROGATE_LA(uc)) {
  ------------------
  |  |  130|  39.1k|#define IS_HIGH_SURROGATE_LA(uc) ((uc) >= 0xD800 && (uc) <= 0xDBFF)
  |  |  ------------------
  |  |  |  Branch (130:35): [True: 10.0k, False: 29.0k]
  |  |  |  Branch (130:53): [True: 4.75k, False: 5.33k]
  |  |  ------------------
  ------------------
 2633|  4.75k|		unsigned uc2;
 2634|       |
 2635|  4.75k|		if (n >= 4) {
  ------------------
  |  Branch (2635:7): [True: 4.75k, False: 0]
  ------------------
 2636|  4.75k|			if (be)
  ------------------
  |  Branch (2636:8): [True: 0, False: 4.75k]
  ------------------
 2637|      0|				uc2 = archive_be16dec(utf16);
 2638|  4.75k|			else
 2639|  4.75k|				uc2 = archive_le16dec(utf16);
 2640|  4.75k|		} else
 2641|      0|			uc2 = 0;
 2642|  4.75k|		if (IS_LOW_SURROGATE_LA(uc2)) {
  ------------------
  |  |  131|  4.75k|#define IS_LOW_SURROGATE_LA(uc)	 ((uc) >= 0xDC00 && (uc) <= 0xDFFF)
  |  |  ------------------
  |  |  |  Branch (131:35): [True: 146, False: 4.61k]
  |  |  |  Branch (131:53): [True: 78, False: 68]
  |  |  ------------------
  ------------------
 2643|     78|			uc = combine_surrogate_pair(uc, uc2);
 2644|     78|			utf16 += 2;
 2645|  4.67k|		} else {
 2646|       |	 		/* Undescribed code point should be U+FFFD
 2647|       |		 	* (replacement character). */
 2648|  4.67k|			*pwc = UNICODE_R_CHAR;
  ------------------
  |  |  134|  4.67k|#define UNICODE_R_CHAR		0xFFFD	/* Replacement character. */
  ------------------
 2649|  4.67k|			return (-2);
 2650|  4.67k|		}
 2651|  4.75k|	}
 2652|       |
 2653|       |	/*
 2654|       |	 * Surrogate pair values(0xd800 through 0xdfff) are only
 2655|       |	 * used by UTF-16, so, after above calculation, the code
 2656|       |	 * must not be surrogate values, and Unicode has no codes
 2657|       |	 * larger than 0x10ffff. Thus, those are not legal Unicode
 2658|       |	 * values.
 2659|       |	 */
 2660|  34.4k|	if (IS_SURROGATE_PAIR_LA(uc) || uc > UNICODE_MAX) {
  ------------------
  |  |  132|  68.9k|#define IS_SURROGATE_PAIR_LA(uc) ((uc) >= 0xD800 && (uc) <= 0xDFFF)
  |  |  ------------------
  |  |  |  Branch (132:35): [True: 5.41k, False: 29.0k]
  |  |  |  Branch (132:53): [True: 770, False: 4.64k]
  |  |  ------------------
  ------------------
              	if (IS_SURROGATE_PAIR_LA(uc) || uc > UNICODE_MAX) {
  ------------------
  |  |  133|  33.7k|#define UNICODE_MAX		0x10FFFF
  ------------------
  |  Branch (2660:34): [True: 0, False: 33.7k]
  ------------------
 2661|       |	 	/* Undescribed code point should be U+FFFD
 2662|       |	 	* (replacement character). */
 2663|    770|		*pwc = UNICODE_R_CHAR;
  ------------------
  |  |  134|    770|#define UNICODE_R_CHAR		0xFFFD	/* Replacement character. */
  ------------------
 2664|    770|		return (((int)(utf16 - s)) * -1);
 2665|    770|	}
 2666|  33.7k|	*pwc = uc;
 2667|  33.7k|	return ((int)(utf16 - s));
 2668|  34.4k|}
archive_string.c:combine_surrogate_pair:
 2508|    406|{
 2509|    406|	uc -= 0xD800;
 2510|    406|	uc *= 0x400;
 2511|    406|	uc += uc2 - 0xDC00;
 2512|    406|	uc += 0x10000;
 2513|    406|	return (uc);
 2514|    406|}
archive_string.c:utf16le_to_unicode:
 2607|  38.9k|{
 2608|  38.9k|	return (utf16_to_unicode(pwc, s, n, 0));
 2609|  38.9k|}
archive_string.c:cesu8_to_unicode:
 2527|  30.3M|{
 2528|  30.3M|	uint32_t wc = 0;
 2529|  30.3M|	int cnt;
 2530|       |
 2531|  30.3M|	cnt = _utf8_to_unicode(&wc, s, n);
 2532|  30.3M|	if (cnt == 3 && IS_HIGH_SURROGATE_LA(wc)) {
  ------------------
  |  |  130|  7.33k|#define IS_HIGH_SURROGATE_LA(uc) ((uc) >= 0xD800 && (uc) <= 0xDBFF)
  |  |  ------------------
  |  |  |  Branch (130:35): [True: 7.33k, False: 1]
  |  |  |  Branch (130:53): [True: 3.51k, False: 3.81k]
  |  |  ------------------
  ------------------
  |  Branch (2532:6): [True: 7.33k, False: 30.3M]
  ------------------
 2533|  3.51k|		uint32_t wc2 = 0;
 2534|  3.51k|		if (n - 3 < 3) {
  ------------------
  |  Branch (2534:7): [True: 185, False: 3.33k]
  ------------------
 2535|       |			/* Invalid byte sequence. */
 2536|    185|			goto invalid_sequence;
 2537|    185|		}
 2538|  3.33k|		cnt = _utf8_to_unicode(&wc2, s+3, n-3);
 2539|  3.33k|		if (cnt != 3 || !IS_LOW_SURROGATE_LA(wc2)) {
  ------------------
  |  |  131|    799|#define IS_LOW_SURROGATE_LA(uc)	 ((uc) >= 0xDC00 && (uc) <= 0xDFFF)
  |  |  ------------------
  |  |  |  Branch (131:35): [True: 799, False: 0]
  |  |  |  Branch (131:53): [True: 328, False: 471]
  |  |  ------------------
  ------------------
  |  Branch (2539:7): [True: 2.53k, False: 799]
  ------------------
 2540|       |			/* Invalid byte sequence. */
 2541|  3.00k|			goto invalid_sequence;
 2542|  3.00k|		}
 2543|    328|		wc = combine_surrogate_pair(wc, wc2);
 2544|    328|		cnt = 6;
 2545|  30.3M|	} else if (cnt == 3 && IS_LOW_SURROGATE_LA(wc)) {
  ------------------
  |  |  131|  3.81k|#define IS_LOW_SURROGATE_LA(uc)	 ((uc) >= 0xDC00 && (uc) <= 0xDFFF)
  |  |  ------------------
  |  |  |  Branch (131:35): [True: 3.81k, False: 1]
  |  |  |  Branch (131:53): [True: 2.69k, False: 1.12k]
  |  |  ------------------
  ------------------
  |  Branch (2545:13): [True: 3.81k, False: 30.3M]
  ------------------
 2546|       |		/* Invalid byte sequence. */
 2547|  2.69k|		goto invalid_sequence;
 2548|  2.69k|	}
 2549|  30.3M|	*pwc = wc;
 2550|  30.3M|	return (cnt);
 2551|  5.88k|invalid_sequence:
 2552|  5.88k|	*pwc = UNICODE_R_CHAR;/* set the Replacement Character instead. */
  ------------------
  |  |  134|  5.88k|#define UNICODE_R_CHAR		0xFFFD	/* Replacement character. */
  ------------------
 2553|  5.88k|	if (cnt > 0)
  ------------------
  |  Branch (2553:6): [True: 3.35k, False: 2.53k]
  ------------------
 2554|  3.35k|		cnt *= -1;
 2555|  5.88k|	return (cnt);
 2556|  30.3M|}
archive_string.c:iconv_strncat_in_locale:
 2098|  69.7k|{
 2099|  69.7k|	ICONV_CONST char *itp;
 2100|  69.7k|	size_t remaining;
 2101|  69.7k|	iconv_t cd;
 2102|  69.7k|	char *outp;
 2103|  69.7k|	size_t avail, bs;
 2104|  69.7k|	int return_value = 0; /* success */
 2105|  69.7k|	size_t to_size, from_size;
 2106|       |
 2107|  69.7k|	if (sc->flag & SCONV_TO_UTF16)
  ------------------
  |  |  111|  69.7k|#define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  107|  69.7k|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  109|  69.7k|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (2107:6): [True: 0, False: 69.7k]
  ------------------
 2108|      0|		to_size = 2;
 2109|  69.7k|	else
 2110|  69.7k|		to_size = 1;
 2111|  69.7k|	if (sc->flag & SCONV_FROM_UTF16)
  ------------------
  |  |  112|  69.7k|#define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  108|  69.7k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  110|  69.7k|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (2111:6): [True: 597, False: 69.1k]
  ------------------
 2112|    597|		from_size = 2;
 2113|  69.1k|	else
 2114|  69.1k|		from_size = 1;
 2115|       |
 2116|  69.7k|	if (archive_string_ensure(as, as->length + length*2+to_size) == NULL)
  ------------------
  |  Branch (2116:6): [True: 0, False: 69.7k]
  ------------------
 2117|      0|		return (-1);
 2118|       |
 2119|  69.7k|	cd = sc->cd;
 2120|  69.7k|	itp = (char *)(uintptr_t)_p;
 2121|  69.7k|	remaining = length;
 2122|  69.7k|	outp = as->s + as->length;
 2123|  69.7k|	avail = as->buffer_length - as->length - to_size;
 2124|   691k|	while (remaining >= from_size) {
  ------------------
  |  Branch (2124:9): [True: 682k, False: 9.58k]
  ------------------
 2125|   682k|		size_t result = iconv(cd, &itp, &remaining, &outp, &avail);
 2126|       |
 2127|   682k|		if (result != (size_t)-1)
  ------------------
  |  Branch (2127:7): [True: 60.1k, False: 621k]
  ------------------
 2128|  60.1k|			break; /* Conversion completed. */
 2129|       |
 2130|   621k|		if (errno == EILSEQ || errno == EINVAL) {
  ------------------
  |  Branch (2130:7): [True: 621k, False: 236]
  |  Branch (2130:26): [True: 0, False: 236]
  ------------------
 2131|       |			/*
 2132|       |		 	 * If an output charset is UTF-8 or UTF-16BE/LE,
 2133|       |			 * unknown character should be U+FFFD
 2134|       |			 * (replacement character).
 2135|       |			 */
 2136|   621k|			if (sc->flag & (SCONV_TO_UTF8 | SCONV_TO_UTF16)) {
  ------------------
  |  |  105|   621k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
              			if (sc->flag & (SCONV_TO_UTF8 | SCONV_TO_UTF16)) {
  ------------------
  |  |  111|   621k|#define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  107|   621k|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  109|   621k|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (2136:8): [True: 72.5k, False: 549k]
  ------------------
 2137|  72.5k|				size_t rbytes;
 2138|  72.5k|				if (sc->flag & SCONV_TO_UTF8)
  ------------------
  |  |  105|  72.5k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
  |  Branch (2138:9): [True: 72.5k, False: 0]
  ------------------
 2139|  72.5k|					rbytes = sizeof(utf8_replacement_char);
 2140|      0|				else
 2141|      0|					rbytes = 2;
 2142|       |
 2143|  72.5k|				if (avail < rbytes) {
  ------------------
  |  Branch (2143:9): [True: 134, False: 72.3k]
  ------------------
 2144|    134|					as->length = outp - as->s;
 2145|    134|					bs = as->buffer_length +
 2146|    134|					    (remaining * to_size) + rbytes;
 2147|    134|					if (NULL ==
  ------------------
  |  Branch (2147:10): [True: 0, False: 134]
  ------------------
 2148|    134|					    archive_string_ensure(as, bs))
 2149|      0|						return (-1);
 2150|    134|					outp = as->s + as->length;
 2151|    134|					avail = as->buffer_length
 2152|    134|					    - as->length - to_size;
 2153|    134|				}
 2154|  72.5k|				if (sc->flag & SCONV_TO_UTF8)
  ------------------
  |  |  105|  72.5k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
  |  Branch (2154:9): [True: 72.5k, False: 0]
  ------------------
 2155|  72.5k|					memcpy(outp, utf8_replacement_char, sizeof(utf8_replacement_char));
 2156|      0|				else if (sc->flag & SCONV_TO_UTF16BE)
  ------------------
  |  |  107|      0|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  ------------------
  |  Branch (2156:14): [True: 0, False: 0]
  ------------------
 2157|      0|					archive_be16enc(outp, UNICODE_R_CHAR);
  ------------------
  |  |  134|      0|#define UNICODE_R_CHAR		0xFFFD	/* Replacement character. */
  ------------------
 2158|      0|				else
 2159|      0|					archive_le16enc(outp, UNICODE_R_CHAR);
  ------------------
  |  |  134|      0|#define UNICODE_R_CHAR		0xFFFD	/* Replacement character. */
  ------------------
 2160|  72.5k|				outp += rbytes;
 2161|  72.5k|				avail -= rbytes;
 2162|   549k|			} else {
 2163|       |				/* Skip the illegal input bytes. */
 2164|   549k|				*outp++ = '?';
 2165|   549k|				avail--;
 2166|   549k|			}
 2167|   621k|			itp += from_size;
 2168|   621k|			remaining -= from_size;
 2169|   621k|			return_value = -1; /* failure */
 2170|   621k|		} else {
 2171|       |			/* E2BIG no output buffer,
 2172|       |			 * Increase an output buffer.  */
 2173|    236|			as->length = outp - as->s;
 2174|    236|			bs = as->buffer_length + remaining * 2;
 2175|    236|			if (NULL == archive_string_ensure(as, bs))
  ------------------
  |  Branch (2175:8): [True: 0, False: 236]
  ------------------
 2176|      0|				return (-1);
 2177|    236|			outp = as->s + as->length;
 2178|    236|			avail = as->buffer_length - as->length - to_size;
 2179|    236|		}
 2180|   621k|	}
 2181|  69.7k|	as->length = outp - as->s;
 2182|  69.7k|	as->s[as->length] = 0;
 2183|  69.7k|	if (to_size == 2)
  ------------------
  |  Branch (2183:6): [True: 0, False: 69.7k]
  ------------------
 2184|      0|		as->s[as->length+1] = 0;
 2185|  69.7k|	return (return_value);
 2186|  69.7k|}
archive_string.c:archive_string_normalize_C:
 2999|  22.7k|{
 3000|  22.7k|	const char *s = (const char *)_p;
 3001|  22.7k|	char *p, *endp;
 3002|  22.7k|	uint32_t uc, uc2;
 3003|  22.7k|	size_t w;
 3004|  22.7k|	int always_replace, n, n2, ret = 0, spair, ts, tm;
 3005|  22.7k|	int (*parse)(uint32_t *, const char *, size_t);
 3006|  22.7k|	size_t (*unparse)(char *, size_t, uint32_t);
 3007|       |
 3008|  22.7k|	always_replace = 1;
 3009|  22.7k|	ts = 1;/* text size. */
 3010|  22.7k|	if (sc->flag & SCONV_TO_UTF16BE) {
  ------------------
  |  |  107|  22.7k|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  ------------------
  |  Branch (3010:6): [True: 0, False: 22.7k]
  ------------------
 3011|      0|		unparse = unicode_to_utf16be;
 3012|      0|		ts = 2;
 3013|      0|		if (sc->flag & SCONV_FROM_UTF16BE)
  ------------------
  |  |  108|      0|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  ------------------
  |  Branch (3013:7): [True: 0, False: 0]
  ------------------
 3014|      0|			always_replace = 0;
 3015|  22.7k|	} else if (sc->flag & SCONV_TO_UTF16LE) {
  ------------------
  |  |  109|  22.7k|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  ------------------
  |  Branch (3015:13): [True: 0, False: 22.7k]
  ------------------
 3016|      0|		unparse = unicode_to_utf16le;
 3017|      0|		ts = 2;
 3018|      0|		if (sc->flag & SCONV_FROM_UTF16LE)
  ------------------
  |  |  110|      0|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  ------------------
  |  Branch (3018:7): [True: 0, False: 0]
  ------------------
 3019|      0|			always_replace = 0;
 3020|  22.7k|	} else if (sc->flag & SCONV_TO_UTF8) {
  ------------------
  |  |  105|  22.7k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
  |  Branch (3020:13): [True: 0, False: 22.7k]
  ------------------
 3021|      0|		unparse = unicode_to_utf8;
 3022|      0|		if (sc->flag & SCONV_FROM_UTF8)
  ------------------
  |  |  106|      0|#define SCONV_FROM_UTF8		(1<<9)	/* "from charset" side is UTF-8. */
  ------------------
  |  Branch (3022:7): [True: 0, False: 0]
  ------------------
 3023|      0|			always_replace = 0;
 3024|  22.7k|	} else {
 3025|       |		/*
 3026|       |		 * This case is going to be converted to another
 3027|       |		 * character-set through iconv.
 3028|       |		 */
 3029|  22.7k|		always_replace = 0;
 3030|  22.7k|		if (sc->flag & SCONV_FROM_UTF16BE) {
  ------------------
  |  |  108|  22.7k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  ------------------
  |  Branch (3030:7): [True: 140, False: 22.5k]
  ------------------
 3031|    140|			unparse = unicode_to_utf16be;
 3032|    140|			ts = 2;
 3033|  22.5k|		} else if (sc->flag & SCONV_FROM_UTF16LE) {
  ------------------
  |  |  110|  22.5k|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  ------------------
  |  Branch (3033:14): [True: 457, False: 22.1k]
  ------------------
 3034|    457|			unparse = unicode_to_utf16le;
 3035|    457|			ts = 2;
 3036|  22.1k|		} else {
 3037|  22.1k|			unparse = unicode_to_utf8;
 3038|  22.1k|		}
 3039|  22.7k|	}
 3040|       |
 3041|  22.7k|	if (sc->flag & SCONV_FROM_UTF16BE) {
  ------------------
  |  |  108|  22.7k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  ------------------
  |  Branch (3041:6): [True: 140, False: 22.5k]
  ------------------
 3042|    140|		parse = utf16be_to_unicode;
 3043|    140|		tm = 1;
 3044|    140|		spair = 4;/* surrogate pair size in UTF-16. */
 3045|  22.5k|	} else if (sc->flag & SCONV_FROM_UTF16LE) {
  ------------------
  |  |  110|  22.5k|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  ------------------
  |  Branch (3045:13): [True: 457, False: 22.1k]
  ------------------
 3046|    457|		parse = utf16le_to_unicode;
 3047|    457|		tm = 1;
 3048|    457|		spair = 4;/* surrogate pair size in UTF-16. */
 3049|  22.1k|	} else {
 3050|  22.1k|		parse = cesu8_to_unicode;
 3051|  22.1k|		tm = ts;
 3052|  22.1k|		spair = 6;/* surrogate pair size in UTF-8. */
 3053|  22.1k|	}
 3054|       |
 3055|  22.7k|	if (archive_string_ensure(as, as->length + len * tm + ts) == NULL)
  ------------------
  |  Branch (3055:6): [True: 0, False: 22.7k]
  ------------------
 3056|      0|		return (-1);
 3057|       |
 3058|  22.7k|	p = as->s + as->length;
 3059|  22.7k|	endp = as->s + as->buffer_length - ts;
 3060|   191k|	while ((n = parse(&uc, s, len)) != 0) {
  ------------------
  |  Branch (3060:9): [True: 185k, False: 6.06k]
  ------------------
 3061|   185k|		const char *ucptr, *uc2ptr;
 3062|       |
 3063|   185k|		if (n < 0) {
  ------------------
  |  Branch (3063:7): [True: 133k, False: 51.8k]
  ------------------
 3064|       |			/* Use a replaced unicode character. */
 3065|   133k|			UNPARSE(p, endp, uc);
  ------------------
  |  | 2929|   133k|#define UNPARSE(p, endp, uc)	do {		\
  |  | 2930|   138k|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  ------------------
  |  |  |  Branch (2930:9): [True: 4.75k, False: 133k]
  |  |  ------------------
  |  | 2931|  4.75k|		EXPAND_BUFFER();		\
  |  |  ------------------
  |  |  |  | 2920|  4.75k|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2921|  4.75k|	as->length = p - as->s;			\
  |  |  |  | 2922|  4.75k|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2922:6): [True: 0, False: 4.75k]
  |  |  |  |  ------------------
  |  |  |  | 2923|  4.75k|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2924|  4.75k|		return (-1);			\
  |  |  |  | 2925|  4.75k|	p = as->s + as->length;			\
  |  |  |  | 2926|  4.75k|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2927|  4.75k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2927:10): [Folded, False: 4.75k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2932|  4.75k|	}					\
  |  | 2933|   133k|	p += w;					\
  |  | 2934|   133k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2934:10): [Folded, False: 133k]
  |  |  ------------------
  ------------------
 3066|   133k|			s += n*-1;
 3067|   133k|			len -= n*-1;
 3068|   133k|			ret = -1;
 3069|   133k|			continue;
 3070|   133k|		} else if (n == spair || always_replace)
  ------------------
  |  Branch (3070:14): [True: 206, False: 51.6k]
  |  Branch (3070:28): [True: 0, False: 51.6k]
  ------------------
 3071|       |			/* uc is converted from a surrogate pair.
 3072|       |			 * this should be treated as a changed code. */
 3073|    206|			ucptr = NULL;
 3074|  51.6k|		else
 3075|  51.6k|			ucptr = s;
 3076|  51.8k|		s += n;
 3077|  51.8k|		len -= n;
 3078|       |
 3079|       |		/* Read second code point. */
 3080|  30.2M|		while ((n2 = parse(&uc2, s, len)) > 0) {
  ------------------
  |  Branch (3080:10): [True: 30.1M, False: 47.3k]
  ------------------
 3081|  30.1M|			uint32_t ucx[FDC_MAX];
 3082|  30.1M|			int ccx[FDC_MAX];
 3083|  30.1M|			int cl, cx, i, nx, ucx_size;
 3084|  30.1M|			int LIndex,SIndex;
 3085|  30.1M|			uint32_t nfc;
 3086|       |
 3087|  30.1M|			if (n2 == spair || always_replace)
  ------------------
  |  Branch (3087:8): [True: 36, False: 30.1M]
  |  Branch (3087:23): [True: 0, False: 30.1M]
  ------------------
 3088|       |				/* uc2 is converted from a surrogate pair.
 3089|       |			 	 * this should be treated as a changed code. */
 3090|     36|				uc2ptr = NULL;
 3091|  30.1M|			else
 3092|  30.1M|				uc2ptr = s;
 3093|  30.1M|			s += n2;
 3094|  30.1M|			len -= n2;
 3095|       |
 3096|       |			/*
 3097|       |			 * If current second code point is out of decomposable
 3098|       |			 * code points, finding compositions is unneeded.
 3099|       |			 */
 3100|  30.1M|			if (!IS_DECOMPOSABLE_BLOCK(uc2)) {
  ------------------
  |  |  986|  30.1M|	(((uc)>>8) <= 0x1D2 && u_decomposable_blocks[(uc)>>8])
  |  |  ------------------
  |  |  |  Branch (986:3): [True: 30.1M, False: 39]
  |  |  |  Branch (986:25): [True: 12.4k, False: 30.1M]
  |  |  ------------------
  ------------------
 3101|  30.1M|				WRITE_UC();
  ------------------
  |  | 2942|  30.1M|#define WRITE_UC()	do {			\
  |  | 2943|  30.1M|	if (ucptr) {				\
  |  |  ------------------
  |  |  |  Branch (2943:6): [True: 30.1M, False: 23]
  |  |  ------------------
  |  | 2944|  30.1M|		if (p + n > endp)		\
  |  |  ------------------
  |  |  |  Branch (2944:7): [True: 2.87k, False: 30.1M]
  |  |  ------------------
  |  | 2945|  30.1M|			EXPAND_BUFFER();	\
  |  |  ------------------
  |  |  |  | 2920|  2.87k|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2921|  2.87k|	as->length = p - as->s;			\
  |  |  |  | 2922|  2.87k|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2922:6): [True: 0, False: 2.87k]
  |  |  |  |  ------------------
  |  |  |  | 2923|  2.87k|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2924|  2.87k|		return (-1);			\
  |  |  |  | 2925|  2.87k|	p = as->s + as->length;			\
  |  |  |  | 2926|  2.87k|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2927|  2.87k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2927:10): [Folded, False: 2.87k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2946|  30.1M|		switch (n) {			\
  |  |  ------------------
  |  |  |  Branch (2946:11): [True: 30.1M, False: 0]
  |  |  ------------------
  |  | 2947|    189|		case 4:				\
  |  |  ------------------
  |  |  |  Branch (2947:3): [True: 189, False: 30.1M]
  |  |  ------------------
  |  | 2948|    189|			*p++ = *ucptr++;	\
  |  | 2949|    189|			/* FALL THROUGH */	\
  |  | 2950|    667|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (2950:3): [True: 478, False: 30.1M]
  |  |  ------------------
  |  | 2951|    667|			*p++ = *ucptr++;	\
  |  | 2952|    667|			/* FALL THROUGH */	\
  |  | 2953|  31.1k|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (2953:3): [True: 30.4k, False: 30.1M]
  |  |  ------------------
  |  | 2954|  31.1k|			*p++ = *ucptr++;	\
  |  | 2955|  31.1k|			/* FALL THROUGH */	\
  |  | 2956|  30.1M|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (2956:3): [True: 30.1M, False: 31.1k]
  |  |  ------------------
  |  | 2957|  30.1M|			*p++ = *ucptr;		\
  |  | 2958|  30.1M|			break;			\
  |  | 2959|  30.1M|		}				\
  |  | 2960|  30.1M|		ucptr = NULL;			\
  |  | 2961|  30.1M|	} else {				\
  |  | 2962|     23|		UNPARSE(p, endp, uc);		\
  |  |  ------------------
  |  |  |  | 2929|     23|#define UNPARSE(p, endp, uc)	do {		\
  |  |  |  | 2930|     23|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2930:9): [True: 0, False: 23]
  |  |  |  |  ------------------
  |  |  |  | 2931|      0|		EXPAND_BUFFER();		\
  |  |  |  |  ------------------
  |  |  |  |  |  | 2920|      0|#define EXPAND_BUFFER() do {			\
  |  |  |  |  |  | 2921|      0|	as->length = p - as->s;			\
  |  |  |  |  |  | 2922|      0|	if (archive_string_ensure(as,		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2922:6): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2923|      0|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  |  |  | 2924|      0|		return (-1);			\
  |  |  |  |  |  | 2925|      0|	p = as->s + as->length;			\
  |  |  |  |  |  | 2926|      0|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  |  |  | 2927|      0|} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2927:10): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2932|      0|	}					\
  |  |  |  | 2933|     23|	p += w;					\
  |  |  |  | 2934|     23|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2934:10): [Folded, False: 23]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2963|     23|	}					\
  |  | 2964|  30.1M|} while (0)
  |  |  ------------------
  |  |  |  Branch (2964:10): [Folded, False: 30.1M]
  |  |  ------------------
  ------------------
 3102|  30.1M|				REPLACE_UC_WITH_UC2();
  ------------------
  |  | 2914|  30.1M|#define REPLACE_UC_WITH_UC2() do {		\
  |  | 2915|  30.1M|	uc = uc2;				\
  |  | 2916|  30.1M|	ucptr = uc2ptr;				\
  |  | 2917|  30.1M|	n = n2;					\
  |  | 2918|  30.1M|} while (0)
  |  |  ------------------
  |  |  |  Branch (2918:10): [Folded, False: 30.1M]
  |  |  ------------------
  ------------------
 3103|  30.1M|				continue;
 3104|  30.1M|			}
 3105|       |
 3106|       |			/*
 3107|       |			 * Try to combine current code points.
 3108|       |			 */
 3109|       |			/*
 3110|       |			 * We have to combine Hangul characters according to
 3111|       |			 * http://uniicode.org/reports/tr15/#Hangul
 3112|       |			 */
 3113|  12.4k|			if (0 <= (LIndex = uc - HC_LBASE) &&
  ------------------
  |  | 2868|  12.4k|#define HC_LBASE	0x1100
  ------------------
  |  Branch (3113:8): [True: 7.04k, False: 5.43k]
  ------------------
 3114|  7.04k|			    LIndex < HC_LCOUNT) {
  ------------------
  |  | 2871|  7.04k|#define HC_LCOUNT	19
  ------------------
  |  Branch (3114:8): [True: 11, False: 7.03k]
  ------------------
 3115|       |				/*
 3116|       |				 * Hangul Composition.
 3117|       |				 * 1. Two current code points are L and V.
 3118|       |				 */
 3119|     11|				int VIndex = uc2 - HC_VBASE;
  ------------------
  |  | 2869|     11|#define HC_VBASE	0x1161
  ------------------
 3120|     11|				if (0 <= VIndex && VIndex < HC_VCOUNT) {
  ------------------
  |  | 2872|     11|#define HC_VCOUNT	21
  ------------------
  |  Branch (3120:9): [True: 11, False: 0]
  |  Branch (3120:24): [True: 0, False: 11]
  ------------------
 3121|       |					/* Make syllable of form LV. */
 3122|      0|					UPDATE_UC(HC_SBASE +
  ------------------
  |  | 2906|      0|#define UPDATE_UC(new_uc)	do {		\
  |  | 2907|      0|	uc = new_uc;				\
  |  | 2908|      0|	ucptr = NULL;				\
  |  | 2909|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (2909:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3123|      0|					    (LIndex * HC_VCOUNT + VIndex) *
 3124|      0|					     HC_TCOUNT);
 3125|     11|				} else {
 3126|     11|					WRITE_UC();
  ------------------
  |  | 2942|     11|#define WRITE_UC()	do {			\
  |  | 2943|     11|	if (ucptr) {				\
  |  |  ------------------
  |  |  |  Branch (2943:6): [True: 11, False: 0]
  |  |  ------------------
  |  | 2944|     11|		if (p + n > endp)		\
  |  |  ------------------
  |  |  |  Branch (2944:7): [True: 0, False: 11]
  |  |  ------------------
  |  | 2945|     11|			EXPAND_BUFFER();	\
  |  |  ------------------
  |  |  |  | 2920|      0|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2921|      0|	as->length = p - as->s;			\
  |  |  |  | 2922|      0|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2922:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 2923|      0|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2924|      0|		return (-1);			\
  |  |  |  | 2925|      0|	p = as->s + as->length;			\
  |  |  |  | 2926|      0|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2927|      0|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2927:10): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2946|     11|		switch (n) {			\
  |  |  ------------------
  |  |  |  Branch (2946:11): [True: 11, False: 0]
  |  |  ------------------
  |  | 2947|      0|		case 4:				\
  |  |  ------------------
  |  |  |  Branch (2947:3): [True: 0, False: 11]
  |  |  ------------------
  |  | 2948|      0|			*p++ = *ucptr++;	\
  |  | 2949|      0|			/* FALL THROUGH */	\
  |  | 2950|      0|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (2950:3): [True: 0, False: 11]
  |  |  ------------------
  |  | 2951|      0|			*p++ = *ucptr++;	\
  |  | 2952|      0|			/* FALL THROUGH */	\
  |  | 2953|     11|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (2953:3): [True: 11, False: 0]
  |  |  ------------------
  |  | 2954|     11|			*p++ = *ucptr++;	\
  |  | 2955|     11|			/* FALL THROUGH */	\
  |  | 2956|     11|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (2956:3): [True: 0, False: 11]
  |  |  ------------------
  |  | 2957|     11|			*p++ = *ucptr;		\
  |  | 2958|     11|			break;			\
  |  | 2959|     11|		}				\
  |  | 2960|     11|		ucptr = NULL;			\
  |  | 2961|     11|	} else {				\
  |  | 2962|      0|		UNPARSE(p, endp, uc);		\
  |  |  ------------------
  |  |  |  | 2929|      0|#define UNPARSE(p, endp, uc)	do {		\
  |  |  |  | 2930|      0|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2930:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 2931|      0|		EXPAND_BUFFER();		\
  |  |  |  |  ------------------
  |  |  |  |  |  | 2920|      0|#define EXPAND_BUFFER() do {			\
  |  |  |  |  |  | 2921|      0|	as->length = p - as->s;			\
  |  |  |  |  |  | 2922|      0|	if (archive_string_ensure(as,		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2922:6): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2923|      0|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  |  |  | 2924|      0|		return (-1);			\
  |  |  |  |  |  | 2925|      0|	p = as->s + as->length;			\
  |  |  |  |  |  | 2926|      0|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  |  |  | 2927|      0|} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2927:10): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2932|      0|	}					\
  |  |  |  | 2933|      0|	p += w;					\
  |  |  |  | 2934|      0|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2934:10): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2963|      0|	}					\
  |  | 2964|     11|} while (0)
  |  |  ------------------
  |  |  |  Branch (2964:10): [Folded, False: 11]
  |  |  ------------------
  ------------------
 3127|     11|					REPLACE_UC_WITH_UC2();
  ------------------
  |  | 2914|     11|#define REPLACE_UC_WITH_UC2() do {		\
  |  | 2915|     11|	uc = uc2;				\
  |  | 2916|     11|	ucptr = uc2ptr;				\
  |  | 2917|     11|	n = n2;					\
  |  | 2918|     11|} while (0)
  |  |  ------------------
  |  |  |  Branch (2918:10): [Folded, False: 11]
  |  |  ------------------
  ------------------
 3128|     11|				}
 3129|     11|				continue;
 3130|  12.4k|			} else if (0 <= (SIndex = uc - HC_SBASE) &&
  ------------------
  |  | 2867|  12.4k|#define HC_SBASE	0xAC00
  ------------------
  |  Branch (3130:15): [True: 2.63k, False: 9.83k]
  ------------------
 3131|  2.63k|			    SIndex < HC_SCOUNT && (SIndex % HC_TCOUNT) == 0) {
  ------------------
  |  | 2875|  15.1k|#define HC_SCOUNT	(HC_LCOUNT * HC_NCOUNT)
  |  |  ------------------
  |  |  |  | 2871|  2.63k|#define HC_LCOUNT	19
  |  |  ------------------
  |  |               #define HC_SCOUNT	(HC_LCOUNT * HC_NCOUNT)
  |  |  ------------------
  |  |  |  | 2874|  2.63k|#define HC_NCOUNT	(HC_VCOUNT * HC_TCOUNT)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2872|  2.63k|#define HC_VCOUNT	21
  |  |  |  |  ------------------
  |  |  |  |               #define HC_NCOUNT	(HC_VCOUNT * HC_TCOUNT)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2873|  2.63k|#define HC_TCOUNT	28
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
              			    SIndex < HC_SCOUNT && (SIndex % HC_TCOUNT) == 0) {
  ------------------
  |  | 2873|  1.56k|#define HC_TCOUNT	28
  ------------------
  |  Branch (3131:8): [True: 1.56k, False: 1.07k]
  |  Branch (3131:30): [True: 46, False: 1.51k]
  ------------------
 3132|       |				/*
 3133|       |				 * Hangul Composition.
 3134|       |				 * 2. Two current code points are LV and T.
 3135|       |				 */
 3136|     46|				int TIndex = uc2 - HC_TBASE;
  ------------------
  |  | 2870|     46|#define HC_TBASE	0x11A7
  ------------------
 3137|     46|				if (0 < TIndex && TIndex < HC_TCOUNT) {
  ------------------
  |  | 2873|     46|#define HC_TCOUNT	28
  ------------------
  |  Branch (3137:9): [True: 46, False: 0]
  |  Branch (3137:23): [True: 0, False: 46]
  ------------------
 3138|       |					/* Make syllable of form LVT. */
 3139|      0|					UPDATE_UC(uc + TIndex);
  ------------------
  |  | 2906|      0|#define UPDATE_UC(new_uc)	do {		\
  |  | 2907|      0|	uc = new_uc;				\
  |  | 2908|      0|	ucptr = NULL;				\
  |  | 2909|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (2909:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3140|     46|				} else {
 3141|     46|					WRITE_UC();
  ------------------
  |  | 2942|     46|#define WRITE_UC()	do {			\
  |  | 2943|     46|	if (ucptr) {				\
  |  |  ------------------
  |  |  |  Branch (2943:6): [True: 46, False: 0]
  |  |  ------------------
  |  | 2944|     46|		if (p + n > endp)		\
  |  |  ------------------
  |  |  |  Branch (2944:7): [True: 0, False: 46]
  |  |  ------------------
  |  | 2945|     46|			EXPAND_BUFFER();	\
  |  |  ------------------
  |  |  |  | 2920|      0|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2921|      0|	as->length = p - as->s;			\
  |  |  |  | 2922|      0|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2922:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 2923|      0|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2924|      0|		return (-1);			\
  |  |  |  | 2925|      0|	p = as->s + as->length;			\
  |  |  |  | 2926|      0|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2927|      0|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2927:10): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2946|     46|		switch (n) {			\
  |  |  ------------------
  |  |  |  Branch (2946:11): [True: 46, False: 0]
  |  |  ------------------
  |  | 2947|      0|		case 4:				\
  |  |  ------------------
  |  |  |  Branch (2947:3): [True: 0, False: 46]
  |  |  ------------------
  |  | 2948|      0|			*p++ = *ucptr++;	\
  |  | 2949|      0|			/* FALL THROUGH */	\
  |  | 2950|      0|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (2950:3): [True: 0, False: 46]
  |  |  ------------------
  |  | 2951|      0|			*p++ = *ucptr++;	\
  |  | 2952|      0|			/* FALL THROUGH */	\
  |  | 2953|     46|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (2953:3): [True: 46, False: 0]
  |  |  ------------------
  |  | 2954|     46|			*p++ = *ucptr++;	\
  |  | 2955|     46|			/* FALL THROUGH */	\
  |  | 2956|     46|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (2956:3): [True: 0, False: 46]
  |  |  ------------------
  |  | 2957|     46|			*p++ = *ucptr;		\
  |  | 2958|     46|			break;			\
  |  | 2959|     46|		}				\
  |  | 2960|     46|		ucptr = NULL;			\
  |  | 2961|     46|	} else {				\
  |  | 2962|      0|		UNPARSE(p, endp, uc);		\
  |  |  ------------------
  |  |  |  | 2929|      0|#define UNPARSE(p, endp, uc)	do {		\
  |  |  |  | 2930|      0|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2930:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 2931|      0|		EXPAND_BUFFER();		\
  |  |  |  |  ------------------
  |  |  |  |  |  | 2920|      0|#define EXPAND_BUFFER() do {			\
  |  |  |  |  |  | 2921|      0|	as->length = p - as->s;			\
  |  |  |  |  |  | 2922|      0|	if (archive_string_ensure(as,		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2922:6): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2923|      0|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  |  |  | 2924|      0|		return (-1);			\
  |  |  |  |  |  | 2925|      0|	p = as->s + as->length;			\
  |  |  |  |  |  | 2926|      0|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  |  |  | 2927|      0|} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2927:10): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2932|      0|	}					\
  |  |  |  | 2933|      0|	p += w;					\
  |  |  |  | 2934|      0|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2934:10): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2963|      0|	}					\
  |  | 2964|     46|} while (0)
  |  |  ------------------
  |  |  |  Branch (2964:10): [Folded, False: 46]
  |  |  ------------------
  ------------------
 3142|     46|					REPLACE_UC_WITH_UC2();
  ------------------
  |  | 2914|     46|#define REPLACE_UC_WITH_UC2() do {		\
  |  | 2915|     46|	uc = uc2;				\
  |  | 2916|     46|	ucptr = uc2ptr;				\
  |  | 2917|     46|	n = n2;					\
  |  | 2918|     46|} while (0)
  |  |  ------------------
  |  |  |  Branch (2918:10): [Folded, False: 46]
  |  |  ------------------
  ------------------
 3143|     46|				}
 3144|     46|				continue;
 3145|  12.4k|			} else if ((nfc = get_nfc(uc, uc2)) != 0) {
  ------------------
  |  Branch (3145:15): [True: 819, False: 11.6k]
  ------------------
 3146|       |				/* A composition to current code points
 3147|       |				 * is found. */
 3148|    819|				UPDATE_UC(nfc);
  ------------------
  |  | 2906|    819|#define UPDATE_UC(new_uc)	do {		\
  |  | 2907|    819|	uc = new_uc;				\
  |  | 2908|    819|	ucptr = NULL;				\
  |  | 2909|    819|} while (0)
  |  |  ------------------
  |  |  |  Branch (2909:10): [Folded, False: 819]
  |  |  ------------------
  ------------------
 3149|    819|				continue;
 3150|  11.6k|			} else if ((cl = CCC(uc2)) == 0) {
  ------------------
  |  | 1007|  11.6k|	(((uc) > 0x1D244)?0:\
  |  |  ------------------
  |  |  |  Branch (1007:3): [True: 0, False: 11.6k]
  |  |  ------------------
  |  | 1008|  11.6k|	ccc_val[ccc_val_index[ccc_index[(uc)>>8]][((uc)>>4)&0x0F]][(uc)&0x0F])
  ------------------
  |  Branch (3150:15): [True: 7.09k, False: 4.51k]
  ------------------
 3151|       |				/* Clearly 'uc2' the second code point is not
 3152|       |				 * a decomposable code. */
 3153|  7.09k|				WRITE_UC();
  ------------------
  |  | 2942|  7.09k|#define WRITE_UC()	do {			\
  |  | 2943|  7.09k|	if (ucptr) {				\
  |  |  ------------------
  |  |  |  Branch (2943:6): [True: 7.09k, False: 2]
  |  |  ------------------
  |  | 2944|  7.09k|		if (p + n > endp)		\
  |  |  ------------------
  |  |  |  Branch (2944:7): [True: 0, False: 7.09k]
  |  |  ------------------
  |  | 2945|  7.09k|			EXPAND_BUFFER();	\
  |  |  ------------------
  |  |  |  | 2920|      0|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2921|      0|	as->length = p - as->s;			\
  |  |  |  | 2922|      0|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2922:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 2923|      0|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2924|      0|		return (-1);			\
  |  |  |  | 2925|      0|	p = as->s + as->length;			\
  |  |  |  | 2926|      0|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2927|      0|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2927:10): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2946|  7.09k|		switch (n) {			\
  |  |  ------------------
  |  |  |  Branch (2946:11): [True: 7.09k, False: 0]
  |  |  ------------------
  |  | 2947|      0|		case 4:				\
  |  |  ------------------
  |  |  |  Branch (2947:3): [True: 0, False: 7.09k]
  |  |  ------------------
  |  | 2948|      0|			*p++ = *ucptr++;	\
  |  | 2949|      0|			/* FALL THROUGH */	\
  |  | 2950|      0|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (2950:3): [True: 0, False: 7.09k]
  |  |  ------------------
  |  | 2951|      0|			*p++ = *ucptr++;	\
  |  | 2952|      0|			/* FALL THROUGH */	\
  |  | 2953|  7.07k|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (2953:3): [True: 7.07k, False: 22]
  |  |  ------------------
  |  | 2954|  7.07k|			*p++ = *ucptr++;	\
  |  | 2955|  7.07k|			/* FALL THROUGH */	\
  |  | 2956|  7.09k|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (2956:3): [True: 22, False: 7.07k]
  |  |  ------------------
  |  | 2957|  7.09k|			*p++ = *ucptr;		\
  |  | 2958|  7.09k|			break;			\
  |  | 2959|  7.09k|		}				\
  |  | 2960|  7.09k|		ucptr = NULL;			\
  |  | 2961|  7.09k|	} else {				\
  |  | 2962|      2|		UNPARSE(p, endp, uc);		\
  |  |  ------------------
  |  |  |  | 2929|      2|#define UNPARSE(p, endp, uc)	do {		\
  |  |  |  | 2930|      2|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2930:9): [True: 0, False: 2]
  |  |  |  |  ------------------
  |  |  |  | 2931|      0|		EXPAND_BUFFER();		\
  |  |  |  |  ------------------
  |  |  |  |  |  | 2920|      0|#define EXPAND_BUFFER() do {			\
  |  |  |  |  |  | 2921|      0|	as->length = p - as->s;			\
  |  |  |  |  |  | 2922|      0|	if (archive_string_ensure(as,		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2922:6): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2923|      0|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  |  |  | 2924|      0|		return (-1);			\
  |  |  |  |  |  | 2925|      0|	p = as->s + as->length;			\
  |  |  |  |  |  | 2926|      0|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  |  |  | 2927|      0|} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2927:10): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2932|      0|	}					\
  |  |  |  | 2933|      2|	p += w;					\
  |  |  |  | 2934|      2|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2934:10): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2963|      2|	}					\
  |  | 2964|  7.09k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2964:10): [Folded, False: 7.09k]
  |  |  ------------------
  ------------------
 3154|  7.09k|				REPLACE_UC_WITH_UC2();
  ------------------
  |  | 2914|  7.09k|#define REPLACE_UC_WITH_UC2() do {		\
  |  | 2915|  7.09k|	uc = uc2;				\
  |  | 2916|  7.09k|	ucptr = uc2ptr;				\
  |  | 2917|  7.09k|	n = n2;					\
  |  | 2918|  7.09k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2918:10): [Folded, False: 7.09k]
  |  |  ------------------
  ------------------
 3155|  7.09k|				continue;
 3156|  7.09k|			}
 3157|       |
 3158|       |			/*
 3159|       |			 * Collect following decomposable code points.
 3160|       |			 */
 3161|  4.51k|			cx = 0;
 3162|  4.51k|			ucx[0] = uc2;
 3163|  4.51k|			ccx[0] = cl;
 3164|  4.51k|			COLLECT_CPS(1);
  ------------------
  |  | 2969|  4.51k|#define COLLECT_CPS(start)	do {		\
  |  | 2970|  4.51k|	int _i;					\
  |  | 2971|  7.04k|	for (_i = start; _i < FDC_MAX ; _i++) {	\
  |  |  ------------------
  |  |  |  | 2900|  7.04k|#define FDC_MAX 10	/* The maximum number of Following Decomposable
  |  |  ------------------
  |  |  |  Branch (2971:19): [True: 7.04k, False: 0]
  |  |  ------------------
  |  | 2972|  7.04k|		nx = parse(&ucx[_i], s, len);	\
  |  | 2973|  7.04k|		if (nx <= 0)			\
  |  |  ------------------
  |  |  |  Branch (2973:7): [True: 3.20k, False: 3.83k]
  |  |  ------------------
  |  | 2974|  7.04k|			break;			\
  |  | 2975|  7.04k|		cx = CCC(ucx[_i]);		\
  |  |  ------------------
  |  |  |  | 1007|  3.83k|	(((uc) > 0x1D244)?0:\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1007:3): [True: 349, False: 3.48k]
  |  |  |  |  ------------------
  |  |  |  | 1008|  3.83k|	ccc_val[ccc_val_index[ccc_index[(uc)>>8]][((uc)>>4)&0x0F]][(uc)&0x0F])
  |  |  ------------------
  |  | 2976|  3.83k|		if (cl >= cx && cl != 228 && cx != 228)\
  |  |  ------------------
  |  |  |  Branch (2976:7): [True: 1.30k, False: 2.53k]
  |  |  |  Branch (2976:19): [True: 1.30k, False: 0]
  |  |  |  Branch (2976:32): [True: 1.30k, False: 0]
  |  |  ------------------
  |  | 2977|  3.83k|			break;			\
  |  | 2978|  3.83k|		s += nx;			\
  |  | 2979|  2.53k|		len -= nx;			\
  |  | 2980|  2.53k|		cl = cx;			\
  |  | 2981|  2.53k|		ccx[_i] = cx;			\
  |  | 2982|  2.53k|	}					\
  |  | 2983|  4.51k|	if (_i >= FDC_MAX) {			\
  |  |  ------------------
  |  |  |  | 2900|  4.51k|#define FDC_MAX 10	/* The maximum number of Following Decomposable
  |  |  ------------------
  |  |  |  Branch (2983:6): [True: 0, False: 4.51k]
  |  |  ------------------
  |  | 2984|      0|		ret = -1;			\
  |  | 2985|      0|		ucx_size = FDC_MAX;		\
  |  |  ------------------
  |  |  |  | 2900|      0|#define FDC_MAX 10	/* The maximum number of Following Decomposable
  |  |  ------------------
  |  | 2986|      0|	} else					\
  |  | 2987|  4.51k|		ucx_size = _i;			\
  |  | 2988|  4.51k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2988:10): [Folded, False: 4.51k]
  |  |  ------------------
  ------------------
 3165|       |
 3166|       |			/*
 3167|       |			 * Find a composed code in the collected code points.
 3168|       |			 */
 3169|  4.51k|			i = 1;
 3170|  9.57k|			while (i < ucx_size) {
  ------------------
  |  Branch (3170:11): [True: 5.06k, False: 4.51k]
  ------------------
 3171|  5.06k|				int j;
 3172|       |
 3173|  5.06k|				if ((nfc = get_nfc(uc, ucx[i])) == 0) {
  ------------------
  |  Branch (3173:9): [True: 2.53k, False: 2.53k]
  ------------------
 3174|  2.53k|					i++;
 3175|  2.53k|					continue;
 3176|  2.53k|				}
 3177|       |
 3178|       |				/*
 3179|       |				 * nfc is composed of uc and ucx[i].
 3180|       |				 */
 3181|  2.53k|				UPDATE_UC(nfc);
  ------------------
  |  | 2906|  2.53k|#define UPDATE_UC(new_uc)	do {		\
  |  | 2907|  2.53k|	uc = new_uc;				\
  |  | 2908|  2.53k|	ucptr = NULL;				\
  |  | 2909|  2.53k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2909:10): [Folded, False: 2.53k]
  |  |  ------------------
  ------------------
 3182|       |
 3183|       |				/*
 3184|       |				 * Remove ucx[i] by shifting
 3185|       |				 * following code points.
 3186|       |				 */
 3187|  2.53k|				for (j = i; j+1 < ucx_size; j++) {
  ------------------
  |  Branch (3187:17): [True: 0, False: 2.53k]
  ------------------
 3188|      0|					ucx[j] = ucx[j+1];
 3189|      0|					ccx[j] = ccx[j+1];
 3190|      0|				}
 3191|  2.53k|				ucx_size --;
 3192|       |
 3193|       |				/*
 3194|       |				 * Collect following code points blocked
 3195|       |				 * by ucx[i] the removed code point.
 3196|       |				 */
 3197|  2.53k|				if (ucx_size > 0 && i == ucx_size &&
  ------------------
  |  Branch (3197:9): [True: 2.53k, False: 0]
  |  Branch (3197:25): [True: 2.53k, False: 0]
  ------------------
 3198|  2.53k|				    nx > 0 && cx == cl) {
  ------------------
  |  Branch (3198:9): [True: 0, False: 2.53k]
  |  Branch (3198:19): [True: 0, False: 0]
  ------------------
 3199|      0|					cl =  ccx[ucx_size-1];
 3200|      0|					COLLECT_CPS(ucx_size);
  ------------------
  |  | 2969|      0|#define COLLECT_CPS(start)	do {		\
  |  | 2970|      0|	int _i;					\
  |  | 2971|      0|	for (_i = start; _i < FDC_MAX ; _i++) {	\
  |  |  ------------------
  |  |  |  | 2900|      0|#define FDC_MAX 10	/* The maximum number of Following Decomposable
  |  |  ------------------
  |  |  |  Branch (2971:19): [True: 0, False: 0]
  |  |  ------------------
  |  | 2972|      0|		nx = parse(&ucx[_i], s, len);	\
  |  | 2973|      0|		if (nx <= 0)			\
  |  |  ------------------
  |  |  |  Branch (2973:7): [True: 0, False: 0]
  |  |  ------------------
  |  | 2974|      0|			break;			\
  |  | 2975|      0|		cx = CCC(ucx[_i]);		\
  |  |  ------------------
  |  |  |  | 1007|      0|	(((uc) > 0x1D244)?0:\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1007:3): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1008|      0|	ccc_val[ccc_val_index[ccc_index[(uc)>>8]][((uc)>>4)&0x0F]][(uc)&0x0F])
  |  |  ------------------
  |  | 2976|      0|		if (cl >= cx && cl != 228 && cx != 228)\
  |  |  ------------------
  |  |  |  Branch (2976:7): [True: 0, False: 0]
  |  |  |  Branch (2976:19): [True: 0, False: 0]
  |  |  |  Branch (2976:32): [True: 0, False: 0]
  |  |  ------------------
  |  | 2977|      0|			break;			\
  |  | 2978|      0|		s += nx;			\
  |  | 2979|      0|		len -= nx;			\
  |  | 2980|      0|		cl = cx;			\
  |  | 2981|      0|		ccx[_i] = cx;			\
  |  | 2982|      0|	}					\
  |  | 2983|      0|	if (_i >= FDC_MAX) {			\
  |  |  ------------------
  |  |  |  | 2900|      0|#define FDC_MAX 10	/* The maximum number of Following Decomposable
  |  |  ------------------
  |  |  |  Branch (2983:6): [True: 0, False: 0]
  |  |  ------------------
  |  | 2984|      0|		ret = -1;			\
  |  | 2985|      0|		ucx_size = FDC_MAX;		\
  |  |  ------------------
  |  |  |  | 2900|      0|#define FDC_MAX 10	/* The maximum number of Following Decomposable
  |  |  ------------------
  |  | 2986|      0|	} else					\
  |  | 2987|      0|		ucx_size = _i;			\
  |  | 2988|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (2988:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3201|      0|				}
 3202|       |				/*
 3203|       |				 * Restart finding a composed code with
 3204|       |				 * the updated uc from the top of the
 3205|       |				 * collected code points.
 3206|       |				 */
 3207|  2.53k|				i = 0;
 3208|  2.53k|			}
 3209|       |
 3210|       |			/*
 3211|       |			 * Apparently the current code points are not
 3212|       |			 * decomposed characters or already composed.
 3213|       |			 */
 3214|  4.51k|			WRITE_UC();
  ------------------
  |  | 2942|  4.51k|#define WRITE_UC()	do {			\
  |  | 2943|  4.51k|	if (ucptr) {				\
  |  |  ------------------
  |  |  |  Branch (2943:6): [True: 1.98k, False: 2.53k]
  |  |  ------------------
  |  | 2944|  1.98k|		if (p + n > endp)		\
  |  |  ------------------
  |  |  |  Branch (2944:7): [True: 0, False: 1.98k]
  |  |  ------------------
  |  | 2945|  1.98k|			EXPAND_BUFFER();	\
  |  |  ------------------
  |  |  |  | 2920|      0|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2921|      0|	as->length = p - as->s;			\
  |  |  |  | 2922|      0|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2922:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 2923|      0|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2924|      0|		return (-1);			\
  |  |  |  | 2925|      0|	p = as->s + as->length;			\
  |  |  |  | 2926|      0|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2927|      0|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2927:10): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2946|  1.98k|		switch (n) {			\
  |  |  ------------------
  |  |  |  Branch (2946:11): [True: 1.98k, False: 0]
  |  |  ------------------
  |  | 2947|      0|		case 4:				\
  |  |  ------------------
  |  |  |  Branch (2947:3): [True: 0, False: 1.98k]
  |  |  ------------------
  |  | 2948|      0|			*p++ = *ucptr++;	\
  |  | 2949|      0|			/* FALL THROUGH */	\
  |  | 2950|    164|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (2950:3): [True: 164, False: 1.81k]
  |  |  ------------------
  |  | 2951|    164|			*p++ = *ucptr++;	\
  |  | 2952|    164|			/* FALL THROUGH */	\
  |  | 2953|    862|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (2953:3): [True: 698, False: 1.28k]
  |  |  ------------------
  |  | 2954|    862|			*p++ = *ucptr++;	\
  |  | 2955|    862|			/* FALL THROUGH */	\
  |  | 2956|  1.98k|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (2956:3): [True: 1.11k, False: 862]
  |  |  ------------------
  |  | 2957|  1.98k|			*p++ = *ucptr;		\
  |  | 2958|  1.98k|			break;			\
  |  | 2959|  1.98k|		}				\
  |  | 2960|  1.98k|		ucptr = NULL;			\
  |  | 2961|  2.53k|	} else {				\
  |  | 2962|  2.53k|		UNPARSE(p, endp, uc);		\
  |  |  ------------------
  |  |  |  | 2929|  2.53k|#define UNPARSE(p, endp, uc)	do {		\
  |  |  |  | 2930|  2.53k|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2930:9): [True: 0, False: 2.53k]
  |  |  |  |  ------------------
  |  |  |  | 2931|      0|		EXPAND_BUFFER();		\
  |  |  |  |  ------------------
  |  |  |  |  |  | 2920|      0|#define EXPAND_BUFFER() do {			\
  |  |  |  |  |  | 2921|      0|	as->length = p - as->s;			\
  |  |  |  |  |  | 2922|      0|	if (archive_string_ensure(as,		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2922:6): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2923|      0|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  |  |  | 2924|      0|		return (-1);			\
  |  |  |  |  |  | 2925|      0|	p = as->s + as->length;			\
  |  |  |  |  |  | 2926|      0|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  |  |  | 2927|      0|} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2927:10): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2932|      0|	}					\
  |  |  |  | 2933|  2.53k|	p += w;					\
  |  |  |  | 2934|  2.53k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2934:10): [Folded, False: 2.53k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2963|  2.53k|	}					\
  |  | 2964|  4.51k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2964:10): [Folded, False: 4.51k]
  |  |  ------------------
  ------------------
 3215|  9.02k|			for (i = 0; i < ucx_size; i++)
  ------------------
  |  Branch (3215:16): [True: 4.51k, False: 4.51k]
  ------------------
 3216|  4.51k|				UNPARSE(p, endp, ucx[i]);
  ------------------
  |  | 2929|  9.02k|#define UNPARSE(p, endp, uc)	do {		\
  |  | 2930|  4.51k|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  ------------------
  |  |  |  Branch (2930:9): [True: 1, False: 4.51k]
  |  |  ------------------
  |  | 2931|      1|		EXPAND_BUFFER();		\
  |  |  ------------------
  |  |  |  | 2920|      1|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2921|      1|	as->length = p - as->s;			\
  |  |  |  | 2922|      1|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2922:6): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  |  | 2923|      1|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2924|      1|		return (-1);			\
  |  |  |  | 2925|      1|	p = as->s + as->length;			\
  |  |  |  | 2926|      1|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2927|      1|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2927:10): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2932|      1|	}					\
  |  | 2933|  4.51k|	p += w;					\
  |  | 2934|  4.51k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2934:10): [Folded, False: 4.51k]
  |  |  ------------------
  ------------------
 3217|       |
 3218|       |			/*
 3219|       |			 * Flush out remaining canonical combining characters.
 3220|       |			 */
 3221|  4.51k|			if (nx > 0 && cx == cl && len > 0) {
  ------------------
  |  Branch (3221:8): [True: 1.30k, False: 3.20k]
  |  Branch (3221:18): [True: 26, False: 1.27k]
  |  Branch (3221:30): [True: 26, False: 0]
  ------------------
 3222|    113|				while ((nx = parse(&ucx[0], s, len))
  ------------------
  |  Branch (3222:12): [True: 113, False: 0]
  ------------------
 3223|    113|				    > 0) {
 3224|    113|					cx = CCC(ucx[0]);
  ------------------
  |  | 1007|    113|	(((uc) > 0x1D244)?0:\
  |  |  ------------------
  |  |  |  Branch (1007:3): [True: 0, False: 113]
  |  |  ------------------
  |  | 1008|    113|	ccc_val[ccc_val_index[ccc_index[(uc)>>8]][((uc)>>4)&0x0F]][(uc)&0x0F])
  ------------------
 3225|    113|					if (cl > cx)
  ------------------
  |  Branch (3225:10): [True: 26, False: 87]
  ------------------
 3226|     26|						break;
 3227|     87|					s += nx;
 3228|     87|					len -= nx;
 3229|     87|					cl = cx;
 3230|     87|					UNPARSE(p, endp, ucx[0]);
  ------------------
  |  | 2929|     87|#define UNPARSE(p, endp, uc)	do {		\
  |  | 2930|     87|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  ------------------
  |  |  |  Branch (2930:9): [True: 0, False: 87]
  |  |  ------------------
  |  | 2931|      0|		EXPAND_BUFFER();		\
  |  |  ------------------
  |  |  |  | 2920|      0|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2921|      0|	as->length = p - as->s;			\
  |  |  |  | 2922|      0|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2922:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 2923|      0|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2924|      0|		return (-1);			\
  |  |  |  | 2925|      0|	p = as->s + as->length;			\
  |  |  |  | 2926|      0|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2927|      0|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2927:10): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2932|      0|	}					\
  |  | 2933|     87|	p += w;					\
  |  | 2934|     87|} while (0)
  |  |  ------------------
  |  |  |  Branch (2934:10): [Folded, False: 87]
  |  |  ------------------
  ------------------
 3231|     87|				}
 3232|     26|			}
 3233|  4.51k|			break;
 3234|  4.51k|		}
 3235|  51.8k|		if (n2 < 0) {
  ------------------
  |  Branch (3235:7): [True: 30.6k, False: 21.1k]
  ------------------
 3236|  30.6k|			WRITE_UC();
  ------------------
  |  | 2942|  30.6k|#define WRITE_UC()	do {			\
  |  | 2943|  30.6k|	if (ucptr) {				\
  |  |  ------------------
  |  |  |  Branch (2943:6): [True: 30.0k, False: 694]
  |  |  ------------------
  |  | 2944|  30.0k|		if (p + n > endp)		\
  |  |  ------------------
  |  |  |  Branch (2944:7): [True: 180, False: 29.8k]
  |  |  ------------------
  |  | 2945|  30.0k|			EXPAND_BUFFER();	\
  |  |  ------------------
  |  |  |  | 2920|    180|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2921|    180|	as->length = p - as->s;			\
  |  |  |  | 2922|    180|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2922:6): [True: 0, False: 180]
  |  |  |  |  ------------------
  |  |  |  | 2923|    180|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2924|    180|		return (-1);			\
  |  |  |  | 2925|    180|	p = as->s + as->length;			\
  |  |  |  | 2926|    180|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2927|    180|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2927:10): [Folded, False: 180]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2946|  30.0k|		switch (n) {			\
  |  |  ------------------
  |  |  |  Branch (2946:11): [True: 30.0k, False: 0]
  |  |  ------------------
  |  | 2947|      1|		case 4:				\
  |  |  ------------------
  |  |  |  Branch (2947:3): [True: 1, False: 29.9k]
  |  |  ------------------
  |  | 2948|      1|			*p++ = *ucptr++;	\
  |  | 2949|      1|			/* FALL THROUGH */	\
  |  | 2950|    480|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (2950:3): [True: 479, False: 29.5k]
  |  |  ------------------
  |  | 2951|    480|			*p++ = *ucptr++;	\
  |  | 2952|    480|			/* FALL THROUGH */	\
  |  | 2953|  1.68k|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (2953:3): [True: 1.20k, False: 28.7k]
  |  |  ------------------
  |  | 2954|  1.68k|			*p++ = *ucptr++;	\
  |  | 2955|  1.68k|			/* FALL THROUGH */	\
  |  | 2956|  30.0k|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (2956:3): [True: 28.3k, False: 1.68k]
  |  |  ------------------
  |  | 2957|  30.0k|			*p++ = *ucptr;		\
  |  | 2958|  30.0k|			break;			\
  |  | 2959|  30.0k|		}				\
  |  | 2960|  30.0k|		ucptr = NULL;			\
  |  | 2961|  30.0k|	} else {				\
  |  | 2962|    694|		UNPARSE(p, endp, uc);		\
  |  |  ------------------
  |  |  |  | 2929|    694|#define UNPARSE(p, endp, uc)	do {		\
  |  |  |  | 2930|    696|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2930:9): [True: 2, False: 694]
  |  |  |  |  ------------------
  |  |  |  | 2931|      2|		EXPAND_BUFFER();		\
  |  |  |  |  ------------------
  |  |  |  |  |  | 2920|      2|#define EXPAND_BUFFER() do {			\
  |  |  |  |  |  | 2921|      2|	as->length = p - as->s;			\
  |  |  |  |  |  | 2922|      2|	if (archive_string_ensure(as,		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2922:6): [True: 0, False: 2]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2923|      2|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  |  |  | 2924|      2|		return (-1);			\
  |  |  |  |  |  | 2925|      2|	p = as->s + as->length;			\
  |  |  |  |  |  | 2926|      2|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  |  |  | 2927|      2|} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2927:10): [Folded, False: 2]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2932|      2|	}					\
  |  |  |  | 2933|    694|	p += w;					\
  |  |  |  | 2934|    694|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2934:10): [Folded, False: 694]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2963|    694|	}					\
  |  | 2964|  30.6k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2964:10): [Folded, False: 30.6k]
  |  |  ------------------
  ------------------
 3237|       |			/* Use a replaced unicode character. */
 3238|  30.6k|			UNPARSE(p, endp, uc2);
  ------------------
  |  | 2929|  30.6k|#define UNPARSE(p, endp, uc)	do {		\
  |  | 2930|  31.2k|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  ------------------
  |  |  |  Branch (2930:9): [True: 518, False: 30.6k]
  |  |  ------------------
  |  | 2931|    518|		EXPAND_BUFFER();		\
  |  |  ------------------
  |  |  |  | 2920|    518|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2921|    518|	as->length = p - as->s;			\
  |  |  |  | 2922|    518|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2922:6): [True: 0, False: 518]
  |  |  |  |  ------------------
  |  |  |  | 2923|    518|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2924|    518|		return (-1);			\
  |  |  |  | 2925|    518|	p = as->s + as->length;			\
  |  |  |  | 2926|    518|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2927|    518|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2927:10): [Folded, False: 518]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2932|    518|	}					\
  |  | 2933|  30.6k|	p += w;					\
  |  | 2934|  30.6k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2934:10): [Folded, False: 30.6k]
  |  |  ------------------
  ------------------
 3239|  30.6k|			s += n2*-1;
 3240|  30.6k|			len -= n2*-1;
 3241|  30.6k|			ret = -1;
 3242|  30.6k|			continue;
 3243|  30.6k|		} else if (n2 == 0) {
  ------------------
  |  Branch (3243:14): [True: 16.6k, False: 4.51k]
  ------------------
 3244|  16.6k|			WRITE_UC();
  ------------------
  |  | 2942|  16.6k|#define WRITE_UC()	do {			\
  |  | 2943|  16.6k|	if (ucptr) {				\
  |  |  ------------------
  |  |  |  Branch (2943:6): [True: 16.3k, False: 342]
  |  |  ------------------
  |  | 2944|  16.3k|		if (p + n > endp)		\
  |  |  ------------------
  |  |  |  Branch (2944:7): [True: 0, False: 16.3k]
  |  |  ------------------
  |  | 2945|  16.3k|			EXPAND_BUFFER();	\
  |  |  ------------------
  |  |  |  | 2920|      0|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2921|      0|	as->length = p - as->s;			\
  |  |  |  | 2922|      0|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2922:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 2923|      0|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2924|      0|		return (-1);			\
  |  |  |  | 2925|      0|	p = as->s + as->length;			\
  |  |  |  | 2926|      0|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2927|      0|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2927:10): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2946|  16.3k|		switch (n) {			\
  |  |  ------------------
  |  |  |  Branch (2946:11): [True: 16.3k, False: 0]
  |  |  ------------------
  |  | 2947|    265|		case 4:				\
  |  |  ------------------
  |  |  |  Branch (2947:3): [True: 265, False: 16.0k]
  |  |  ------------------
  |  | 2948|    265|			*p++ = *ucptr++;	\
  |  | 2949|    265|			/* FALL THROUGH */	\
  |  | 2950|    265|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (2950:3): [True: 0, False: 16.3k]
  |  |  ------------------
  |  | 2951|    265|			*p++ = *ucptr++;	\
  |  | 2952|    265|			/* FALL THROUGH */	\
  |  | 2953|    863|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (2953:3): [True: 598, False: 15.7k]
  |  |  ------------------
  |  | 2954|    863|			*p++ = *ucptr++;	\
  |  | 2955|    863|			/* FALL THROUGH */	\
  |  | 2956|  16.3k|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (2956:3): [True: 15.4k, False: 863]
  |  |  ------------------
  |  | 2957|  16.3k|			*p++ = *ucptr;		\
  |  | 2958|  16.3k|			break;			\
  |  | 2959|  16.3k|		}				\
  |  | 2960|  16.3k|		ucptr = NULL;			\
  |  | 2961|  16.3k|	} else {				\
  |  | 2962|    342|		UNPARSE(p, endp, uc);		\
  |  |  ------------------
  |  |  |  | 2929|    342|#define UNPARSE(p, endp, uc)	do {		\
  |  |  |  | 2930|    342|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2930:9): [True: 0, False: 342]
  |  |  |  |  ------------------
  |  |  |  | 2931|      0|		EXPAND_BUFFER();		\
  |  |  |  |  ------------------
  |  |  |  |  |  | 2920|      0|#define EXPAND_BUFFER() do {			\
  |  |  |  |  |  | 2921|      0|	as->length = p - as->s;			\
  |  |  |  |  |  | 2922|      0|	if (archive_string_ensure(as,		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2922:6): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2923|      0|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  |  |  | 2924|      0|		return (-1);			\
  |  |  |  |  |  | 2925|      0|	p = as->s + as->length;			\
  |  |  |  |  |  | 2926|      0|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  |  |  | 2927|      0|} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2927:10): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2932|      0|	}					\
  |  |  |  | 2933|    342|	p += w;					\
  |  |  |  | 2934|    342|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2934:10): [Folded, False: 342]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2963|    342|	}					\
  |  | 2964|  16.6k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2964:10): [Folded, False: 16.6k]
  |  |  ------------------
  ------------------
 3245|  16.6k|			break;
 3246|  16.6k|		}
 3247|  51.8k|	}
 3248|  22.7k|	as->length = p - as->s;
 3249|  22.7k|	as->s[as->length] = '\0';
 3250|  22.7k|	if (ts == 2)
  ------------------
  |  Branch (3250:6): [True: 597, False: 22.1k]
  ------------------
 3251|    597|		as->s[as->length+1] = '\0';
 3252|  22.7k|	return (ret);
 3253|  22.7k|}
archive_string.c:get_nfc:
 2879|  17.4k|{
 2880|  17.4k|	int t, b;
 2881|       |
 2882|  17.4k|	t = 0;
 2883|  17.4k|	b = sizeof(u_composition_table)/sizeof(u_composition_table[0]) -1;
 2884|   179k|	while (b >= t) {
  ------------------
  |  Branch (2884:9): [True: 165k, False: 14.1k]
  ------------------
 2885|   165k|		int m = (t + b) / 2;
 2886|   165k|		if (u_composition_table[m].cp1 < uc)
  ------------------
  |  Branch (2886:7): [True: 99.3k, False: 66.5k]
  ------------------
 2887|  99.3k|			t = m + 1;
 2888|  66.5k|		else if (u_composition_table[m].cp1 > uc)
  ------------------
  |  Branch (2888:12): [True: 54.6k, False: 11.9k]
  ------------------
 2889|  54.6k|			b = m - 1;
 2890|  11.9k|		else if (u_composition_table[m].cp2 < uc2)
  ------------------
  |  Branch (2890:12): [True: 4.85k, False: 7.05k]
  ------------------
 2891|  4.85k|			t = m + 1;
 2892|  7.05k|		else if (u_composition_table[m].cp2 > uc2)
  ------------------
  |  Branch (2892:12): [True: 3.70k, False: 3.35k]
  ------------------
 2893|  3.70k|			b = m - 1;
 2894|  3.35k|		else
 2895|  3.35k|			return (u_composition_table[m].nfc);
 2896|   165k|	}
 2897|  14.1k|	return (0);
 2898|  17.4k|}
archive_string.c:utf16nbytes:
 1986|    670|{
 1987|    670|	size_t s;
 1988|    670|	const char *p, *pp;
 1989|       |
 1990|    670|	if (_p == NULL)
  ------------------
  |  Branch (1990:6): [True: 0, False: 670]
  ------------------
 1991|      0|		return (0);
 1992|    670|	p = (const char *)_p;
 1993|       |
 1994|       |	/* Like strlen(p), except won't examine positions beyond p[n]. */
 1995|    670|	s = 0;
 1996|    670|	pp = p;
 1997|    670|	n >>= 1;
 1998|  39.5k|	while (s < n && (pp[0] || pp[1])) {
  ------------------
  |  Branch (1998:9): [True: 38.9k, False: 560]
  |  Branch (1998:19): [True: 37.7k, False: 1.21k]
  |  Branch (1998:28): [True: 1.10k, False: 110]
  ------------------
 1999|  38.8k|		pp += 2;
 2000|  38.8k|		s++;
 2001|  38.8k|	}
 2002|    670|	return (s<<1);
 2003|    670|}
archive_string.c:mbsnbytes:
 1966|   130k|{
 1967|   130k|	size_t s;
 1968|   130k|	const char *p, *pp;
 1969|       |
 1970|   130k|	if (_p == NULL)
  ------------------
  |  Branch (1970:6): [True: 0, False: 130k]
  ------------------
 1971|      0|		return (0);
 1972|   130k|	p = (const char *)_p;
 1973|       |
 1974|       |	/* Like strlen(p), except won't examine positions beyond p[n]. */
 1975|   130k|	s = 0;
 1976|   130k|	pp = p;
 1977|  33.5M|	while (s < n && *pp) {
  ------------------
  |  Branch (1977:9): [True: 33.4M, False: 100k]
  |  Branch (1977:18): [True: 33.4M, False: 30.1k]
  ------------------
 1978|  33.4M|		pp++;
 1979|  33.4M|		s++;
 1980|  33.4M|	}
 1981|   130k|	return (s);
 1982|   130k|}

archive_string_sprintf:
   77|  43.2k|{
   78|  43.2k|	va_list ap;
   79|       |
   80|  43.2k|	va_start(ap, fmt);
   81|  43.2k|	archive_string_vsprintf(as, fmt, ap);
   82|       |	va_end(ap);
   83|  43.2k|}
archive_string_vsprintf:
   92|   326k|{
   93|   326k|	char long_flag;
   94|   326k|	intmax_t s; /* Signed integer temp. */
   95|   326k|	uintmax_t u; /* Unsigned integer temp. */
   96|   326k|	const char *p, *p2;
   97|   326k|	const wchar_t *pw;
   98|       |
   99|   326k|	if (archive_string_ensure(as, 64) == NULL)
  ------------------
  |  Branch (99:6): [True: 0, False: 326k]
  ------------------
  100|      0|		__archive_errx(1, "Out of memory");
  101|       |
  102|   326k|	if (fmt == NULL) {
  ------------------
  |  Branch (102:6): [True: 0, False: 326k]
  ------------------
  103|      0|		as->s[0] = 0;
  104|      0|		return;
  105|      0|	}
  106|       |
  107|  12.4M|	for (p = fmt; *p != '\0'; p++) {
  ------------------
  |  Branch (107:16): [True: 12.1M, False: 326k]
  ------------------
  108|  12.1M|		const char *saved_p = p;
  109|       |
  110|  12.1M|		if (*p != '%') {
  ------------------
  |  Branch (110:7): [True: 11.9M, False: 190k]
  ------------------
  111|  11.9M|			archive_strappend_char(as, *p);
  112|  11.9M|			continue;
  113|  11.9M|		}
  114|       |
  115|   190k|		p++;
  116|       |
  117|   190k|		long_flag = '\0';
  118|   190k|		switch(*p) {
  ------------------
  |  Branch (118:10): [True: 40.4k, False: 150k]
  ------------------
  119|     12|		case 'l':
  ------------------
  |  Branch (119:3): [True: 12, False: 190k]
  ------------------
  120|     12|			if (p[1] == 'l') {
  ------------------
  |  Branch (120:8): [True: 4, False: 8]
  ------------------
  121|      4|				long_flag = 'L';
  122|      4|				p += 2;
  123|      4|				break;
  124|      4|			}
  125|      8|			__LA_FALLTHROUGH;
  126|  33.6k|		case 'j':
  ------------------
  |  Branch (126:3): [True: 33.6k, False: 157k]
  ------------------
  127|  40.4k|		case 'z':
  ------------------
  |  Branch (127:3): [True: 6.82k, False: 183k]
  ------------------
  128|  40.4k|			long_flag = *p;
  129|  40.4k|			p++;
  130|  40.4k|			break;
  131|   190k|		}
  132|       |
  133|   190k|		switch (*p) {
  134|      0|		case '%':
  ------------------
  |  Branch (134:3): [True: 0, False: 190k]
  ------------------
  135|      0|			archive_strappend_char(as, '%');
  136|      0|			break;
  137|    429|		case 'c':
  ------------------
  |  Branch (137:3): [True: 429, False: 190k]
  ------------------
  138|    429|			s = va_arg(ap, int);
  139|    429|			archive_strappend_char(as, (char)s);
  140|    429|			break;
  141|   119k|		case 'd':
  ------------------
  |  Branch (141:3): [True: 119k, False: 70.8k]
  ------------------
  142|   119k|			switch(long_flag) {
  143|  33.6k|			case 'j': s = va_arg(ap, intmax_t); break;
  ------------------
  |  Branch (143:4): [True: 33.6k, False: 86.1k]
  ------------------
  144|      0|			case 'l': s = va_arg(ap, long); break;
  ------------------
  |  Branch (144:4): [True: 0, False: 119k]
  ------------------
  145|      4|			case 'L': s = va_arg(ap, long long); break;
  ------------------
  |  Branch (145:4): [True: 4, False: 119k]
  ------------------
  146|      0|			case 'z': s = va_arg(ap, ssize_t); break;
  ------------------
  |  Branch (146:4): [True: 0, False: 119k]
  ------------------
  147|  86.1k|			default:  s = va_arg(ap, int); break;
  ------------------
  |  Branch (147:4): [True: 86.1k, False: 33.6k]
  ------------------
  148|   119k|			}
  149|   119k|			append_int(as, s, 10);
  150|   119k|			break;
  151|  53.6k|		case 's':
  ------------------
  |  Branch (151:3): [True: 53.6k, False: 137k]
  ------------------
  152|  53.6k|			switch(long_flag) {
  153|      0|			case 'l':
  ------------------
  |  Branch (153:4): [True: 0, False: 53.6k]
  ------------------
  154|      0|			case 'L':
  ------------------
  |  Branch (154:4): [True: 0, False: 53.6k]
  ------------------
  155|      0|				pw = va_arg(ap, wchar_t *);
  156|      0|				if (pw == NULL)
  ------------------
  |  Branch (156:9): [True: 0, False: 0]
  ------------------
  157|      0|					pw = L"(null)";
  158|      0|				if (archive_string_append_from_wcs(as, pw,
  ------------------
  |  Branch (158:9): [True: 0, False: 0]
  ------------------
  159|      0|				    wcslen(pw)) != 0 && errno == ENOMEM)
  ------------------
  |  Branch (159:29): [True: 0, False: 0]
  ------------------
  160|      0|					__archive_errx(1, "Out of memory");
  161|      0|				break;
  162|  53.6k|			default:
  ------------------
  |  Branch (162:4): [True: 53.6k, False: 0]
  ------------------
  163|  53.6k|				p2 = va_arg(ap, char *);
  164|  53.6k|				if (p2 == NULL)
  ------------------
  |  Branch (164:9): [True: 1, False: 53.6k]
  ------------------
  165|      1|					p2 = "(null)";
  166|  53.6k|				archive_strcat(as, p2);
  167|  53.6k|				break;
  168|  53.6k|			}
  169|  53.6k|			break;
  170|  53.6k|		case 'S':
  ------------------
  |  Branch (170:3): [True: 0, False: 190k]
  ------------------
  171|      0|			pw = va_arg(ap, wchar_t *);
  172|      0|			if (pw == NULL)
  ------------------
  |  Branch (172:8): [True: 0, False: 0]
  ------------------
  173|      0|				pw = L"(null)";
  174|      0|			if (archive_string_append_from_wcs(as, pw,
  ------------------
  |  Branch (174:8): [True: 0, False: 0]
  ------------------
  175|      0|			    wcslen(pw)) != 0 && errno == ENOMEM)
  ------------------
  |  Branch (175:28): [True: 0, False: 0]
  ------------------
  176|      0|				__archive_errx(1, "Out of memory");
  177|      0|			break;
  178|  16.7k|		case 'o': case 'u': case 'x': case 'X':
  ------------------
  |  Branch (178:3): [True: 0, False: 190k]
  |  Branch (178:13): [True: 16.7k, False: 173k]
  |  Branch (178:23): [True: 11, False: 190k]
  |  Branch (178:33): [True: 4, False: 190k]
  ------------------
  179|       |			/* Common handling for unsigned integer formats. */
  180|  16.7k|			switch(long_flag) {
  181|      4|			case 'j': u = va_arg(ap, uintmax_t); break;
  ------------------
  |  Branch (181:4): [True: 4, False: 16.7k]
  ------------------
  182|      8|			case 'l': u = va_arg(ap, unsigned long); break;
  ------------------
  |  Branch (182:4): [True: 8, False: 16.7k]
  ------------------
  183|      0|			case 'L': u = va_arg(ap, unsigned long long); break;
  ------------------
  |  Branch (183:4): [True: 0, False: 16.7k]
  ------------------
  184|  6.82k|			case 'z': u = va_arg(ap, size_t); break;
  ------------------
  |  Branch (184:4): [True: 6.82k, False: 9.94k]
  ------------------
  185|  9.93k|			default:  u = va_arg(ap, unsigned int); break;
  ------------------
  |  Branch (185:4): [True: 9.93k, False: 6.83k]
  ------------------
  186|  16.7k|			}
  187|       |			/* Format it in the correct base. */
  188|  16.7k|			switch (*p) {
  189|      0|			case 'o': append_uint(as, u, 8); break;
  ------------------
  |  Branch (189:4): [True: 0, False: 16.7k]
  ------------------
  190|  16.7k|			case 'u': append_uint(as, u, 10); break;
  ------------------
  |  Branch (190:4): [True: 16.7k, False: 15]
  ------------------
  191|     15|			default: append_uint(as, u, 16); break;
  ------------------
  |  Branch (191:4): [True: 15, False: 16.7k]
  ------------------
  192|  16.7k|			}
  193|  16.7k|			break;
  194|  16.7k|		default:
  ------------------
  |  Branch (194:3): [True: 0, False: 190k]
  ------------------
  195|       |			/* Rewind and print the initial '%' literally. */
  196|      0|			p = saved_p;
  197|      0|			archive_strappend_char(as, *p);
  198|   190k|		}
  199|   190k|	}
  200|   326k|}
archive_string_sprintf.c:append_int:
   63|   119k|{
   64|   119k|	uintmax_t ud;
   65|       |
   66|   119k|	if (d < 0) {
  ------------------
  |  Branch (66:6): [True: 9.91k, False: 109k]
  ------------------
   67|  9.91k|		archive_strappend_char(as, '-');
   68|  9.91k|		ud = (d == INTMAX_MIN) ? (uintmax_t)(INTMAX_MAX) + 1 : (uintmax_t)(-d);
  ------------------
  |  Branch (68:8): [True: 0, False: 9.91k]
  ------------------
   69|  9.91k|	} else
   70|   109k|		ud = d;
   71|   119k|	append_uint(as, ud, base);
   72|   119k|}
archive_string_sprintf.c:append_uint:
   54|   326k|{
   55|   326k|	static const char digits[] = "0123456789abcdef";
   56|   326k|	if (d >= base)
  ------------------
  |  Branch (56:6): [True: 189k, False: 136k]
  ------------------
   57|   189k|		append_uint(as, d/base, base);
   58|   326k|	archive_strappend_char(as, digits[d % base]);
   59|   326k|}

dos_to_unix:
   55|  36.5k|{
   56|  36.5k|	uint16_t msTime, msDate;
   57|  36.5k|	struct tm ts;
   58|  36.5k|	time_t t;
   59|       |
   60|  36.5k|	msTime = (0xFFFF & dos_time);
   61|  36.5k|	msDate = (dos_time >> 16);
   62|       |
   63|  36.5k|	memset(&ts, 0, sizeof(ts));
   64|  36.5k|	ts.tm_year = ((msDate >> 9) & 0x7f) + 80; /* Years since 1900. */
   65|  36.5k|	ts.tm_mon = ((msDate >> 5) & 0x0f) - 1; /* Month number. */
   66|  36.5k|	ts.tm_mday = msDate & 0x1f; /* Day of month. */
   67|  36.5k|	ts.tm_hour = (msTime >> 11) & 0x1f;
   68|  36.5k|	ts.tm_min = (msTime >> 5) & 0x3f;
   69|  36.5k|	ts.tm_sec = (msTime << 1) & 0x3e;
   70|  36.5k|	ts.tm_isdst = -1;
   71|  36.5k|	t = mktime(&ts);
   72|  36.5k|	return (int64_t)(t == (time_t)-1 ? INT32_MAX : t);
  ------------------
  |  Branch (72:19): [True: 0, False: 36.5k]
  ------------------
   73|  36.5k|}
ntfs_to_unix:
  127|  2.74k|{
  128|  2.74k|	if (ntfs > INT64_MAX) {
  ------------------
  |  Branch (128:6): [True: 66, False: 2.68k]
  ------------------
  129|     66|		ntfs -= NTFS_EPOC_TICKS;
  ------------------
  |  |   35|     66|#define NTFS_EPOC_TICKS (NTFS_EPOC_TIME * NTFS_TICKS)
  |  |  ------------------
  |  |  |  |   33|     66|#define NTFS_EPOC_TIME ARCHIVE_LITERAL_ULL(11644473600)
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|     66|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define NTFS_EPOC_TICKS (NTFS_EPOC_TIME * NTFS_TICKS)
  |  |  ------------------
  |  |  |  |   34|     66|#define NTFS_TICKS ARCHIVE_LITERAL_ULL(10000000)
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|     66|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  130|     66|		*secs = ntfs / NTFS_TICKS;
  ------------------
  |  |   34|     66|#define NTFS_TICKS ARCHIVE_LITERAL_ULL(10000000)
  |  |  ------------------
  |  |  |  |  180|     66|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  ------------------
  ------------------
  131|     66|		*nsecs = 100 * (ntfs % NTFS_TICKS);
  ------------------
  |  |   34|     66|#define NTFS_TICKS ARCHIVE_LITERAL_ULL(10000000)
  |  |  ------------------
  |  |  |  |  180|     66|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  ------------------
  ------------------
  132|     66|	}
  133|  2.68k|	else {
  134|  2.68k|		lldiv_t tdiv;
  135|  2.68k|		int64_t value = (int64_t)ntfs - (int64_t)NTFS_EPOC_TICKS;
  ------------------
  |  |   35|  2.68k|#define NTFS_EPOC_TICKS (NTFS_EPOC_TIME * NTFS_TICKS)
  |  |  ------------------
  |  |  |  |   33|  2.68k|#define NTFS_EPOC_TIME ARCHIVE_LITERAL_ULL(11644473600)
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  2.68k|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define NTFS_EPOC_TICKS (NTFS_EPOC_TIME * NTFS_TICKS)
  |  |  ------------------
  |  |  |  |   34|  2.68k|#define NTFS_TICKS ARCHIVE_LITERAL_ULL(10000000)
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  2.68k|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  136|       |
  137|  2.68k|		tdiv = lldiv(value, NTFS_TICKS);
  ------------------
  |  |   34|  2.68k|#define NTFS_TICKS ARCHIVE_LITERAL_ULL(10000000)
  |  |  ------------------
  |  |  |  |  180|  2.68k|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  ------------------
  ------------------
  138|  2.68k|		*secs = tdiv.quot;
  139|  2.68k|		*nsecs = (uint32_t)(tdiv.rem * 100);
  140|  2.68k|	}
  141|  2.74k|}

__archive_clean:
   81|  2.49k|{
   82|  2.49k|	archive_string_conversion_free(a);
   83|  2.49k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
   84|  2.49k|}
archive_file_count:
  116|  2.44k|{
  117|  2.44k|	return (a->file_count);
  118|  2.44k|}
archive_clear_error:
  166|   309k|{
  167|   309k|	archive_string_empty(&a->error_string);
  ------------------
  |  |  181|   309k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  168|       |	a->error = NULL;
  169|   309k|	a->archive_error_number = 0;
  170|   309k|}
archive_set_error:
  174|   283k|{
  175|   283k|	va_list ap;
  176|       |
  177|   283k|	a->archive_error_number = error_number;
  178|   283k|	if (fmt == NULL) {
  ------------------
  |  Branch (178:6): [True: 0, False: 283k]
  ------------------
  179|      0|		a->error = NULL;
  180|      0|		return;
  181|      0|	}
  182|       |
  183|   283k|	archive_string_empty(&(a->error_string));
  ------------------
  |  |  181|   283k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  184|   283k|	va_start(ap, fmt);
  185|   283k|	archive_string_vsprintf(&(a->error_string), fmt, ap);
  186|       |	va_end(ap);
  187|   283k|	a->error = a->error_string.s;
  188|   283k|}

archive_filter_bytes:
   52|    263|{
   53|    263|	return ((a->vtable->archive_filter_bytes)(a, n));
   54|    263|}
archive_free:
   58|  2.49k|{
   59|  2.49k|	if (a == NULL)
  ------------------
  |  Branch (59:6): [True: 0, False: 2.49k]
  ------------------
   60|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
   61|  2.49k|	return ((a->vtable->archive_free)(a));
   62|  2.49k|}
archive_read_free:
  100|  2.49k|{
  101|  2.49k|	return archive_free(a);
  102|  2.49k|}
archive_read_next_header:
  147|   301k|{
  148|   301k|	return ((a->vtable->archive_read_next_header)(a, entry));
  149|   301k|}
archive_read_data_block:
  160|   159k|{
  161|   159k|	return ((a->vtable->archive_read_data_block)(a, buff, s, o));
  162|   159k|}

xxhash.c:XXH32:
  295|    762|{
  296|       |#if 0
  297|       |    // Simple version, good for code maintenance, but unfortunately slow for small inputs
  298|       |    void* state = XXH32_init(seed);
  299|       |    XXH32_update(state, input, len);
  300|       |    return XXH32_digest(state);
  301|       |#else
  302|    762|    XXH_endianess endian_detected = (XXH_endianess)XXH_CPU_LITTLE_ENDIAN;
  ------------------
  |  |  202|    762|#   define XXH_CPU_LITTLE_ENDIAN   (*(const char*)(&one))
  ------------------
  303|       |
  304|       |#  if !defined(XXH_USE_UNALIGNED_ACCESS)
  305|       |    if ((((size_t)input) & 3) == 0)   /* Input is aligned, let's leverage the speed advantage */
  306|       |    {
  307|       |        if ((endian_detected==XXH_littleEndian) || XXH_FORCE_NATIVE_FORMAT)
  308|       |            return XXH32_endian_align(input, len, seed, XXH_littleEndian, XXH_aligned);
  309|       |        else
  310|       |            return XXH32_endian_align(input, len, seed, XXH_bigEndian, XXH_aligned);
  311|       |    }
  312|       |#  endif
  313|       |
  314|    762|    if ((endian_detected==XXH_littleEndian) || XXH_FORCE_NATIVE_FORMAT)
  ------------------
  |  |   68|      0|#define XXH_FORCE_NATIVE_FORMAT 0
  |  |  ------------------
  |  |  |  Branch (68:33): [Folded, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (314:9): [True: 762, False: 0]
  ------------------
  315|    762|        return XXH32_endian_align(input, len, seed, XXH_littleEndian, XXH_unaligned);
  316|      0|    else
  317|      0|        return XXH32_endian_align(input, len, seed, XXH_bigEndian, XXH_unaligned);
  318|    762|#endif
  319|    762|}
xxhash.c:XXH32_endian_align:
  235|    762|{
  236|    762|    const BYTE* p = (const BYTE*)input;
  237|    762|    const BYTE* bEnd = p + len;
  238|    762|    U32 h32;
  239|    762|#define XXH_get32bits(p) XXH_readLE32_align((const U32*)p, endian, align)
  240|       |
  241|       |#ifdef XXH_ACCEPT_NULL_INPUT_POINTER
  242|       |    if (p==NULL) { len=0; bEnd=p=(const BYTE*)(size_t)16; }
  243|       |#endif
  244|       |
  245|    762|    if (len>=16)
  ------------------
  |  Branch (245:9): [True: 3, False: 759]
  ------------------
  246|      3|    {
  247|      3|        const BYTE* const limit = bEnd - 16;
  248|      3|        U32 v1 = seed + PRIME32_1 + PRIME32_2;
  ------------------
  |  |  189|      3|#define PRIME32_1   2654435761U
  ------------------
                      U32 v1 = seed + PRIME32_1 + PRIME32_2;
  ------------------
  |  |  190|      3|#define PRIME32_2   2246822519U
  ------------------
  249|      3|        U32 v2 = seed + PRIME32_2;
  ------------------
  |  |  190|      3|#define PRIME32_2   2246822519U
  ------------------
  250|      3|        U32 v3 = seed + 0;
  251|      3|        U32 v4 = seed - PRIME32_1;
  ------------------
  |  |  189|      3|#define PRIME32_1   2654435761U
  ------------------
  252|       |
  253|      3|        do
  254|  2.28k|        {
  255|  2.28k|            v1 += XXH_get32bits(p) * PRIME32_2; v1 = XXH_rotl32(v1, 13); v1 *= PRIME32_1; p+=4;
  ------------------
  |  |  239|  2.28k|#define XXH_get32bits(p) XXH_readLE32_align((const U32*)p, endian, align)
  ------------------
                          v1 += XXH_get32bits(p) * PRIME32_2; v1 = XXH_rotl32(v1, 13); v1 *= PRIME32_1; p+=4;
  ------------------
  |  |  190|  2.28k|#define PRIME32_2   2246822519U
  ------------------
                          v1 += XXH_get32bits(p) * PRIME32_2; v1 = XXH_rotl32(v1, 13); v1 *= PRIME32_1; p+=4;
  ------------------
  |  |  170|  2.28k|#  define XXH_rotl32(x,r) ((x << r) | (x >> (32 - r)))
  ------------------
                          v1 += XXH_get32bits(p) * PRIME32_2; v1 = XXH_rotl32(v1, 13); v1 *= PRIME32_1; p+=4;
  ------------------
  |  |  189|  2.28k|#define PRIME32_1   2654435761U
  ------------------
  256|  2.28k|            v2 += XXH_get32bits(p) * PRIME32_2; v2 = XXH_rotl32(v2, 13); v2 *= PRIME32_1; p+=4;
  ------------------
  |  |  239|  2.28k|#define XXH_get32bits(p) XXH_readLE32_align((const U32*)p, endian, align)
  ------------------
                          v2 += XXH_get32bits(p) * PRIME32_2; v2 = XXH_rotl32(v2, 13); v2 *= PRIME32_1; p+=4;
  ------------------
  |  |  190|  2.28k|#define PRIME32_2   2246822519U
  ------------------
                          v2 += XXH_get32bits(p) * PRIME32_2; v2 = XXH_rotl32(v2, 13); v2 *= PRIME32_1; p+=4;
  ------------------
  |  |  170|  2.28k|#  define XXH_rotl32(x,r) ((x << r) | (x >> (32 - r)))
  ------------------
                          v2 += XXH_get32bits(p) * PRIME32_2; v2 = XXH_rotl32(v2, 13); v2 *= PRIME32_1; p+=4;
  ------------------
  |  |  189|  2.28k|#define PRIME32_1   2654435761U
  ------------------
  257|  2.28k|            v3 += XXH_get32bits(p) * PRIME32_2; v3 = XXH_rotl32(v3, 13); v3 *= PRIME32_1; p+=4;
  ------------------
  |  |  239|  2.28k|#define XXH_get32bits(p) XXH_readLE32_align((const U32*)p, endian, align)
  ------------------
                          v3 += XXH_get32bits(p) * PRIME32_2; v3 = XXH_rotl32(v3, 13); v3 *= PRIME32_1; p+=4;
  ------------------
  |  |  190|  2.28k|#define PRIME32_2   2246822519U
  ------------------
                          v3 += XXH_get32bits(p) * PRIME32_2; v3 = XXH_rotl32(v3, 13); v3 *= PRIME32_1; p+=4;
  ------------------
  |  |  170|  2.28k|#  define XXH_rotl32(x,r) ((x << r) | (x >> (32 - r)))
  ------------------
                          v3 += XXH_get32bits(p) * PRIME32_2; v3 = XXH_rotl32(v3, 13); v3 *= PRIME32_1; p+=4;
  ------------------
  |  |  189|  2.28k|#define PRIME32_1   2654435761U
  ------------------
  258|  2.28k|            v4 += XXH_get32bits(p) * PRIME32_2; v4 = XXH_rotl32(v4, 13); v4 *= PRIME32_1; p+=4;
  ------------------
  |  |  239|  2.28k|#define XXH_get32bits(p) XXH_readLE32_align((const U32*)p, endian, align)
  ------------------
                          v4 += XXH_get32bits(p) * PRIME32_2; v4 = XXH_rotl32(v4, 13); v4 *= PRIME32_1; p+=4;
  ------------------
  |  |  190|  2.28k|#define PRIME32_2   2246822519U
  ------------------
                          v4 += XXH_get32bits(p) * PRIME32_2; v4 = XXH_rotl32(v4, 13); v4 *= PRIME32_1; p+=4;
  ------------------
  |  |  170|  2.28k|#  define XXH_rotl32(x,r) ((x << r) | (x >> (32 - r)))
  ------------------
                          v4 += XXH_get32bits(p) * PRIME32_2; v4 = XXH_rotl32(v4, 13); v4 *= PRIME32_1; p+=4;
  ------------------
  |  |  189|  2.28k|#define PRIME32_1   2654435761U
  ------------------
  259|  2.28k|        } while (p<=limit);
  ------------------
  |  Branch (259:18): [True: 2.28k, False: 3]
  ------------------
  260|       |
  261|      3|        h32 = XXH_rotl32(v1, 1) + XXH_rotl32(v2, 7) + XXH_rotl32(v3, 12) + XXH_rotl32(v4, 18);
  ------------------
  |  |  170|      3|#  define XXH_rotl32(x,r) ((x << r) | (x >> (32 - r)))
  ------------------
                      h32 = XXH_rotl32(v1, 1) + XXH_rotl32(v2, 7) + XXH_rotl32(v3, 12) + XXH_rotl32(v4, 18);
  ------------------
  |  |  170|      3|#  define XXH_rotl32(x,r) ((x << r) | (x >> (32 - r)))
  ------------------
                      h32 = XXH_rotl32(v1, 1) + XXH_rotl32(v2, 7) + XXH_rotl32(v3, 12) + XXH_rotl32(v4, 18);
  ------------------
  |  |  170|      3|#  define XXH_rotl32(x,r) ((x << r) | (x >> (32 - r)))
  ------------------
                      h32 = XXH_rotl32(v1, 1) + XXH_rotl32(v2, 7) + XXH_rotl32(v3, 12) + XXH_rotl32(v4, 18);
  ------------------
  |  |  170|      3|#  define XXH_rotl32(x,r) ((x << r) | (x >> (32 - r)))
  ------------------
  262|      3|    }
  263|    759|    else
  264|    759|    {
  265|    759|        h32  = seed + PRIME32_5;
  ------------------
  |  |  193|    759|#define PRIME32_5    374761393U
  ------------------
  266|    759|    }
  267|       |
  268|    762|    h32 += (U32) len;
  269|       |
  270|  1.84k|    while (p<=bEnd-4)
  ------------------
  |  Branch (270:12): [True: 1.08k, False: 762]
  ------------------
  271|  1.08k|    {
  272|  1.08k|        h32 += XXH_get32bits(p) * PRIME32_3;
  ------------------
  |  |  239|  1.08k|#define XXH_get32bits(p) XXH_readLE32_align((const U32*)p, endian, align)
  ------------------
                      h32 += XXH_get32bits(p) * PRIME32_3;
  ------------------
  |  |  191|  1.08k|#define PRIME32_3   3266489917U
  ------------------
  273|  1.08k|        h32  = XXH_rotl32(h32, 17) * PRIME32_4 ;
  ------------------
  |  |  170|  1.08k|#  define XXH_rotl32(x,r) ((x << r) | (x >> (32 - r)))
  ------------------
                      h32  = XXH_rotl32(h32, 17) * PRIME32_4 ;
  ------------------
  |  |  192|  1.08k|#define PRIME32_4    668265263U
  ------------------
  274|  1.08k|        p+=4;
  275|  1.08k|    }
  276|       |
  277|  1.56k|    while (p<bEnd)
  ------------------
  |  Branch (277:12): [True: 798, False: 762]
  ------------------
  278|    798|    {
  279|    798|        h32 += (*p) * PRIME32_5;
  ------------------
  |  |  193|    798|#define PRIME32_5    374761393U
  ------------------
  280|    798|        h32 = XXH_rotl32(h32, 11) * PRIME32_1 ;
  ------------------
  |  |  170|    798|#  define XXH_rotl32(x,r) ((x << r) | (x >> (32 - r)))
  ------------------
                      h32 = XXH_rotl32(h32, 11) * PRIME32_1 ;
  ------------------
  |  |  189|    798|#define PRIME32_1   2654435761U
  ------------------
  281|    798|        p++;
  282|    798|    }
  283|       |
  284|    762|    h32 ^= h32 >> 15;
  285|    762|    h32 *= PRIME32_2;
  ------------------
  |  |  190|    762|#define PRIME32_2   2246822519U
  ------------------
  286|    762|    h32 ^= h32 >> 13;
  287|    762|    h32 *= PRIME32_3;
  ------------------
  |  |  191|    762|#define PRIME32_3   3266489917U
  ------------------
  288|    762|    h32 ^= h32 >> 16;
  289|       |
  290|    762|    return h32;
  291|    762|}
xxhash.c:XXH_readLE32_align:
  219|  23.0k|{
  220|  23.0k|    if (align==XXH_unaligned)
  ------------------
  |  Branch (220:9): [True: 23.0k, False: 0]
  ------------------
  221|  23.0k|        return endian==XXH_littleEndian ? A32(ptr) : XXH_swap32(A32(ptr));
  ------------------
  |  Branch (221:16): [True: 23.0k, False: 0]
  ------------------
  222|      0|    else
  223|      0|        return endian==XXH_littleEndian ? *ptr : XXH_swap32(*ptr);
  ------------------
  |  Branch (223:16): [True: 0, False: 0]
  ------------------
  224|  23.0k|}
xxhash.c:A32:
  162|  23.0k|{
  163|  23.0k|    return (((const U32_S *)(x))->v);
  164|  23.0k|}
xxhash.c:XXH32_init:
  362|    276|{
  363|    276|    void* state = XXH_malloc (sizeof(struct XXH_state32_t));
  ------------------
  |  |   91|    276|#define XXH_malloc malloc
  ------------------
  364|    276|    if (state == NULL)
  ------------------
  |  Branch (364:9): [True: 0, False: 276]
  ------------------
  365|      0|        return NULL;
  366|    276|    XXH32_resetState(state, seed);
  367|    276|    return state;
  368|    276|}
xxhash.c:XXH32_resetState:
  348|    276|{
  349|    276|    struct XXH_state32_t * state = (struct XXH_state32_t *) state_in;
  350|    276|    state->seed = seed;
  351|    276|    state->v1 = seed + PRIME32_1 + PRIME32_2;
  ------------------
  |  |  189|    276|#define PRIME32_1   2654435761U
  ------------------
                  state->v1 = seed + PRIME32_1 + PRIME32_2;
  ------------------
  |  |  190|    276|#define PRIME32_2   2246822519U
  ------------------
  352|    276|    state->v2 = seed + PRIME32_2;
  ------------------
  |  |  190|    276|#define PRIME32_2   2246822519U
  ------------------
  353|    276|    state->v3 = seed + 0;
  354|    276|    state->v4 = seed - PRIME32_1;
  ------------------
  |  |  189|    276|#define PRIME32_1   2654435761U
  ------------------
  355|    276|    state->total_len = 0;
  356|    276|    state->memsize = 0;
  357|    276|    return XXH_OK;
  358|    276|}
xxhash.c:XXH32_update:
  437|  2.09k|{
  438|  2.09k|    XXH_endianess endian_detected = (XXH_endianess)XXH_CPU_LITTLE_ENDIAN;
  ------------------
  |  |  202|  2.09k|#   define XXH_CPU_LITTLE_ENDIAN   (*(const char*)(&one))
  ------------------
  439|       |
  440|  2.09k|    if ((endian_detected==XXH_littleEndian) || XXH_FORCE_NATIVE_FORMAT)
  ------------------
  |  |   68|      0|#define XXH_FORCE_NATIVE_FORMAT 0
  |  |  ------------------
  |  |  |  Branch (68:33): [Folded, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (440:9): [True: 2.09k, False: 0]
  ------------------
  441|  2.09k|        return XXH32_update_endian(state_in, input, len, XXH_littleEndian);
  442|      0|    else
  443|      0|        return XXH32_update_endian(state_in, input, len, XXH_bigEndian);
  444|  2.09k|}
xxhash.c:XXH32_update_endian:
  372|  2.09k|{
  373|  2.09k|    struct XXH_state32_t * state = (struct XXH_state32_t *) state_in;
  374|  2.09k|    const BYTE* p = (const BYTE*)input;
  375|  2.09k|    const BYTE* const bEnd = p + len;
  376|       |
  377|       |#ifdef XXH_ACCEPT_NULL_INPUT_POINTER
  378|       |    if (input==NULL) return XXH_ERROR;
  379|       |#endif
  380|       |
  381|  2.09k|    state->total_len += len;
  382|       |
  383|  2.09k|    if (state->memsize + len < 16)   /* fill in tmp buffer */
  ------------------
  |  Branch (383:9): [True: 1.27k, False: 827]
  ------------------
  384|  1.27k|    {
  385|  1.27k|        XXH_memcpy(state->memory + state->memsize, input, len);
  ------------------
  |  |   93|  1.27k|#define XXH_memcpy memcpy
  ------------------
  386|  1.27k|        state->memsize +=  len;
  387|  1.27k|        return XXH_OK;
  388|  1.27k|    }
  389|       |
  390|    827|    if (state->memsize)   /* some data left from previous update */
  ------------------
  |  Branch (390:9): [True: 754, False: 73]
  ------------------
  391|    754|    {
  392|    754|        XXH_memcpy(state->memory + state->memsize, input, 16-state->memsize);
  ------------------
  |  |   93|    754|#define XXH_memcpy memcpy
  ------------------
  393|    754|        {
  394|    754|            const U32* p32 = (const U32*)state->memory;
  395|    754|            state->v1 += XXH_readLE32(p32, endian) * PRIME32_2; state->v1 = XXH_rotl32(state->v1, 13); state->v1 *= PRIME32_1; p32++;
  ------------------
  |  |  190|    754|#define PRIME32_2   2246822519U
  ------------------
                          state->v1 += XXH_readLE32(p32, endian) * PRIME32_2; state->v1 = XXH_rotl32(state->v1, 13); state->v1 *= PRIME32_1; p32++;
  ------------------
  |  |  170|    754|#  define XXH_rotl32(x,r) ((x << r) | (x >> (32 - r)))
  ------------------
                          state->v1 += XXH_readLE32(p32, endian) * PRIME32_2; state->v1 = XXH_rotl32(state->v1, 13); state->v1 *= PRIME32_1; p32++;
  ------------------
  |  |  189|    754|#define PRIME32_1   2654435761U
  ------------------
  396|    754|            state->v2 += XXH_readLE32(p32, endian) * PRIME32_2; state->v2 = XXH_rotl32(state->v2, 13); state->v2 *= PRIME32_1; p32++;
  ------------------
  |  |  190|    754|#define PRIME32_2   2246822519U
  ------------------
                          state->v2 += XXH_readLE32(p32, endian) * PRIME32_2; state->v2 = XXH_rotl32(state->v2, 13); state->v2 *= PRIME32_1; p32++;
  ------------------
  |  |  170|    754|#  define XXH_rotl32(x,r) ((x << r) | (x >> (32 - r)))
  ------------------
                          state->v2 += XXH_readLE32(p32, endian) * PRIME32_2; state->v2 = XXH_rotl32(state->v2, 13); state->v2 *= PRIME32_1; p32++;
  ------------------
  |  |  189|    754|#define PRIME32_1   2654435761U
  ------------------
  397|    754|            state->v3 += XXH_readLE32(p32, endian) * PRIME32_2; state->v3 = XXH_rotl32(state->v3, 13); state->v3 *= PRIME32_1; p32++;
  ------------------
  |  |  190|    754|#define PRIME32_2   2246822519U
  ------------------
                          state->v3 += XXH_readLE32(p32, endian) * PRIME32_2; state->v3 = XXH_rotl32(state->v3, 13); state->v3 *= PRIME32_1; p32++;
  ------------------
  |  |  170|    754|#  define XXH_rotl32(x,r) ((x << r) | (x >> (32 - r)))
  ------------------
                          state->v3 += XXH_readLE32(p32, endian) * PRIME32_2; state->v3 = XXH_rotl32(state->v3, 13); state->v3 *= PRIME32_1; p32++;
  ------------------
  |  |  189|    754|#define PRIME32_1   2654435761U
  ------------------
  398|    754|            state->v4 += XXH_readLE32(p32, endian) * PRIME32_2; state->v4 = XXH_rotl32(state->v4, 13); state->v4 *= PRIME32_1; p32++;
  ------------------
  |  |  190|    754|#define PRIME32_2   2246822519U
  ------------------
                          state->v4 += XXH_readLE32(p32, endian) * PRIME32_2; state->v4 = XXH_rotl32(state->v4, 13); state->v4 *= PRIME32_1; p32++;
  ------------------
  |  |  170|    754|#  define XXH_rotl32(x,r) ((x << r) | (x >> (32 - r)))
  ------------------
                          state->v4 += XXH_readLE32(p32, endian) * PRIME32_2; state->v4 = XXH_rotl32(state->v4, 13); state->v4 *= PRIME32_1; p32++;
  ------------------
  |  |  189|    754|#define PRIME32_1   2654435761U
  ------------------
  399|    754|        }
  400|    754|        p += 16-state->memsize;
  401|    754|        state->memsize = 0;
  402|    754|    }
  403|       |
  404|    827|    if (p <= bEnd-16)
  ------------------
  |  Branch (404:9): [True: 298, False: 529]
  ------------------
  405|    298|    {
  406|    298|        const BYTE* const limit = bEnd - 16;
  407|    298|        U32 v1 = state->v1;
  408|    298|        U32 v2 = state->v2;
  409|    298|        U32 v3 = state->v3;
  410|    298|        U32 v4 = state->v4;
  411|       |
  412|    298|        do
  413|  2.45k|        {
  414|  2.45k|            v1 += XXH_readLE32((const U32*)p, endian) * PRIME32_2; v1 = XXH_rotl32(v1, 13); v1 *= PRIME32_1; p+=4;
  ------------------
  |  |  190|  2.45k|#define PRIME32_2   2246822519U
  ------------------
                          v1 += XXH_readLE32((const U32*)p, endian) * PRIME32_2; v1 = XXH_rotl32(v1, 13); v1 *= PRIME32_1; p+=4;
  ------------------
  |  |  170|  2.45k|#  define XXH_rotl32(x,r) ((x << r) | (x >> (32 - r)))
  ------------------
                          v1 += XXH_readLE32((const U32*)p, endian) * PRIME32_2; v1 = XXH_rotl32(v1, 13); v1 *= PRIME32_1; p+=4;
  ------------------
  |  |  189|  2.45k|#define PRIME32_1   2654435761U
  ------------------
  415|  2.45k|            v2 += XXH_readLE32((const U32*)p, endian) * PRIME32_2; v2 = XXH_rotl32(v2, 13); v2 *= PRIME32_1; p+=4;
  ------------------
  |  |  190|  2.45k|#define PRIME32_2   2246822519U
  ------------------
                          v2 += XXH_readLE32((const U32*)p, endian) * PRIME32_2; v2 = XXH_rotl32(v2, 13); v2 *= PRIME32_1; p+=4;
  ------------------
  |  |  170|  2.45k|#  define XXH_rotl32(x,r) ((x << r) | (x >> (32 - r)))
  ------------------
                          v2 += XXH_readLE32((const U32*)p, endian) * PRIME32_2; v2 = XXH_rotl32(v2, 13); v2 *= PRIME32_1; p+=4;
  ------------------
  |  |  189|  2.45k|#define PRIME32_1   2654435761U
  ------------------
  416|  2.45k|            v3 += XXH_readLE32((const U32*)p, endian) * PRIME32_2; v3 = XXH_rotl32(v3, 13); v3 *= PRIME32_1; p+=4;
  ------------------
  |  |  190|  2.45k|#define PRIME32_2   2246822519U
  ------------------
                          v3 += XXH_readLE32((const U32*)p, endian) * PRIME32_2; v3 = XXH_rotl32(v3, 13); v3 *= PRIME32_1; p+=4;
  ------------------
  |  |  170|  2.45k|#  define XXH_rotl32(x,r) ((x << r) | (x >> (32 - r)))
  ------------------
                          v3 += XXH_readLE32((const U32*)p, endian) * PRIME32_2; v3 = XXH_rotl32(v3, 13); v3 *= PRIME32_1; p+=4;
  ------------------
  |  |  189|  2.45k|#define PRIME32_1   2654435761U
  ------------------
  417|  2.45k|            v4 += XXH_readLE32((const U32*)p, endian) * PRIME32_2; v4 = XXH_rotl32(v4, 13); v4 *= PRIME32_1; p+=4;
  ------------------
  |  |  190|  2.45k|#define PRIME32_2   2246822519U
  ------------------
                          v4 += XXH_readLE32((const U32*)p, endian) * PRIME32_2; v4 = XXH_rotl32(v4, 13); v4 *= PRIME32_1; p+=4;
  ------------------
  |  |  170|  2.45k|#  define XXH_rotl32(x,r) ((x << r) | (x >> (32 - r)))
  ------------------
                          v4 += XXH_readLE32((const U32*)p, endian) * PRIME32_2; v4 = XXH_rotl32(v4, 13); v4 *= PRIME32_1; p+=4;
  ------------------
  |  |  189|  2.45k|#define PRIME32_1   2654435761U
  ------------------
  418|  2.45k|        } while (p<=limit);
  ------------------
  |  Branch (418:18): [True: 2.15k, False: 298]
  ------------------
  419|       |
  420|    298|        state->v1 = v1;
  421|    298|        state->v2 = v2;
  422|    298|        state->v3 = v3;
  423|    298|        state->v4 = v4;
  424|    298|    }
  425|       |
  426|    827|    if (p < bEnd)
  ------------------
  |  Branch (426:9): [True: 632, False: 195]
  ------------------
  427|    632|    {
  428|    632|        XXH_memcpy(state->memory, p, bEnd-p);
  ------------------
  |  |   93|    632|#define XXH_memcpy memcpy
  ------------------
  429|    632|        state->memsize = (int)(bEnd-p);
  430|    632|    }
  431|       |
  432|    827|    return XXH_OK;
  433|  2.09k|}
xxhash.c:XXH_readLE32:
  227|  12.8k|FORCE_INLINE U32 XXH_readLE32(const U32* ptr, XXH_endianess endian) { return XXH_readLE32_align(ptr, endian, XXH_unaligned); }
xxhash.c:XXH32_digest:
  503|    263|{
  504|    263|    U32 h32 = XXH32_intermediateDigest(state_in);
  505|       |
  506|    263|    XXH_free(state_in);
  ------------------
  |  |   92|    263|#define XXH_free free
  ------------------
  507|       |
  508|    263|    return h32;
  509|    263|}
xxhash.c:XXH32_intermediateDigest:
  492|    263|{
  493|    263|    XXH_endianess endian_detected = (XXH_endianess)XXH_CPU_LITTLE_ENDIAN;
  ------------------
  |  |  202|    263|#   define XXH_CPU_LITTLE_ENDIAN   (*(const char*)(&one))
  ------------------
  494|       |
  495|    263|    if ((endian_detected==XXH_littleEndian) || XXH_FORCE_NATIVE_FORMAT)
  ------------------
  |  |   68|      0|#define XXH_FORCE_NATIVE_FORMAT 0
  |  |  ------------------
  |  |  |  Branch (68:33): [Folded, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (495:9): [True: 263, False: 0]
  ------------------
  496|    263|        return XXH32_intermediateDigest_endian(state_in, XXH_littleEndian);
  497|      0|    else
  498|      0|        return XXH32_intermediateDigest_endian(state_in, XXH_bigEndian);
  499|    263|}
xxhash.c:XXH32_intermediateDigest_endian:
  450|    263|{
  451|    263|    struct XXH_state32_t * state = (struct XXH_state32_t *) state_in;
  452|    263|    const BYTE * p = (const BYTE*)state->memory;
  453|    263|    BYTE* bEnd = (BYTE*)state->memory + state->memsize;
  454|    263|    U32 h32;
  455|       |
  456|    263|    if (state->total_len >= 16)
  ------------------
  |  Branch (456:9): [True: 1, False: 262]
  ------------------
  457|      1|    {
  458|      1|        h32 = XXH_rotl32(state->v1, 1) + XXH_rotl32(state->v2, 7) + XXH_rotl32(state->v3, 12) + XXH_rotl32(state->v4, 18);
  ------------------
  |  |  170|      1|#  define XXH_rotl32(x,r) ((x << r) | (x >> (32 - r)))
  ------------------
                      h32 = XXH_rotl32(state->v1, 1) + XXH_rotl32(state->v2, 7) + XXH_rotl32(state->v3, 12) + XXH_rotl32(state->v4, 18);
  ------------------
  |  |  170|      1|#  define XXH_rotl32(x,r) ((x << r) | (x >> (32 - r)))
  ------------------
                      h32 = XXH_rotl32(state->v1, 1) + XXH_rotl32(state->v2, 7) + XXH_rotl32(state->v3, 12) + XXH_rotl32(state->v4, 18);
  ------------------
  |  |  170|      1|#  define XXH_rotl32(x,r) ((x << r) | (x >> (32 - r)))
  ------------------
                      h32 = XXH_rotl32(state->v1, 1) + XXH_rotl32(state->v2, 7) + XXH_rotl32(state->v3, 12) + XXH_rotl32(state->v4, 18);
  ------------------
  |  |  170|      1|#  define XXH_rotl32(x,r) ((x << r) | (x >> (32 - r)))
  ------------------
  459|      1|    }
  460|    262|    else
  461|    262|    {
  462|    262|        h32  = state->seed + PRIME32_5;
  ------------------
  |  |  193|    262|#define PRIME32_5    374761393U
  ------------------
  463|    262|    }
  464|       |
  465|    263|    h32 += (U32) state->total_len;
  466|       |
  467|    264|    while (p<=bEnd-4)
  ------------------
  |  Branch (467:12): [True: 1, False: 263]
  ------------------
  468|      1|    {
  469|      1|        h32 += XXH_readLE32((const U32*)p, endian) * PRIME32_3;
  ------------------
  |  |  191|      1|#define PRIME32_3   3266489917U
  ------------------
  470|      1|        h32  = XXH_rotl32(h32, 17) * PRIME32_4;
  ------------------
  |  |  170|      1|#  define XXH_rotl32(x,r) ((x << r) | (x >> (32 - r)))
  ------------------
                      h32  = XXH_rotl32(h32, 17) * PRIME32_4;
  ------------------
  |  |  192|      1|#define PRIME32_4    668265263U
  ------------------
  471|      1|        p+=4;
  472|      1|    }
  473|       |
  474|  1.05k|    while (p<bEnd)
  ------------------
  |  Branch (474:12): [True: 788, False: 263]
  ------------------
  475|    788|    {
  476|    788|        h32 += (*p) * PRIME32_5;
  ------------------
  |  |  193|    788|#define PRIME32_5    374761393U
  ------------------
  477|    788|        h32 = XXH_rotl32(h32, 11) * PRIME32_1;
  ------------------
  |  |  170|    788|#  define XXH_rotl32(x,r) ((x << r) | (x >> (32 - r)))
  ------------------
                      h32 = XXH_rotl32(h32, 11) * PRIME32_1;
  ------------------
  |  |  189|    788|#define PRIME32_1   2654435761U
  ------------------
  478|    788|        p++;
  479|    788|    }
  480|       |
  481|    263|    h32 ^= h32 >> 15;
  482|    263|    h32 *= PRIME32_2;
  ------------------
  |  |  190|    263|#define PRIME32_2   2246822519U
  ------------------
  483|    263|    h32 ^= h32 >> 13;
  484|    263|    h32 *= PRIME32_3;
  ------------------
  |  |  191|    263|#define PRIME32_3   3266489917U
  ------------------
  485|    263|    h32 ^= h32 >> 16;
  486|       |
  487|    263|    return h32;
  488|    263|}

LLVMFuzzerTestOneInput:
   23|  2.49k|extern "C" int LLVMFuzzerTestOneInput(const uint8_t *buf, size_t len) {
   24|  2.49k|  struct archive *a = archive_read_new();
   25|       |
   26|  2.49k|  archive_read_support_filter_all(a);
   27|  2.49k|  archive_read_support_format_all(a);
   28|  2.49k|  archive_read_support_format_empty(a);
   29|  2.49k|  archive_read_support_format_raw(a);
   30|  2.49k|  archive_read_support_format_gnutar(a);
   31|       |
   32|  2.49k|  if (ARCHIVE_OK != archive_read_set_options(a, "zip:ignorecrc32,tar:read_concatenated_archives,tar:mac-ext")) {
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (32:7): [True: 0, False: 2.49k]
  ------------------
   33|      0|    return 0;
   34|      0|  }
   35|       |
   36|  2.49k|  archive_read_add_passphrase(a, "secret");
   37|       |
   38|  2.49k|  if (ARCHIVE_OK != archive_read_open_memory(a, buf, len)) {
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (38:7): [True: 56, False: 2.44k]
  ------------------
   39|     56|    archive_read_free(a);
   40|     56|    return 0;
   41|     56|  }
   42|       |
   43|   301k|  while(1) {
  ------------------
  |  Branch (43:9): [True: 301k, Folded]
  ------------------
   44|   301k|    std::vector<uint8_t> data_buffer(getpagesize(), 0);
   45|   301k|    struct archive_entry *entry;
   46|   301k|    int ret = archive_read_next_header(a, &entry);
   47|   301k|    if (ret == ARCHIVE_EOF || ret == ARCHIVE_FATAL)
  ------------------
  |  |  232|   603k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
                  if (ret == ARCHIVE_EOF || ret == ARCHIVE_FATAL)
  ------------------
  |  |  239|   301k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (47:9): [True: 350, False: 301k]
  |  Branch (47:31): [True: 1.69k, False: 299k]
  ------------------
   48|  2.04k|      break;
   49|   299k|    if (ret == ARCHIVE_RETRY)
  ------------------
  |  |  234|   299k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  |  Branch (49:9): [True: 212k, False: 87.4k]
  ------------------
   50|   212k|      continue;
   51|       |
   52|  87.4k|    (void)archive_entry_pathname(entry);
   53|  87.4k|    (void)archive_entry_pathname_utf8(entry);
   54|  87.4k|    (void)archive_entry_pathname_w(entry);
   55|       |
   56|  87.4k|    (void)archive_entry_atime(entry);
   57|  87.4k|    (void)archive_entry_birthtime(entry);
   58|  87.4k|    (void)archive_entry_ctime(entry);
   59|  87.4k|    (void)archive_entry_dev(entry);
   60|  87.4k|    (void)archive_entry_digest(entry, ARCHIVE_ENTRY_DIGEST_SHA1);
  ------------------
  |  |  446|  87.4k|#define ARCHIVE_ENTRY_DIGEST_SHA1             0x00000003
  ------------------
   61|  87.4k|    (void)archive_entry_filetype(entry);
   62|  87.4k|    (void)archive_entry_gid(entry);
   63|  87.4k|    (void)archive_entry_is_data_encrypted(entry);
   64|  87.4k|    (void)archive_entry_is_encrypted(entry);
   65|  87.4k|    (void)archive_entry_is_metadata_encrypted(entry);
   66|  87.4k|    (void)archive_entry_mode(entry);
   67|  87.4k|    (void)archive_entry_mtime(entry);
   68|  87.4k|    (void)archive_entry_size(entry);
   69|  87.4k|    (void)archive_entry_uid(entry);
   70|       |
   71|  87.4k|    ssize_t r;
   72|   106M|    while ((r = archive_read_data(a, data_buffer.data(),
  ------------------
  |  Branch (72:12): [True: 106M, False: 87.4k]
  ------------------
   73|   106M|            data_buffer.size())) > 0)
   74|   106M|      ;
   75|  87.4k|    if (r == ARCHIVE_FATAL)
  ------------------
  |  |  239|  87.4k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (75:9): [True: 400, False: 87.0k]
  ------------------
   76|    400|      break;
   77|  87.4k|  }
   78|       |
   79|  2.44k|  archive_read_has_encrypted_entries(a);
   80|  2.44k|  archive_read_format_capabilities(a);
   81|  2.44k|  archive_file_count(a);
   82|  2.44k|  archive_seek_data(a, 0, SEEK_SET);
   83|       |
   84|  2.44k|  archive_read_free(a);
   85|  2.44k|  return 0;
   86|  2.49k|}

